
- Mostly finished the settings menu - Got basic AI working on easy difficulty - Changed when animations are loaded - Music now changes when you hit play - Changed how AI will work. All enemies should only need the combatant script now
52 lines
1.7 KiB
GDScript
52 lines
1.7 KiB
GDScript
extends Control
|
|
|
|
@onready var data: Data = $/root/Root/Data
|
|
@onready var titleScreen: Control = $/root/Root/MainMenu/TitleScreen
|
|
@onready var fpsMonitor: RichTextLabel = $/root/Root/FPSMonitor
|
|
@onready var mainBus: int = AudioServer.get_bus_index("Master")
|
|
@onready var musicBus: int = AudioServer.get_bus_index("Music")
|
|
@onready var effectsBus: int = AudioServer.get_bus_index("Effects")
|
|
|
|
func home():
|
|
self.hide()
|
|
titleScreen.show()
|
|
|
|
func changeDifficulty(i: int):
|
|
data.difficulty = i
|
|
|
|
func changeVolMaster(i: float):
|
|
AudioServer.set_bus_volume_db(mainBus, linear_to_db(i))
|
|
|
|
func changeVolMusic(i: float):
|
|
AudioServer.set_bus_volume_db(musicBus, linear_to_db(i))
|
|
|
|
func changeVolEffects(i: float):
|
|
AudioServer.set_bus_volume_db(effectsBus, linear_to_db(i))
|
|
|
|
func windowModeChanged(index: int):
|
|
match index:
|
|
0: DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
|
|
1: DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
|
|
2: DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_EXCLUSIVE_FULLSCREEN)
|
|
|
|
func vsyncChanged(index: int):
|
|
match index:
|
|
0: DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_DISABLED)
|
|
1: DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_ENABLED)
|
|
2: DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_ADAPTIVE)
|
|
3: DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_MAILBOX)
|
|
|
|
func toggleFPSMonitor(toggled_on: bool):
|
|
fpsMonitor.visible = toggled_on
|
|
|
|
func fpsChanged(index: int):
|
|
match index:
|
|
0: Engine.max_fps = 24
|
|
1: Engine.max_fps = 30
|
|
2: Engine.max_fps = 60
|
|
3: Engine.max_fps = 90
|
|
4: Engine.max_fps = 120
|
|
5: Engine.max_fps = 144
|
|
6: Engine.max_fps = 240
|
|
7: Engine.max_fps = 0
|