diff --git a/code/__DEFINES/__game.dm b/code/__DEFINES/__game.dm index a03701045768..4a26de4b955e 100644 --- a/code/__DEFINES/__game.dm +++ b/code/__DEFINES/__game.dm @@ -550,3 +550,15 @@ #define PERF_TOGGLE_SHUTTLES (1<<3) /// Disables loading Techwebs and additional Z-Levels #define PERF_TOGGLE_TECHWEBS (1<<4) + +#define PIXEL_SCALING_AUTO 0 +#define PIXEL_SCALING_1X 1 +#define PIXEL_SCALING_1_2X 1.5 +#define PIXEL_SCALING_2X 2 +#define PIXEL_SCALING_2_2X 2.5 +#define PIXEL_SCALING_3X 3 +#define PIXEL_SCALING_4X 4 + +#define SCALING_METHOD_NORMAL "normal" +#define SCALING_METHOD_DISTORT "distort" +#define SCALING_METHOD_BLUR "blur" diff --git a/code/__DEFINES/xeno.dm b/code/__DEFINES/xeno.dm index fb9d6bfb4faf..7f308b040a98 100644 --- a/code/__DEFINES/xeno.dm +++ b/code/__DEFINES/xeno.dm @@ -722,7 +722,7 @@ #define FIRE_MULTIPLIER_EXTREME 2 #define FIRE_MULTIPLIER_DEADLY 3 -#define TRAPPER_VIEWRANGE 13 +#define TRAPPER_VIEWRANGE 12 #define SECRETE_RESIN_INTERRUPT -1 #define SECRETE_RESIN_FAIL 0 diff --git a/code/_globalvars/global_lists.dm b/code/_globalvars/global_lists.dm index 4dbf46086f02..f13084bc88e8 100644 --- a/code/_globalvars/global_lists.dm +++ b/code/_globalvars/global_lists.dm @@ -522,3 +522,6 @@ GLOBAL_PROTECT(topic_tokens) GLOBAL_LIST_EMPTY(topic_commands) GLOBAL_PROTECT(topic_commands) + +GLOBAL_LIST_INIT(pixel_size_options, list(PIXEL_SCALING_AUTO, PIXEL_SCALING_1X, PIXEL_SCALING_1_2X, PIXEL_SCALING_2X, PIXEL_SCALING_2_2X, PIXEL_SCALING_3X, PIXEL_SCALING_4X)) +GLOBAL_LIST_INIT(scaling_options, list(SCALING_METHOD_NORMAL, SCALING_METHOD_DISTORT, SCALING_METHOD_BLUR)) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 72e298d32729..4cb9761144ff 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -327,7 +327,7 @@ /client/proc/change_view(new_size, atom/source) if(SEND_SIGNAL(mob, COMSIG_MOB_CHANGE_VIEW, new_size) & COMPONENT_OVERRIDE_VIEW) return TRUE - view = mob.check_view_change(new_size, source) + view = new_size apply_clickcatcher() mob.reload_fullscreens() @@ -382,18 +382,18 @@ /proc/getviewsize(view) - var/viewX - var/viewY if(isnum(view)) - var/totalviewrange = 1 + 2 * view - viewX = totalviewrange - viewY = totalviewrange + var/totalviewrange = (view < 0 ? -1 : 1) + 2 * view + return list(totalviewrange, totalviewrange) else var/list/viewrangelist = splittext(view,"x") - viewX = text2num(viewrangelist[1]) - viewY = text2num(viewrangelist[2]) - return list(viewX, viewY) + return list(text2num(viewrangelist[1]), text2num(viewrangelist[2])) +///Return the center turf of the user's view +/proc/get_view_center(mob/user) + var/x_offset = round(user.client.pixel_x / 32) + var/y_offset = round(user.client.pixel_y / 32) + return locate(user.x + x_offset, user.y + y_offset, user.z) #if DEBUG_CLICK_RATE /obj/item/clickrate_test diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm index e2572e5e2d61..a4c1aa662138 100644 --- a/code/controllers/configuration/entries/general.dm +++ b/code/controllers/configuration/entries/general.dm @@ -439,7 +439,7 @@ The default value assumes youtube-dl is in your system PATH /datum/config_entry/string/default_view - config_entry_value = "15x15" + config_entry_value = "19x15" /datum/config_entry/string/default_view_square config_entry_value = "15x15" diff --git a/code/datums/custom_hud.dm b/code/datums/custom_hud.dm index 62ae36aa7b89..681653847ecf 100644 --- a/code/datums/custom_hud.dm +++ b/code/datums/custom_hud.dm @@ -6,17 +6,17 @@ var/ui_inventory = "WEST:6,1:5" //Lower center, persistent menu - var/ui_sstore1 = "WEST+2:10,1:5" - var/ui_id = "WEST+3:12,1:5" - var/ui_belt = "WEST+4:14,1:5" - var/ui_back = "WEST+5:14,1:5" - var/ui_rhand = "WEST+6:16,1:5" - var/ui_lhand = "WEST+7:16,1:5" - var/ui_equip = "WEST+6:16,2:5" - var/ui_swaphand1 = "WEST+6:16,2:5" - var/ui_swaphand2 = "WEST+7:16,2:5" - var/ui_storage1 = "WEST+8:18,1:5" - var/ui_storage2 = "WEST+9:20,1:5" + var/ui_sstore1 = "CENTER-5:10,1:5" + var/ui_id = "CENTER-4:12,1:5" + var/ui_belt = "CENTER-3:14,1:5" + var/ui_back = "CENTER-2:14,1:5" + var/ui_rhand = "CENTER-1:16,1:5" + var/ui_lhand = "CENTER:16,1:5" + var/ui_equip = "CENTER-1:16,2:5" + var/ui_swaphand1 = "CENTER-1:16,2:5" + var/ui_swaphand2 = "CENTER:16,2:5" + var/ui_storage1 = "CENTER+1:18,1:5" + var/ui_storage2 = "CENTER+2:20,1:5" //Lower right, persistent menu var/ui_dropbutton = "EAST-4:22,1:5" @@ -153,7 +153,7 @@ /datum/custom_hud/alien ui_style_icon = 'icons/mob/hud/alien_standard.dmi' - ui_resist = "WEST+9:20,1:5" + ui_resist = "CENTER+1:20,1:5" UI_HEALTH_LOC = "EAST-1:28,7:13" var/ui_alien_nightvision = "EAST-1:28,9:13" diff --git a/code/datums/emergency_calls/contractor.dm b/code/datums/emergency_calls/contractor.dm index 05d6ab7b4671..584d39d6d8ba 100644 --- a/code/datums/emergency_calls/contractor.dm +++ b/code/datums/emergency_calls/contractor.dm @@ -117,7 +117,7 @@ var/mob/living/carbon/human/H = new(spawn_loc) H.key = M.key if(H.client) - H.client.change_view(GLOB.world_view_size) + H.client.view_size.reset_to_default() if(!leader && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_LEADER) && check_timelock(H.client, JOB_SQUAD_LEADER, time_required_for_job)) //First one spawned is always the leader. leader = H diff --git a/code/datums/emergency_calls/pmc.dm b/code/datums/emergency_calls/pmc.dm index 06a51c9869eb..6f3b36cf7028 100644 --- a/code/datums/emergency_calls/pmc.dm +++ b/code/datums/emergency_calls/pmc.dm @@ -121,7 +121,7 @@ var/mob/living/carbon/human/H = new(spawn_loc) H.key = M.key if(H.client) - H.client.change_view(GLOB.world_view_size) + H.client.view_size.reset_to_default() if(!leader && HAS_FLAG(H.client.prefs.toggles_ert, PLAY_LEADER) && check_timelock(H.client, JOB_SQUAD_LEADER, time_required_for_job)) //First one spawned is always the leader. leader = H diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 945f4d0a5351..36b9026543d5 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -68,7 +68,7 @@ SSround_recording.recorder.update_key(new_character) if(new_character.client) new_character.client.init_verbs() - new_character.client.change_view(GLOB.world_view_size) //reset view range to default. + new_character.client.view_size.reset_to_default() //reset view range to default. new_character.client.pixel_x = 0 new_character.client.pixel_y = 0 if(usr && usr.open_uis) diff --git a/code/datums/view.dm b/code/datums/view.dm new file mode 100644 index 000000000000..f43a60b3f4db --- /dev/null +++ b/code/datums/view.dm @@ -0,0 +1,172 @@ +//This is intended to be a full wrapper. DO NOT directly modify its values +///Container for client viewsize +/datum/view_data + ///width ratio of the parents clients view + var/width = 0 + ///height ratio of the parents clients view + var/height = 0 + ///Default view size, formatted as a string + var/default = "" + + ///Bool that determines whether we want it to ignore any other changes after we applied some changes + var/suppress_changes = FALSE + ///the parent of this view data + var/client/parent = null + +/datum/view_data/New(client/parent, view_string) + default = view_string + src.parent = parent + apply() + +///sets the default view size froma string +/datum/view_data/proc/set_default(string) + default = string + apply() + +///Updates formatting while considering zoom +/datum/view_data/proc/safe_apply_formatting() + if(is_zooming()) + assert_format() + return + update_pixel_format() + +///Resets the format type +/datum/view_data/proc/assert_format() + winset(parent, "mapwindow.map", "zoom=0") + +///applies the current clients preferred pixel size setting +/datum/view_data/proc/update_pixel_format() + winset(parent, "mapwindow.map", "zoom=[parent.prefs.pixel_size]") + +///applies the preferred clients scaling method +/datum/view_data/proc/update_zoom_mode() + winset(parent, "mapwindow.map", "zoom-mode=[parent.prefs.scaling_method]") + +///Returns a boolean if the client has any form of zoom +/datum/view_data/proc/is_zooming() + return (width || height) + +///Resets the zoom to the default string +/datum/view_data/proc/reset_to_default() + width = 0 + height = 0 + apply() + +///adds the number inputted to the zoom and applies it +/datum/view_data/proc/add(num_to_add) + width += num_to_add + height += num_to_add + 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] + apply() + +///sets the size, which can also be a string and applies it +/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 + apply() + +///sets width and height as numbers +/datum/view_data/proc/set_width_and_height(new_width, new_height) + width = new_width + height = new_height + apply() + +///sets the width of the view +/datum/view_data/proc/set_width(new_width) + width = new_width + apply() + +///sets the height of the view +/datum/view_data/proc/set_height(new_height) + height = new_height + apply() + +///adds the inputted width to the view +/datum/view_data/proc/add_to_width(width_to_add) + width += width_to_add + apply() + +///adds the inputted height to the view +/datum/view_data/proc/add_to_height(height_to_add) + height += height_to_add + apply() + +///applies all current outstanding changes to the client +/datum/view_data/proc/apply() + parent.change_view(get_client_view_size()) + safe_apply_formatting() + +///supresses any further view changes until it is unsupressed +/datum/view_data/proc/suppress() + suppress_changes = TRUE + apply() + +///unsupresses to allow further view changes +/datum/view_data/proc/unsuppress() + suppress_changes = FALSE + apply() + +///returns the client view size in string format +/datum/view_data/proc/get_client_view_size() + var/list/temp = getviewsize(default) + if(suppress_changes) + return "[temp[1]]x[temp[2]]" + return "[width + temp[1]]x[height + temp[2]]" + +///Zooms the client back in with an animate pretty simple +/datum/view_data/proc/zoom_in() + reset_to_default() + animate(parent, pixel_x = 0, pixel_y = 0, 0, FALSE, LINEAR_EASING, ANIMATION_END_NOW) + +///zooms out the client with a given radius and offset as well as a direction +/datum/view_data/proc/zoom_out(radius = 0, offset = 0, direction = NONE) + if(direction) + var/_x = 0 + var/_y = 0 + switch(direction) + if(NORTH) + _y = offset + if(EAST) + _x = offset + if(SOUTH) + _y = -offset + if(WEST) + _x = -offset + animate(parent, pixel_x = world.icon_size*_x, pixel_y = world.icon_size*_y, 0, FALSE, LINEAR_EASING, ANIMATION_END_NOW) + + set_view_radius_to(radius) + +///gets the current screen size as defined in config +/proc/get_screen_size(widescreen) + if(widescreen) + return CONFIG_GET(string/default_view) + return CONFIG_GET(string/default_view_square) + +/client/verb/set_pixel_size(size as num) + set name = ".set_pixel_size" + + if(!(size in GLOB.pixel_size_options)) + return + + prefs.pixel_size = size + prefs.save_preferences() + + view_size.apply() + +/client/verb/set_scaling_method(method as text) + set name = ".set_scaling_method" + + if(!(method in GLOB.scaling_options)) + return + + prefs.scaling_method = method + prefs.save_preferences() + + view_size.update_zoom_mode() diff --git a/code/game/cas_manager/datums/cas_fire_envelope.dm b/code/game/cas_manager/datums/cas_fire_envelope.dm index cc38b034c764..d2a64a97cbea 100644 --- a/code/game/cas_manager/datums/cas_fire_envelope.dm +++ b/code/game/cas_manager/datums/cas_fire_envelope.dm @@ -216,7 +216,7 @@ M.lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE M.sync_lighting_plane_alpha() if(linked_console.upgraded == MATRIX_WIDE) - M.client?.change_view(7, M) + M.client?.view_size.reset_to_default() else return @@ -324,7 +324,7 @@ /datum/cas_fire_envelope/uscm_dropship fire_length = 12 - grace_period = 5 SECONDS + grace_period = 5 SECONDS flyto_period = 4 SECONDS //sleep in the FM itself has been increased by one more second flyoff_period = 5 SECONDS cooldown_period = 10 SECONDS diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 30e179949be5..816c05f0e09b 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -661,7 +661,7 @@ Additional game mode variables. // Let the round recorder know that the key has changed SSround_recording.recorder.update_key(new_xeno) if(new_xeno.client) - new_xeno.client.change_view(GLOB.world_view_size) + new_xeno.client.view_size.reset_to_default() msg_admin_niche("[new_xeno.key] has joined as [new_xeno].") if(isxeno(new_xeno)) //Dear lord diff --git a/code/game/gamemodes/colonialmarines/huntergames.dm b/code/game/gamemodes/colonialmarines/huntergames.dm index 310785070458..2648179fbe89 100644 --- a/code/game/gamemodes/colonialmarines/huntergames.dm +++ b/code/game/gamemodes/colonialmarines/huntergames.dm @@ -234,7 +234,8 @@ H = new(picked) H.key = M.key - if(H.client) H.client.change_view(GLOB.world_view_size) + if(H.client) + H.client.view_size.reset_to_default() if(!H.mind) H.mind = new(H.key) diff --git a/code/game/machinery/computer/groundside_operations.dm b/code/game/machinery/computer/groundside_operations.dm index 52ff558cde89..32dc0079c65d 100644 --- a/code/game/machinery/computer/groundside_operations.dm +++ b/code/game/machinery/computer/groundside_operations.dm @@ -308,7 +308,7 @@ usr.UnregisterSignal(cam, COMSIG_PARENT_QDELETING) cam = null usr.reset_view(null) - else if(usr.client.view != GLOB.world_view_size) + else if(usr.client.view_size.is_zooming()) to_chat(usr, SPAN_WARNING("You're too busy peering through binoculars.")) else if(cam) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index fcd431c33d26..a5cabfd8bc16 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -831,9 +831,9 @@ cases. Override_icon_state should be a list.*/ else if(!zoom) do_zoom(user, tileoffset, viewsize, keep_zoom) return - unzoom(user) + unzoom(user, tileoffset) -/obj/item/proc/unzoom(mob/living/user) +/obj/item/proc/unzoom(mob/living/user, tileoffset) if(user.interactee == src) user.unset_interaction() var/zoom_device = zoomdevicename ? "\improper [zoomdevicename] of [src]" : "\improper [src]" @@ -851,7 +851,7 @@ cases. Override_icon_state should be a list.*/ UnregisterSignal(user, COMSIG_MOB_MOVE_OR_LOOK) //General reset in case anything goes wrong, the view will always reset to default unless zooming in. if(user.client) - user.client.change_view(GLOB.world_view_size, src) + user.client.view_size.reset_to_default() user.client.pixel_x = 0 user.client.pixel_y = 0 @@ -874,8 +874,6 @@ cases. Override_icon_state should be a list.*/ else user.set_interaction(src) if(user.client) - user.client.change_view(viewsize, src) - RegisterSignal(src, list( COMSIG_ITEM_DROPPED, COMSIG_ITEM_UNWIELD, @@ -885,22 +883,8 @@ cases. Override_icon_state should be a list.*/ zoom_initial_mob_dir = user.dir - var/tilesize = 32 - var/viewoffset = tilesize * tileoffset - - switch(user.dir) - if(NORTH) - user.client.pixel_x = 0 - user.client.pixel_y = viewoffset - if(SOUTH) - user.client.pixel_x = 0 - user.client.pixel_y = -viewoffset - if(EAST) - user.client.pixel_x = viewoffset - user.client.pixel_y = 0 - if(WEST) - user.client.pixel_x = -viewoffset - user.client.pixel_y = 0 + user.client.view_size.add(viewsize) + change_zoom_offset(user, zoom_offset = tileoffset) SEND_SIGNAL(src, COMSIG_ITEM_ZOOM, user) var/zoom_device = zoomdevicename ? "\improper [zoomdevicename] of [src]" : "\improper [src]" @@ -908,6 +892,32 @@ cases. Override_icon_state should be a list.*/ SPAN_NOTICE("You peer through \the [zoom_device].")) zoom = !zoom +///applies the offset of the zooming +/obj/item/proc/change_zoom_offset(mob/user, newdir, zoom_offset) + SIGNAL_HANDLER + if(!istype(user)) + return + + var/viewoffset + if(zoom_offset) + viewoffset = zoom_offset * 32 + + var/dirtooffset = newdir ? newdir : user.dir + + switch(dirtooffset) + if(NORTH) + user.client.pixel_x = 0 + user.client.pixel_y = viewoffset + if(SOUTH) + user.client.pixel_x = 0 + user.client.pixel_y = -viewoffset + if(EAST) + user.client.pixel_x = viewoffset + user.client.pixel_y = 0 + if(WEST) + user.client.pixel_x = -viewoffset + user.client.pixel_y = 0 + /obj/item/proc/get_icon_state(mob/user_mob, slot) var/mob_state var/item_state_slot_state = LAZYACCESS(item_state_slots, slot) diff --git a/code/game/objects/items/devices/binoculars.dm b/code/game/objects/items/devices/binoculars.dm index 84da7d9acff4..5e65599a9b01 100644 --- a/code/game/objects/items/devices/binoculars.dm +++ b/code/game/objects/items/devices/binoculars.dm @@ -30,7 +30,7 @@ if(SEND_SIGNAL(user, COMSIG_BINOCULAR_ATTACK_SELF, src)) return - zoom(user, 11, 12) + zoom(user, 11, 10) /obj/item/device/binoculars/dropped(/obj/item/item, mob/user) . = ..() diff --git a/code/game/objects/items/devices/motion_detector.dm b/code/game/objects/items/devices/motion_detector.dm index 7db2825deedf..a9cda25248fa 100644 --- a/code/game/objects/items/devices/motion_detector.dm +++ b/code/game/objects/items/devices/motion_detector.dm @@ -265,29 +265,39 @@ blip_pool[target] = new /obj/effect/detector_blip var/obj/effect/detector_blip/DB = blip_pool[target] - var/c_view = user.client.view - var/view_x_offset = 0 - var/view_y_offset = 0 - if(c_view > 7) - if(user.client.pixel_x >= 0) view_x_offset = round(user.client.pixel_x/32) - else view_x_offset = Ceiling(user.client.pixel_x/32) - if(user.client.pixel_y >= 0) view_y_offset = round(user.client.pixel_y/32) - else view_y_offset = Ceiling(user.client.pixel_y/32) - - var/diff_dir_x = 0 - var/diff_dir_y = 0 - if(target.x - user.x > c_view + view_x_offset) diff_dir_x = 4 - else if(target.x - user.x < -c_view + view_x_offset) diff_dir_x = 8 - if(target.y - user.y > c_view + view_y_offset) diff_dir_y = 1 - else if(target.y - user.y < -c_view + view_y_offset) diff_dir_y = 2 - if(diff_dir_x || diff_dir_y) + + var/c_view = getviewsize(user.client.view) + var/view_x = c_view[1] + var/view_y = c_view[2] + + var/turf/center_view = get_view_center(user) + + var/dir + + var/screen_pos_y = target.y - center_view.y + round(view_y * 0.5) + 1 + if(screen_pos_y < 1) + dir = SOUTH + screen_pos_y = 1 + else if (screen_pos_y > view_y) + dir = NORTH + screen_pos_y = view_y + + var/screen_pos_x = target.x - center_view.x + round(view_x * 0.5) + 1 + if(screen_pos_x < 1) + dir = (dir ? dir == SOUTH ? SOUTHWEST : NORTHWEST : WEST) + screen_pos_x = 1 + else if (screen_pos_x > view_x) + dir = (dir ? dir == SOUTH ? SOUTHEAST : NORTHEAST : EAST) + screen_pos_x = view_x + + if(dir) DB.icon_state = "[blip_icon]_blip_dir" - DB.setDir(diff_dir_x + diff_dir_y) + DB.setDir(dir) else DB.icon_state = "[blip_icon]_blip" DB.setDir(initial(DB.dir)) - DB.screen_loc = "[clamp(c_view + 1 - view_x_offset + (target.x - user.x), 1, 2*c_view+1)],[clamp(c_view + 1 - view_y_offset + (target.y - user.y), 1, 2*c_view+1)]" + DB.screen_loc = "[screen_pos_x],[screen_pos_y]" user.client.add_to_screen(DB) addtimer(CALLBACK(src, PROC_REF(clear_pings), user, DB), 1 SECONDS) diff --git a/code/game/objects/items/props/helmetgarb.dm b/code/game/objects/items/props/helmetgarb.dm index bdf140ff11c3..f43981d5c522 100644 --- a/code/game/objects/items/props/helmetgarb.dm +++ b/code/game/objects/items/props/helmetgarb.dm @@ -392,7 +392,7 @@ to_chat(user, SPAN_WARNING("You cannot use \the [src] when they are hidden.")) return - if(user.client.view > 7 && shape != NVG_SHAPE_COSMETIC) + if(user.client.view_size.is_zooming() && shape != NVG_SHAPE_COSMETIC) to_chat(user, SPAN_WARNING("You cannot use \the [src] while using optics.")) return diff --git a/code/game/sim_manager/datums/simulator.dm b/code/game/sim_manager/datums/simulator.dm index 1f1aedad8153..67a1b32cbe7a 100644 --- a/code/game/sim_manager/datums/simulator.dm +++ b/code/game/sim_manager/datums/simulator.dm @@ -40,7 +40,7 @@ if(!sim_camera) to_chat(user, SPAN_WARNING("GPU damaged! Unable to start simulation.")) return - if(user.client.view != GLOB.world_view_size) + if(user.client.view_size.is_zooming()) to_chat(user, SPAN_WARNING("You're too busy looking at something else.")) return user.reset_view(sim_camera) diff --git a/code/modules/admin/tabs/admin_tab.dm b/code/modules/admin/tabs/admin_tab.dm index 356762b5edd7..c598bf75bc96 100644 --- a/code/modules/admin/tabs/admin_tab.dm +++ b/code/modules/admin/tabs/admin_tab.dm @@ -103,7 +103,7 @@ if(body && !body.key) body.key = "@[key]" //Haaaaaaaack. But the people have spoken. If it breaks; blame adminbus if(body.client) - body.client.change_view(GLOB.world_view_size) //reset view range to default. + body.client.view_size.reset_to_default() //reset view range to default. //re-open STUI if(new_STUI) diff --git a/code/modules/admin/topic/topic.dm b/code/modules/admin/topic/topic.dm index ecef2627ed3c..05ba49cf0fd4 100644 --- a/code/modules/admin/topic/topic.dm +++ b/code/modules/admin/topic/topic.dm @@ -1082,7 +1082,8 @@ H.mind.transfer_to(M) else M.key = H.key - if(M.client) M.client.change_view(GLOB.world_view_size) + if(M.client) + M.client.view_size.reset_to_default() if(M.skills) qdel(M.skills) diff --git a/code/modules/admin/verbs/mob_verbs.dm b/code/modules/admin/verbs/mob_verbs.dm index abb43461c2fe..ad6f8186b70b 100644 --- a/code/modules/admin/verbs/mob_verbs.dm +++ b/code/modules/admin/verbs/mob_verbs.dm @@ -24,7 +24,7 @@ message_admins("[key_name_admin(usr)] modified [key_name(M)]'s ckey to [new_ckey]", 1) M.ckey = new_ckey - M.client?.change_view(GLOB.world_view_size) + M.client?.view_size.reset_to_default() /client/proc/cmd_admin_changekey(mob/O in GLOB.mob_list) set name = "Change CKey" diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm index 2facce7c3a59..4ae3414f8a42 100644 --- a/code/modules/client/client_defines.dm +++ b/code/modules/client/client_defines.dm @@ -131,3 +131,5 @@ ///datum that controls the displaying and hiding of tooltips var/datum/tooltip/tooltips + + var/datum/view_data/view_size diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 5796d5ff505e..55ed5c152982 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -420,11 +420,17 @@ GLOBAL_LIST_INIT(whitelisted_client_procs, list( if(prefs.lastchangelog != GLOB.changelog_hash) //bolds the changelog button on the interface so we know there are updates. winset(src, "infowindow.changelog", "background-color=#ED9F9B;font-style=bold") + view_size = new(src, get_screen_size(prefs.widescreen)) + view_size.update_pixel_format() + view_size.update_zoom_mode() + fit_viewport() + + /* if(prefs.toggle_prefs & TOGGLE_FULLSCREEN) toggle_fullscreen(TRUE) else toggle_fullscreen(FALSE) - + */ var/file = file2text("config/donators.txt") var/lines = splittext(file, "\n") @@ -442,8 +448,6 @@ GLOBAL_LIST_INIT(whitelisted_client_procs, list( load_player_data() - view = GLOB.world_view_size - SEND_GLOBAL_SIGNAL(COMSIG_GLOB_CLIENT_LOGGED_IN, src) ////////////// diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 113d585e44ef..51bee51b60a1 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -236,6 +236,11 @@ GLOBAL_LIST_INIT(bgstate_options, list( /// if this client has custom cursors enabled var/custom_cursors = TRUE + var/widescreen = TRUE + + var/pixel_size = PIXEL_SCALING_AUTO + var/scaling_method = SCALING_METHOD_NORMAL + /// if this client has tooltips enabled var/tooltips = TRUE @@ -583,6 +588,7 @@ GLOBAL_LIST_INIT(bgstate_options, list( dat += "
" dat += "

