fix map change config load value and show player keys in menu

This commit is contained in:
interfisch 2025-04-07 21:55:13 +02:00
parent c12f3a3883
commit 8efe7f7bac
3 changed files with 7 additions and 3 deletions

View file

@ -105,7 +105,6 @@ offset_right = 517.0
offset_bottom = 637.245
[node name="VBoxContainer_Playerlist" type="VBoxContainer" parent="MenuDisplay/MarginContainer"]
visible = false
layout_mode = 2
theme = SubResource("Theme_eo4i1")

View file

@ -20,7 +20,7 @@ var carpreset="normal"
var remove_cars_timeout=true
var automatic_map_change_after=2
var automatic_map_change_after=-1 #-1 to load config value initally
var automatic_map_change_in=automatic_map_change_after #change map when this reaches 0
var colorwheelstep:float=0.3
@ -47,6 +47,8 @@ func setCarPreset(p:String):
func setAutomaticMapChangeAfter(v):
automatic_map_change_after=max(v,0)
if automatic_map_change_in==-1:
automatic_map_change_in=automatic_map_change_after #initial value
func getSelectedMap(): #return only short map name "00"
return map_scene_name

View file

@ -6,7 +6,7 @@ const MAX_OUTLINESIZE=60
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
$MapChangeInfo.text="Mapchange in "+str(Gamestate.automatic_map_change_in)
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
@ -60,3 +60,6 @@ func _process(delta: float) -> void:
var outlinesize=max(0,label.get_theme_constant("outline_size")-2*delta)
label.add_theme_constant_override("outline_size",outlinesize)
$MapChangeInfo.text="Mapchange in "+str(Gamestate.automatic_map_change_in)