Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random UI things #340

Merged
merged 16 commits into from
Oct 7, 2023
Merged

Random UI things #340

merged 16 commits into from
Oct 7, 2023

Conversation

Dregu
Copy link
Collaborator

@Dregu Dregu commented Oct 5, 2023

  • Random UI fixes
  • Expose update_state() to run the game logic really fast, maybe to skip forward in a TAS or double the game speed
  • Add set_frametime() to change the target engine fps, capped by gpu/monitor/vsync/whatever still
-- skip hundun rise in a few seconds, simulating everything in between but not wasting time to render it
while state.time_level < 5000 do
  update_state()
end

-- run game at double speed, but keep timer at normal speed
set_callback(function()
  if not no_repeat then
    no_repeat = true
    update_state()
    state.time_level = state.time_level - 1
    state.time_total = state.time_total - 1
    no_repeat = nil
  end
end, ON.POST_UPDATE)

-- run at 50% speed by changing frametime
set_frametime(1/30)

-- don't cap fps when window is unfocused
set_frametime_unfocused(0)

src/game_api/movable.hpp Outdated Show resolved Hide resolved
src/game_api/custom_types.cpp Show resolved Hide resolved
src/game_api/flags.hpp Outdated Show resolved Hide resolved
src/game_api/script/lua_vm.cpp Show resolved Hide resolved
@Dregu Dregu merged commit 6b559e7 into main Oct 7, 2023
@Dregu Dregu deleted the UI branch October 7, 2023 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants