diff --git a/wadsrc/static/zscript/ui/statscreen/statscreen.zs b/wadsrc/static/zscript/ui/statscreen/statscreen.zs index a357e22c47..c1dcca7d59 100644 --- a/wadsrc/static/zscript/ui/statscreen/statscreen.zs +++ b/wadsrc/static/zscript/ui/statscreen/statscreen.zs @@ -509,6 +509,28 @@ 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) + { + if (t < 0) + return; + + int hours = t / 3600; + t -= hours * 3600; + int minutes = t / 60; + t -= minutes * 60; + int seconds = t; + + String s = (hours > 0 ? String.Format("%d:", hours) : "") .. String.Format("%02d:%02d", minutes, 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 c40aa0b1e5..02fc1734ba 100644 --- a/wadsrc/static/zscript/ui/statscreen/statscreen_coop.zs +++ b/wadsrc/static/zscript/ui/statscreen/statscreen_coop.zs @@ -55,7 +55,7 @@ class CoopStatusScreen : StatusScreen bool stillticking; bool autoskip = autoSkip(); - if ((acceleratestage || autoskip) && ng_state != 10) + if ((acceleratestage || autoskip) && ng_state != 12) { acceleratestage = 0; @@ -72,8 +72,12 @@ class CoopStatusScreen : StatusScreen cnt_frags[i] = fragSum (i); } cnt_otherkills = otherkills; + + cnt_time = Thinker.Tics2Seconds(Plrs[me].stime); + cnt_total_time = Thinker.Tics2Seconds(wbs.totaltime); + PlaySound("intermission/nextstage"); - ng_state = 10; + ng_state = 12; } if (ng_state == 2) @@ -156,7 +160,7 @@ class CoopStatusScreen : StatusScreen if (!stillticking) { PlaySound("intermission/nextstage"); - ng_state += 1 + 2*!dofrags; + ng_state ++; } } else if (ng_state == 8) @@ -166,6 +170,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); + } } }