diff --git a/wadsrc/static/zscript/ui/statscreen/statscreen.zs b/wadsrc/static/zscript/ui/statscreen/statscreen.zs index 007b3a9e34..18a4f8d7dd 100644 --- a/wadsrc/static/zscript/ui/statscreen/statscreen.zs +++ b/wadsrc/static/zscript/ui/statscreen/statscreen.zs @@ -507,6 +507,45 @@ class StatusScreen abstract play version("2.5") drawTextScaled(fnt, x - fnt.StringWidth(s) * scale, y, s, scale, color); } + //==================================================================== + // + // Display the completed time scaled + // + //==================================================================== + + void drawTimeScaled (Font fnt, int x, int y, int t, double scale, int color = Font.CR_UNTRANSLATED) + { + int sec = Thinker.Tics2Seconds(Plrs[me].stime); + if (t < 0) + return; + + int hours = t / 3600; + t -= hours * 3600; + int minutes = t / 60; + t -= minutes * 60; + int seconds = t; + + String s = ""; + if (hours > 0) + { + s = String.Format("%d", hours) .. ":"; + } + + if (hours > 0 || minutes < 10) + { + s = s .. "0"; + } + s = s .. String.Format("%d", minutes) .. ":"; + + if (seconds < 10) + { + s = s .. "0"; + } + s = s .. String.Format("%d", seconds); + + drawTextScaled(fnt, x - fnt.StringWidth(s) * scale, y, s, scale, color); + } + //==================================================================== // // Display level completion time and par, or "sucks" message if overflow. diff --git a/wadsrc/static/zscript/ui/statscreen/statscreen_coop.zs b/wadsrc/static/zscript/ui/statscreen/statscreen_coop.zs index 48bf30d93b..9aab6a4e92 100644 --- a/wadsrc/static/zscript/ui/statscreen/statscreen_coop.zs +++ b/wadsrc/static/zscript/ui/statscreen/statscreen_coop.zs @@ -53,7 +53,7 @@ class CoopStatusScreen : StatusScreen bool stillticking; bool autoskip = autoSkip(); - if ((acceleratestage || autoskip) && ng_state != 10) + if ((acceleratestage || autoskip) && ng_state != 12) { acceleratestage = 0; @@ -70,7 +70,7 @@ class CoopStatusScreen : StatusScreen cnt_frags[i] = fragSum (i); } PlaySound("intermission/nextstage"); - ng_state = 10; + ng_state = 12; } if (ng_state == 2) @@ -146,7 +146,7 @@ class CoopStatusScreen : StatusScreen if (!stillticking) { PlaySound("intermission/nextstage"); - ng_state += 1 + 2*!dofrags; + ng_state ++; } } else if (ng_state == 8) @@ -156,6 +156,34 @@ class CoopStatusScreen : StatusScreen stillticking = false; + cnt_time += 3; + cnt_total_time += 3; + + int sec = Thinker.Tics2Seconds(Plrs[me].stime); + if (cnt_time > sec) + cnt_time = sec; + else + stillticking = true; + + int tsec = Thinker.Tics2Seconds(wbs.totaltime); + if (cnt_total_time > tsec) + cnt_total_time = tsec; + else + stillticking = true; + + if (!stillticking) + { + PlaySound("intermission/nextstage"); + ng_state += 1 + 2*!dofrags; + } + } + else if (ng_state == 10) + { + if (!(bcnt&3)) + PlaySound("intermission/tick"); + + stillticking = false; + for (i=0 ; i= 8) + { + drawTimeScaled(displayFont, kills_x, y, cnt_time, FontScale, textcolor); + drawTimeScaled(displayFont, secret_x, y, cnt_total_time, FontScale, textcolor); + } } }