summaryrefslogtreecommitdiff
path: root/src/engine/Rulesets.cpp
diff options
context:
space:
mode:
authorMegaMech <MegaMech@users.noreply.github.com>2025-12-13 11:50:28 -0700
committerGitHub <noreply@github.com>2025-12-13 11:50:28 -0700
commitb934e98fc34964970ab5efacb2fb7c3372ae0b1a (patch)
treecd96e5fabec7fdcc098d0de33b3b7e2754fb6cd5 /src/engine/Rulesets.cpp
parente6acb59ef4797ce27ddc9e21982c3f4e40824b52 (diff)
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>
Diffstat (limited to 'src/engine/Rulesets.cpp')
-rw-r--r--src/engine/Rulesets.cpp75
1 files changed, 0 insertions, 75 deletions
diff --git a/src/engine/Rulesets.cpp b/src/engine/Rulesets.cpp
deleted file mode 100644
index 23ea0a6cf..000000000
--- a/src/engine/Rulesets.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-#include "Rulesets.h"
-#include "objects/Thwomp.h"
-#include "objects/Trophy.h"
-#include "objects/BombKart.h"
-#include "actors/Text.h"
-
-extern "C" {
-#include "code_800029B0.h"
-#include "memory.h"
-}
-
-// Before the game is loaded, and before vertices and displaylists are unpacked.
-// Only runs a single time at the beginning of a track.
-void Rulesets::PreLoad() {
-}
-
-// Just before BeginPlay() (used to spawn actors) is ran.
-// Only runs a single time at the beginning of a track.
-void Rulesets::PreInit() {
- if (CVarGetInteger("gDisableItemboxes", false) == true) {
- gPlaceItemBoxes = false;
- } else {
- gPlaceItemBoxes = true;
- }
-}
-
-// Just after BeginPlay() is ran.
-// Only runs a single time at the beginning of a track.
-void Rulesets::PostInit() {
- if (CVarGetInteger("gAllThwompsAreMarty", false) == true) {
- for (auto object : gWorldInstance.Objects) {
- if (OThwomp* thwomp = dynamic_cast<OThwomp*>(object)) {
- gObjectList[thwomp->_objectIndex].unk_0D5 = OThwomp::States::JAILED; // Sets all the thwomp behaviour flags to marty
- thwomp->Behaviour = OThwomp::States::JAILED;
- }
- }
- }
-
- if (CVarGetInteger("gAllBombKartsChase", false) == true) {
- for (auto object : gWorldInstance.Objects) {
- if (OBombKart* kart = dynamic_cast<OBombKart*>(object)) {
- kart->Behaviour = OBombKart::States::CHASE;
- }
- }
- }
-
- if (CVarGetInteger("gGoFish", false) == true) {
- OTrophy::Spawn(FVector(0,0,0), OTrophy::TrophyType::GOLD, OTrophy::Behaviour::GO_FISH);
- }
-
- if (CVarGetInteger("gPlayerNames", false) == true) {
-
- std::string playerNames[NUM_PLAYERS] = {
- "Player 1", "Player 2", "Player 3",
- "Player 4", "Player 5", "Player 6",
- "Player 7", "Player 8"
- };
-
- for (size_t i = 0; i < NUM_PLAYERS; i++) {
- // text, pos, scale, mode, playerIndex
- AText* text = AText::Spawn(playerNames[i], FVector(0, 0, 0), FVector(0.15f, 0.15f, 0.15f), AText::TextMode::FOLLOW_PLAYER, i);
- text->ScaleX = 1.0f;
- text->Scale.x = 0.15f;
- text->Scale.y = 0.15f;
- text->Scale.z = 0.15f;
- text->Animate = false; // Cycle between colours similar to grand prix title text
-
- // White
- for (size_t j = 0; j < 4; j++) {
- text->TextColour[j] = {255, 255, 255, 255};
- }
-
- }
- }
-}