Skip to content

Commit

Permalink
delete widescreen
Browse files Browse the repository at this point in the history
  • Loading branch information
Helg2 committed Aug 23, 2024
1 parent d4400d5 commit 77f7db2
Show file tree
Hide file tree
Showing 21 changed files with 26 additions and 93 deletions.
11 changes: 0 additions & 11 deletions code/__DEFINES/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,3 @@
"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),\
CONFIG_GET(string/default_view3)\
)

#define WIDESCREEN1 "17x15"
#define WIDESCREEN2 "19x15"
#define WIDESCREEN3 "21x15"
#define SQUARESCREEN "15x15"
14 changes: 4 additions & 10 deletions code/controllers/configuration/entries/general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -403,19 +403,13 @@ The default value assumes youtube-dl is in your system PATH
config_entry_value = "Sorry but the server is currently not accepting connections from never before seen players."

/datum/config_entry/flag/check_randomizer
//RU TGMC EDIT
/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_view3
config_entry_value = WIDESCREEN3
/datum/config_entry/string/default_view
config_entry_value = "15x15"

/datum/config_entry/string/default_view_square
config_entry_value = SQUARESCREEN
//RU TGMC EDIT
config_entry_value = "15x15"

/*
This maintains a list of ip addresses that are able to bypass topic filtering.
*/
Expand Down
28 changes: 3 additions & 25 deletions code/datums/view.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,35 +56,20 @@
/datum/view_data/proc/add(num_to_add)
width += num_to_add
height += num_to_add
//RU TGMC EDIT
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
//RU TGMC EDIT
apply()

///adds the size, which can also be a string, to the default and applies it
/datum/view_data/proc/add_size(toAdd)
var/list/new_size = getviewsize(toAdd)
width += new_size[1]
height += new_size[2]
//RU TGMC EDIT
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
//RU TGMC EDIT
apply()

///INCREASES the view radius by this.
/datum/view_data/proc/set_view_radius_to(toAdd)
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
//RU TGMC EDIT
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
//RU TGMC EDIT
apply()

///sets width and height as numbers
Expand Down Expand Up @@ -157,16 +142,9 @@
animate(chief, pixel_x = world.icon_size*_x, pixel_y = world.icon_size*_y, 0, FALSE, LINEAR_EASING, ANIMATION_END_NOW)

set_view_radius_to(radius)
//RU TGMC EDIT

///gets the current screen size as defined in config
/proc/get_screen_size(widescreen, resolution = WIDESCREEN1)
/proc/get_screen_size(widescreen)
if(widescreen)
if(resolution)
switch(resolution)
if(WIDESCREEN2)
return CONFIG_GET(string/default_view2)
if(WIDESCREEN3)
return CONFIG_GET(string/default_view3)
return CONFIG_GET(string/default_view1)
return CONFIG_GET(string/default_view)
return CONFIG_GET(string/default_view_square)
//RU TGMC EDIT
2 changes: 1 addition & 1 deletion code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 5 //RU TGMC EDIT
var/zoom_viewsize = 7
///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
Expand Down
3 changes: 1 addition & 2 deletions code/game/objects/items/binoculars.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
throw_range = 15
throw_speed = 3
zoom_tile_offset = 11
zoom_viewsize = 15 //RU TGMC EDIT

zoom_viewsize = 12

/obj/item/binoculars/attack_self(mob/user)
if(user.interactee && istype(user.interactee, /obj/machinery/deployable))
Expand Down
6 changes: 2 additions & 4 deletions code/modules/client/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@
if(!tooltips && prefs.tooltips)
tooltips = new /datum/tooltip(src)

view_size = new(src, get_screen_size(prefs.widescreenpref, prefs.screen_resolution)) //RU TGMC EDIT
view_size = new(src, get_screen_size(prefs.widescreenpref))
view_size.update_pixel_format()
view_size.update_zoom_mode()

Expand Down Expand Up @@ -882,14 +882,12 @@
CRASH("change_view called without argument.")
if(isnum(new_size))
CRASH("change_view called with a number argument. Use the string format instead.")
/* RU TGMC EDIT
if(prefs && !prefs.widescreenpref && new_size == CONFIG_GET(string/default_view))
new_size = CONFIG_GET(string/default_view_square)
RU TGMC EDIT */
view = new_size
apply_clickcatcher()
mob.reload_fullscreens()
if(prefs.auto_fit_viewport && (isnull(view_size) || !view_size.is_zooming()))
if(prefs.auto_fit_viewport)
INVOKE_NEXT_TICK(src, VERB_REF(fit_viewport), 1 SECONDS) //Delayed to avoid wingets from Login calls.

///Change the fullscreen setting of the client
Expand Down
2 changes: 0 additions & 2 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ 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
Expand Down
4 changes: 0 additions & 4 deletions code/modules/client/preferences_savefile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@
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)
Expand Down Expand Up @@ -211,7 +210,6 @@
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))
Expand Down Expand Up @@ -286,7 +284,6 @@
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())
Expand Down Expand Up @@ -337,7 +334,6 @@
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)
Expand Down
10 changes: 1 addition & 9 deletions code/modules/client/preferences_ui.dm
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@
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)
Expand Down Expand Up @@ -953,14 +952,7 @@

if("widescreenpref")
widescreenpref = !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))
user.client.view_size.set_default(get_screen_size(widescreenpref))

