mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-01-22 22:36:03 +00:00
A lot of FPS agnosticism, added def lerp
This commit is contained in:
@@ -1298,11 +1298,11 @@ def pbAnimationsOrganiser
|
||||
list.delete_at(cmd[1])
|
||||
cmd[1] = [cmd[1], list.length - 1].min
|
||||
refreshlist = true
|
||||
pbWait(Graphics.frame_rate * 2 / 10)
|
||||
pbWait(0.2)
|
||||
when 4 # Insert spot
|
||||
list.insert(cmd[1], PBAnimation.new)
|
||||
refreshlist = true
|
||||
pbWait(Graphics.frame_rate * 2 / 10)
|
||||
pbWait(0.2)
|
||||
when 0
|
||||
cmd2 = pbMessage(_INTL("Save changes?"),
|
||||
[_INTL("Yes"), _INTL("No"), _INTL("Cancel")], 3)
|
||||
|
||||
@@ -382,11 +382,11 @@ class MapScreenScene
|
||||
end
|
||||
|
||||
def onClick(mapid, x, y)
|
||||
if @lastclick > 0 && Graphics.frame_count - @lastclick < Graphics.frame_rate * 0.5
|
||||
if @lastclick > 0 && System.uptime - @lastclick <= 0.5
|
||||
onDoubleClick(mapid)
|
||||
@lastclick = -1
|
||||
else
|
||||
@lastclick = Graphics.frame_count
|
||||
@lastclick = System.uptime
|
||||
if mapid >= 0
|
||||
@dragging = true
|
||||
@dragmapid = mapid
|
||||
|
||||
@@ -248,7 +248,7 @@ class SpritePositioner
|
||||
@sprites["info"].visible = true
|
||||
ret = false
|
||||
loop do
|
||||
sprite.visible = (Graphics.frame_count % 16) < 12 # Flash the selected sprite
|
||||
sprite.visible = ((System.uptime * 8).to_i % 4) < 3 # Flash the selected sprite
|
||||
Graphics.update
|
||||
Input.update
|
||||
self.update
|
||||
|
||||
@@ -100,10 +100,10 @@ MenuHandlers.add(:debug_menu, :safari_zone_and_bug_contest, {
|
||||
loop do
|
||||
cmds = []
|
||||
if Settings::BUG_CONTEST_TIME > 0
|
||||
curtime = [(contest.timer + Settings::BUG_CONTEST_TIME * Graphics.frame_rate) - Graphics.frame_count, 0].max
|
||||
curtime /= Graphics.frame_rate
|
||||
min = curtime / 60
|
||||
sec = curtime % 60
|
||||
time_left = Settings::BUG_CONTEST_TIME - (System.uptime - contest.timer_start).to_i
|
||||
time_left = 0 if time_left < 0
|
||||
min = time_left / 60
|
||||
sec = time_left % 60
|
||||
time_string = _ISPRINTF("{1:02d}m {2:02d}s", min, sec)
|
||||
else
|
||||
time_string = _INTL("infinite")
|
||||
@@ -119,13 +119,10 @@ MenuHandlers.add(:debug_menu, :safari_zone_and_bug_contest, {
|
||||
params.setRange(0, 99999)
|
||||
params.setDefaultValue(min)
|
||||
new_time = pbMessageChooseNumber(_INTL("Set the time remaining (in minutes) in this Bug-Catching Contest."), params)
|
||||
echoln contest.timer
|
||||
echoln new_time
|
||||
contest.timer += (new_time - min) * 60 * Graphics.frame_rate
|
||||
echoln contest.timer
|
||||
contest.timer_start += (new_time - min) * 60
|
||||
$scene.spriteset.usersprites.each do |sprite|
|
||||
next if !sprite.is_a?(TimerDisplay)
|
||||
sprite.start = contest.timer
|
||||
sprite.start_time = contest.timer_start
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user