Saved ultra-wide settings the_adventures_of_teddy/public_issues#27
This commit is contained in:
parent
8367c92536
commit
2feb35bc53
3 changed files with 15 additions and 1 deletions
|
@ -57,6 +57,13 @@ var kickAllPlayers = false # Can be set to true to kick all players in-game
|
|||
var respawnLocationChosen = false # When set to false, the game will be allowed to select a spawnpoint for the player
|
||||
var lastEnteredIP = "" # For keeping track of the last IP Address that was used
|
||||
var lastEnteredPort = "28000" # For keeping track of the last port that was used
|
||||
var stretchUI = false # Can be used for "enabling" ultra wide
|
||||
@onready var main:Window = $"/root"
|
||||
|
||||
func _ready():
|
||||
await get_tree().create_timer(0.1).timeout
|
||||
if stretchUI == true:
|
||||
main.set_content_scale_aspect(Window.CONTENT_SCALE_ASPECT_IGNORE)
|
||||
|
||||
func _process(delta):
|
||||
spawn_locations()
|
||||
|
|
|
@ -8,7 +8,8 @@ var settings_template = { # Default values if we don't already have a settings f
|
|||
'volume' : 0.5,
|
||||
'tutorialCompleted' : false,
|
||||
'lastEnteredIP' : "",
|
||||
'lastEnteredPort' : "28000"
|
||||
'lastEnteredPort' : "28000",
|
||||
'stretchUI' : false
|
||||
}
|
||||
|
||||
var settings_data = {} # This gets filled as soon as load_data() is called.
|
||||
|
@ -40,6 +41,7 @@ func save_data():
|
|||
settings_data['tutorialCompleted'] = Global.tutorialCompleted
|
||||
settings_data['lastEnteredIP'] = Global.lastEnteredIP
|
||||
settings_data['lastEnteredPort'] = Global.lastEnteredPort
|
||||
settings_data['stretchUI'] = Global.stretchUI
|
||||
file.store_line(JSON.stringify(settings_data))
|
||||
|
||||
func load_data():
|
||||
|
@ -52,9 +54,11 @@ func load_data():
|
|||
var tutorialCompleted = settings_data['tutorialCompleted']
|
||||
var lastEnteredIP = settings_data['lastEnteredIP']
|
||||
var lastEnteredPort = settings_data['lastEnteredPort']
|
||||
var stretchUI = settings_data['stretchUI']
|
||||
Global.mouseSensitivity = mousesense
|
||||
Global.playerName = playername
|
||||
Global.volumeModifer = volume
|
||||
Global.tutorialCompleted = tutorialCompleted
|
||||
Global.lastEnteredIP = lastEnteredIP
|
||||
Global.lastEnteredPort = lastEnteredPort
|
||||
Global.stretchUI = stretchUI
|
||||
|
|
|
@ -48,5 +48,8 @@ func _on_fullscreen_box_pressed():
|
|||
func _on_wide_box_pressed():
|
||||
if $wideBox.button_pressed == true:
|
||||
main.set_content_scale_aspect(Window.CONTENT_SCALE_ASPECT_IGNORE)
|
||||
Global.stretchUI = true
|
||||
if $wideBox.button_pressed == false:
|
||||
main.set_content_scale_aspect(Window.CONTENT_SCALE_ASPECT_KEEP)
|
||||
Global.stretchUI = false
|
||||
Global.save_data()
|
||||
|
|
Loading…
Reference in a new issue