aboutsummaryrefslogtreecommitdiff
path: root/game/src/OptionMenu/MonitorDisplaySelector.gd
diff options
context:
space:
mode:
author Spartan322 <Megacake1234@gmail.com>2023-02-10 10:18:46 +0100
committer Spartan322 <Megacake1234@gmail.com>2023-02-10 10:31:28 +0100
commit3798205c740e7e2faf2594866cb497260012508c (patch)
tree4ca4a0835cb833fbba1983f0e8de5fa66227b86e /game/src/OptionMenu/MonitorDisplaySelector.gd
parent6525b89a37a31eaf88182b11410bd46b6658e297 (diff)
Implement a usable settings UI, should fulfill:
SS-58, SS-61, SS-6, SS-9, SS-10, SS-11, SS-13 UI-11, UI-12, UI-19, UI-44, UI-47, UI-22
Diffstat (limited to 'game/src/OptionMenu/MonitorDisplaySelector.gd')
-rw-r--r--game/src/OptionMenu/MonitorDisplaySelector.gd16
1 files changed, 16 insertions, 0 deletions
diff --git a/game/src/OptionMenu/MonitorDisplaySelector.gd b/game/src/OptionMenu/MonitorDisplaySelector.gd
new file mode 100644
index 0000000..600b296
--- /dev/null
+++ b/game/src/OptionMenu/MonitorDisplaySelector.gd
@@ -0,0 +1,16 @@
+extends SettingOptionButton
+
+
+func _ready():
+ clear()
+ for screen_index in range(DisplayServer.get_screen_count()):
+ add_item("Monitor %d" % (screen_index + 1))
+
+func _on_item_selected(index):
+ print("Selected index: %d" % index)
+ var window := get_viewport().get_window()
+ var mode := window.mode
+ window.mode = Window.MODE_WINDOWED
+ get_viewport().get_window().set_current_screen(index)
+ window.mode = mode
+ print(get_viewport().get_window().current_screen)