Created a cfg file for the settings menu

This commit is contained in:
To Live Is To Die 2022-04-03 12:10:31 -06:00
parent 6046667b2f
commit 06e885f4cb
2 changed files with 37 additions and 3 deletions

View File

@ -0,0 +1,24 @@
extends Control
var iniFile = ConfigFile.new()
func initFile():
iniFile.set_value("player_preferences", "player_name", "Cliff")
iniFile.set_value("player_preferences", "risk_threshold", 2)
iniFile.set_value("visual_controls", "font_size", 3)
iniFile.set_value("visual_controls", "brightness", 3)
iniFile.set_value("general_settings", "volume", 3)
iniFile.set_value("general_settings", "closed_captions", false)
iniFile.set_value("general_settings", "dev_console", 3)
iniFile.save("user://PlayerPreferences.cfg")
func saveFile():
iniFile.save("user://PlayerPreferences.cfg")
func loadFile():
pass
func _ready():
initFile()

View File

@ -1,8 +1,13 @@
[gd_scene format=2]
[gd_scene load_steps=3 format=2]
[ext_resource path="res://SettingsMenuConfig.gd" type="Script" id=1]
[sub_resource type="StyleBoxFlat" id=1]
[node name="Control" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
@ -14,6 +19,7 @@ margin_left = -12.9719
margin_top = -2.0755
margin_right = -12.9719
margin_bottom = -2.0755
custom_styles/panel = SubResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
@ -107,7 +113,9 @@ text = "Font Size:"
margin_top = 18.0
margin_right = 155.0
margin_bottom = 34.0
max_value = 10.0
min_value = 1.0
max_value = 5.0
value = 5.0
tick_count = 10
ticks_on_borders = true
@ -121,7 +129,9 @@ text = "Brightness:"
margin_top = 56.0
margin_right = 155.0
margin_bottom = 72.0
max_value = 10.0
min_value = 1.0
max_value = 5.0
value = 5.0
tick_count = 10
ticks_on_borders = true