Skip to content

Commit

Permalink
splits enabled and minimal settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Die4Ever committed Sep 6, 2023
1 parent 63252aa commit ecf8a05
Showing 1 changed file with 36 additions and 23 deletions.
59 changes: 36 additions & 23 deletions GUI/DeusEx/Classes/HUDSpeedrunSplits.uc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ var config Font textfont;
var config int windowWidth, windowHeight;
var config Color colorBackground, colorText, colorBehind, colorBehindLosingTime, colorBehindGainingTime, colorAhead, colorAheadLosingTime, colorAheadGainingTime, colorBest, colorBestBehind, colorBestAhead;

var config bool enabled, minimal;

var config int PB[16];
var config int Golds[16];

Expand Down Expand Up @@ -60,22 +62,6 @@ function InitStats(DXRStats newstats)

total = TotalTime();

if(curMission == 99) {
// write back new PBs and Golds
bNewPB = PB_total == 0 || total < PB_total;
for(i=1; i<=15; i++) {
time = stats.missions_times[i];
time += stats.missions_menu_times[i];
if(Golds[i] == 0 || time < Golds[i]) {
Golds[i] = time;
}
if(bNewPB) {
PB[i] = time;
}
}
}
SaveConfig();

if(curMission < 1 || curMission > 15) {
Hide();
return;
Expand All @@ -93,6 +79,27 @@ function InitStats(DXRStats newstats)
msg = msg $ ", Deaths: " $ stats.GetDataStorageStat(stats.dxr, "DXRStats_deaths");
player.ClientMessage(msg);

if(!enabled) {
Hide();
return;
}

if(curMission == 99) {
// write back new PBs and Golds
bNewPB = PB_total == 0 || total < PB_total;
for(i=1; i<=15; i++) {
time = stats.missions_times[i];
time += stats.missions_menu_times[i];
if(Golds[i] == 0 || time < Golds[i]) {
Golds[i] = time;
}
if(bNewPB) {
PB[i] = time;
}
}
}
SaveConfig();

SetSize(windowWidth, windowHeight);
StyleChanged();
}
Expand Down Expand Up @@ -149,7 +156,7 @@ function DrawWindow(GC gc)
h = text_height;

// previous split
if(prev > 0) {
if(prev > 0 && !minimal) {
time = cur_totals[prev] - balanced_splits_totals[prev];
t = prevTime - balanced_splits[prev];
msg = fmtTimeDiff(time);
Expand All @@ -160,22 +167,25 @@ function DrawWindow(GC gc)
y += h;

// current/upcoming split, showing balanced PB time
msg = fmtTime(balanced_splits_totals[cur]);
DrawTextLine(gc, MissionName(cur), msg, colorText, x, y);
if(!minimal) {
msg = fmtTime(balanced_splits_totals[cur]);
DrawTextLine(gc, MissionName(cur), msg, colorText, x, y);
}
y += h;

// next split
if(next > 0) {
if(next > 0 && !minimal) {
msg = fmtTime(balanced_splits_totals[next]);
DrawTextLine(gc, MissionName(next), msg, colorText, x, y);
}
y += h;

if(minimal) y += h;
// current segment time with comparison
msg = fmtTimeSeg(curTime);
s = "/ " $ fmtTimeSeg(balanced_splits[cur]);
t = curTime - balanced_splits[cur];
DrawTextLine(gc, "SEG:", msg, GetCmpColor(t, 0), x, y, s);
DrawTextLine(gc, "SEG:", msg, GetCmpColor(t, t), x, y, s);
y += h;

// current overall time
Expand All @@ -185,8 +195,10 @@ function DrawWindow(GC gc)
y += h;

// PB time
msg = fmtTime(PB_total);
DrawTextLine(gc, "PB:", msg, colorText, x, y);
if(!minimal) {
msg = fmtTime(PB_total);
DrawTextLine(gc, "PB:", msg, colorText, x, y);
}
y += h;
}

Expand Down Expand Up @@ -274,6 +286,7 @@ function DrawBackground(GC gc)

defaultproperties
{
enabled=true
windowWidth=150
windowHeight=80
textfont=Font'DeusExUI.FontMenuHeaders_DS';
Expand Down

0 comments on commit ecf8a05

Please sign in to comment.