Add scenery info version 30 support
+Added support for scenery info version 30 (sceneries with info version 29 are still supported) +Added UUID field in SceneryInfoView
This commit is contained in:
parent
91173c13c1
commit
9622bc87fc
@ -15,6 +15,7 @@ export default function SceneryInfoView({ scenery }) {
|
|||||||
<SceneryInfoViewItem label="Description" value={sceneryInfo.description} />
|
<SceneryInfoViewItem label="Description" value={sceneryInfo.description} />
|
||||||
<SceneryInfoViewItem label="Link" value={sceneryInfo.link} isLink={true} />
|
<SceneryInfoViewItem label="Link" value={sceneryInfo.link} isLink={true} />
|
||||||
<SceneryInfoViewItem label="Main signalbox" value={sceneryInfo.main_signalbox} />
|
<SceneryInfoViewItem label="Main signalbox" value={sceneryInfo.main_signalbox} />
|
||||||
|
<SceneryInfoViewItem label="UUID" value={sceneryInfo.uuid} />
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -14,7 +14,8 @@ const Constants = {
|
|||||||
},
|
},
|
||||||
parser: {
|
parser: {
|
||||||
logSceneryAfterFinished: true,
|
logSceneryAfterFinished: true,
|
||||||
sceneryInfoVersion: 29,
|
sceneryInfoVersionMin: 29,
|
||||||
|
sceneryInfoVersionMax: 30,
|
||||||
alwaysShowLogDialog: false,
|
alwaysShowLogDialog: false,
|
||||||
runTracksConnectionTest: false,
|
runTracksConnectionTest: false,
|
||||||
tracksConnectionTestIgnoreY: true,
|
tracksConnectionTestIgnoreY: true,
|
||||||
|
|||||||
@ -83,8 +83,8 @@ export default class SceneryParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const version = parseInt(infoHeader.split("v")[1]);
|
const version = parseInt(infoHeader.split("v")[1]);
|
||||||
if(version !== Constants.parser.sceneryInfoVersion) {
|
if(version < Constants.parser.sceneryInfoVersionMin || version > Constants.parser.sceneryInfoVersionMax) {
|
||||||
SceneryParserLog.warn('invalidSceneryInfoVersion', `Invalid scenery info version: ${version}. Expected: ${Constants.parser.sceneryInfoVersion}`);
|
SceneryParserLog.warn('invalidSceneryInfoVersion', `Invalid scenery info version: ${version}. Expected: ${Constants.parser.sceneryInfoVersionMin}-${Constants.parser.sceneryInfoVersionMax}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return SceneryInfo.fromText(text);
|
return SceneryInfo.fromText(text);
|
||||||
|
|||||||
@ -7,9 +7,10 @@ export default class SceneryInfo extends SpecialObject {
|
|||||||
link;
|
link;
|
||||||
author;
|
author;
|
||||||
main_signalbox;
|
main_signalbox;
|
||||||
|
uuid;
|
||||||
type = "SceneryInfo";
|
type = "SceneryInfo";
|
||||||
|
|
||||||
constructor(name, version, description, link, author, main_signalbox) {
|
constructor(name, version, description, link, author, main_signalbox, uuid) {
|
||||||
super();
|
super();
|
||||||
Object.assign(this, {
|
Object.assign(this, {
|
||||||
name,
|
name,
|
||||||
@ -17,7 +18,8 @@ export default class SceneryInfo extends SpecialObject {
|
|||||||
description,
|
description,
|
||||||
link,
|
link,
|
||||||
author,
|
author,
|
||||||
main_signalbox
|
main_signalbox,
|
||||||
|
uuid
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,7 +31,8 @@ export default class SceneryInfo extends SpecialObject {
|
|||||||
values[3], // description
|
values[3], // description
|
||||||
values[4], // link
|
values[4], // link
|
||||||
values[5], // author
|
values[5], // author
|
||||||
values[6] // main_signalbox
|
values[6], // main_signalbox
|
||||||
|
values[7] // uuid
|
||||||
);
|
);
|
||||||
|
|
||||||
return sceneryInfo;
|
return sceneryInfo;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user