Fullscreen Mode (#12586)

This commit is contained in:
Geeves
2021-10-10 15:43:53 +02:00
committed by GitHub
parent ee0f4fefe5
commit f52d334c0f
4 changed files with 33 additions and 0 deletions
+21
View File
@@ -391,6 +391,9 @@ var/list/localhost_addresses = list(
if (byond_version >= 511 && prefs.clientfps)
fps = prefs.clientfps
if(prefs.toggles_secondary & FULLSCREEN_MODE)
toggle_fullscreen(TRUE)
/client/proc/InitClient()
to_chat(src, "<span class='alert'>If the title screen is black, resources are still downloading. Please be patient until the title screen appears.</span>")
@@ -598,6 +601,24 @@ var/list/localhost_addresses = list(
if(prefs)
prefs.ShowChoices(usr)
/client/verb/toggle_fullscreen_preference()
set name = "Toggle Fullscreen Preference"
set category = "Preferences"
set desc = "Toggles whether the game window will be true fullscreen or normal."
prefs.toggles_secondary ^= FULLSCREEN_MODE
prefs.save_preferences()
toggle_fullscreen(prefs.toggles_secondary & FULLSCREEN_MODE)
/client/proc/toggle_fullscreen(new_value)
if(new_value)
winset(src, "mainwindow", "is-maximized=false;can-resize=false;titlebar=false;menu=menu")
winset(src, "mainwindow.mainvsplit", "pos=0x0")
else
winset(src, "mainwindow", "is-maximized=false;can-resize=true;titlebar=true;menu=menu")
winset(src, "mainwindow.mainvsplit", "pos=3x0")
winset(src, "mainwindow", "is-maximized=true")
/client/proc/apply_fps(var/client_fps)
if(world.byond_version >= 511 && byond_version >= 511 && client_fps >= 0 && client_fps <= 1000)
vars["fps"] = prefs.clientfps