From 2a79d6424ea2189f348dfa0e3aadf1963e74c8af Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Sat, 21 Jun 2025 21:14:55 -0400 Subject: [PATCH] Removes widescreen config (#91419) 19x15 forever, or 15x15 if you're non widescreen user. Idek why this is a config --- code/__DEFINES/hud.dm | 5 +++++ .../configuration/entries/general.dm | 6 ------ code/datums/view.dm | 19 +++++++++++-------- code/modules/admin/verbs/admingame.dm | 2 +- code/modules/client/client_procs.dm | 2 +- code/modules/client/preferences/screen.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 2 +- code/modules/mob/login.dm | 5 +---- code/modules/photography/camera/camera.dm | 3 +-- config/config.txt | 14 -------------- 10 files changed, 22 insertions(+), 38 deletions(-) diff --git a/code/__DEFINES/hud.dm b/code/__DEFINES/hud.dm index 78a83a07b2d..cf25075c912 100644 --- a/code/__DEFINES/hud.dm +++ b/code/__DEFINES/hud.dm @@ -15,6 +15,11 @@ /// Used for HUD objects #define APPEARANCE_UI (RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|PIXEL_SCALE) +//used to set the default viewport to the user's preference. +#define VIEWPORT_USE_PREF "use_pref" +#define WIDESCREEN_VIEWPORT_SIZE "21x15" // BUBBER EDIT CHANGE - ORIGINAL: #define WIDESCREEN_VIEWPORT_SIZE "19x15" +#define SQUARE_VIEWPORT_SIZE "15x15" + /* These defines specificy screen locations. For more information, see the byond documentation on the screen_loc var. diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm index 567ae37c7b9..bb2714b6123 100644 --- a/code/controllers/configuration/entries/general.dm +++ b/code/controllers/configuration/entries/general.dm @@ -633,12 +633,6 @@ default = -1 min_val = 0 -/datum/config_entry/string/default_view - default = "15x15" - -/datum/config_entry/string/default_view_square - default = "15x15" - /datum/config_entry/flag/log_pictures /datum/config_entry/flag/picture_logging_camera diff --git a/code/datums/view.dm b/code/datums/view.dm index 380011fcdc7..b9a15f0cb05 100644 --- a/code/datums/view.dm +++ b/code/datums/view.dm @@ -20,9 +20,9 @@ /// The client that owns this view packet var/client/chief = null -/datum/view_data/New(client/owner, view_string) - default = view_string +/datum/view_data/New(client/owner) chief = owner + default = getScreenSize() apply() /datum/view_data/Destroy() @@ -30,7 +30,10 @@ return ..() /datum/view_data/proc/setDefault(string) - default = string + if(string == VIEWPORT_USE_PREF) + default = getScreenSize() + else + default = string apply() /datum/view_data/proc/afterViewChange() @@ -56,6 +59,11 @@ /datum/view_data/proc/isZooming() return (width || height) +/datum/view_data/proc/getScreenSize() + if(chief.prefs.read_preference(/datum/preference/toggle/widescreen)) + return WIDESCREEN_VIEWPORT_SIZE + return SQUARE_VIEWPORT_SIZE + /datum/view_data/proc/resetToDefault() width = 0 height = 0 @@ -137,8 +145,3 @@ animate(chief, pixel_x = ICON_SIZE_X*_x, pixel_y = ICON_SIZE_Y*_y, 0, FALSE, LINEAR_EASING, ANIMATION_END_NOW) //Ready for this one? setTo(radius) - -/proc/getScreenSize(widescreen) - if(widescreen) - return CONFIG_GET(string/default_view) - return CONFIG_GET(string/default_view_square) diff --git a/code/modules/admin/verbs/admingame.dm b/code/modules/admin/verbs/admingame.dm index 19d4291c97f..a07bd889e98 100644 --- a/code/modules/admin/verbs/admingame.dm +++ b/code/modules/admin/verbs/admingame.dm @@ -363,7 +363,7 @@ ADMIN_VERB(toggle_view_range, R_ADMIN, "Change View Range", "Switch between 1x a if(user.view_size.getView() == user.view_size.default) user.view_size.setTo(input(user, "Select view range:", "FUCK YE", 7) in list(1,2,3,4,5,6,7,8,9,10,11,12,13,14,37) - 7) else - user.view_size.resetToDefault(getScreenSize(user.prefs.read_preference(/datum/preference/toggle/widescreen))) + user.view_size.resetToDefault() log_admin("[key_name(user)] changed their view range to [user.view].") SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Change View Range", "[user.view]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc! diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 31a9900a491..9592907b8a1 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -572,7 +572,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( loot_panel = new(src) - view_size = new(src, getScreenSize(prefs.read_preference(/datum/preference/toggle/widescreen))) + view_size = new(src) set_fullscreen(logging_in = TRUE) view_size.resetFormat() view_size.setZoomMode() diff --git a/code/modules/client/preferences/screen.dm b/code/modules/client/preferences/screen.dm index 338972a0a6b..ee9202c5387 100644 --- a/code/modules/client/preferences/screen.dm +++ b/code/modules/client/preferences/screen.dm @@ -4,7 +4,7 @@ savefile_identifier = PREFERENCE_PLAYER /datum/preference/toggle/widescreen/apply_to_client(client/client, value) - client.view_size?.setDefault(getScreenSize(value)) + client.view_size?.setDefault(VIEWPORT_USE_PREF) /datum/preference/toggle/fullscreen_mode default_value = FALSE diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 67685619482..a2e605fdcc3 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -379,7 +379,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(mind.current.key && !IS_FAKE_KEY(mind.current.key)) //makes sure we don't accidentally kick any clients to_chat(usr, span_warning("Another consciousness is in your body...It is resisting you.")) return - client.view_size.setDefault(getScreenSize(client.prefs.read_preference(/datum/preference/toggle/widescreen)))//Let's reset so people can't become allseeing gods + client.view_size.resetToDefault()//Let's reset so people can't become allseeing gods SStgui.on_transfer(src, mind.current) // Transfer NanoUIs. if(mind.current.stat == DEAD && SSlag_switch.measures[DISABLE_DEAD_KEYLOOP]) to_chat(src, span_warning("To leave your body again use the Ghost verb.")) diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 46772ecda51..6d1d404f35e 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -105,10 +105,7 @@ stop_sound_channel(CHANNEL_AMBIENCE) if(client) - if(client.view_size) - client.view_size.resetToDefault() // Resets the client.view in case it was changed. - else - client.change_view(getScreenSize(client.prefs.read_preference(/datum/preference/toggle/widescreen))) + client.view_size.resetToDefault() // Resets the client.view in case it was changed. for(var/datum/action/A as anything in persistent_client.player_actions) A.Grant(src) diff --git a/code/modules/photography/camera/camera.dm b/code/modules/photography/camera/camera.dm index bdbb3e8f7bd..1c6ac03dffd 100644 --- a/code/modules/photography/camera/camera.dm +++ b/code/modules/photography/camera/camera.dm @@ -174,7 +174,6 @@ var/turf/target_turf = get_turf(target) if(isnull(target_turf)) return FALSE - if(isAI(user)) return can_ai_target(target_turf) if(ismob(user)) @@ -198,7 +197,7 @@ /// Check whether a mob could take a picture of the target turf. /obj/item/camera/proc/can_mob_target(turf/target_turf, mob/user) - var/user_view = user.client ? user.client.view : CONFIG_GET(string/default_view) + var/user_view = user.client ? user.client.view : WIDESCREEN_VIEWPORT_SIZE var/user_eye = user.client ? user.client.eye : user if(!(target_turf in get_hear(user_view, user_eye))) return FALSE diff --git a/config/config.txt b/config/config.txt index 4b502e3b825..1b60df28f3d 100644 --- a/config/config.txt +++ b/config/config.txt @@ -490,20 +490,6 @@ DISABLE_HIGH_POP_MC_MODE_AMOUNT 60 ## Uncomment to set the number of /world/Reboot()s before the DreamDaemon restarts itself. 0 means restart every round. Requires tgstation server tools. #ROUNDS_UNTIL_HARD_RESTART 10 - -##Default view size, in tiles. -## By default, this is 15x15, which gets simplified to 7 by byond -## 15x15 would be the standard square view. 21x15 is what goonstation uses for widescreen. -## Setting this to something different from DEFAULT_VIEW_SQUARE will enable widescreen toggles -## Do note that changing this value will affect the title screen. The title screen will have to be updated manually if this is changed. -DEFAULT_VIEW 21x15 - -##Default view size, in tiles. Should *always* be square. -## The alternative square viewport size if you're using a widescreen view size -## You probably shouldn't ever be changing this, but it's here if you want to. -DEFAULT_VIEW_SQUARE 15x15 - - ## Enable automatic profiling - Byond 513.1506 and newer only. #AUTO_PROFILE