add config parameter for remove car timeout
This commit is contained in:
parent
dc8e3a7902
commit
07aedaa514
7 changed files with 29 additions and 11 deletions
|
@ -241,7 +241,6 @@ bus = &"Crash"
|
|||
[node name="NoInputTimer" type="Timer" parent="CharacterBody_Car"]
|
||||
wait_time = 15.0
|
||||
one_shot = true
|
||||
autostart = true
|
||||
|
||||
[connection signal="timeout" from="CharacterBody_Car/resetTimer" to="CharacterBody_Car" method="_on_reset_timer_timeout"]
|
||||
[connection signal="timeout" from="CharacterBody_Car/collisionEnableTimer" to="CharacterBody_Car" method="_on_collision_enable_timer_timeout"]
|
||||
|
|
|
@ -122,7 +122,6 @@ collision_mask = 4
|
|||
[node name="CollisionShape2D" type="CollisionShape2D" parent="area_cp3"]
|
||||
position = Vector2(6807.55, 249.841)
|
||||
rotation = 0.23911
|
||||
scale = Vector2(1, 1)
|
||||
shape = SubResource("RectangleShape2D_j11df")
|
||||
|
||||
[node name="area_cp4" type="Area2D" parent="."]
|
||||
|
|
|
@ -253,7 +253,7 @@ func get_input(delta:float):
|
|||
if key_accelerator_pressed:
|
||||
no_input_timer.stop()
|
||||
else:
|
||||
if no_input_timer.is_stopped() and !no_input_timeout_flag: #reset timer
|
||||
if Gamestate.enabled_remove_timeout_cars and no_input_timer.is_stopped() and !no_input_timeout_flag: #reset timer
|
||||
no_input_timer.start()
|
||||
|
||||
if key_accelerator_pressed:
|
||||
|
|
|
@ -10,6 +10,8 @@ func _ready() -> void:
|
|||
|
||||
config.set_value("video", "fullscreen", false)
|
||||
|
||||
config.set_value("general", "remove_timeout_cars", true)
|
||||
|
||||
config.save(SETTINGS_FILE_PATH)
|
||||
else:
|
||||
config.load(SETTINGS_FILE_PATH)
|
||||
|
@ -21,6 +23,13 @@ func save_video_setting(key: String, value):
|
|||
func get_video_setting(key: String):
|
||||
return config.get_value("video", key)
|
||||
|
||||
func save_general_setting(key: String, value):
|
||||
config.set_value("general", key,value)
|
||||
config.save(SETTINGS_FILE_PATH)
|
||||
|
||||
func get_general_setting(key: String):
|
||||
return config.get_value("general", key)
|
||||
|
||||
func get_keywhitelist_setting():
|
||||
var keywhitelist=[]
|
||||
if config.get_value("keywhitelist", "enabled"):
|
||||
|
|
|
@ -16,6 +16,8 @@ var map_scene_name_postfix=".tscn"
|
|||
|
||||
var rounds=3
|
||||
|
||||
var enabled_remove_timeout_cars=true
|
||||
|
||||
var automatic_map_change_in_start=5
|
||||
var automatic_map_change_in=automatic_map_change_in_start #change map when this reaches 0
|
||||
|
||||
|
@ -28,6 +30,14 @@ func setRounds(r):
|
|||
print("Rounds set to "+str(r))
|
||||
rounds=r
|
||||
|
||||
func getEnabledRemoveTimeoutCars():
|
||||
return enabled_remove_timeout_cars
|
||||
|
||||
func setEnabledRemoveTimeoutCars(s):
|
||||
print("enabled_remove_timeout_cars set to "+str(s))
|
||||
enabled_remove_timeout_cars=s
|
||||
|
||||
|
||||
func getSelectedMap(): #return only short map name "00"
|
||||
return map_scene_name
|
||||
|
||||
|
|
|
@ -16,6 +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"))
|
||||
|
||||
keywhitelist=ConfigFileHandler.get_keywhitelist_setting() #empty list if disabled
|
||||
btn_save_whitelist.disabled=keywhitelist.size()>0 #whitelist enabled, then disable save whitelist button
|
||||
|
|
|
@ -20,7 +20,7 @@ vec3 blur(sampler2D sp, vec2 uv, vec2 scale) {
|
|||
float accum = 0.0;
|
||||
float weight;
|
||||
vec2 offset;
|
||||
|
||||
|
||||
for (int x = -samples / 2; x < samples / 2; ++x) {
|
||||
for (int y = -samples / 2; y < samples / 2; ++y) {
|
||||
offset = vec2(float(x), float(y));
|
||||
|
@ -29,7 +29,7 @@ vec3 blur(sampler2D sp, vec2 uv, vec2 scale) {
|
|||
accum += weight;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return col / accum;
|
||||
}
|
||||
|
||||
|
@ -39,22 +39,22 @@ vec2 rotateUV(vec2 uv, vec2 pivot, float rotation) {
|
|||
uv -= pivot;
|
||||
return vec2(
|
||||
cosa * uv.x - sina * uv.y,
|
||||
cosa * uv.y + sina * uv.x
|
||||
cosa * uv.y + sina * uv.x
|
||||
) + pivot;
|
||||
}
|
||||
|
||||
|
||||
void fragment() {
|
||||
|
||||
|
||||
vec2 uv = UV ;
|
||||
vec2 rotuv=rotateUV(uv,rotationpivot,TIME*speed);
|
||||
|
||||
|
||||
float _strength=abs(0.47-uv.y)*strength;
|
||||
vec2 ps = vec2(1.0) / iResolution.xy * .000001 * _strength;
|
||||
|
||||
|
||||
|
||||
|
||||
//COLOR.rgb=texture(iChannel0, uv).rgb;
|
||||
|
||||
|
||||
COLOR.rgb = blur(iChannel0, rotuv, ps );
|
||||
COLOR.a = 1.0;
|
||||
}
|
Loading…
Add table
Reference in a new issue