From 843b7b7e5d2176bdad4c696d41c761e78fa5b4a4 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Tue, 28 Mar 2023 00:37:23 +0100 Subject: [PATCH 1/5] partially working --- code/__DEFINES/__game.dm | 10 ++ .../dcs/signals/atom/mob/signals_mob.dm | 2 +- code/__DEFINES/subsystems.dm | 1 + code/__HELPERS/sanitize_values.dm | 7 + code/_onclick/click.dm | 13 +- code/datums/emergency_calls/contractor.dm | 2 +- code/datums/emergency_calls/pmc.dm | 2 +- code/datums/mind.dm | 2 +- code/datums/view.dm | 150 ++++++++++++++++++ .../cas_manager/datums/cas_fire_envelope.dm | 4 +- code/game/gamemodes/cm_initialize.dm | 2 +- .../gamemodes/colonialmarines/huntergames.dm | 2 +- .../computer/groundside_operations.dm | 2 +- code/game/objects/items.dm | 50 +++--- .../objects/items/robot/robot_upgrades.dm | 2 +- code/modules/admin/tabs/admin_tab.dm | 2 +- code/modules/admin/topic/topic.dm | 2 +- code/modules/admin/verbs/mob_verbs.dm | 2 +- code/modules/client/client_defines.dm | 2 + code/modules/client/client_procs.dm | 10 +- code/modules/client/preferences.dm | 6 + code/modules/clothing/glasses/night.dm | 4 +- code/modules/cm_marines/overwatch.dm | 2 +- code/modules/cm_marines/smartgun_mount.dm | 4 +- code/modules/mob/dead/observer/observer.dm | 6 +- code/modules/mob/death.dm | 2 +- code/modules/mob/living/brain/brain_item.dm | 2 +- .../living/carbon/human/human_abilities.dm | 4 +- .../mob/living/carbon/xenomorph/Embryo.dm | 2 +- .../mob/living/carbon/xenomorph/Evolution.dm | 4 +- .../abilities/ability_helper_procs.dm | 4 +- .../xenomorph/abilities/queen/queen_powers.dm | 2 +- .../strains/hivelord/resin_whisperer.dm | 2 +- .../mob/living/silicon/robot/drone/drone.dm | 2 +- .../simple_animal/friendly/spiderbot.dm | 2 +- code/modules/mob/mob_verbs.dm | 2 +- code/modules/mob/new_player/login.dm | 2 +- code/modules/mob/new_player/new_player.dm | 4 +- code/modules/mob/transform_procs.dm | 10 +- .../vehicles/hardpoints/holder/tank_turret.dm | 2 +- .../vehicles/hardpoints/support/artillery.dm | 6 +- .../vehicles/interior/interactable/seats.dm | 16 +- colonialmarines.dme | 1 + 43 files changed, 272 insertions(+), 88 deletions(-) create mode 100644 code/datums/view.dm diff --git a/code/__DEFINES/__game.dm b/code/__DEFINES/__game.dm index adaa767c28b4..2d9556a0c9f7 100644 --- a/code/__DEFINES/__game.dm +++ b/code/__DEFINES/__game.dm @@ -538,3 +538,13 @@ block( \ #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_3X 3 + +#define SCALING_METHOD_NORMAL "normal" +#define SCALING_METHOD_DISTORT "distort" +#define SCALING_METHOD_BLUR "blur" diff --git a/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm b/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm index bdae2114ff23..5aa51b4bfe12 100644 --- a/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm +++ b/code/__DEFINES/dcs/signals/atom/mob/signals_mob.dm @@ -58,7 +58,7 @@ #define COMSIG_MOB_WEED_SLOWDOWN "mob_weeds_slowdown" #define COMSIG_MOB_TAKE_DAMAGE "mob_take_damage" // TODO: move COMSIG_XENO_TAKE_DAMAGE & COMSIG_HUMAN_TAKE_DAMAGE to this -///called in /client/change_view() +///called in /client/view_size.set_view_radius_to() #define COMSIG_MOB_CHANGE_VIEW "mob_change_view" #define COMPONENT_OVERRIDE_VIEW (1<<0) diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index 4a5b060fab3d..af6cefea8d41 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -110,6 +110,7 @@ // The numbers just define the ordering, they are meaningless otherwise. #define SS_INIT_TICKER_SPAWN 999 +#define SS_INIT_TITLE 990 #define SS_INIT_INPUT 85 #define SS_INIT_RUST 26 #define SS_INIT_SUPPLY_SHUTTLE 25 diff --git a/code/__HELPERS/sanitize_values.dm b/code/__HELPERS/sanitize_values.dm index 85e102a3c1ac..87fd5f900a5c 100644 --- a/code/__HELPERS/sanitize_values.dm +++ b/code/__HELPERS/sanitize_values.dm @@ -6,6 +6,13 @@ return number return default +/proc/sanitize_float(number, min=0, max=1, accuracy=1, default=0) + if(isnum(number)) + number = round(number, accuracy) + if(min <= number && number <= max) + return number + return default + /proc/sanitize_text(text, default="") if(istext(text)) return text diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 0e574e1f610b..d6a3f37d8cc7 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -320,7 +320,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() @@ -355,17 +355,12 @@ /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])) #if DEBUG_CLICK_RATE diff --git a/code/datums/emergency_calls/contractor.dm b/code/datums/emergency_calls/contractor.dm index a5d6c2d7e80f..84df00b1cc53 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(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 37347dcbc058..05be9f3e06e6 100644 --- a/code/datums/emergency_calls/pmc.dm +++ b/code/datums/emergency_calls/pmc.dm @@ -120,7 +120,7 @@ var/mob/living/carbon/human/H = new(spawn_loc) H.key = M.key if(H.client) - H.client.change_view(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 90df42f7d12a..85674cfebcb1 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -61,7 +61,7 @@ SSround_recording.recorder.update_key(new_character) if(new_character.client) new_character.client.init_verbs() - new_character.client.change_view(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..c25ba62722d2 --- /dev/null +++ b/code/datums/view.dm @@ -0,0 +1,150 @@ +//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 owneing clients view + var/width = 0 + ///height ratio of the owneing 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 owner of this view data + var/client/chief = null + +/datum/view_data/New(client/owner, view_string) + default = view_string + chief = owner + 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(chief, "mapwindow.map", "zoom=0") + +///applies the current clients preferred pixel size setting +/datum/view_data/proc/update_pixel_format() + winset(chief, "mapwindow.map", "zoom=[chief.prefs.pixel_size]") + +///applies the preferred clients scaling method +/datum/view_data/proc/update_zoom_mode() + winset(chief, "mapwindow.map", "zoom-mode=[chief.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() + chief.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(chief, 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(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) + +///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) diff --git a/code/game/cas_manager/datums/cas_fire_envelope.dm b/code/game/cas_manager/datums/cas_fire_envelope.dm index a2c2aa9cdf6b..1b823e8cff32 100644 --- a/code/game/cas_manager/datums/cas_fire_envelope.dm +++ b/code/game/cas_manager/datums/cas_fire_envelope.dm @@ -194,7 +194,7 @@ M.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE M.sync_lighting_plane_alpha() else if (linked_console.upgraded == MATRIX_WIDE) - M.client?.change_view(linked_console.power + 5, M) + M.client?.view_size.set_view_radius_to(linked_console.power + 5, M) /datum/cas_fire_envelope/proc/remove_upgrades(user) @@ -206,7 +206,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.set_view_radius_to(7, M) else return diff --git a/code/game/gamemodes/cm_initialize.dm b/code/game/gamemodes/cm_initialize.dm index 0f9dabf7ac68..ee3fe2787360 100644 --- a/code/game/gamemodes/cm_initialize.dm +++ b/code/game/gamemodes/cm_initialize.dm @@ -547,7 +547,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(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 2ab7a72385ce..c2085b432030 100644 --- a/code/game/gamemodes/colonialmarines/huntergames.dm +++ b/code/game/gamemodes/colonialmarines/huntergames.dm @@ -235,7 +235,7 @@ var/waiting_for_drop_votes = 0 H = new(picked) H.key = M.key - if(H.client) H.client.change_view(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 234852539226..61da7a6c30af 100644 --- a/code/game/machinery/computer/groundside_operations.dm +++ b/code/game/machinery/computer/groundside_operations.dm @@ -275,7 +275,7 @@ visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("Stopping helmet cam view of [cam_target].")]") cam = null usr.reset_view(null) - else if(usr.client.view != world_view_size) + else if(usr.client.view_size.get_client_view_size() != usr.client.view_size.default) to_chat(usr, SPAN_WARNING("You're too busy peering through binoculars.")) else cam = new_cam diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 14b4ce373072..b4021486f2f5 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -815,9 +815,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) var/zoom_device = zoomdevicename ? "\improper [zoomdevicename] of [src]" : "\improper [src]" INVOKE_ASYNC(user, TYPE_PROC_REF(/atom, visible_message), SPAN_NOTICE("[user] looks up from [zoom_device]."), SPAN_NOTICE("You look up from [zoom_device].")) @@ -832,7 +832,8 @@ 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(world_view_size, src) + user.client.view_size.reset_to_default() + animate(user.client, 3*(tileoffset/7), pixel_x = 0, pixel_y = 0) user.client.pixel_x = 0 user.client.pixel_y = 0 @@ -855,8 +856,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, @@ -865,22 +864,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]" @@ -888,6 +873,29 @@ cases. Override_icon_state should be a list.*/ SPAN_NOTICE("You peer through \the [zoom_device].")) zoom = !zoom +///applies the offset of the zooming, using animate for smoothing. +/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/zoom_offset_time = 3*((viewoffset/32)/7) + var/dirtooffset = newdir ? newdir : user.dir + + switch(dirtooffset) + if(NORTH) + animate(user.client, pixel_x = 0, pixel_y = viewoffset, time = zoom_offset_time) + if(SOUTH) + animate(user.client, pixel_x = 0, pixel_y = -viewoffset, time = zoom_offset_time) + if(EAST) + animate(user.client, pixel_x = viewoffset, pixel_y = 0, time = zoom_offset_time) + if(WEST) + animate(user.client, pixel_x = -viewoffset, pixel_y = 0, time = zoom_offset_time) + /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/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm index c5fa39fd100c..c639ac478588 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -68,7 +68,7 @@ for(var/mob/dead/observer/ghost in GLOB.observer_list) if(ghost.mind && ghost.mind.original == R) R.key = ghost.key - if(R.client) R.client.change_view(world_view_size) + if(R.client) R.client.view_size.reset_to_default() break R.set_stat(CONSCIOUS) diff --git a/code/modules/admin/tabs/admin_tab.dm b/code/modules/admin/tabs/admin_tab.dm index 697208064c15..2abd2a79954d 100644 --- a/code/modules/admin/tabs/admin_tab.dm +++ b/code/modules/admin/tabs/admin_tab.dm @@ -97,7 +97,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(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 5ebd7fe607cb..5fafa63f15b5 100644 --- a/code/modules/admin/topic/topic.dm +++ b/code/modules/admin/topic/topic.dm @@ -1059,7 +1059,7 @@ H.mind.transfer_to(M) else M.key = H.key - if(M.client) M.client.change_view(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 3aed46d5434e..1a05b3fe0762 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(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 be2f977b6a53..f758f14ed919 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 c0a4dd718877..6b30b0a11719 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -413,11 +413,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.widescreenpref)) + 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") @@ -432,8 +438,6 @@ GLOBAL_LIST_INIT(whitelisted_client_procs, list( load_player_data() - view = world_view_size - SEND_GLOBAL_SIGNAL(COMSIG_GLOB_CLIENT_LOGIN, src) ////////////// diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index c06440198817..fb484ebd02da 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -229,6 +229,12 @@ var/const/MAX_SAVE_SLOTS = 10 /// if this client has custom cursors enabled var/custom_cursors = TRUE + var/widescreenpref = TRUE + + var/pixel_size = 0 + + var/scaling_method = SCALING_METHOD_NORMAL + /datum/preferences/New(client/C) key_bindings = deepCopyList(GLOB.hotkey_keybinding_list_by_key) // give them default keybinds and update their movement keys macros = new(C, src) diff --git a/code/modules/clothing/glasses/night.dm b/code/modules/clothing/glasses/night.dm index be58dd80cc25..462ec3e69db0 100644 --- a/code/modules/clothing/glasses/night.dm +++ b/code/modules/clothing/glasses/night.dm @@ -143,14 +143,14 @@ far_sight = TRUE if(user) if(user.client) - user.client.change_view(8, src) + user.client.view_size.set_view_radius_to(8, src) START_PROCESSING(SSobj, src) else powerpack = null far_sight = FALSE if(user) if(user.client) - user.client.change_view(world_view_size, src) + user.client.view_size.set_view_radius_to(world_view_size, src) 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 5da13d755945..758af586f2b8 100644 --- a/code/modules/cm_marines/overwatch.dm +++ b/code/modules/cm_marines/overwatch.dm @@ -595,7 +595,7 @@ visible_message("[icon2html(src, viewers(src))] [SPAN_BOLDNOTICE("Stopping helmet cam view of [cam_target].")]") cam = null usr.reset_view(null) - else if(usr.client.view != world_view_size) + else if(usr.client.view_size.get_client_view_size() != usr.client.view_size.default) to_chat(usr, SPAN_WARNING("You're too busy peering through binoculars.")) else cam = new_cam diff --git a/code/modules/cm_marines/smartgun_mount.dm b/code/modules/cm_marines/smartgun_mount.dm index 7c1fb6dc7484..33d4f0ded44f 100644 --- a/code/modules/cm_marines/smartgun_mount.dm +++ b/code/modules/cm_marines/smartgun_mount.dm @@ -936,7 +936,7 @@ animate(user, pixel_x=diff_x, pixel_y=diff_y, 0.4 SECONDS) else if(user.client) - user.client.change_view(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) @@ -1608,7 +1608,7 @@ animate(user, pixel_x=diff_x, pixel_y=diff_y, 0.4 SECONDS) else if(user.client) - user.client.change_view(world_view_size) + user.client.view_size.reset_to_default() user.client.pixel_x = 0 user.client.pixel_y = 0 UnregisterSignal(user.client, list( diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 4fb85ad7924e..3b1b794de1f7 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -345,7 +345,7 @@ Works together with spawning an observer, noted above. if(ghost.client) ghost.client.init_verbs() - ghost.client.change_view(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) @@ -641,9 +641,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(client) if(client.view != world_view_size) - client.change_view(world_view_size) + client.view_size.reset_to_default() else - client.change_view(14) + client.view_size.set_view_radius_to(14) /mob/dead/observer/verb/toggle_darkness() diff --git a/code/modules/mob/death.dm b/code/modules/mob/death.dm index 6c825ec50994..cd9c60d07428 100644 --- a/code/modules/mob/death.dm +++ b/code/modules/mob/death.dm @@ -63,7 +63,7 @@ jitteriness = 0 if(client) - client.change_view(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 c8925239c33b..c8b8ac97697f 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -67,4 +67,4 @@ brainmob.mind.transfer_to(target) else target.key = brainmob.key - if(target.client) target.client.change_view(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 17ee03090daa..e4c29ba8eee5 100644 --- a/code/modules/mob/living/carbon/human/human_abilities.dm +++ b/code/modules/mob/living/carbon/human/human_abilities.dm @@ -558,7 +558,7 @@ CULT H.cancel_camera() H.reset_view() - H.client.change_view(world_view_size, target) + H.client.view_size.set_view_radius_to(world_view_size, target) H.client.pixel_x = 0 H.client.pixel_y = 0 @@ -590,7 +590,7 @@ CULT remove_from(H) H.unset_interaction() - H.client.change_view(world_view_size, target) + H.client.view_size.set_view_radius_to(world_view_size, target) 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 bc5eaa43868c..48bfb96c9cc5 100644 --- a/code/modules/mob/living/carbon/xenomorph/Embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/Embryo.dm @@ -183,7 +183,7 @@ new_xeno.key = picked.key if(new_xeno.client) - new_xeno.client.change_view(world_view_size) + new_xeno.client.view_size.reset_to_default() SSround_recording.recorder.track_player(new_xeno) diff --git a/code/modules/mob/living/carbon/xenomorph/Evolution.dm b/code/modules/mob/living/carbon/xenomorph/Evolution.dm index 1f88643db764..c13bf8ffa24f 100644 --- a/code/modules/mob/living/carbon/xenomorph/Evolution.dm +++ b/code/modules/mob/living/carbon/xenomorph/Evolution.dm @@ -145,7 +145,7 @@ else new_xeno.key = src.key if(new_xeno.client) - new_xeno.client.change_view(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() @@ -332,7 +332,7 @@ else new_xeno.key = key if(new_xeno.client) - new_xeno.client.change_view(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 a2121697ebea..386980d3b38d 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 @@ -201,7 +201,7 @@ if(!client) return is_zoomed = 1 - client.change_view(viewsize) + client.view_size.set_view_radius_to(viewsize) var/viewoffset = 32 * tileoffset switch(dir) if(NORTH) @@ -220,7 +220,7 @@ /mob/living/carbon/xenomorph/proc/zoom_out() if(!client) return - client.change_view(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 3811aae1719b..0925fcfad71e 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 @@ -102,7 +102,7 @@ else new_xeno.key = target_xeno.key if(new_xeno.client) - new_xeno.client.change_view(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/mutators/strains/hivelord/resin_whisperer.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/hivelord/resin_whisperer.dm index 02a81c7e63c2..3f43f362f397 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/hivelord/resin_whisperer.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/hivelord/resin_whisperer.dm @@ -28,7 +28,7 @@ hivelord.extra_build_dist = 12 // 1 + 12 = 13 tile build range hivelord.can_stack_builds = TRUE - hivelord.client.change_view(10, src) + hivelord.client.view_size.set_view_radius_to(10, src) hivelord.mutation_type = HIVELORD_RESIN_WHISPERER mutator_update_actions(hivelord) diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index 3ec91da9b219..e2cab69e5475 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -173,7 +173,7 @@ /mob/living/silicon/robot/drone/proc/transfer_personality(client/player) if(!player) return - player.change_view(world_view_size) + player.view_size.reset_to_default() src.ckey = player.ckey if(player.mob && player.mob.mind) diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm index f693574349d7..386ac5598715 100644 --- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm @@ -138,7 +138,7 @@ src.mind = M.brainmob.mind src.mind.key = M.brainmob.key src.ckey = M.brainmob.ckey - if(client) client.change_view(world_view_size) + 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. diff --git a/code/modules/mob/mob_verbs.dm b/code/modules/mob/mob_verbs.dm index 5a6443b78857..7cb4fff74cf0 100644 --- a/code/modules/mob/mob_verbs.dm +++ b/code/modules/mob/mob_verbs.dm @@ -155,7 +155,7 @@ return M.key = key - if(M.client) M.client.change_view(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 9ff317260ccf..1300091d1721 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(lobby_view_size) + client.view_size.add(7) // Credit the lobby art author if(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 943c407b765e..e24c72db834b 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(world_view_size) + observer.client.view_size.reset_to_default() observer.set_huds_from_prefs() @@ -392,7 +392,7 @@ INVOKE_ASYNC(new_character, TYPE_PROC_REF(/mob/living/carbon/human, update_hair)) new_character.key = key //Manually transfer the key to log them in - new_character.client?.change_view(world_view_size) + new_character.client?.view_size.reset_to_default() return new_character diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index dcb478d0fc7c..1daae68f4df3 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -108,7 +108,7 @@ O.mind.original = O else O.key = key - if(O.client) O.client.change_view(world_view_size) + if(O.client) O.client.view_size.reset_to_default() O.forceMove(loc) O.job = "Cyborg" @@ -180,7 +180,7 @@ new_xeno.a_intent = INTENT_HARM new_xeno.key = key - if(new_xeno.client) new_xeno.client.change_view(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) @@ -202,7 +202,7 @@ var/mob/living/simple_animal/corgi/new_corgi = new /mob/living/simple_animal/corgi (loc) new_corgi.a_intent = INTENT_HARM new_corgi.key = key - if(new_corgi.client) new_corgi.client.change_view(world_view_size) + if(new_corgi.client) new_corgi.client.view_size.reset_to_default() to_chat(new_corgi, "You are now a Corgi. Yap Yap!") qdel(src) @@ -234,7 +234,7 @@ var/mob/new_mob = new mobpath(src.loc) new_mob.key = key - if(new_mob.client) new_mob.client.change_view(world_view_size) + if(new_mob.client) new_mob.client.view_size.reset_to_default() new_mob.a_intent = INTENT_HARM @@ -254,7 +254,7 @@ var/mob/new_mob = new mobpath(src.loc) new_mob.key = key - if(new_mob.client) new_mob.client.change_view(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/hardpoints/holder/tank_turret.dm b/code/modules/vehicles/hardpoints/holder/tank_turret.dm index db67dadb132d..f1a772cf3263 100644 --- a/code/modules/vehicles/hardpoints/holder/tank_turret.dm +++ b/code/modules/vehicles/hardpoints/holder/tank_turret.dm @@ -166,7 +166,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.set_view_radius_to(AM.view_buff, src) switch(dir) if(NORTH) diff --git a/code/modules/vehicles/hardpoints/support/artillery.dm b/code/modules/vehicles/hardpoints/support/artillery.dm index 441817107e7c..707c237edf0d 100644 --- a/code/modules/vehicles/hardpoints/support/artillery.dm +++ b/code/modules/vehicles/hardpoints/support/artillery.dm @@ -19,7 +19,7 @@ return if(is_active) - user.client.change_view(8, owner) + user.client.view_size.set_view_radius_to(8, owner) 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.set_view_radius_to(view_buff, owner) 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(world_view_size, owner) + user.client.view_size.set_view_radius_to(world_view_size, owner) 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 251081be0372..931a930839b6 100644 --- a/code/modules/vehicles/interior/interactable/seats.dm +++ b/code/modules/vehicles/interior/interactable/seats.dm @@ -43,7 +43,7 @@ vehicle.set_seated_mob(seat, null) M.unset_interaction() if(M.client) - M.client.change_view(world_view_size, vehicle) + M.client.view_size.set_view_radius_to(world_view_size, vehicle) 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.set_view_radius_to(8, vehicle) /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.set_view_radius_to(8, vehicle) vehicle.set_seated_mob(seat, user) return TRUE else @@ -177,7 +177,7 @@ vehicle.set_seated_mob(seat, null) M.unset_interaction() if(M.client) - M.client.change_view(world_view_size, vehicle) + M.client.view_size.set_view_radius_to(world_view_size, vehicle) 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.set_view_radius_to(APC.gunner_view_buff, vehicle) else - M.client.change_view(8, vehicle) + M.client.view_size.set_view_radius_to(8, vehicle) /obj/structure/bed/chair/comfy/vehicle/gunner/armor/update_icon() overlays.Cut() @@ -255,7 +255,7 @@ vehicle.set_seated_mob(seat, null) M.unset_interaction() if(M.client) - M.client.change_view(world_view_size, vehicle) + M.client.view_size.set_view_radius_to(world_view_size, vehicle) 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.set_view_radius_to(8, vehicle) 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 cabb251fb838..c76c113da538 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -324,6 +324,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\_ndatabase\include.dm" #include "code\datums\agents\tools.dm" From 8e684c984eeb1eaf8f86e87ead9437c03722f671 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Fri, 31 Mar 2023 19:43:21 +0100 Subject: [PATCH 2/5] feature complete basically --- code/__DEFINES/xeno.dm | 2 +- .../game/cas_manager/datums/cas_fire_envelope.dm | 4 ++-- code/modules/clothing/glasses/night.dm | 4 ++-- code/modules/mob/dead/observer/observer.dm | 2 +- .../mob/living/carbon/human/human_abilities.dm | 4 ++-- .../xenomorph/abilities/ability_helper_procs.dm | 2 +- .../mutators/strains/hivelord/resin_whisperer.dm | 2 +- code/modules/vehicles/apc/apc.dm | 2 +- .../vehicles/hardpoints/holder/tank_turret.dm | 2 +- .../vehicles/hardpoints/support/artillery.dm | 8 ++++---- .../vehicles/interior/interactable/seats.dm | 16 ++++++++-------- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/code/__DEFINES/xeno.dm b/code/__DEFINES/xeno.dm index e73aa5093855..b54cc75ff013 100644 --- a/code/__DEFINES/xeno.dm +++ b/code/__DEFINES/xeno.dm @@ -630,7 +630,7 @@ #define FIRE_VULNERABILITY_MULTIPLIER 1.5 -#define TRAPPER_VIEWRANGE 13 +#define TRAPPER_VIEWRANGE 6 #define SECRETE_RESIN_INTERRUPT -1 #define SECRETE_RESIN_FAIL 0 diff --git a/code/game/cas_manager/datums/cas_fire_envelope.dm b/code/game/cas_manager/datums/cas_fire_envelope.dm index 1b823e8cff32..7e257a266aa5 100644 --- a/code/game/cas_manager/datums/cas_fire_envelope.dm +++ b/code/game/cas_manager/datums/cas_fire_envelope.dm @@ -194,7 +194,7 @@ M.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE M.sync_lighting_plane_alpha() else if (linked_console.upgraded == MATRIX_WIDE) - M.client?.view_size.set_view_radius_to(linked_console.power + 5, M) + M.client?.view_size.add(linked_console.power - 2, M) /datum/cas_fire_envelope/proc/remove_upgrades(user) @@ -206,7 +206,7 @@ M.lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE M.sync_lighting_plane_alpha() if(linked_console.upgraded == MATRIX_WIDE) - M.client?.view_size.set_view_radius_to(7, M) + M.client?.view_size.reset_to_default() else return diff --git a/code/modules/clothing/glasses/night.dm b/code/modules/clothing/glasses/night.dm index 462ec3e69db0..9b81fdffac23 100644 --- a/code/modules/clothing/glasses/night.dm +++ b/code/modules/clothing/glasses/night.dm @@ -143,14 +143,14 @@ far_sight = TRUE if(user) if(user.client) - user.client.view_size.set_view_radius_to(8, src) + user.client.view_size.add(1) START_PROCESSING(SSobj, src) else powerpack = null far_sight = FALSE if(user) if(user.client) - user.client.view_size.set_view_radius_to(world_view_size, src) + user.client.view_size.reset_to_default() 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/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 3b1b794de1f7..d455f98aa1c3 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -643,7 +643,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(client.view != world_view_size) client.view_size.reset_to_default() else - client.view_size.set_view_radius_to(14) + client.view_size.add(7) /mob/dead/observer/verb/toggle_darkness() diff --git a/code/modules/mob/living/carbon/human/human_abilities.dm b/code/modules/mob/living/carbon/human/human_abilities.dm index e4c29ba8eee5..608b2c41cfe1 100644 --- a/code/modules/mob/living/carbon/human/human_abilities.dm +++ b/code/modules/mob/living/carbon/human/human_abilities.dm @@ -558,7 +558,7 @@ CULT H.cancel_camera() H.reset_view() - H.client.view_size.set_view_radius_to(world_view_size, target) + H.client.view_size.reset_to_default() H.client.pixel_x = 0 H.client.pixel_y = 0 @@ -590,7 +590,7 @@ CULT remove_from(H) H.unset_interaction() - H.client.view_size.set_view_radius_to(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/abilities/ability_helper_procs.dm b/code/modules/mob/living/carbon/xenomorph/abilities/ability_helper_procs.dm index 386980d3b38d..50409bb55ef4 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 @@ -201,7 +201,7 @@ if(!client) return is_zoomed = 1 - client.view_size.set_view_radius_to(viewsize) + client.view_size.add(viewsize) var/viewoffset = 32 * tileoffset switch(dir) if(NORTH) diff --git a/code/modules/mob/living/carbon/xenomorph/mutators/strains/hivelord/resin_whisperer.dm b/code/modules/mob/living/carbon/xenomorph/mutators/strains/hivelord/resin_whisperer.dm index 3f43f362f397..63d167c67a0b 100644 --- a/code/modules/mob/living/carbon/xenomorph/mutators/strains/hivelord/resin_whisperer.dm +++ b/code/modules/mob/living/carbon/xenomorph/mutators/strains/hivelord/resin_whisperer.dm @@ -28,7 +28,7 @@ hivelord.extra_build_dist = 12 // 1 + 12 = 13 tile build range hivelord.can_stack_builds = TRUE - hivelord.client.view_size.set_view_radius_to(10, src) + hivelord.client.view_size.add(3) hivelord.mutation_type = HIVELORD_RESIN_WHISPERER mutator_update_actions(hivelord) diff --git a/code/modules/vehicles/apc/apc.dm b/code/modules/vehicles/apc/apc.dm index 2d0c823dd638..2768b33cb923 100644 --- a/code/modules/vehicles/apc/apc.dm +++ b/code/modules/vehicles/apc/apc.dm @@ -35,7 +35,7 @@ GLOBAL_LIST_EMPTY(command_apc_list) movement_sound = 'sound/vehicles/tank_driving.ogg' luminosity = 7 - var/gunner_view_buff = 10 + var/gunner_view_buff = 3 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 f1a772cf3263..8e1d72dd2089 100644 --- a/code/modules/vehicles/hardpoints/holder/tank_turret.dm +++ b/code/modules/vehicles/hardpoints/holder/tank_turret.dm @@ -166,7 +166,7 @@ var/mob/user = C.seats[VEHICLE_GUNNER] if(user && user.client) user = C.seats[VEHICLE_GUNNER] - user.client.view_size.set_view_radius_to(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 707c237edf0d..df518729edb2 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 = 3 //This way you can VV for more or less fun var/view_tile_offset = 7 /obj/item/hardpoint/support/artillery_module/activate(mob/user, atom/A) @@ -19,7 +19,7 @@ return if(is_active) - user.client.view_size.set_view_radius_to(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.view_size.set_view_radius_to(view_buff, owner) + user.client.view_size.add(3) is_active = TRUE switch(holder.dir) @@ -57,7 +57,7 @@ continue var/mob/user = C.seats[seat] if(!user.client) continue - user.client.view_size.set_view_radius_to(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 931a930839b6..5dae524fa194 100644 --- a/code/modules/vehicles/interior/interactable/seats.dm +++ b/code/modules/vehicles/interior/interactable/seats.dm @@ -43,7 +43,7 @@ vehicle.set_seated_mob(seat, null) M.unset_interaction() if(M.client) - M.client.view_size.set_view_radius_to(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.view_size.set_view_radius_to(8, vehicle) + M.client.view_size.add(1) /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.view_size.set_view_radius_to(8, vehicle) + user.client.view_size.add(1) vehicle.set_seated_mob(seat, user) return TRUE else @@ -177,7 +177,7 @@ vehicle.set_seated_mob(seat, null) M.unset_interaction() if(M.client) - M.client.view_size.set_view_radius_to(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.view_size.set_view_radius_to(APC.gunner_view_buff, vehicle) + M.client.view_size.add(APC.gunner_view_buff) else - M.client.view_size.set_view_radius_to(8, vehicle) + M.client.view_size.add(1) /obj/structure/bed/chair/comfy/vehicle/gunner/armor/update_icon() overlays.Cut() @@ -255,7 +255,7 @@ vehicle.set_seated_mob(seat, null) M.unset_interaction() if(M.client) - M.client.view_size.set_view_radius_to(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.view_size.set_view_radius_to(8, vehicle) + M.client.view_size.add(1) if(vehicle.health < initial(vehicle.health) / 2) to_chat(M, SPAN_WARNING("\The [vehicle] is too damaged to operate the Firing Port Weapon!")) From c6140d71062a438bad373ebf805d367e6f61a378 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sat, 1 Apr 2023 17:50:17 +0100 Subject: [PATCH 3/5] makes the pref go --- code/modules/client/preferences.dm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index fb484ebd02da..5a370de07477 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -573,6 +573,7 @@ var/const/MAX_SAVE_SLOTS = 10 dat += "
" dat += "

Game Settings:

" + dat += "Widescreen: [widescreenpref ? "Enabled" : "Disabled"]
" dat += "Ambient Occlusion: [toggle_prefs & TOGGLE_AMBIENT_OCCLUSION ? "Enabled" : "Disabled"]
" dat += "Fit Viewport: [auto_fit_viewport ? "Auto" : "Manual"]
" dat += "tgui Window Mode: [(tgui_fancy) ? "Fancy (default)" : "Compatible (slower)"]
" @@ -1795,6 +1796,10 @@ var/const/MAX_SAVE_SLOTS = 10 if("change_menu") current_menu = href_list["menu"] + if("widescreenpref") + widescreenpref = !widescreenpref + user.client.view_size.set_default(get_screen_size(widescreenpref)) + ShowChoices(user) return 1 From b3fddff43bf1b6d14a2a8c455f8ab01de672b130 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sat, 1 Apr 2023 17:55:47 +0100 Subject: [PATCH 4/5] better login size --- code/modules/mob/new_player/login.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/new_player/login.dm b/code/modules/mob/new_player/login.dm index 1300091d1721..45fcfdabe075 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.view_size.add(7) + client.view_size.add(15) // Credit the lobby art author if(displayed_lobby_art != -1) var/list/lobby_authors = CONFIG_GET(str_list/lobby_art_authors) From c4a4ae311fc7df59e8cabb48138ca078a0a353b5 Mon Sep 17 00:00:00 2001 From: harryob Date: Thu, 29 Feb 2024 21:26:47 +0000 Subject: [PATCH 5/5] ruins the game, for real --- code/controllers/configuration/entries/general.dm | 2 +- .../strains/castes/hivelord/resin_whisperer.dm | 2 +- .../mob/living/simple_animal/friendly/spiderbot.dm | 13 ++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) 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/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 cbac00b7f544..a7991c293967 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 @@ -1,4 +1,4 @@ -Z/datum/xeno_strain/resin_whisperer +/datum/xeno_strain/resin_whisperer name = HIVELORD_RESIN_WHISPERER description = "You lose your corrosive acid, your ability to secrete thick resin, your ability to reinforce resin secretions, sacrifice your ability to plant weed nodes outside of weeds, and you sacrifice a fifth of your plasma reserves to enhance your vision and gain a stronger connection to the resin. You can now remotely place resin secretions including weed nodes up to a distance of twelve paces!" flavor_description = "Let the resin guide you. It whispers, so listen closely." diff --git a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm index 741b23db1dcf..eb430b9b02bc 100644 --- a/code/modules/mob/living/simple_animal/friendly/spiderbot.dm +++ b/code/modules/mob/living/simple_animal/friendly/spiderbot.dm @@ -133,13 +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.view_size.reset_to_default() - 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))