Added ability to adjust mouse settings in game
This commit is contained in:
@ -1,17 +1,78 @@
|
||||
extends Node
|
||||
|
||||
enum Setting{Mouse_Speed, Joystick_Speed, SFX_Volume, Music_Volume, Voice_Volume, FOV, Test_Value}
|
||||
|
||||
var DEVMODE = true
|
||||
var is_paused = false
|
||||
|
||||
var Joystick_Sensitivity = 2
|
||||
var Mouse_Sensitivity = 0.02
|
||||
|
||||
var current_map = ""
|
||||
var SpawnPoint:Vector3
|
||||
var Player_Last_Location = Vector3(0,0,0)
|
||||
|
||||
var HasGeneratorKey = false
|
||||
|
||||
var Settings:Dictionary = {
|
||||
Setting.Mouse_Speed: {
|
||||
"value": 0.02,
|
||||
"text": "Mouse Speed",
|
||||
"range": Vector2(0.0001, 0.09)
|
||||
},
|
||||
Setting.Joystick_Speed: {
|
||||
"value": 2,
|
||||
"text": "Mouse Speed",
|
||||
"range": Vector2(0.5, 4)
|
||||
},
|
||||
Setting.SFX_Volume: {
|
||||
"value": 100,
|
||||
"text": "SFX Volume",
|
||||
"range": Vector2(0,100)
|
||||
},
|
||||
Setting.Music_Volume: {
|
||||
"value": 100,
|
||||
"text": "Music Volume",
|
||||
"range": Vector2(0,100)
|
||||
},
|
||||
Setting.Voice_Volume: {
|
||||
"value": 100,
|
||||
"text": "Voice Volume",
|
||||
"range": Vector2(0,100)
|
||||
},
|
||||
Setting.FOV: {
|
||||
"value": 95,
|
||||
"text": "FOV",
|
||||
"range": Vector2(75,115)
|
||||
},
|
||||
Setting.Test_Value: {
|
||||
"value": 69,
|
||||
"text": "Test Value",
|
||||
"range": Vector2(0,100)
|
||||
}
|
||||
}
|
||||
|
||||
var GlobalData:Dictionary = {
|
||||
"SpawnPoint": Vector3(),
|
||||
"Player_Last_Location": Vector3()
|
||||
}
|
||||
|
||||
func GetSetting(SettingName):
|
||||
return Settings.get(SettingName).get("value")
|
||||
|
||||
func GetSettingName(SettingName):
|
||||
return Settings.get(SettingName).get("text")
|
||||
|
||||
func GetSettingRange(SettingName):
|
||||
return Settings.get(SettingName).get("range")
|
||||
|
||||
|
||||
|
||||
func SetSetting(SettingName, value):
|
||||
Settings[SettingName]["value"] = value
|
||||
|
||||
func PrintSettings():
|
||||
for setting in Settings.keys():
|
||||
print(setting, ":", Settings.get(setting))
|
||||
|
||||
|
||||
func SetCurrentMap(selected_map):
|
||||
current_map = selected_map
|
||||
|
||||
|
||||
Reference in New Issue
Block a user