if("radialmedicalpref")
toggles_gameplay ^= RADIAL_MEDICAL
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/modular_armor/attachments/modules.dm
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@
active = FALSE
flags_item = DOES_NOT_NEED_HANDS
zoom_tile_offset = 11
zoom_viewsize = 15 //RU TGMC EDIT
zoom_viewsize = 12
flags_attach_features = ATTACH_REMOVABLE|ATTACH_ACTIVATION|ATTACH_APPLY_ON_MOB
slot = ATTACHMENT_SLOT_HEAD_MODULE
prefered_slot = SLOT_HEAD
Expand Down
8 changes: 3 additions & 5 deletions code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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, client.prefs.screen_resolution))//Let's reset so people can't become allseeing gods
client.view_size.set_default(get_screen_size(client.prefs.widescreenpref))//Let's reset so people can't become allseeing gods
mind.transfer_to(old_mob, TRUE)
return TRUE

Expand Down Expand Up @@ -687,19 +687,17 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
pixel_y = 0
animate(src, pixel_y = 2, time = 10, loop = -1)


/mob/dead/observer/verb/toggle_zoom()
set category = "Ghost"
set name = "Toggle Zoom"

if(!client)
return

if(client.view_size.is_zooming())
if(client.view != CONFIG_GET(string/default_view))
client.view_size.reset_to_default()
else
client.view_size.set_view_radius_to(12) //RUT GMC EDIT

client.view_size.set_view_radius_to(12.5)

/mob/dead/observer/verb/add_view_range(input as num)
set name = "Add View Range"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(4.5) //RU TGMC EDIT
X.zoom_in(11)
..()

// ***************************************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,15 +329,13 @@
return
zoom_xeno_in(xeno.observed_xeno ? FALSE : TRUE) //No need for feedback message if our eye is elsewhere.


/datum/action/ability/xeno_action/toggle_queen_zoom/proc/zoom_xeno_in(message = TRUE)
var/mob/living/carbon/xenomorph/xeno = owner
RegisterSignal(xeno, COMSIG_MOVABLE_MOVED, PROC_REF(on_movement))
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, 4.5) //RU TGMC EDIT

xeno.zoom_in(0, 12)

/datum/action/ability/xeno_action/toggle_queen_zoom/proc/zoom_xeno_out(message = TRUE)
var/mob/living/carbon/xenomorph/xeno = owner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,5 +622,5 @@
else
if(!do_after(X, 0 SECONDS, IGNORE_HELD_ITEM, null, BUSY_ICON_GENERIC) || X.is_zoomed)
return
X.zoom_in(0, 4.5)
X.zoom_in(0, 9)
..()
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/xenomorph/xenoprocs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@
update_sight()


/mob/living/carbon/xenomorph/proc/zoom_in(tileoffset = 5, viewsize = 4.5) //RU TGMC EDIT
/mob/living/carbon/xenomorph/proc/zoom_in(tileoffset = 5, viewsize = 12)
if(stat || resting)
if(is_zoomed)
is_zoomed = 0
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/login.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,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.prefs.screen_resolution))
client.change_view(get_screen_size(client.prefs.widescreenpref))

if(client.player_details)
for(var/foo in client.player_details.post_login_callbacks)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/projectiles/attachables/scope.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
aim_speed_mod = 0.3
wield_delay_mod = 0.2 SECONDS
zoom_tile_offset = 7
zoom_viewsize = 5 //RU TGMC EDIT
zoom_viewsize = 2
add_aim_mode = TRUE

/obj/item/attachable/scope/mosin
Expand Down Expand Up @@ -114,7 +114,7 @@
/obj/item/attachable/scope/unremovable/tl102/nest
scope_delay = 2 SECONDS
zoom_tile_offset = 7
zoom_viewsize = 5 //RU TGMC EDIT
zoom_viewsize = 2
deployed_scope_rezoom = FALSE

/obj/item/attachable/scope/activate(mob/living/carbon/user, turn_off)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/guns/specialist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,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 = 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
/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
. = ..()
var/obj/item/attachable/scope = LAZYACCESS(attachments_by_slot, ATTACHMENT_SLOT_RAIL)
if(!scope.zoom && (targetmarker_on || targetmarker_primed) )
Expand Down
2 changes: 1 addition & 1 deletion code/modules/shuttle/mini_dropship.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
shuttleId = SHUTTLE_TADPOLE
lock_override = CAMERA_LOCK_GROUND
shuttlePortId = "minidropship_custom"
view_range = "25x25"
view_range = "26x26"
x_offset = 0
y_offset = 0
open_prompt = FALSE
Expand Down
4 changes: 1 addition & 3 deletions config/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,7 @@ 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_VIEW1 17x15
DEFAULT_VIEW2 19x15
DEFAULT_VIEW3 21x15
DEFAULT_VIEW 19x15

##Default view size, in tiles. Should *always* be square.
## The alternative square viewport size if you're using a widescreen view size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,6 @@ export const GameSettings = (props, context) => {
leftLabel={'Enabled'}
rightLabel={'Disabled'}
/>
<SelectFieldPreference
label={'Widescreen resolution'}
value={'screen_resolution'}
action={'screen_resolution'}
/>
<ToggleFieldPreference
label="Radial medical wheel"
value="radialmedicalpref"
Expand Down

0 comments on commit 77f7db2

Please sign in to comment.