diff --git a/code/__DEFINES/preferences.dm b/code/__DEFINES/preferences.dm index b9943fbb4ff..7b3da22e53e 100644 --- a/code/__DEFINES/preferences.dm +++ b/code/__DEFINES/preferences.dm @@ -194,3 +194,12 @@ "End of Round Deathmatch" = BE_DEATHMATCH,\ "Prefer Squad over Role" = BE_SQUAD_STRICT\ ) + +#define WIDESCREEN_RESOLUTIONS list(\ + CONFIG_GET(string/default_view1),\ + CONFIG_GET(string/default_view2)\ + ) + +#define WIDESCREEN1 "17x15" +#define WIDESCREEN2 "19x15" +#define SQUARESCREEN "15x15" diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm index d20f0371dc4..b89065cba81 100644 --- a/code/controllers/configuration/entries/general.dm +++ b/code/controllers/configuration/entries/general.dm @@ -406,11 +406,14 @@ The default value assumes yt-dlp is in your system PATH /datum/config_entry/flag/check_randomizer -/datum/config_entry/string/default_view - config_entry_value = "15x15" +/datum/config_entry/string/default_view1 + config_entry_value = WIDESCREEN1 + +/datum/config_entry/string/default_view2 + config_entry_value = WIDESCREEN2 /datum/config_entry/string/default_view_square - config_entry_value = "15x15" + config_entry_value = SQUARESCREEN /* This maintains a list of ip addresses that are able to bypass topic filtering. diff --git a/code/datums/view.dm b/code/datums/view.dm index 60019bc4139..461feaade8a 100644 --- a/code/datums/view.dm +++ b/code/datums/view.dm @@ -56,6 +56,9 @@ /datum/view_data/proc/add(num_to_add) width += num_to_add height += num_to_add + if(chief.prefs.widescreenpref) // if widescreen enabled + var/list/wide_size = getviewsize(default) // pickup current resolution + width = round(width * (wide_size[1] / wide_size[2])) // trying to save aspect ratio, cant be float/double number apply() ///adds the size, which can also be a string, to the default and applies it @@ -63,6 +66,9 @@ var/list/new_size = getviewsize(toAdd) width += new_size[1] height += new_size[2] + if(chief.prefs.widescreenpref) // if widescreen enabled + var/list/wide_size = getviewsize(default) // pickup current resolution + width = round(width * (wide_size[1] / wide_size[2])) // trying to save aspect ratio, cant be float/double number apply() ///INCREASES the view radius by this. @@ -70,6 +76,9 @@ var/list/new_size = getviewsize(toAdd) //Backward compatability to account width = new_size[1] //for a change in how sizes get calculated. we used to include world.view in height = new_size[2] //this, but it was jank, so I had to move it + if(chief.prefs.widescreenpref) // if widescreen enabled + var/list/wide_size = getviewsize(default) // pickup current resolution + width = round(width * (wide_size[1] / wide_size[2])) // trying to save aspect ratio, cant be float/double number apply() ///sets width and height as numbers @@ -144,7 +153,9 @@ set_view_radius_to(radius) ///gets the current screen size as defined in config -/proc/get_screen_size(widescreen) +/proc/get_screen_size(widescreen, resolution = WIDESCREEN1) if(widescreen) - return CONFIG_GET(string/default_view) + if(resolution == WIDESCREEN2) + return CONFIG_GET(string/default_view2) + return CONFIG_GET(string/default_view1) return CONFIG_GET(string/default_view_square) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 728c761485b..7c56d247ef7 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -61,7 +61,7 @@ GLOBAL_DATUM_INIT(welding_sparks_prepdoor, /mutable_appearance, mutable_appearan ///how much tiles the zoom offsets to the direction it zooms to. var/zoom_tile_offset = 6 ///how much tiles the zoom zooms out, 5 is the default view. - var/zoom_viewsize = 7 + var/zoom_viewsize = 5 ///if you can move with the zoom on, only works if zoom_view_size is 7 otherwise CRASH() is called due to maptick performance reasons. var/zoom_allow_movement = FALSE var/datum/embedding_behavior/embedding diff --git a/code/game/objects/items/binoculars.dm b/code/game/objects/items/binoculars.dm index 302d8b1e588..0443c80bd0d 100644 --- a/code/game/objects/items/binoculars.dm +++ b/code/game/objects/items/binoculars.dm @@ -14,7 +14,7 @@ throw_range = 15 throw_speed = 3 zoom_tile_offset = 11 - zoom_viewsize = 12 + zoom_viewsize = 15 /obj/item/binoculars/attack_self(mob/user) if(user.interactee && istype(user.interactee, /obj/machinery/deployable)) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index a188beb687f..6fcdaa1bc03 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -354,7 +354,7 @@ if(!tooltips && prefs.tooltips) tooltips = new /datum/tooltip(src) - view_size = new(src, get_screen_size(prefs.widescreenpref)) + view_size = new(src, get_screen_size(prefs.widescreenpref, prefs.screen_resolution)) view_size.update_pixel_format() view_size.update_zoom_mode() @@ -870,14 +870,12 @@ CRASH("change_view called without argument.") if(isnum(new_size)) CRASH("change_view called with a number argument. Use the string format instead.") - if(prefs && !prefs.widescreenpref && new_size == CONFIG_GET(string/default_view)) - new_size = CONFIG_GET(string/default_view_square) view = new_size apply_clickcatcher() mob.reload_fullscreens() - if(prefs.auto_fit_viewport) + if(prefs.auto_fit_viewport && (isnull(view_size) || !view_size.is_zooming())) INVOKE_NEXT_TICK(src, VERB_REF(fit_viewport), 1 SECONDS) //Delayed to avoid wingets from Login calls. ///Change the fullscreen setting of the client diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 81a47c6a168..f461d20d08e 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -151,6 +151,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/datum/loadout_manager/loadout_manager ///Should we be in the widescreen mode set by the config? var/widescreenpref = TRUE + ///widescreen resolution + var/screen_resolution = "17x15" ///What size should pixels be displayed as? 0 is strech to fit var/pixel_size = 0 ///What scaling method should we use? Distort means nearest neighbor diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 9ede91d8709..d4b43501b4e 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -137,6 +137,7 @@ READ_FILE(S["windowflashing"], windowflashing) READ_FILE(S["auto_fit_viewport"], auto_fit_viewport) READ_FILE(S["widescreenpref"], widescreenpref) + READ_FILE(S["screen_resolution"], screen_resolution) READ_FILE(S["pixel_size"], pixel_size) READ_FILE(S["scaling_method"], scaling_method) READ_FILE(S["menuoptions"], menuoptions) @@ -194,6 +195,7 @@ windowflashing = sanitize_integer(windowflashing, FALSE, TRUE, initial(windowflashing)) auto_fit_viewport = sanitize_integer(auto_fit_viewport, FALSE, TRUE, initial(auto_fit_viewport)) widescreenpref = sanitize_integer(widescreenpref, FALSE, TRUE, initial(widescreenpref)) + screen_resolution = sanitize_inlist(screen_resolution, WIDESCREEN_RESOLUTIONS, initial(screen_resolution)) pixel_size = sanitize_float(pixel_size, PIXEL_SCALING_AUTO, PIXEL_SCALING_3X, 0.5, initial(pixel_size)) scaling_method = sanitize_text(scaling_method, initial(scaling_method)) ghost_vision = sanitize_integer(ghost_vision, FALSE, TRUE, initial(ghost_vision)) @@ -266,6 +268,7 @@ windowflashing = sanitize_integer(windowflashing, FALSE, TRUE, initial(windowflashing)) auto_fit_viewport = sanitize_integer(auto_fit_viewport, FALSE, TRUE, initial(auto_fit_viewport)) widescreenpref = sanitize_integer(widescreenpref, FALSE, TRUE, initial(widescreenpref)) + screen_resolution = sanitize_inlist(screen_resolution, WIDESCREEN_RESOLUTIONS, initial(screen_resolution)) pixel_size = sanitize_float(pixel_size, PIXEL_SCALING_AUTO, PIXEL_SCALING_3X, 0.5, initial(pixel_size)) scaling_method = sanitize_text(scaling_method, initial(scaling_method)) chem_macros = sanitize_islist(chem_macros, list()) @@ -314,6 +317,7 @@ WRITE_FILE(S["windowflashing"], windowflashing) WRITE_FILE(S["auto_fit_viewport"], auto_fit_viewport) WRITE_FILE(S["widescreenpref"], widescreenpref) + WRITE_FILE(S["screen_resolution"], screen_resolution) WRITE_FILE(S["pixel_size"], pixel_size) WRITE_FILE(S["scaling_method"], scaling_method) WRITE_FILE(S["menuoptions"], menuoptions) diff --git a/code/modules/client/preferences_ui.dm b/code/modules/client/preferences_ui.dm index 1a096158f4d..4642b85786b 100644 --- a/code/modules/client/preferences_ui.dm +++ b/code/modules/client/preferences_ui.dm @@ -144,6 +144,7 @@ data["show_typing"] = show_typing data["tooltips"] = tooltips data["widescreenpref"] = widescreenpref + data["screen_resolution"] = screen_resolution data["radialmedicalpref"] = !!(toggles_gameplay & RADIAL_MEDICAL) data["radialstackspref"] = !!(toggles_gameplay & RADIAL_STACKS) data["radiallasersgunpref"] = !!(toggles_gameplay & RADIAL_LASERGUNS) @@ -906,7 +907,14 @@ if("widescreenpref") widescreenpref = !widescreenpref - user.client.view_size.set_default(get_screen_size(widescreenpref)) + user.client.view_size.set_default(get_screen_size(widescreenpref, screen_resolution)) + + if("screen_resolution") + var/choice = tgui_input_list(ui.user, "Choose widescreen resolution", "Resolutions", WIDESCREEN_RESOLUTIONS) + if(choice) + screen_resolution = choice + if(widescreenpref) + user.client.view_size.set_default(get_screen_size(widescreenpref, screen_resolution)) if("radialmedicalpref") toggles_gameplay ^= RADIAL_MEDICAL diff --git a/code/modules/clothing/modular_armor/attachments/modules.dm b/code/modules/clothing/modular_armor/attachments/modules.dm index 45b6781c7f1..ca81060d5f8 100644 --- a/code/modules/clothing/modular_armor/attachments/modules.dm +++ b/code/modules/clothing/modular_armor/attachments/modules.dm @@ -571,7 +571,7 @@ active = FALSE flags_item = DOES_NOT_NEED_HANDS zoom_tile_offset = 11 - zoom_viewsize = 12 + zoom_viewsize = 15 flags_attach_features = ATTACH_REMOVABLE|ATTACH_ACTIVATION|ATTACH_APPLY_ON_MOB slot = ATTACHMENT_SLOT_HEAD_MODULE prefered_slot = SLOT_HEAD diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index ec4b8235c5f..c8533eac1fa 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -369,7 +369,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) to_chat(src, span_warning("Another consciousness is in your body...It is resisting you.")) return FALSE - client.view_size.set_default(get_screen_size(client.prefs.widescreenpref))//Let's reset so people can't become allseeing gods + client.view_size.set_default(get_screen_size(client.prefs.widescreenpref, client.prefs.screen_resolution))//Let's reset so people can't become allseeing gods mind.transfer_to(old_mob, TRUE) return TRUE @@ -691,10 +691,10 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) if(!client) return - if(client.view != CONFIG_GET(string/default_view)) + if(client.view_size.is_zooming()) client.view_size.reset_to_default() else - client.view_size.set_view_radius_to(12.5) + client.view_size.set_view_radius_to(12) /mob/dead/observer/verb/add_view_range(input as num) set name = "Add View Range" diff --git a/code/modules/mob/living/carbon/xenomorph/castes/boiler/abilities_boiler.dm b/code/modules/mob/living/carbon/xenomorph/castes/boiler/abilities_boiler.dm index 49894ad7bb5..1902a86b588 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/boiler/abilities_boiler.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/boiler/abilities_boiler.dm @@ -45,7 +45,7 @@ GLOBAL_LIST_INIT(boiler_glob_image_list, list( span_notice("We start focusing your sight to look off into the distance."), null, 5) if(!do_after(X, 1 SECONDS, IGNORE_HELD_ITEM, null, BUSY_ICON_GENERIC) || X.is_zoomed) return - X.zoom_in(11) + X.zoom_in(10, 10) return ..() // *************************************** diff --git a/code/modules/mob/living/carbon/xenomorph/castes/queen/abilities_queen.dm b/code/modules/mob/living/carbon/xenomorph/castes/queen/abilities_queen.dm index 7c6f8fc5f37..a36ccdf6abe 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/queen/abilities_queen.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/queen/abilities_queen.dm @@ -333,7 +333,7 @@ if(message) xeno.visible_message(span_notice("[xeno] emits a broad and weak psychic aura."), span_notice("We start focusing our psychic energy to expand the reach of our senses."), null, 5) - xeno.zoom_in(0, 12) + xeno.zoom_in(0, 10) /datum/action/ability/xeno_action/toggle_queen_zoom/proc/zoom_xeno_out(message = TRUE) var/mob/living/carbon/xenomorph/xeno = owner diff --git a/code/modules/mob/living/carbon/xenomorph/castes/warlock/abilities_warlock.dm b/code/modules/mob/living/carbon/xenomorph/castes/warlock/abilities_warlock.dm index 9461b894c41..e179e85af41 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/warlock/abilities_warlock.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/warlock/abilities_warlock.dm @@ -621,5 +621,5 @@ else if(!do_after(X, 0 SECONDS, IGNORE_HELD_ITEM, null, BUSY_ICON_GENERIC) || X.is_zoomed) return - X.zoom_in(0, 9) + X.zoom_in(0, 10) ..() diff --git a/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm b/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm index 90e971d031b..fbd6429ab2a 100644 --- a/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm +++ b/code/modules/mob/living/carbon/xenomorph/xenoprocs.dm @@ -395,7 +395,7 @@ update_sight() -/mob/living/carbon/xenomorph/proc/zoom_in(tileoffset = 5, viewsize = 12) +/mob/living/carbon/xenomorph/proc/zoom_in(tileoffset = 5, viewsize = 4.5) if(stat || resting) if(is_zoomed) is_zoomed = FALSE diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index f9e5db4879a..154d710d1f9 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -54,7 +54,7 @@ if(client.view_size) client.view_size.reset_to_default() // Resets the client.view in case it was changed. else - client.change_view(get_screen_size(client.prefs.widescreenpref)) + client.change_view(get_screen_size(client.prefs.widescreenpref, client.prefs.screen_resolution)) if(client.player_details) for(var/foo in client.player_details.post_login_callbacks) diff --git a/code/modules/projectiles/attachables/scope.dm b/code/modules/projectiles/attachables/scope.dm index b0f46efe416..935d5f0be23 100644 --- a/code/modules/projectiles/attachables/scope.dm +++ b/code/modules/projectiles/attachables/scope.dm @@ -44,7 +44,7 @@ aim_speed_mod = 0.3 wield_delay_mod = 0.2 SECONDS zoom_tile_offset = 7 - zoom_viewsize = 2 + zoom_viewsize = 5 add_aim_mode = TRUE /obj/item/attachable/scope/mosin @@ -115,7 +115,7 @@ /obj/item/attachable/scope/unremovable/hsg102/nest scope_delay = 2 SECONDS zoom_tile_offset = 7 - zoom_viewsize = 2 + zoom_viewsize = 5 deployed_scope_rezoom = FALSE /obj/item/attachable/scope/activate(mob/living/carbon/user, turn_off) diff --git a/code/modules/projectiles/guns/specialist.dm b/code/modules/projectiles/guns/specialist.dm index 309ddcf5252..96b40e567c9 100644 --- a/code/modules/projectiles/guns/specialist.dm +++ b/code/modules/projectiles/guns/specialist.dm @@ -152,7 +152,7 @@ Note that this means that snipers will have a slowdown of 3, due to the scope to_chat(user, span_danger("You lose sight of your target!")) playsound(user,'sound/machines/click.ogg', 25, 1) -/obj/item/weapon/gun/rifle/sniper/antimaterial/zoom(mob/living/user, tileoffset = 11, viewsize = 12) //tileoffset is client view offset in the direction the user is facing. viewsize is how far out this thing zooms. 7 is normal view +/obj/item/weapon/gun/rifle/sniper/antimaterial/zoom(mob/living/user, tileoffset = 11, viewsize = 10) //tileoffset is client view offset in the direction the user is facing. viewsize is how far out this thing zooms. 5 is normal view . = ..() var/obj/item/attachable/scope = LAZYACCESS(attachments_by_slot, ATTACHMENT_SLOT_RAIL) if(!scope.zoom && (targetmarker_on || targetmarker_primed) ) diff --git a/code/modules/shuttle/mini_dropship.dm b/code/modules/shuttle/mini_dropship.dm index 321dfeec661..bc3fba62e13 100644 --- a/code/modules/shuttle/mini_dropship.dm +++ b/code/modules/shuttle/mini_dropship.dm @@ -24,7 +24,7 @@ shuttleId = SHUTTLE_TADPOLE lock_override = CAMERA_LOCK_GROUND shuttlePortId = "minidropship_custom" - view_range = "26x26" + view_range = "25x25" x_offset = 0 y_offset = 0 open_prompt = FALSE diff --git a/config/config.txt b/config/config.txt index 5df4d48024f..bf936abf310 100644 --- a/config/config.txt +++ b/config/config.txt @@ -212,7 +212,8 @@ IS_AUTOMATIC_BALANCE_ON ## 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 19x15 +DEFAULT_VIEW1 17x15 +DEFAULT_VIEW2 19x15 ##Default view size, in tiles. Should *always* be square. ## The alternative square viewport size if you're using a widescreen view size diff --git a/tgui/packages/tgui/interfaces/PlayerPreferences/GameSettings.tsx b/tgui/packages/tgui/interfaces/PlayerPreferences/GameSettings.tsx index a378a3274d1..bfcb7fc2250 100644 --- a/tgui/packages/tgui/interfaces/PlayerPreferences/GameSettings.tsx +++ b/tgui/packages/tgui/interfaces/PlayerPreferences/GameSettings.tsx @@ -241,6 +241,11 @@ export const GameSettings = (props) => { leftLabel={'Enabled'} rightLabel={'Disabled'} /> +