Skip to content

Commit

Permalink
Fix no respawn time not displaying for some runs
Browse files Browse the repository at this point in the history
If run was reset before ghost added than no respawn time was not displayed
  • Loading branch information
Vanawy committed Oct 1, 2024
1 parent 4be28d0 commit eed7bfc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "Run History"
author = "Vanawy"
category = "Overlay"
version = "0.6.0"
version = "0.6.1"

[script]
dependencies = ["MLHook", "MLFeedRaceData"]
Expand Down
23 changes: 10 additions & 13 deletions src/main.as
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,19 @@ bool autoChangeTarget = true;

uint championMedalUpdateAttempts = 0;

CTrackMania@ trackmania = cast<CTrackMania>(GetApp());

void Main()
{

string lastMapId = "";
string lastGhostId = "";

print("App loaded");

// init delta thresholds table
thresholdsTable.FromString(settingDeltasSerialized);


#if DEPENDENCY_WARRIORMEDALS
print("WarriorMedals detected");
targets.InsertAt(1, warrior);
Expand All @@ -72,7 +74,7 @@ void Main()


while(true) {
sleep(1000);
yield();

auto gd = MLFeed::GetGhostData();
if (gd !is null && gd.Ghosts_V2 !is null && gd.NbGhosts != 0) {
Expand All @@ -83,21 +85,16 @@ void Main()
}
}

CTrackMania@ trackmania = cast<CTrackMania>(GetApp());
if (trackmania !is null) {
auto map = @trackmania.RootMap;
if (map !is null && lastMapId != map.MapInfo.MapUid) {
lastMapId = map.MapInfo.MapUid;
OnMapChange(map);
}
auto map = @trackmania.RootMap;
if (map !is null && lastMapId != map.MapInfo.MapUid) {
lastMapId = map.MapInfo.MapUid;
OnMapChange(map);
}
}
}

void Render()
{
auto trackmania = cast<CTrackMania@>(GetApp());

{
auto map = trackmania.RootMap;

if(!UI::IsGameUIVisible()) {
Expand Down Expand Up @@ -198,8 +195,8 @@ void RenderAddTargetPopup()


void RenderMenu() {
if (UI::BeginMenu(ICON_MENU + " " + TEXT_PLUGIN_NAME)) {

if (UI::BeginMenu(ICON_MENU + " " + TEXT_PLUGIN_NAME)) {
string toggleVisibilityText = settingWindowHide
? Icons::Eye + " Show window"
: Icons::EyeSlash + " Hide window";
Expand Down

0 comments on commit eed7bfc

Please sign in to comment.