Skip to content

Commit

Permalink
Merge pull request #351 from Yata9arasu/fullscreen
Browse files Browse the repository at this point in the history
Fullscreen added
  • Loading branch information
MysticalFaceLesS authored Mar 26, 2024
2 parents 35955ca + 1de0b28 commit a9f9459
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
35 changes: 35 additions & 0 deletions mod_celadon/__tweaks/fullscreen.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#define COMSIG_KB_CLIENT_FULLSCREEN_DOWN "keybinding_client_fullscreen_down"

/client
var/fullscreen = FALSE

/datum/keybinding/client/t_fullscreen
hotkey_keys = list("F11")
name = "change_fullscreen"
keybind_signal = COMSIG_KB_CLIENT_FULLSCREEN_DOWN

/datum/keybinding/client/t_fullscreen/down(client/C)
. = ..()
C.toggle_fullscreen()

/client/verb/toggle_fullscreen()
set name = "Toggle Fullscreen"
set category = "OOC"

fullscreen = !fullscreen

if (fullscreen)
winset(usr, "mainwindow", "on-size=")
winset(usr, "mainwindow", "titlebar=false")
winset(usr, "mainwindow", "can-resize=false")
winset(usr, "mainwindow", "menu=")
winset(usr, "mainwindow", "is-maximized=false")
winset(usr, "mainwindow", "is-maximized=true")
else
winset(usr, "mainwindow", "titlebar=true")
winset(usr, "mainwindow", "can-resize=true")
winset(usr, "mainwindow", "menu=menu")
winset(usr, "mainwindow", "is-maximized=false")
winset(usr, "mainwindow", "on-size=fitviewport")

fit_viewport()
1 change: 1 addition & 0 deletions mod_celadon/mod_celadon.dme
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "__tweaks/fullscreen.dm"
1 change: 1 addition & 0 deletions shiptest.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3487,4 +3487,5 @@
#include "interface\menu.dm"
#include "interface\stylesheet.dm"
#include "interface\skin.dmf"
#include "mod_celadon\mod_celadon.dme"
// END_INCLUDE

0 comments on commit a9f9459

Please sign in to comment.