mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-06-08 12:28:35 -04:00
Edit TrackInfo Properties (#594)
* Fix finishline for toads turnpike in extra * Fixed trash bin in extra * Refactor fov * Update scene.json * Allow setting fog * impl fog save & load * Fix modifying resourceName and rename editor namespace to trackeditor * small change
This commit is contained in:
@@ -350,7 +350,6 @@ bool IsTriangleWindingInverted() {
|
||||
return !gModifiedGfxSet.empty();
|
||||
}
|
||||
|
||||
|
||||
Track::Track() {
|
||||
Props.SetText(Props.ResourceName, "mod:blank_track", sizeof(Props.ResourceName));
|
||||
Props.SetText(Props.Name, "Blank Track", sizeof(Props.Name));
|
||||
@@ -358,7 +357,7 @@ Track::Track() {
|
||||
Props.SetText(Props.TrackLength, "100m", sizeof(Props.TrackLength));
|
||||
// Props.Cup = FLOWER_CUP;
|
||||
// Props.CupIndex = 3;
|
||||
ResourceName = "";
|
||||
ResourceName = "mod:blank_track";
|
||||
Props.Minimap.Texture = minimap_mario_raceway;
|
||||
Props.Minimap.Width = ResourceGetTexWidthByName(Props.Minimap.Texture);
|
||||
Props.Minimap.Height = ResourceGetTexHeightByName(Props.Minimap.Texture);
|
||||
@@ -450,7 +449,7 @@ void Track::Load() {
|
||||
} else { // Load custom track
|
||||
bIsMod = true;
|
||||
|
||||
Editor::LoadTrackDataFromJson(this, trackPath);
|
||||
TrackEditor::LoadTrackDataFromJson(this, trackPath);
|
||||
|
||||
const std::string trackSectionPath = (trackPath + "/data_track_sections");
|
||||
TrackSections* sections = (TrackSections*) LOAD_ASSET_RAW(trackSectionPath.c_str());
|
||||
@@ -647,6 +646,10 @@ void Track::Draw(ScreenContext* arg0) {
|
||||
}
|
||||
|
||||
const TrackInfo* info = gTrackRegistry.GetInfo(ResourceName);
|
||||
if (nullptr == info) {
|
||||
printf("[Track] [Draw] Resource name did not return a valid TrackInfo %s\n", ResourceName.c_str());
|
||||
return;
|
||||
}
|
||||
std::string res = info->Path + "/data_track_sections";
|
||||
|
||||
TrackSections* sections = (TrackSections*) LOAD_ASSET_RAW(res.c_str());
|
||||
|
||||
Reference in New Issue
Block a user