aboutsummaryrefslogtreecommitdiff
path: root/game/src/OptionMenu/MonitorDisplaySelector.gd
blob: f2f0dc8783c428838e59a1d667a83b7f3162e054 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
extends SettingOptionButton

func _setup_button():
   clear()
   for screen_index in range(DisplayServer.get_screen_count()):
      add_item("Monitor %d" % (screen_index + 1))
   default_selected = get_viewport().get_window().current_screen

func _on_item_selected(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