change remove cars timeout setting to use time instead of boolean
This commit is contained in:
parent
07aedaa514
commit
e71115be84
4 changed files with 10 additions and 9 deletions
|
@ -110,6 +110,7 @@ var finalTime=-1
|
|||
func _ready() -> void:
|
||||
collision_shape.disabled=true #disable collisions on start. also to avoid collision when initially setting position
|
||||
finalTime=-1
|
||||
no_input_timer.wait_time=Gamestate.getRemoveCarsTimeout()
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
|
@ -253,7 +254,7 @@ func get_input(delta:float):
|
|||
if key_accelerator_pressed:
|
||||
no_input_timer.stop()
|
||||
else:
|
||||
if Gamestate.enabled_remove_timeout_cars and no_input_timer.is_stopped() and !no_input_timeout_flag: #reset timer
|
||||
if Gamestate.getRemoveCarsTimeout()>0 and no_input_timer.is_stopped() and !no_input_timeout_flag: #reset timer
|
||||
no_input_timer.start()
|
||||
|
||||
if key_accelerator_pressed:
|
||||
|
|
|
@ -10,7 +10,7 @@ func _ready() -> void:
|
|||
|
||||
config.set_value("video", "fullscreen", false)
|
||||
|
||||
config.set_value("general", "remove_timeout_cars", true)
|
||||
config.set_value("general", "remove_cars_timeout", 15)
|
||||
|
||||
config.save(SETTINGS_FILE_PATH)
|
||||
else:
|
||||
|
|
|
@ -16,7 +16,7 @@ var map_scene_name_postfix=".tscn"
|
|||
|
||||
var rounds=3
|
||||
|
||||
var enabled_remove_timeout_cars=true
|
||||
var remove_cars_timeout=true
|
||||
|
||||
var automatic_map_change_in_start=5
|
||||
var automatic_map_change_in=automatic_map_change_in_start #change map when this reaches 0
|
||||
|
@ -30,12 +30,12 @@ func setRounds(r):
|
|||
print("Rounds set to "+str(r))
|
||||
rounds=r
|
||||
|
||||
func getEnabledRemoveTimeoutCars():
|
||||
return enabled_remove_timeout_cars
|
||||
func getRemoveCarsTimeout():
|
||||
return remove_cars_timeout
|
||||
|
||||
func setEnabledRemoveTimeoutCars(s):
|
||||
print("enabled_remove_timeout_cars set to "+str(s))
|
||||
enabled_remove_timeout_cars=s
|
||||
func setRemoveCarsTimeout(s):
|
||||
print("remove_cars_timeout set to "+str(s))
|
||||
remove_cars_timeout=s
|
||||
|
||||
|
||||
func getSelectedMap(): #return only short map name "00"
|
||||
|
|
|
@ -16,7 +16,7 @@ func _ready():
|
|||
btn_fullscreen.button_pressed=DisplayServer.window_get_mode(0)==DisplayServer.WINDOW_MODE_FULLSCREEN #toogle fullscreen switch to correct init state
|
||||
|
||||
btn_fullscreen.button_pressed=ConfigFileHandler.get_video_setting("fullscreen")
|
||||
Gamestate.setEnabledRemoveTimeoutCars(ConfigFileHandler.get_general_setting("remove_timeout_cars"))
|
||||
Gamestate.setRemoveCarsTimeout(ConfigFileHandler.get_general_setting("remove_cars_timeout"))
|
||||
|
||||
keywhitelist=ConfigFileHandler.get_keywhitelist_setting() #empty list if disabled
|
||||
btn_save_whitelist.disabled=keywhitelist.size()>0 #whitelist enabled, then disable save whitelist button
|
||||
|
|
Loading…
Add table
Reference in a new issue