Skip to content

Commit

Permalink
Move idle ticks to follow app ticks (CorsixTH#2691)
Browse files Browse the repository at this point in the history
* Move idle ticks to follow app ticks
  • Loading branch information
lewri authored Oct 27, 2024
1 parent 9ecc4ed commit d372f96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CorsixTH/Lua/app.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1253,8 +1253,8 @@ function App:idle()
self:resetIdle()
return
end
-- Have we been idle enough (~30s)
if self.idle_tick > 1000 then
-- Have we been idle enough (~30s, based on SDL tick rate of 18ms)
if self.idle_tick > 1680 then
-- User is idle, play the demo gameplay movie
self.moviePlayer:playDemoMovie()
self:resetIdle()
Expand Down
3 changes: 3 additions & 0 deletions CorsixTH/Lua/dialogs/resizables/main_menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ function UIMainMenu:draw(canvas, x, y)
ly = ly - 15
end
self.label_font:draw(canvas, _S.main_menu.version .. self.version_number, x + 5, ly, 190, 0, "right")
end

function UIMainMenu:onTick()
TheApp:idle()
end

Expand Down

0 comments on commit d372f96

Please sign in to comment.