diff --git a/src/menu/menu.cpp b/src/menu/menu.cpp index 242e69ace..84f296cfd 100644 --- a/src/menu/menu.cpp +++ b/src/menu/menu.cpp @@ -1011,6 +1011,7 @@ CCMD(undocolorpic) DEFINE_GLOBAL(menuactive) DEFINE_GLOBAL(BackbuttonTime) DEFINE_GLOBAL(BackbuttonAlpha) +DEFINE_GLOBAL(GameTicRate) DEFINE_FIELD(DMenu, mParentMenu) DEFINE_FIELD(DMenu, mMouseCapture); diff --git a/wadsrc/static/zscript/base.zs b/wadsrc/static/zscript/base.zs index b44b703f7..cfaf4685c 100644 --- a/wadsrc/static/zscript/base.zs +++ b/wadsrc/static/zscript/base.zs @@ -49,6 +49,7 @@ struct _ native // These are the global variables, the struct is only here to av native int LocalViewPitch; native readonly @MusPlayingInfo musplaying; native readonly bool generic_ui; + native readonly int GameTicRate; // sandbox state in multi-level setups: diff --git a/wadsrc/static/zscript/ui/menu/menu.zs b/wadsrc/static/zscript/ui/menu/menu.zs index 65a563211..a11e301e8 100644 --- a/wadsrc/static/zscript/ui/menu/menu.zs +++ b/wadsrc/static/zscript/ui/menu/menu.zs @@ -191,7 +191,7 @@ class Menu : Object native ui version("2.4") } else if (ev.type == UIEvent.Type_MouseMove) { - BackbuttonTime = 4*Thinker.TICRATE; + BackbuttonTime = 4*GameTicRate; if (mMouseCapture || m_use_mouse == 1) { res = MouseEventBack(MOUSE_Move, ev.MouseX, y); diff --git a/wadsrc/static/zscript/ui/menu/readthis.zs b/wadsrc/static/zscript/ui/menu/readthis.zs index 58904b0f4..59ea658ff 100644 --- a/wadsrc/static/zscript/ui/menu/readthis.zs +++ b/wadsrc/static/zscript/ui/menu/readthis.zs @@ -74,7 +74,7 @@ class ReadThisMenu : GenericMenu } screen.Dim(0, 1.0, 0,0, screen.GetWidth(), screen.GetHeight()); - alpha = MIN((gametic - mInfoTic) * (3. / Thinker.TICRATE), 1.); + alpha = MIN((gametic - mInfoTic) * (3. / GameTicRate), 1.); if (alpha < 1. && prevpic.IsValid()) { screen.DrawTexture (prevpic, false, 0, 0, DTA_Fullscreen, true); diff --git a/wadsrc/static/zscript/ui/statscreen/statscreen.zs b/wadsrc/static/zscript/ui/statscreen/statscreen.zs index 7ee6e9eb7..5b1547133 100644 --- a/wadsrc/static/zscript/ui/statscreen/statscreen.zs +++ b/wadsrc/static/zscript/ui/statscreen/statscreen.zs @@ -633,7 +633,7 @@ class StatusScreen abstract play version("2.5") bool autoSkip() { - return wi_autoadvance > 0 && bcnt > (wi_autoadvance * Thinker.TICRATE); + return wi_autoadvance > 0 && bcnt > (wi_autoadvance * GameTicRate); } //==================================================================== @@ -703,7 +703,7 @@ class StatusScreen abstract play version("2.5") CurState = ShowNextLoc; acceleratestage = 0; - cnt = SHOWNEXTLOCDELAY * Thinker.TICRATE; + cnt = SHOWNEXTLOCDELAY * GameTicRate; noautostartmap = bg.LoadBackground(true); } diff --git a/wadsrc/static/zscript/ui/statscreen/statscreen_coop.zs b/wadsrc/static/zscript/ui/statscreen/statscreen_coop.zs index 6f40d9dcc..47941066a 100644 --- a/wadsrc/static/zscript/ui/statscreen/statscreen_coop.zs +++ b/wadsrc/static/zscript/ui/statscreen/statscreen_coop.zs @@ -23,7 +23,7 @@ class CoopStatusScreen : StatusScreen FontScale = max(screen.GetHeight() / 400, 1); RowHeight = int(max((displayFont.GetHeight() + 1) * FontScale, 1)); - cnt_pause = Thinker.TICRATE; + cnt_pause = GameTicRate; for (int i = 0; i < MAXPLAYERS; i++) { @@ -236,7 +236,7 @@ class CoopStatusScreen : StatusScreen if (!--cnt_pause) { ng_state++; - cnt_pause = Thinker.TICRATE; + cnt_pause = GameTicRate; } } } diff --git a/wadsrc/static/zscript/ui/statscreen/statscreen_dm.zs b/wadsrc/static/zscript/ui/statscreen/statscreen_dm.zs index 0a6e969db..49ae54ed3 100644 --- a/wadsrc/static/zscript/ui/statscreen/statscreen_dm.zs +++ b/wadsrc/static/zscript/ui/statscreen/statscreen_dm.zs @@ -33,7 +33,7 @@ class DeathmatchStatusScreen : StatusScreen total_deaths = 0; ng_state = 1; - cnt_pause = Thinker.TICRATE; + cnt_pause = GameTicRate; for (i=0 ; i= tsec) cnt_total_time = tsec; - int psec = wbs.partime / Thinker.TICRATE; + int psec = wbs.partime / GameTicRate; if (!intermissioncounter || cnt_par >= psec) { cnt_par = psec; @@ -126,7 +126,7 @@ class DoomStatusScreen : StatusScreen if (!--cnt_pause) { sp_state++; - cnt_pause = Thinker.TICRATE; + cnt_pause = GameTicRate; } } } diff --git a/wadsrc/static/zscript/ui/statusbar/alt_hud.zs b/wadsrc/static/zscript/ui/statusbar/alt_hud.zs index 914850151..deaedf553 100644 --- a/wadsrc/static/zscript/ui/statusbar/alt_hud.zs +++ b/wadsrc/static/zscript/ui/statusbar/alt_hud.zs @@ -800,7 +800,7 @@ class AltHud ui if (showMillis) { - int millis = (Level.time % Thinker.TICRATE) * (1000 / Thinker.TICRATE); + int millis = (Level.time % GameTicRate) * 1000 / GameTicRate; timeString = String.Format("%02i:%02i:%02i.%03i", hours, minutes, seconds, millis); } else if (showSeconds)