mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-02-03 00:33:55 +03:00
Add checkpoint developer tool (doesn't work perfectly)
This commit is contained in:
parent
0e39eed609
commit
e34419b38e
@ -4647,6 +4647,13 @@ void Player_Setup(Player* playerx) {
|
|||||||
|
|
||||||
gDisplayedHitCount = gHitCount;
|
gDisplayedHitCount = gHitCount;
|
||||||
D_hud_80161730 = 0;
|
D_hud_80161730 = 0;
|
||||||
|
|
||||||
|
if (CVarGetInteger("gCheckpoint.Set", 0)) {
|
||||||
|
gSavedGroundSurface = CVarGetInteger("gCheckpoint.gSavedGroundSurface", gSavedGroundSurface);
|
||||||
|
gSavedPathProgress = CVarGetFloat("gCheckpoint.gSavedPathProgress", gSavedPathProgress);
|
||||||
|
gSavedObjectLoadIndex = CVarGetInteger("gCheckpoint.gSavedObjectLoadIndex", gSavedObjectLoadIndex);
|
||||||
|
}
|
||||||
|
|
||||||
gMissedZoSearchlight = gSavedZoSearchlightStatus;
|
gMissedZoSearchlight = gSavedZoSearchlightStatus;
|
||||||
gObjectLoadIndex = gSavedObjectLoadIndex;
|
gObjectLoadIndex = gSavedObjectLoadIndex;
|
||||||
gGroundSurface = gSavedGroundSurface;
|
gGroundSurface = gSavedGroundSurface;
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
#include <sf64audio_provisional.h>
|
#include <sf64audio_provisional.h>
|
||||||
|
#include <sf64context.h>
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace GameUI {
|
namespace GameUI {
|
||||||
@ -558,6 +559,21 @@ void DrawDebugMenu() {
|
|||||||
.tooltip = "Control the Arwing speed"
|
.tooltip = "Control the Arwing speed"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (CVarGetInteger("gCheckpoint.Set", 0)) {
|
||||||
|
if (UIWidgets::Button("Clear Checkpoint")) {
|
||||||
|
CVarClear("gCheckpoint.Set");
|
||||||
|
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
|
||||||
|
}
|
||||||
|
} else if (gPlayer != NULL) {
|
||||||
|
if (UIWidgets::Button("Set Checkpoint")) {
|
||||||
|
CVarSetInteger("gCheckpoint.Set", 1);
|
||||||
|
CVarSetInteger("gCheckpoint.gSavedPathProgress", gGroundSurface);
|
||||||
|
CVarSetFloat("gCheckpoint.gSavedPathProgress", (-gPlayer->pos.z) - 250.0f);
|
||||||
|
CVarSetInteger("gCheckpoint.gSavedObjectLoadIndex", gObjectLoadIndex);
|
||||||
|
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UIWidgets::Spacer(0);
|
UIWidgets::Spacer(0);
|
||||||
|
|
||||||
UIWidgets::WindowButton("Stats", "gStatsEnabled", GameUI::mStatsWindow, {
|
UIWidgets::WindowButton("Stats", "gStatsEnabled", GameUI::mStatsWindow, {
|
||||||
|
Loading…
Reference in New Issue
Block a user