Refactor yaml and remove segment (#531)

* move yaml (still need to fix header path)

* fix header

* change kart to karts and add migration

* fix include

* Update migration.py

* fix common_texture_debug_font extraction

* Update torch

* update torch and header

* unduplicate texture for tumble

* Update torch

* Update migration.py

* put the sort by default

* fix replace_segmented_textures_with_o2r_textures

* Update torch

* fix yamls

* add manual_segments in data of course

* comment out replace_segmented_textures_with_o2r_textures and segment 3

* remove segment 5

* (wip) remove segment 6

still plenty of thing to do

* more vtx

* more change

* Update torch

* small fix

* Update BansheeBoardwalk.cpp

* fix blockFort

* Delete test.yaml

* fix bowser castle and simplify track sections

* fix choco mountain

* clean banshee

* fix dk jungle

* fix double deck

* fix macos

* fix error

* fix macos ci

* Update torch

* Update torch

* fix frappe snowland

* fix kalimari desert

* fix koopa troopa beach

* fix luigi raceway

* fix mario raceway and simplify thing

* fix moo moo farm

* fix rainbow road

* Update torch

* Update torch

* hopefully fix windows error

* fix a small error

* fix royal raceway (and podium in theory)

* fix sherbet_land

* fix skyscraper

* fix toads turnpike

* fix wario stadium

* fix yoshi valley

* update torch

* more clang tidy rules

* REMOVE totally SEGMENT (sorry for the PR)

* remove unused field in course and props and unused packed asset

* fix kart texture

* fix particle

* fix track section and transparency

* try fix mode extra

* fix macos build and render

* fix collision in extra

* small change and try fix windows error

* a little of clean

* more cleanup

* forget header and more clean up

* Update Makefile

* fix credits

* fix kart texture offset

* remove LoadTextures and add Unload

* fix definitevely mirror mode

* add unload but it's not perfect

* revert a bad fix

* clean no longer used python script

* fix crash with player

* being able to load the same course twice

* add a comment on DrawWater

* fix render of transparent object

* better hack

* add a proper migration instruction

* fix number

* add basic modsmanager

* add meta/mods.toml

* Update EditorMath.h

* Update ModsManager.cpp

* basic modManager (maybe I should rename it ModLoader)

* use range on dependencies

* add information about mods.toml

* fix coment

* some rename around

* Delete beta-to-v1.md

* Update migrations.md

* Update textures-pack.md

* Update modding.md

* Update modding.md

* clean yamls_old

* move to mods in engine

* rename ModsManger to  ModManager

* move init and unload at the top

* rename ModsMetadata to ModMetadata

* fix header

* Update ModManager.cpp

* put core mods at top
This commit is contained in:
coco875
2025-12-07 15:34:53 +01:00
committed by GitHub
parent eec7d65048
commit 02ad54ca72
584 changed files with 338908 additions and 169368 deletions
+40 -40
View File
@@ -34,14 +34,14 @@ namespace Editor {
static char lengthBuffer[256] = "567m";
ImGui::InputText("ID", idBuffer, IM_ARRAYSIZE(idBuffer));
ImGui::InputText("Name", gWorldInstance.CurrentCourse->Props.Name, IM_ARRAYSIZE(nameBuffer));
ImGui::InputText("Debug Name", gWorldInstance.CurrentCourse->Props.DebugName, IM_ARRAYSIZE(debugNameBuffer));
ImGui::InputText("Course Length", gWorldInstance.CurrentCourse->Props.CourseLength, IM_ARRAYSIZE(lengthBuffer));
ImGui::InputFloat("Water Level", &gWorldInstance.CurrentCourse->Props.WaterLevel);
ImGui::InputText("Name", gWorldInstance.GetCurrentCourse()->Props.Name, IM_ARRAYSIZE(nameBuffer));
ImGui::InputText("Debug Name", gWorldInstance.GetCurrentCourse()->Props.DebugName, IM_ARRAYSIZE(debugNameBuffer));
ImGui::InputText("Course Length", gWorldInstance.GetCurrentCourse()->Props.CourseLength, IM_ARRAYSIZE(lengthBuffer));
ImGui::InputFloat("Water Level", &gWorldInstance.GetCurrentCourse()->Props.WaterLevel);
if (ImGui::CollapsingHeader("Camera")) {
ImGui::InputFloat("Near Perspective", &gWorldInstance.CurrentCourse->Props.NearPersp);
ImGui::InputFloat("Far Perspective", &gWorldInstance.CurrentCourse->Props.FarPersp);
ImGui::InputFloat("Near Perspective", &gWorldInstance.GetCurrentCourse()->Props.NearPersp);
ImGui::InputFloat("Far Perspective", &gWorldInstance.GetCurrentCourse()->Props.FarPersp);
if (ImGui::IsItemHovered()) {
ImGui::BeginTooltip();
ImGui::Text("Controls the far clipping distance for perspective rendering.");
@@ -56,92 +56,92 @@ namespace Editor {
if (ImGui::CollapsingHeader("AI")) {
ImGui::InputFloat("AI Max Separation", &gWorldInstance.CurrentCourse->Props.AIMaximumSeparation);
ImGui::InputFloat("AI Min Separation", &gWorldInstance.CurrentCourse->Props.AIMinimumSeparation);
ImGui::InputInt("AI Steering Sensitivity", (int*)&gWorldInstance.CurrentCourse->Props.AISteeringSensitivity);
ImGui::InputFloat("AI Max Separation", &gWorldInstance.GetCurrentCourse()->Props.AIMaximumSeparation);
ImGui::InputFloat("AI Min Separation", &gWorldInstance.GetCurrentCourse()->Props.AIMinimumSeparation);
ImGui::InputInt("AI Steering Sensitivity", (int*)&gWorldInstance.GetCurrentCourse()->Props.AISteeringSensitivity);
ImGui::Separator();
for (size_t i = 0; i < 32; i++) {
ImGui::InputScalar(("Element " + std::to_string(i)).c_str(), ImGuiDataType_S16, &gWorldInstance.CurrentCourse->Props.AIDistance[i]);
ImGui::InputScalar(("Element " + std::to_string(i)).c_str(), ImGuiDataType_S16, &gWorldInstance.GetCurrentCourse()->Props.AIDistance[i]);
}
}
if (ImGui::CollapsingHeader("Random Junk")) {
for (size_t i = 0; i < 4; i++) {
ImGui::InputFloat(fmt::format("CurveTargetSpeed[{}]", i).c_str(), &gWorldInstance.CurrentCourse->Props.CurveTargetSpeed[i]);
ImGui::InputFloat(fmt::format("CurveTargetSpeed[{}]", i).c_str(), &gWorldInstance.GetCurrentCourse()->Props.CurveTargetSpeed[i]);
}
ImGui::Separator();
for (size_t i = 0; i < 4; i++) {
ImGui::InputFloat(fmt::format("NormalTargetSpeed[{}]", i).c_str(), &gWorldInstance.CurrentCourse->Props.NormalTargetSpeed[i]);
ImGui::InputFloat(fmt::format("NormalTargetSpeed[{}]", i).c_str(), &gWorldInstance.GetCurrentCourse()->Props.NormalTargetSpeed[i]);
}
ImGui::Separator();
for (size_t i = 0; i < 4; i++) {
ImGui::InputFloat(fmt::format("D_0D0096B8[{}]", i).c_str(), &gWorldInstance.CurrentCourse->Props.D_0D0096B8[i]);
ImGui::InputFloat(fmt::format("D_0D0096B8[{}]", i).c_str(), &gWorldInstance.GetCurrentCourse()->Props.D_0D0096B8[i]);
}
ImGui::Separator();
for (size_t i = 0; i < 4; i++) {
ImGui::InputFloat(fmt::format("OffTrackTargetSpeed[{}]", i).c_str(), &gWorldInstance.CurrentCourse->Props.OffTrackTargetSpeed[i]);
ImGui::InputFloat(fmt::format("OffTrackTargetSpeed[{}]", i).c_str(), &gWorldInstance.GetCurrentCourse()->Props.OffTrackTargetSpeed[i]);
}
}
float minimapColour[3];
RGB8ToFloat((u8*)&gWorldInstance.CurrentCourse->Props.Minimap.Colour, minimapColour);
RGB8ToFloat((u8*)&gWorldInstance.GetCurrentCourse()->Props.Minimap.Colour, minimapColour);
if (ImGui::CollapsingHeader("Minimap")) {
ImGui::Text("Position");
ImGui::SameLine();
if (ImGui::DragInt2("##MinimapPosition", &gWorldInstance.CurrentCourse->Props.Minimap.Pos[0].X, 1.0f)) {
if (ImGui::DragInt2("##MinimapPosition", &gWorldInstance.GetCurrentCourse()->Props.Minimap.Pos[0].X, 1.0f)) {
}
ImGui::Text("P2 Position");
ImGui::SameLine();
if (ImGui::DragInt2("##MinimapPosition2p", &gWorldInstance.CurrentCourse->Props.Minimap.Pos[1].X, 1.0f)) {
if (ImGui::DragInt2("##MinimapPosition2p", &gWorldInstance.GetCurrentCourse()->Props.Minimap.Pos[1].X, 1.0f)) {
}
ImGui::Text("Player Markers");
ImGui::SameLine();
if (ImGui::DragInt2("##MinimapPlayers", &gWorldInstance.CurrentCourse->Props.Minimap.PlayerX, 1.0f)) {
if (ImGui::DragInt2("##MinimapPlayers", &gWorldInstance.GetCurrentCourse()->Props.Minimap.PlayerX, 1.0f)) {
}
ImGui::Text("Player Scale Factor");
ImGui::SameLine();
if (ImGui::DragFloat("##MinimapScaleFactor", &gWorldInstance.CurrentCourse->Props.Minimap.PlayerScaleFactor, 0.0001f)) {
if (ImGui::DragFloat("##MinimapScaleFactor", &gWorldInstance.GetCurrentCourse()->Props.Minimap.PlayerScaleFactor, 0.0001f)) {
}
ImGui::Text("Finishline");
ImGui::SameLine();
ImGui::DragFloat2("##MinimapFinishlineX", &gWorldInstance.CurrentCourse->Props.Minimap.FinishlineX, 1.0f);
ImGui::DragFloat2("##MinimapFinishlineX", &gWorldInstance.GetCurrentCourse()->Props.Minimap.FinishlineX, 1.0f);
ImGui::Text("Colour");
ImGui::SameLine();
ImGui::ColorEdit3("##MinimapColour", minimapColour, 1.0f);
}
FloatToRGB8(minimapColour, (u8*)&gWorldInstance.CurrentCourse->Props.Minimap.Colour);
FloatToRGB8(minimapColour, (u8*)&gWorldInstance.GetCurrentCourse()->Props.Minimap.Colour);
// Convert and pass to ImGui ColorEdit3
float topRight[3], bottomRight[3], bottomLeft[3], topLeft[3];
float floorTopRight[3], floorBottomRight[3], floorBottomLeft[3], floorTopLeft[3];
// Convert RGB8 (0-255) to float (0.0f to 1.0f)
RGB8ToFloat((u8*)&gWorldInstance.CurrentCourse->Props.Skybox.TopRight, topRight);
RGB8ToFloat((u8*)&gWorldInstance.CurrentCourse->Props.Skybox.BottomRight, bottomRight);
RGB8ToFloat((u8*)&gWorldInstance.CurrentCourse->Props.Skybox.BottomLeft, bottomLeft);
RGB8ToFloat((u8*)&gWorldInstance.CurrentCourse->Props.Skybox.TopLeft, topLeft);
RGB8ToFloat((u8*)&gWorldInstance.CurrentCourse->Props.Skybox.FloorTopRight, floorTopRight);
RGB8ToFloat((u8*)&gWorldInstance.CurrentCourse->Props.Skybox.FloorBottomRight, floorBottomRight);
RGB8ToFloat((u8*)&gWorldInstance.CurrentCourse->Props.Skybox.FloorBottomLeft, floorBottomLeft);
RGB8ToFloat((u8*)&gWorldInstance.CurrentCourse->Props.Skybox.FloorTopLeft, floorTopLeft);
RGB8ToFloat((u8*)&gWorldInstance.GetCurrentCourse()->Props.Skybox.TopRight, topRight);
RGB8ToFloat((u8*)&gWorldInstance.GetCurrentCourse()->Props.Skybox.BottomRight, bottomRight);
RGB8ToFloat((u8*)&gWorldInstance.GetCurrentCourse()->Props.Skybox.BottomLeft, bottomLeft);
RGB8ToFloat((u8*)&gWorldInstance.GetCurrentCourse()->Props.Skybox.TopLeft, topLeft);
RGB8ToFloat((u8*)&gWorldInstance.GetCurrentCourse()->Props.Skybox.FloorTopRight, floorTopRight);
RGB8ToFloat((u8*)&gWorldInstance.GetCurrentCourse()->Props.Skybox.FloorBottomRight, floorBottomRight);
RGB8ToFloat((u8*)&gWorldInstance.GetCurrentCourse()->Props.Skybox.FloorBottomLeft, floorBottomLeft);
RGB8ToFloat((u8*)&gWorldInstance.GetCurrentCourse()->Props.Skybox.FloorTopLeft, floorTopLeft);
if (ImGui::CollapsingHeader("Skybox")) {
ImGui::ColorEdit3("Skybox Top Right", topRight);
@@ -155,14 +155,14 @@ namespace Editor {
}
// Convert the modified float values back to RGB8 (0-255)
FloatToRGB8(topRight, (u8*)&gWorldInstance.CurrentCourse->Props.Skybox.TopRight);
FloatToRGB8(bottomRight, (u8*)&gWorldInstance.CurrentCourse->Props.Skybox.BottomRight);
FloatToRGB8(bottomLeft, (u8*)&gWorldInstance.CurrentCourse->Props.Skybox.BottomLeft);
FloatToRGB8(topLeft, (u8*)&gWorldInstance.CurrentCourse->Props.Skybox.TopLeft);
FloatToRGB8(floorTopRight, (u8*)&gWorldInstance.CurrentCourse->Props.Skybox.FloorTopRight);
FloatToRGB8(floorBottomRight, (u8*)&gWorldInstance.CurrentCourse->Props.Skybox.FloorBottomRight);
FloatToRGB8(floorBottomLeft, (u8*)&gWorldInstance.CurrentCourse->Props.Skybox.FloorBottomLeft);
FloatToRGB8(floorTopLeft, (u8*)&gWorldInstance.CurrentCourse->Props.Skybox.FloorTopLeft);
FloatToRGB8(topRight, (u8*)&gWorldInstance.GetCurrentCourse()->Props.Skybox.TopRight);
FloatToRGB8(bottomRight, (u8*)&gWorldInstance.GetCurrentCourse()->Props.Skybox.BottomRight);
FloatToRGB8(bottomLeft, (u8*)&gWorldInstance.GetCurrentCourse()->Props.Skybox.BottomLeft);
FloatToRGB8(topLeft, (u8*)&gWorldInstance.GetCurrentCourse()->Props.Skybox.TopLeft);
FloatToRGB8(floorTopRight, (u8*)&gWorldInstance.GetCurrentCourse()->Props.Skybox.FloorTopRight);
FloatToRGB8(floorBottomRight, (u8*)&gWorldInstance.GetCurrentCourse()->Props.Skybox.FloorBottomRight);
FloatToRGB8(floorBottomLeft, (u8*)&gWorldInstance.GetCurrentCourse()->Props.Skybox.FloorBottomLeft);
FloatToRGB8(floorTopLeft, (u8*)&gWorldInstance.GetCurrentCourse()->Props.Skybox.FloorTopLeft);
TrackPropertiesWindow::DrawMusic();
}
@@ -178,15 +178,15 @@ namespace Editor {
"Royal Raceway", "Yoshi Valley", "Block Fort", "Double Deck"
};
const char* currentItem = MusicSeqToString(gWorldInstance.CurrentCourse->Props.Sequence); // Get the current selected value's string
const char* currentItem = MusicSeqToString(gWorldInstance.GetCurrentCourse()->Props.Sequence); // Get the current selected value's string
if (ImGui::BeginCombo("Music Sequence", currentItem)) {
for (size_t i = 0; i < IM_ARRAYSIZE(items); ++i) {
bool isSelected = (currentItem == items[i]);
if (ImGui::Selectable(items[i], isSelected)) {
// Update the sequence when an option is selected
gWorldInstance.CurrentCourse->Props.Sequence = static_cast<MusicSeq>(i);
play_sequence(gWorldInstance.CurrentCourse->Props.Sequence); // Call play_sequence with the updated sequence
gWorldInstance.GetCurrentCourse()->Props.Sequence = static_cast<MusicSeq>(i);
play_sequence(gWorldInstance.GetCurrentCourse()->Props.Sequence); // Call play_sequence with the updated sequence
// Update currentItem after selection is made
currentItem = items[i];