Refactor Track Class To Instantiate On Track Load (#587)

* Initial Commit

* First compilation of Registry template

* Further changes

* wip changes

* Impl TrackBrowser and Registry Info

* Remove const from TInfo

* Prep GetWorld

* Name refactor

* Refactor gWorldInstance to GetWorld()

* wip

* Should work now

* Data menu work again

* Fix editor staying open after program close

* Rename LoadLevel to LoadTrackDataFromJson

* More changes

* Add statue

* Add search to content browser using tags

* Fix statue pos and register tags

* Fix actor loading

* Fix delete all bug which deleted cameras

* reduce some boiler plate in actor and object

* Remove unused rulesets

* Search bar for all tabs

* fix data screen

* fix actor spawning

* temp editor fix

* Clean up

* improve extra mode transformation

* fix podium crash

* Fix editor clicking

* Fix editor clicking 2

* fix extra in custom track

* Fix FI for three actors

* Fix divide by zero error

* Ids managed by Registry

* Add scary comment

---------

Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>
Co-authored-by: coco875 <pereira.jannin@gmail.com>
This commit is contained in:
MegaMech
2025-12-13 11:50:28 -07:00
committed by GitHub
parent e6acb59ef4
commit b934e98fc3
157 changed files with 2623 additions and 2473 deletions
+8 -12
View File
@@ -52,15 +52,11 @@ extern "C" void add_triangle_to_collision_mesh(Vtx* vtx1, Vtx* vtx2, Vtx* vtx3,
}
void RaceManager::Load() {
if (WorldContext.GetTrack()) {
if (GetWorld()->GetTrack()) {
mirroredVtxCache.clear();
WorldContext.GetTrack()->Load();
}
}
void RaceManager::UnLoad() {
if (WorldContext.GetTrack()) {
WorldContext.GetTrack()->UnLoad();
GetWorld()->GetTrack()->Load();
} else {
printf("[RaceManager] [Load] Track was nullptr\n");
}
}
@@ -97,8 +93,8 @@ void RaceManager::BeginPlay() {
void RaceManager::PostInit() {
// Ruleset options
if (CVarGetInteger("gAllThwompsAreMarty", false) == true) {
for (auto object : gWorldInstance.Objects) {
if (OThwomp* thwomp = dynamic_cast<OThwomp*>(object)) {
for (auto& object : GetWorld()->Objects) {
if (OThwomp* thwomp = dynamic_cast<OThwomp*>(object.get())) {
gObjectList[thwomp->_objectIndex].unk_0D5 = OThwomp::States::JAILED; // Sets all the thwomp behaviour flags to marty
thwomp->Behaviour = OThwomp::States::JAILED;
}
@@ -106,8 +102,8 @@ void RaceManager::PostInit() {
}
if (CVarGetInteger("gAllBombKartsChase", false) == true) {
for (auto object : gWorldInstance.Objects) {
if (OBombKart* kart = dynamic_cast<OBombKart*>(object)) {
for (auto& object : GetWorld()->Objects) {
if (OBombKart* kart = dynamic_cast<OBombKart*>(object.get())) {
kart->Behaviour = OBombKart::States::CHASE;
}
}