mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
[PORT] Fullscreen Port from BayStation12 / TG (#25587)
* Changes necrosis_prob to use decaylevel. * Reverts previous change to create a new branch. * Ports over full screen from BayStation12. * Adds fullscreen keybind. F11 to toggle. * Apply suggestions from code review I want to strange @1080p Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com> Signed-off-by: Spaghetti-bit <60483458+Spaghetti-bit@users.noreply.github.com> * Makes fullscreen to non-fullscreen more seamless. Still has to readjust the chat box size similar to how someone would do it if they manually adjusted their chatbox size. This is currently unavoidable. * Fixing lint angy * Gives the user input in the chat when they toggle fullscreen on or off. * gives the user a tip on how to enable and disable fullscreen * readability --------- Signed-off-by: Spaghetti-bit <60483458+Spaghetti-bit@users.noreply.github.com> Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com>
This commit is contained in:
@@ -225,6 +225,9 @@
|
||||
/// Our object window datum. It stores info about and handles behavior for the object tab
|
||||
var/datum/object_window_info/obj_window
|
||||
|
||||
/// The current fullscreen state for /client/toggle_fullscreen()
|
||||
var/fullscreen = FALSE
|
||||
|
||||
/client/vv_edit_var(var_name, var_value)
|
||||
switch(var_name)
|
||||
// I know we will never be in a world where admins are editing client vars to let people bypass TOS
|
||||
|
||||
@@ -1270,6 +1270,31 @@
|
||||
class = "unknown"
|
||||
debug_variables(stat_item)
|
||||
message_admins("Admin [key_name_admin(usr)] is debugging the [stat_item] [class].")
|
||||
/**
|
||||
* Handles fullscreen on the client.
|
||||
*/
|
||||
/client/verb/toggle_fullscreen()
|
||||
set name = "Toggle Fullscreen"
|
||||
set category = "OOC"
|
||||
|
||||
fullscreen = !fullscreen
|
||||
|
||||
if(fullscreen)
|
||||
winset(usr, "mainwindow", "titlebar=false")
|
||||
winset(usr, "mainwindow", "can-resize=false")
|
||||
winset(usr, "mainwindow", "is-maximized=false") // Ensures the window doesn't get stretched oddly.
|
||||
winset(usr, "mainwindow", "is-maximized=true")
|
||||
winset(usr, "mainwindow", "is-fullscreen=true")
|
||||
winset(usr, "mainwindow", "menu=") // Top-Menu bar [DISABLED]
|
||||
else
|
||||
winset(usr, "mainwindow", "titlebar=true")
|
||||
winset(usr, "mainwindow", "can-resize=true")
|
||||
winset(usr, "mainwindow", "is-fullscreen=false") // Order matters. Fullscreen [OFF] -> Maximize [TRUE]
|
||||
winset(usr, "mainwindow", "is-maximized=true")
|
||||
winset(usr, "mainwindow", "menu=menu")
|
||||
var/fullscreen_state = fullscreen ? "on" : "off"
|
||||
to_chat(usr, "Toggled fullscreen [fullscreen_state]. To Toggle fullscreen; Go to the tab OOC -> Toggle fullscreen or press F11")
|
||||
fit_viewport()
|
||||
|
||||
/client/proc/try_open_reagent_editor(atom/target)
|
||||
var/target_UID = target.UID()
|
||||
|
||||
Reference in New Issue
Block a user