Game Settings:

" + dat += "Widescreen: [widescreen ? "Enabled" : "Disabled"]
" dat += "Ambient Occlusion: [toggle_prefs & TOGGLE_AMBIENT_OCCLUSION ? "Enabled" : "Disabled"]
" dat += "Fit Viewport: [auto_fit_viewport ? "Auto" : "Manual"]
" dat += "Adaptive Zoom: [adaptive_zoom ? "[adaptive_zoom * 2]x" : "Disabled"]
" @@ -1979,6 +1985,26 @@ GLOBAL_LIST_INIT(bgstate_options, list( if("change_menu") current_menu = href_list["menu"] + if("widescreen") + widescreen = !widescreen + user.client.view_size.set_default(get_screen_size(widescreen)) + + if("pixel_size") + var/index = GLOB.pixel_size_options.Find(pixel_size) + 1 + if(index > length(GLOB.pixel_size_options)) + index = 1 + pixel_size = GLOB.pixel_size_options[index] + + user.client.view_size.apply() + + if("scaling_method") + var/index = GLOB.scaling_options.Find(scaling_method) + 1 + if(index > length(GLOB.scaling_options)) + index = 1 + scaling_method = GLOB.scaling_options[index] + + user.client.view_size.update_zoom_mode() + ShowChoices(user) return 1 diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 8f3d10c102ce..8b4eee8650fe 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -151,6 +151,10 @@ S["ghost_orbit"] >> ghost_orbit S["auto_observe"] >> auto_observe + S["widescreen"] >> widescreen + S["pixel_size"] >> pixel_size + S["scaling_method"] >> scaling_method + S["human_name_ban"] >> human_name_ban S["xeno_prefix"] >> xeno_prefix @@ -241,6 +245,10 @@ adaptive_zoom = sanitize_integer(adaptive_zoom, 0, 2, 0) tooltips = sanitize_integer(tooltips, FALSE, TRUE, TRUE) + widescreen = sanitize_integer(widescreen, min = FALSE, max = TRUE, default = initial(widescreen)) + pixel_size = sanitize_inlist(pixel_size, GLOB.pixel_size_options, default = initial(pixel_size)) + scaling_method = sanitize_inlist(scaling_method, GLOB.scaling_options, default = initial(scaling_method)) + synthetic_name = synthetic_name ? sanitize_text(synthetic_name, initial(synthetic_name)) : initial(synthetic_name) synthetic_type = sanitize_inlist(synthetic_type, PLAYER_SYNTHS, initial(synthetic_type)) predator_name = predator_name ? sanitize_text(predator_name, initial(predator_name)) : initial(predator_name) @@ -340,6 +348,10 @@ S["ghost_orbit"] << ghost_orbit S["auto_observe"] << auto_observe + S["widescreen"] << widescreen + S["pixel_size"] << pixel_size + S["scaling_method"] << scaling_method + S["human_name_ban"] << human_name_ban S["xeno_prefix"] << xeno_prefix diff --git a/code/modules/clothing/glasses/night.dm b/code/modules/clothing/glasses/night.dm index b2b6f8406dcc..4b6a5cbe4eb2 100644 --- a/code/modules/clothing/glasses/night.dm +++ b/code/modules/clothing/glasses/night.dm @@ -143,14 +143,16 @@ far_sight = TRUE if(user) if(user.client) - user.client.change_view(8, src) + var/list/global_view = getviewsize(get_screen_size(user.client.prefs.widescreen)) + user.client.view_size.set_default("[global_view[1] + 2]x[global_view[2] + 2]") + START_PROCESSING(SSobj, src) else linked_smartgun = null far_sight = FALSE if(user) if(user.client) - user.client.change_view(GLOB.world_view_size, src) + user.client.view_size.set_default(get_screen_size(user.client.prefs.widescreen)) STOP_PROCESSING(SSobj, src) var/datum/action/item_action/m56_goggles/far_sight/FT = locate(/datum/action/item_action/m56_goggles/far_sight) in actions diff --git a/code/modules/cm_marines/overwatch.dm b/code/modules/cm_marines/overwatch.dm index e68ef467faa9..4908523e8423 100644 --- a/code/modules/cm_marines/overwatch.dm +++ b/code/modules/cm_marines/overwatch.dm @@ -507,7 +507,7 @@ user.UnregisterSignal(cam, COMSIG_PARENT_QDELETING) cam = null user.reset_view(null) - else if(user.client.view != GLOB.world_view_size) + else if(usr.client.view_size.get_client_view_size() != usr.client.view_size.default) to_chat(user, SPAN_WARNING("You're too busy peering through binoculars.")) else if(cam) diff --git a/code/modules/cm_marines/smartgun_mount.dm b/code/modules/cm_marines/smartgun_mount.dm index 7cb3b4fa051b..e9a55ec04e90 100644 --- a/code/modules/cm_marines/smartgun_mount.dm +++ b/code/modules/cm_marines/smartgun_mount.dm @@ -973,7 +973,7 @@ animate(user, pixel_x=diff_x, pixel_y=diff_y, 0.4 SECONDS) else if(user.client) - user.client.change_view(GLOB.world_view_size) + user.client.view_size.reset_to_default() user.client.pixel_x = 0 user.client.pixel_y = 0 animate(user, pixel_x=user_old_x, pixel_y=user_old_y, 4, 1) diff --git a/code/modules/maptext_alerts/screen_alerts.dm b/code/modules/maptext_alerts/screen_alerts.dm index e0a4d2e4d5b8..5f3c2f856d94 100644 --- a/code/modules/maptext_alerts/screen_alerts.dm +++ b/code/modules/maptext_alerts/screen_alerts.dm @@ -57,7 +57,6 @@ maptext_width = 480 maptext_x = 0 maptext_y = 0 - screen_loc = "LEFT,TOP-3" letters_per_update = 2 fade_out_delay = 4.5 SECONDS diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 3a27af37f669..20284a0aa7db 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -470,7 +470,7 @@ Works together with spawning an observer, noted above. if(ghost.client) ghost.client.init_verbs() - ghost.client.change_view(GLOB.world_view_size) //reset view range to default + ghost.client.view_size.reset_to_default() //reset view range to default ghost.client.pixel_x = 0 //recenters our view ghost.client.pixel_y = 0 ghost.set_lighting_alpha_from_pref(ghost.client) @@ -810,9 +810,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(client) if(client.view != GLOB.world_view_size) - client.change_view(GLOB.world_view_size) + client.view_size.reset_to_default() else - client.change_view(14) + client.view_size.add(14) /mob/dead/observer/verb/toggle_darkness() @@ -1256,7 +1256,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/client/observer_client = nearby_observer.client // We check observer view range specifically to also show the message to zoomed out ghosts. Double check Z as get_dist goes thru levels. if((observer_client?.prefs?.toggles_chat & CHAT_DEAD) \ - && src.z == nearby_observer.z && get_dist(src, nearby_observer) <= observer_client.view) + && src.z == nearby_observer.z && (nearby_observer in view(observer_client))) to_chat(observer_client, SPAN_DEADSAY("[src] points to [A] [nearby_observer.format_jump(A)]")) return TRUE diff --git a/code/modules/mob/death.dm b/code/modules/mob/death.dm index 8aea59b96a81..b49646fe775d 100644 --- a/code/modules/mob/death.dm +++ b/code/modules/mob/death.dm @@ -61,7 +61,7 @@ jitteriness = 0 if(client) - client.change_view(GLOB.world_view_size) //just so we never get stuck with a large view somehow + client.view_size.reset_to_default() //just so we never get stuck with a large view somehow if(s_active) //Close inventory screens. s_active.storage_close(src) diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index 4f1b4f193275..a7b5d81f8a87 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -67,4 +67,5 @@ brainmob.mind.transfer_to(target) else target.key = brainmob.key - if(target.client) target.client.change_view(GLOB.world_view_size) + if(target.client) + target.client.view_size.reset_to_default() diff --git a/code/modules/mob/living/carbon/human/human_abilities.dm b/code/modules/mob/living/carbon/human/human_abilities.dm index a568e93df5c0..e4271cf04ca8 100644 --- a/code/modules/mob/living/carbon/human/human_abilities.dm +++ b/code/modules/mob/living/carbon/human/human_abilities.dm @@ -556,7 +556,7 @@ CULT H.cancel_camera() H.reset_view() - H.client.change_view(GLOB.world_view_size, target) + H.client.view_size.reset_to_default() H.client.pixel_x = 0 H.client.pixel_y = 0 @@ -588,7 +588,7 @@ CULT remove_from(H) H.unset_interaction() - H.client.change_view(GLOB.world_view_size, target) + H.client.view_size.reset_to_default() H.client.pixel_x = 0 H.client.pixel_y = 0 H.reset_view() diff --git a/code/modules/mob/living/carbon/xenomorph/Embryo.dm b/code/modules/mob/living/carbon/xenomorph/Embryo.dm index d0890bd3cf37..41f0b17ea30b 100644 --- a/code/modules/mob/living/carbon/xenomorph/Embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/Embryo.dm @@ -263,7 +263,7 @@ new_xeno.key = picked.key if(new_xeno.client) - new_xeno.client.change_view(GLOB.world_view_size) + new_xeno.client.view_size.reset_to_default() if(new_xeno.client.prefs?.toggles_flashing & FLASH_POOLSPAWN) window_flash(new_xeno.client) diff --git a/code/modules/mob/living/carbon/xenomorph/Evolution.dm b/code/modules/mob/living/carbon/xenomorph/Evolution.dm index b6576b764b51..36e1c62092a2 100644 --- a/code/modules/mob/living/carbon/xenomorph/Evolution.dm +++ b/code/modules/mob/living/carbon/xenomorph/Evolution.dm @@ -156,7 +156,7 @@ else new_xeno.key = src.key if(new_xeno.client) - new_xeno.client.change_view(GLOB.world_view_size) + new_xeno.client.view_size.reset_to_default() //Regenerate the new mob's name now that our player is inside new_xeno.generate_name() @@ -350,7 +350,7 @@ else new_xeno.key = key if(new_xeno.client) - new_xeno.client.change_view(GLOB.world_view_size) + new_xeno.client.view_size.reset_to_default() new_xeno.client.pixel_x = 0 new_xeno.client.pixel_y = 0 diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm b/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm index 41459353ec1e..930c8dd36710 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm @@ -177,7 +177,7 @@ if(!client) return is_zoomed = 1 - client.change_view(viewsize) + client.view_size.add(viewsize) var/viewoffset = 32 * tileoffset switch(dir) if(NORTH) @@ -196,7 +196,7 @@ /mob/living/carbon/xenomorph/proc/zoom_out() if(!client) return - client.change_view(GLOB.world_view_size) + client.view_size.reset_to_default() client.pixel_x = 0 client.pixel_y = 0 is_zoomed = 0 diff --git a/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm b/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm index 1f37651b2c8e..fc911f7e6a05 100644 --- a/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm +++ b/code/modules/mob/living/carbon/xenomorph/abilities/queen/queen_powers.dm @@ -103,7 +103,7 @@ else new_xeno.key = target_xeno.key if(new_xeno.client) - new_xeno.client.change_view(GLOB.world_view_size) + new_xeno.client.view_size.reset_to_default() new_xeno.client.pixel_x = 0 new_xeno.client.pixel_y = 0 diff --git a/code/modules/mob/living/carbon/xenomorph/strains/castes/facehugger/watcher.dm b/code/modules/mob/living/carbon/xenomorph/strains/castes/facehugger/watcher.dm index 7fba30b6f352..8de9645a8493 100644 --- a/code/modules/mob/living/carbon/xenomorph/strains/castes/facehugger/watcher.dm +++ b/code/modules/mob/living/carbon/xenomorph/strains/castes/facehugger/watcher.dm @@ -13,7 +13,7 @@ behavior_delegate_type = /datum/behavior_delegate/facehugger_watcher /datum/xeno_strain/watcher/apply_strain(mob/living/carbon/xenomorph/facehugger/huggy) - huggy.viewsize = 10 + huggy.viewsize = 6 huggy.layer = initial(huggy.layer) // This has no special effects, it's just here to skip `/datum/behavior_delegate/facehugger_base/on_life()`. diff --git a/code/modules/mob/living/carbon/xenomorph/strains/castes/hivelord/resin_whisperer.dm b/code/modules/mob/living/carbon/xenomorph/strains/castes/hivelord/resin_whisperer.dm index cf1cafde9267..7f92ef5556d2 100644 --- a/code/modules/mob/living/carbon/xenomorph/strains/castes/hivelord/resin_whisperer.dm +++ b/code/modules/mob/living/carbon/xenomorph/strains/castes/hivelord/resin_whisperer.dm @@ -23,7 +23,7 @@ hivelord.can_stack_builds = TRUE hivelord.recalculate_plasma() - hivelord.client?.change_view(10, src) + hivelord.client?.view_size.add(6) hivelord.set_resin_build_order(GLOB.resin_build_order_hivelord_whisperer) for(var/datum/action/xeno_action/action in hivelord.actions) diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm index cb4d02cd28ec..eb430b9b02bc 100644 --- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm @@ -133,12 +133,12 @@ M.show_message(SPAN_DANGER("[user] gently taps [src] with \the [O]."), SHOW_MESSAGE_VISIBLE) /mob/living/simple_animal/spiderbot/proc/transfer_personality(obj/item/device/mmi/M as obj) - - src.mind = M.brainmob.mind - src.mind.key = M.brainmob.key - src.ckey = M.brainmob.ckey - if(client) client.change_view(GLOB.world_view_size) - src.name = "Spider-bot ([M.brainmob.name])" + src.mind = M.brainmob.mind + src.mind.key = M.brainmob.key + src.ckey = M.brainmob.ckey + if(client) + client.view_size.reset_to_default() + src.name = "Spider-bot ([M.brainmob.name])" /mob/living/simple_animal/spiderbot/proc/explode(cause = "exploding") //When emagged. for(var/mob/M as anything in viewers(src, null)) diff --git a/code/modules/mob/mob_verbs.dm b/code/modules/mob/mob_verbs.dm index f12d00cc0988..689e99338881 100644 --- a/code/modules/mob/mob_verbs.dm +++ b/code/modules/mob/mob_verbs.dm @@ -154,7 +154,8 @@ return M.key = key - if(M.client) M.client.change_view(GLOB.world_view_size) + if(M.client) + M.client.view_size.reset_to_default() // M.Login() //wat return diff --git a/code/modules/mob/new_player/login.dm b/code/modules/mob/new_player/login.dm index 4b25d7a2ae39..0fba88fba034 100644 --- a/code/modules/mob/new_player/login.dm +++ b/code/modules/mob/new_player/login.dm @@ -25,7 +25,7 @@ client.playtitlemusic() // To show them the full lobby art. This fixes itself on a mind transfer so no worries there. - client.change_view(GLOB.lobby_view_size) + client.view_size.add(15) // Credit the lobby art author if(GLOB.displayed_lobby_art != -1) var/list/lobby_authors = CONFIG_GET(str_list/lobby_art_authors) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 7917394df830..5bb643541d4a 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -146,7 +146,7 @@ mind.transfer_to(observer, TRUE) if(observer.client) - observer.client.change_view(GLOB.world_view_size) + observer.client.view_size.reset_to_default() observer.set_huds_from_prefs() @@ -369,7 +369,7 @@ setup_human(new_character, src, is_late_join) - new_character.client?.change_view(GLOB.world_view_size) + new_character.client?.view_size.reset_to_default() return new_character diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index 95c9227bd3d5..262fd7f96cd4 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -91,7 +91,7 @@ if(isobserver(M) && !orbiting) var/mob/dead/observer/observer = M var/turf/their_turf = get_turf(M) - if(alpha && observer.ghostvision && my_turf.z == their_turf.z && get_dist(my_turf, their_turf) <= observer.client.view) + if(alpha && observer.ghostvision && my_turf.z == their_turf.z && (my_turf in view(observer.client))) langchat_listeners += observer if(M.stat == DEAD) diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 520b58a30db6..d321213e9a61 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -107,7 +107,8 @@ new_xeno.a_intent = INTENT_HARM new_xeno.key = key - if(new_xeno.client) new_xeno.client.change_view(GLOB.world_view_size) + if(new_xeno.client) + new_xeno.client.view_size.reset_to_default() to_chat(new_xeno, "You are now an alien.") qdel(src) @@ -139,7 +140,8 @@ var/mob/new_mob = new mobpath(src.loc) new_mob.key = key - if(new_mob.client) new_mob.client.change_view(GLOB.world_view_size) + if(new_mob.client) + new_mob.client.view_size.reset_to_default() new_mob.a_intent = INTENT_HARM @@ -159,7 +161,8 @@ var/mob/new_mob = new mobpath(src.loc) new_mob.key = key - if(new_mob.client) new_mob.client.change_view(GLOB.world_view_size) + if(new_mob.client) + new_mob.client.view_size.reset_to_default() new_mob.a_intent = INTENT_HARM to_chat(new_mob, "You feel more... animalistic") diff --git a/code/modules/vehicles/apc/apc.dm b/code/modules/vehicles/apc/apc.dm index 24b137a6804a..6f12bd54cfdb 100644 --- a/code/modules/vehicles/apc/apc.dm +++ b/code/modules/vehicles/apc/apc.dm @@ -34,7 +34,7 @@ GLOBAL_LIST_EMPTY(command_apc_list) movement_sound = 'sound/vehicles/tank_driving.ogg' - var/gunner_view_buff = 10 + var/gunner_view_buff = 6 hardpoints_allowed = list( /obj/item/hardpoint/primary/dualcannon, diff --git a/code/modules/vehicles/hardpoints/holder/tank_turret.dm b/code/modules/vehicles/hardpoints/holder/tank_turret.dm index 896628e609bb..7bef469c0ba2 100644 --- a/code/modules/vehicles/hardpoints/holder/tank_turret.dm +++ b/code/modules/vehicles/hardpoints/holder/tank_turret.dm @@ -173,7 +173,7 @@ var/mob/user = C.seats[VEHICLE_GUNNER] if(user && user.client) user = C.seats[VEHICLE_GUNNER] - user.client.change_view(AM.view_buff, src) + user.client.view_size.add(AM.view_buff) switch(dir) if(NORTH) diff --git a/code/modules/vehicles/hardpoints/support/artillery.dm b/code/modules/vehicles/hardpoints/support/artillery.dm index dfcdcaf73f74..ede6dfe9b205 100644 --- a/code/modules/vehicles/hardpoints/support/artillery.dm +++ b/code/modules/vehicles/hardpoints/support/artillery.dm @@ -11,7 +11,7 @@ activatable = TRUE var/is_active = 0 - var/view_buff = 10 //This way you can VV for more or less fun + var/view_buff = 6 //This way you can VV for more or less fun var/view_tile_offset = 7 /obj/item/hardpoint/support/artillery_module/handle_fire(atom/target, mob/living/user, params) @@ -19,7 +19,7 @@ return if(is_active) - user.client.change_view(8, owner) + user.client.view_size.reset_to_default() user.client.pixel_x = 0 user.client.pixel_y = 0 is_active = FALSE @@ -30,7 +30,7 @@ holder = T break - user.client.change_view(view_buff, owner) + user.client.view_size.add(view_buff) is_active = TRUE switch(holder.dir) @@ -57,7 +57,7 @@ continue var/mob/user = C.seats[seat] if(!user.client) continue - user.client.change_view(GLOB.world_view_size, owner) + user.client.view_size.reset_to_default() user.client.pixel_x = 0 user.client.pixel_y = 0 is_active = FALSE diff --git a/code/modules/vehicles/interior/interactable/seats.dm b/code/modules/vehicles/interior/interactable/seats.dm index 253b4a066b4f..e3a6bad0323d 100644 --- a/code/modules/vehicles/interior/interactable/seats.dm +++ b/code/modules/vehicles/interior/interactable/seats.dm @@ -43,7 +43,7 @@ M.unset_interaction() vehicle.set_seated_mob(seat, null) if(M.client) - M.client.change_view(GLOB.world_view_size, vehicle) + M.client.view_size.reset_to_default() M.client.pixel_x = 0 M.client.pixel_y = 0 M.reset_view() @@ -53,11 +53,11 @@ return vehicle.set_seated_mob(seat, M) if(M && M.client) - M.client.change_view(8, vehicle) + M.client.view_size.add(2) /obj/structure/bed/chair/comfy/vehicle/clicked(mob/user, list/mods) // If you're buckled, you can shift-click on the seat in order to return to camera-view if(user == buckled_mob && mods["shift"] && !user.is_mob_incapacitated()) - user.client.change_view(8, vehicle) + user.client.view_size.add(2) vehicle.set_seated_mob(seat, user) return TRUE else @@ -177,7 +177,7 @@ M.unset_interaction() vehicle.set_seated_mob(seat, null) if(M.client) - M.client.change_view(GLOB.world_view_size, vehicle) + M.client.view_size.reset_to_default() M.client.pixel_x = 0 M.client.pixel_y = 0 else @@ -188,9 +188,9 @@ if(M && M.client) if(istype(vehicle, /obj/vehicle/multitile/apc)) var/obj/vehicle/multitile/apc/APC = vehicle - M.client.change_view(APC.gunner_view_buff, vehicle) + M.client.view_size.add(APC.gunner_view_buff) else - M.client.change_view(8, vehicle) + M.client.view_size.add(2) /obj/structure/bed/chair/comfy/vehicle/gunner/armor/update_icon() overlays.Cut() @@ -255,7 +255,7 @@ M.unset_interaction() vehicle.set_seated_mob(seat, null) if(M.client) - M.client.change_view(GLOB.world_view_size, vehicle) + M.client.view_size.reset_to_default() M.client.pixel_x = 0 M.client.pixel_y = 0 M.reset_view() @@ -265,7 +265,7 @@ return vehicle.set_seated_mob(seat, M) if(M && M.client) - M.client.change_view(8, vehicle) + M.client.view_size.add(2) if(vehicle.health < initial(vehicle.health) / 2) to_chat(M, SPAN_WARNING("\The [vehicle] is too damaged to operate the Firing Port Weapon!")) diff --git a/colonialmarines.dme b/colonialmarines.dme index 2a421a818589..08876edb884b 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -360,6 +360,7 @@ #include "code\datums\soundOutput.dm" #include "code\datums\tgs_event_handler.dm" #include "code\datums\vehicles.dm" +#include "code\datums\view.dm" #include "code\datums\weakrefs.dm" #include "code\datums\world_topic.dm" #include "code\datums\_ndatabase\include.dm" diff --git a/interface/skin.dmf b/interface/skin.dmf index e31c42938cd9..e515d834b5b7 100644 --- a/interface/skin.dmf +++ b/interface/skin.dmf @@ -41,7 +41,7 @@ menu "menu" saved-params = "is-checked" elem "stretch" name = "&Stretch to fit" - command = ".winset \"mapwindow.map.icon-size=0\"" + command = ".set_pixel_size 0" category = "&Icons" is-checked = true can-check = true @@ -49,42 +49,42 @@ menu "menu" saved-params = "is-checked" elem "icon256" name = "&256x256 (4x)" - command = ".winset \"mapwindow.map.icon-size=256\"" + command = ".set_pixel_size 4" category = "&Icons" can-check = true group = "size" saved-params = "is-checked" elem "icon128" name = "&128x128 (3x)" - command = ".winset \"mapwindow.map.icon-size=128\"" + command = ".set_pixel_size 3" category = "&Icons" can-check = true group = "size" saved-params = "is-checked" elem "icon96" name = "&96x96 (2.5x)" - command = ".winset \"mapwindow.map.icon-size=96\"" + command = ".set_pixel_size 2.5" category = "&Icons" can-check = true group = "size" saved-params = "is-checked" elem "icon64" name = "&64x64 (2x)" - command = ".winset \"mapwindow.map.icon-size=64\"" + command = ".set_pixel_size 2" category = "&Icons" can-check = true group = "size" saved-params = "is-checked" elem "icon48" name = "&48x48 (1.5x)" - command = ".winset \"mapwindow.map.icon-size=48\"" + command = ".set_pixel_size 1.5" category = "&Icons" can-check = true group = "size" saved-params = "is-checked" elem "icon32" - name = "&32x32" - command = ".winset \"mapwindow.map.icon-size=32\"" + name = "&32x32 (1x)" + command = ".set_pixel-size 1" category = "&Icons" can-check = true group = "size" @@ -106,21 +106,21 @@ menu "menu" saved-params = "is-checked" elem name = "&Nearest Neighbor" - command = ".winset \"mapwindow.map.zoom-mode=distort\"" + command = ".set_scaling_method distort" category = "Rendering" can-check = true group = "RM" saved-params = "is-checked" elem name = "&Point Sampling" - command = ".winset \"mapwindow.map.zoom-mode=normal\"" + command = ".set_scaling_method normal" category = "Rendering" can-check = true group = "RM" saved-params = "is-checked" elem name = "&Bilinear" - command = ".winset \"mapwindow.map.zoom-mode=blur\"" + command = ".set_scaling_method blur" category = "Rendering" can-check = true group = "RM"