diff --git a/code/__defines/misc.dm b/code/__defines/misc.dm index 40cdeb0b782..2ea0204a841 100644 --- a/code/__defines/misc.dm +++ b/code/__defines/misc.dm @@ -116,11 +116,6 @@ #define PROJECTILE_CONTINUE -1 //if the projectile should continue flying after calling bullet_act() #define PROJECTILE_FORCE_MISS -2 //if the projectile should treat the attack as a miss (suppresses attack and admin logs) - only applies to mobs. -//Camera capture modes -#define CAPTURE_MODE_REGULAR 0 //Regular polaroid camera mode -#define CAPTURE_MODE_ALL 1 //Admin camera mode -#define CAPTURE_MODE_PARTIAL 3 //Simular to regular mode, but does not do dummy check - //objectives #define CONFIG_OBJECTIVE_NONE 2 #define CONFIG_OBJECTIVE_VERB 1 diff --git a/code/_helpers/icons.dm b/code/_helpers/icons.dm index 209e88d1699..2955ed44bde 100644 --- a/code/_helpers/icons.dm +++ b/code/_helpers/icons.dm @@ -872,53 +872,64 @@ The _flatIcons list is a cache for generated icon files. result.Swap(i, gap + i) swapped = 1 return result -/* -generate_image function generates image of specified range and location -arguments tx, ty, tz are target coordinates (requred), range defines render distance to opposite corner (requred) -cap_mode is capturing mode (optional), user is capturing mob (requred only wehen cap_mode = CAPTURE_MODE_REGULAR), -lighting determines lighting capturing (optional), suppress_errors suppreses errors and continues to capture (optional). +/** + * Generate_image function generates image of specified range and location: + * * arguments `target_x`, `target_y`, `target_z` are target coordinates (requred). + * * `range` defines render distance to opposite corner (requred). + * * lighting determines lighting capturing (optional), suppress_errors suppreses errors and continues to capture (optional). + * * `checker` is a person from which side will be perfored capture check, should be `/mob/living` target_ype. */ -/proc/generate_image(var/tx as num, var/ty as num, var/tz as num, var/range as num, var/cap_mode = CAPTURE_MODE_PARTIAL, var/mob/living/user, var/lighting = 1, var/suppress_errors = 1) - var/list/turfstocapture = list() - //Lines below determine what tiles will be rendered - for(var/xoff = 0 to range) - for(var/yoff = 0 to range) - var/turf/T = locate(tx + xoff,ty + yoff,tz) - if(T) - if(cap_mode == CAPTURE_MODE_REGULAR) - if(user.can_capture_turf(T)) - turfstocapture.Add(T) - continue - else - turfstocapture.Add(T) +/proc/create_area_image(target_x, target_y, target_z, range, show_lighting = TRUE, mob/living/checker) + // They're all should be set. + ASSERT(target_x) + ASSERT(target_y) + ASSERT(target_z) + ASSERT(range) + + // - Collecting list of turfs to render - + + var/list/render_turfs = list() + for(var/x_offset = 0 to range) + for(var/y_offset = 0 to range) + var/turf/T = locate(target_x + x_offset, target_y + y_offset, target_z) + if(checker && !checker?.can_capture_turf(T)) + continue else - //Capture includes non-existan turfs - if(!suppress_errors) - return - //Lines below determine what objects will be rendered - var/list/atoms = list() - for(var/turf/T in turfstocapture) - atoms.Add(T) - for(var/atom/A in T) - if(istype(A, /atom/movable/lighting_overlay) && lighting) //Special case for lighting - atoms.Add(A) + render_turfs.Add(T) + + // - Collecting list of atoms to render - + + var/list/render_atoms = list() + for(var/turf/T as anything in render_turfs) + render_atoms.Add(T) + + for(var/atom/A as anything in T) + // In some cases we want to filter lighting overlays. + if(istype(A, /atom/movable/lighting_overlay) && show_lighting) + render_atoms.Add(A) + continue + + if(!A.alpha || A.invisibility) continue - if(A.invisibility) continue - atoms.Add(A) - //Lines below actually render all colected data - atoms = sort_atoms_by_layer(atoms) - var/icon/cap = icon('icons/effects/96x96.dmi', "") - cap.Scale(range*32, range*32) - cap.Blend("#000", ICON_OVERLAY) - for(var/atom/A in atoms) - if(A) - var/icon/img = getFlatIcon(A) - if(istype(img, /icon)) - if(istype(A, /mob/living) && A:lying) - img.BecomeLying() - var/xoff = (A.x - tx) * 32 - var/yoff = (A.y - ty) * 32 - cap.Blend(img, blendMode2iconMode(A.blend_mode), A.pixel_x + xoff, A.pixel_y + yoff) - - return cap + render_atoms.Add(A) + + // - Performing rendering with collected atoms in list - + + render_atoms = sort_atoms_by_layer(render_atoms) + var/icon/capture = icon('icons/effects/96x96.dmi', "") + capture.Scale(range * world.icon_size, range * world.icon_size) + capture.Blend(COLOR_BLACK, ICON_OVERLAY) + for(var/atom/A as anything in render_atoms) + var/icon/atom_icon = getFlatIcon(A) + + if(ismob(A)) + var/mob/M = A + if(M.lying) + atom_icon.BecomeLying() + + var/x_offset = (A.x - target_x) * world.icon_size + var/y_offset = (A.y - target_y) * world.icon_size + capture.Blend(atom_icon, blendMode2iconMode(A.blend_mode), A.pixel_x + x_offset, A.pixel_y + y_offset) + + return capture diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 16d4de2b5ce..bf00ec77cd3 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -50,7 +50,7 @@ name = "default attack selector" icon_state = "attack_selector" screen_loc = ui_attack_selector - maptext_y = 5 + maptext_y = 12 var/mob/living/carbon/human/owner /obj/screen/default_attack_selector/Click(location, control, params) diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index ec7b2849251..fec4974c071 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -128,16 +128,25 @@ occupant.SetStasis(stasis) /obj/machinery/sleeper/on_update_icon() - overlays.Cut() + cut_overlays() icon_state = "med_pod" + if(occupant) - var/image/pickle = new - pickle.appearance = occupant + var/mutable_appearance/pickle = new /mutable_appearance(occupant) + var/list/icon_scale_values = occupant.get_icon_scale_mult() + var/desired_scale_x = icon_scale_values[1] + var/desired_scale_y = icon_scale_values[2] + + var/matrix/M = matrix() + M.Scale(desired_scale_x, desired_scale_y) + M.Translate(0, (1.5 * world.icon_size) * (desired_scale_y - 1)) + pickle.transform = M + pickle.layer = FLOAT_LAYER pickle.pixel_z = 12 - overlays += pickle - var/image/I = image(icon, "med_lid[!!(occupant && !(stat & (BROKEN|NOPOWER)))]") - overlays += I + add_overlay(pickle) + + add_overlay(image(icon, "med_lid[!!(occupant && !(stat & (BROKEN|NOPOWER)))]")) /obj/machinery/sleeper/DefaultTopicState() return global.outside_topic_state diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 319df9873a4..35b2db95d8b 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -38,7 +38,7 @@ . = (loc == user && istype(over, /obj/screen)) || ..() /obj/item/storage/handle_mouse_drop(var/atom/over, var/mob/user) - if(canremove && (ishuman(user) || isrobot(user))) + if(canremove && (ishuman(user) || isrobot(user) || isanimal(user)) && !user.incapacitated(INCAPACITATION_DISRUPTED)) if(over == user) open(user) return TRUE @@ -50,6 +50,21 @@ return TRUE . = ..() +/obj/item/storage/AltClick(mob/user) + if(!canremove) + return + + if(!Adjacent(user)) + return + + if(!(ishuman(user) || isrobot(user) || issmall(user))) + return + + if(user.incapacitated(INCAPACITATION_DISRUPTED)) + return + + open(user) + /obj/item/storage/proc/return_inv() var/list/L = list( ) diff --git a/code/game/objects/items/weapons/storage/storage_ui/default.dm b/code/game/objects/items/weapons/storage/storage_ui/default.dm index 5ea7a3f7843..f51e1cac25e 100644 --- a/code/game/objects/items/weapons/storage/storage_ui/default.dm +++ b/code/game/objects/items/weapons/storage/storage_ui/default.dm @@ -176,22 +176,26 @@ row_num = round((adjusted_contents-1) / 7) // 7 is the maximum allowed width. arrange_item_slots(row_num, col_count) +#define SCREEN_LOC_MOD_FIRST 3 +#define SCREEN_LOC_MOD_SECOND 1.7 +#define SCREEN_LOC_MOD_DIVIDED (1.5 * world.icon_size) + //This proc draws out the inventory and places the items on it. It uses the standard position. -/datum/storage_ui/default/proc/arrange_item_slots(var/rows, var/cols) - var/cx = 4 - var/cy = 2+rows - boxes.screen_loc = "LEFT+3:16,BOTTOM+1.7:16 to LEFT+[3+cols]:16,BOTTOM+[1.7+rows]:16" +/datum/storage_ui/default/proc/arrange_item_slots(rows, cols) + var/cx = SCREEN_LOC_MOD_FIRST + var/cy = SCREEN_LOC_MOD_SECOND + rows + boxes.screen_loc = "LEFT+[SCREEN_LOC_MOD_FIRST]:[SCREEN_LOC_MOD_DIVIDED],BOTTOM+[SCREEN_LOC_MOD_SECOND]:[SCREEN_LOC_MOD_DIVIDED] to LEFT+[SCREEN_LOC_MOD_FIRST] + cols]:[SCREEN_LOC_MOD_DIVIDED],BOTTOM+[SCREEN_LOC_MOD_SECOND] + rows]:[SCREEN_LOC_MOD_DIVIDED]" for(var/obj/O in storage.contents) - O.screen_loc = "LEFT+[cx]:16,BOTTOM+[cy]:16" + O.screen_loc = "LEFT+[cx]:[SCREEN_LOC_MOD_DIVIDED],BOTTOM+[cy]:[SCREEN_LOC_MOD_DIVIDED]" O.maptext = "" O.hud_layerise() cx++ - if (cx > (4+cols)) - cx = 4 + if (cx > (SCREEN_LOC_MOD_FIRST + cols)) + cx = SCREEN_LOC_MOD_FIRST cy-- - closer.screen_loc = "LEFT+[4+cols+1]:16,BOTTOM+2:16" + closer.screen_loc = "LEFT+[SCREEN_LOC_MOD_FIRST] + cols + 1]:[SCREEN_LOC_MOD_DIVIDED],BOTTOM+[SCREEN_LOC_MOD_SECOND]:[SCREEN_LOC_MOD_DIVIDED]" /datum/storage_ui/default/proc/space_orient_objs() @@ -206,9 +210,9 @@ M.Scale((storage_width-storage_cap_width*2+3)/32,1) storage_continue.transform = M - storage_start.screen_loc = "LEFT+3:16,BOTTOM+1.7:16" - storage_continue.screen_loc = "LEFT+3:[storage_cap_width+(storage_width-storage_cap_width*2)/2+2],BOTTOM+1.7:16" - storage_end.screen_loc = "LEFT+3:[19+storage_width-storage_cap_width],BOTTOM+1.7:16" + storage_start.screen_loc = "LEFT+[SCREEN_LOC_MOD_FIRST]:[SCREEN_LOC_MOD_DIVIDED],BOTTOM+[SCREEN_LOC_MOD_SECOND]:[SCREEN_LOC_MOD_DIVIDED]" + storage_continue.screen_loc = "LEFT+[SCREEN_LOC_MOD_FIRST]:[storage_cap_width+(storage_width-storage_cap_width*2)/2+2],BOTTOM+[SCREEN_LOC_MOD_SECOND]:[SCREEN_LOC_MOD_DIVIDED]" + storage_end.screen_loc = "LEFT+[SCREEN_LOC_MOD_FIRST]:[19+storage_width-storage_cap_width],BOTTOM+[SCREEN_LOC_MOD_SECOND]:[SCREEN_LOC_MOD_DIVIDED]" var/startpoint = 0 var/endpoint = 1 @@ -231,11 +235,12 @@ storage_start.overlays += stored_continue storage_start.overlays += stored_end - O.screen_loc = "LEFT+3:[round((startpoint+endpoint)/2)+2-O.pixel_x],BOTTOM+1.7:[16-O.pixel_y]" + O.reset_offsets() + O.screen_loc = "LEFT+[SCREEN_LOC_MOD_FIRST]:[round((startpoint+endpoint)/2)+2-O.pixel_x],BOTTOM+[SCREEN_LOC_MOD_SECOND]:[SCREEN_LOC_MOD_DIVIDED]-O.pixel_y]" O.maptext = "" O.hud_layerise() - closer.screen_loc = "LEFT+3:[storage_width+19],BOTTOM+1.7:16" + closer.screen_loc = "LEFT+[SCREEN_LOC_MOD_FIRST]:[storage_width+19],BOTTOM+[SCREEN_LOC_MOD_SECOND]:[SCREEN_LOC_MOD_DIVIDED]" // Sets up numbered display to show the stack size of each stored mineral // NOTE: numbered display is turned off currently because it's broken @@ -249,3 +254,7 @@ arrange_item_slots(row_num, col_count) if(user && user.s_active) user.s_active.show_to(user) + +#undef SCREEN_LOC_MOD_FIRST +#undef SCREEN_LOC_MOD_SECOND +#undef SCREEN_LOC_MOD_DIVIDED diff --git a/code/modules/admin/buildmode/areas.dm b/code/modules/admin/buildmode/areas.dm index 0d86bb979ba..cd983e3ca2d 100644 --- a/code/modules/admin/buildmode/areas.dm +++ b/code/modules/admin/buildmode/areas.dm @@ -73,7 +73,7 @@ Right Click - List/Create Area var/used_colors = 0 var/list/max_colors = length(distinct_colors) var/list/vision_colors = list() - for (var/turf/T in range(get_effective_view(user.client), user)) + for (var/turf/T in range(user?.client?.view || world.view, user)) var/image/I = new('icons/turf/overlays.dmi', T, "whiteOverlay") var/ref = "\ref[T.loc]" if (!vision_colors[ref]) diff --git a/code/modules/admin/callproc/callproc.dm b/code/modules/admin/callproc/callproc.dm index 179751c6ba1..bf013e00126 100644 --- a/code/modules/admin/callproc/callproc.dm +++ b/code/modules/admin/callproc/callproc.dm @@ -120,7 +120,7 @@ return CANCEL switch(input("Type of [arguments.len+1]\th variable", "argument [arguments.len+1]") as null|anything in list( "finished", "null", "text", "num", "type", "obj reference", "mob reference", - "area/turf reference", "icon", "file", "client", "mob's area", "marked datum", "click on atom")) + "area/turf reference", "icon", "file", "client", "mob's area", "path", "marked datum", "click on atom")) if(null) return CANCEL @@ -177,6 +177,11 @@ if("Cancel") return CANCEL + if ("path") + current = text2path(input("Enter path for [arguments.len+1]\th argument") as null|text) + if (isnull(current)) + return CANCEL + if("marked datum") current = C.holder.marked_datum() if(!current) @@ -220,7 +225,7 @@ returnval = call(target, procname)() else log_admin("[key_name(src)] called [procname]() with [arguments.len ? "the arguments [list2params(arguments)]" : "no arguments"].") - returnval = call(procname)(arglist(arguments)) + returnval = call(text2path("/proc/[procname]"))(arglist(arguments)) to_chat(usr, "[procname]() returned: [json_encode(returnval)]") SSstatistics.add_field_details("admin_verb","APC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/map_capture.dm b/code/modules/admin/map_capture.dm index cdecac7c51e..903aed3dc5e 100644 --- a/code/modules/admin/map_capture.dm +++ b/code/modules/admin/map_capture.dm @@ -21,7 +21,7 @@ var/ligths = 0 if(alert("Do you want lighting to be included in capture?", "Map Capture", "No", "Yes") == "Yes") ligths = 1 - var/cap = generate_image(tx ,ty ,tz ,range, CAPTURE_MODE_PARTIAL, null, ligths, 1) + var/cap = create_area_image(tx ,ty ,tz, range, ligths) var/file_name = "map_capture_x[tx]_y[ty]_z[tz]_r[range].png" to_chat(usr, "Saved capture in cache as [file_name].") send_rsc(usr, cap, file_name) @@ -30,7 +30,7 @@ /datum/admins/proc/capture_map_capture_next(currentz, currentx, currenty, ligths) if(locate(currentx, currenty, currentz)) - var/cap = generate_image(currentx ,currenty ,currentz ,32, CAPTURE_MODE_PARTIAL, null, ligths, 1) + var/cap = create_area_image(currentx,currenty, currentz, 32, ligths) var/file_name = "map_capture_x[currentx]_y[currenty]_z[currentz]_r32.png" to_chat(usr, "Saved capture in cache as [file_name].") send_rsc(usr, cap, file_name) @@ -41,7 +41,7 @@ currenty = currenty + 32 currentx = 1 if(locate(currentx, currenty, currentz)) - var/cap = generate_image(currentx ,currenty ,currentz ,32, CAPTURE_MODE_PARTIAL, null, ligths, 1) + var/cap = create_area_image(currentx,currenty, currentz, 32, ligths) var/file_name = "map_capture_x[currentx]_y[currenty]_z[currentz]_r32.png" to_chat(usr, "Saved capture in cache as [file_name].") send_rsc(usr, cap, file_name) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 493796a8675..88c0d09cfa8 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -529,17 +529,18 @@ var/global/const/MAX_VIEW = 41 if(mob) mob.reload_fullscreen() -/client/proc/toggle_fullscreen(new_value) - if((new_value == PREF_BASIC) || (new_value == PREF_FULL)) - winset(src, "mainwindow", "is-maximized=false;can-resize=false;titlebar=false") - if(new_value == PREF_FULL) - winset(src, "mainwindow", "menu=null;statusbar=false") - winset(src, "mainwindow.split", "pos=0x0") - else - winset(src, "mainwindow", "is-maximized=false;can-resize=true;titlebar=true") - winset(src, "mainwindow", "menu=menu;statusbar=true") - winset(src, "mainwindow.split", "pos=3x0") - winset(src, "mainwindow", "is-maximized=true") +/client/proc/toggle_fullscreen(value) + set waitfor = FALSE + + winset(src, null, {" + mainwindow.is-maximized = false; + mainwindow.can-resize = [(value == PREF_BASIC) || (value == PREF_FULL) ? "false" : "true"]; + mainwindow.titlebar = [(value == PREF_BASIC) || (value == PREF_FULL) ? "false" : "true"]; + mainwindow.menu = [value == PREF_FULL ? "null" : "menu"]; + mainwindow.statusbar = [value == PREF_FULL ? "false" : "true"]; + mainwindow.split.pos = [(value == PREF_BASIC) || (value == PREF_FULL) ? "0x0" : "3x0"]; + "}) + winset(src, null, "mainwindow.is-maximized = true;") /client/verb/fit_viewport() set name = "Fit Viewport" diff --git a/code/modules/client/preference_setup/global/preferences.dm b/code/modules/client/preference_setup/global/preferences.dm index ebd6ace1a1f..d1d135e1317 100644 --- a/code/modules/client/preference_setup/global/preferences.dm +++ b/code/modules/client/preference_setup/global/preferences.dm @@ -205,8 +205,7 @@ var/global/list/_client_preferences_by_type /datum/client_preference/fullscreen_mode description = "Fullscreen Mode" key = "FULLSCREEN" - options = list(PREF_BASIC, PREF_FULL, PREF_NO) - default_value = PREF_NO + options = list(PREF_NO, PREF_BASIC, PREF_FULL) /datum/client_preference/fullscreen_mode/changed(mob/preference_mob, new_value) if(preference_mob.client) diff --git a/code/modules/client/ui_style.dm b/code/modules/client/ui_style.dm index eabc0ca3b5a..f20646370b6 100644 --- a/code/modules/client/ui_style.dm +++ b/code/modules/client/ui_style.dm @@ -26,40 +26,40 @@ var/global/all_tooltip_styles = list( /client/verb/change_ui() set name = "Change UI" - set category = "OOC" set desc = "Configure your user interface" + set category = "OOC" - if(!ishuman(usr)) - to_chat(usr, "You must be human to use this verb.") + if(!ishuman(mob)) + to_chat(src, SPAN_WARNING("You must be human to use this verb.")) return - var/UI_style_new = input(usr, "Select a style. White is recommended for customization") as null|anything in all_ui_styles - if(!UI_style_new) return - - var/UI_style_alpha_new = input(usr, "Select a new alpha (transparency) parameter for your UI, between 50 and 255") as null|num - if(!UI_style_alpha_new || !(UI_style_alpha_new <= 255 && UI_style_alpha_new >= 50)) + var/UI_style_new = input(src, "Select a style. White is recommended for customization", "Change UI: Style", prefs.UI_style) as null|anything in global.all_ui_styles + if(!UI_style_new) return - var/UI_style_color_new = input(usr, "Choose your UI color. Dark colors are not recommended!") as color|null + var/UI_style_color_new = input(src, "Choose your UI color. Dark colors are not recommended!", "Change UI: Color", prefs.UI_style_color) as color|null if(!UI_style_color_new) return - //update UI - var/list/icons = usr.hud_used.adding + usr.hud_used.other + usr.hud_used.hotkeybuttons - icons.Add(usr.zone_sel) - icons.Add(usr.gun_setting_icon) - icons.Add(usr.item_use_icon) - icons.Add(usr.gun_move_icon) - icons.Add(usr.radio_use_icon) + var/UI_style_alpha_new = input(src, "Select a new alpha (transparency) parameter for your UI, between 50 and 255", "Change UI: Alpha", prefs.UI_style_alpha) as null|num + if(!UI_style_alpha_new) + return + + UI_style_alpha_new = clamp(UI_style_alpha_new, 50, 255) + + var/list/icons = mob.hud_used.adding + mob.hud_used.other + mob.hud_used.hotkeybuttons - var/icon/ic = all_ui_styles[UI_style_new] + icons.Add( + mob.zone_sel, + mob.gun_setting_icon, + mob.item_use_icon, + mob.gun_move_icon, + mob.radio_use_icon + ) - for(var/obj/screen/I in icons) - if(I.name in list(I_HELP, I_HURT, I_DISARM, I_GRAB)) continue - I.icon = ic - I.color = UI_style_color_new - I.alpha = UI_style_alpha_new + var/icon/UI_style_icon_new = all_ui_styles[UI_style_new] + apply_ui_style(icons, UI_style_icon_new, UI_style_color_new, UI_style_alpha_new) if(alert("Like it? Save changes?",,"Yes", "No") == "Yes") prefs.UI_style = UI_style_new @@ -67,3 +67,12 @@ var/global/all_tooltip_styles = list( prefs.UI_style_color = UI_style_color_new SScharacter_setup.queue_preferences_save(prefs) to_chat(usr, "Your UI settings were saved.") + else + apply_ui_style(icons) + +/client/proc/apply_ui_style(list/atoms, ui_icon = all_ui_styles[prefs.UI_style], ui_color = prefs.UI_style_color, ui_alpha = prefs.UI_style_alpha) + for(var/obj/screen/S in atoms) + if(!(S.name in list(I_HELP, I_HURT, I_DISARM, I_GRAB))) + S.icon = ui_icon + S.color = ui_color + S.alpha = ui_alpha diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 24d3e43ab7a..dfc05cfb3f7 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -171,7 +171,7 @@ next_sonar_ping += 10 SECONDS var/heard_something = FALSE to_chat(src, "You take a moment to listen in to your environment...") - for(var/mob/living/L in range(get_effective_view(client), src)) + for(var/mob/living/L in range(client?.view || world.view, src)) var/turf/T = get_turf(L) if(!T || L == src || L.stat == DEAD || is_below_sound_pressure(T)) continue diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index dbc93bf06e3..48b62fae6a0 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -240,14 +240,16 @@ Please contact me on #coderbus IRC. ~Carn x turn_angle = pick(-90, 90) M.Turn(turn_angle) M.Scale(desired_scale_y, desired_scale_x) - M.Translate(1, -6-default_pixel_z) + M.Translate(turn_angle == 90 ? 1 : -2, (turn_angle == 90 ? -6 : -5) - default_pixel_z) else M.Scale(desired_scale_x, desired_scale_y) - M.Translate(0, 16*(desired_scale_y-1)) + M.Translate(0, 16 * (desired_scale_y - 1)) + if(transform_animate_time) animate(src, transform = M, time = transform_animate_time) else transform = M + return transform var/global/list/damage_icon_parts = list() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 9de86c53f62..3f274e02aa1 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -602,6 +602,7 @@ default behaviour is: return resting = !resting UpdateLyingBuckledAndVerbStatus() + update_icon() to_chat(src, SPAN_NOTICE("You are now [resting ? "resting" : "getting up"].")) //called when the mob receives a bright flash diff --git a/code/modules/mob/living/simple_animal/friendly/mouse.dm b/code/modules/mob/living/simple_animal/friendly/mouse.dm index 442359e40af..566a122645f 100644 --- a/code/modules/mob/living/simple_animal/friendly/mouse.dm +++ b/code/modules/mob/living/simple_animal/friendly/mouse.dm @@ -54,10 +54,6 @@ else if(prob(5)) INVOKE_ASYNC(src, .proc/audible_emote, "snuffles.") -/mob/living/simple_animal/mouse/lay_down() - ..() - icon_state = resting ? "mouse_[body_color]_sleep" : "mouse_[body_color]" - /mob/living/simple_animal/mouse/Initialize() verbs += /mob/living/proc/ventcrawl verbs += /mob/living/proc/hide diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 9532faf3a58..a208a54d7d4 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -119,10 +119,10 @@ icon_state = ICON_STATE_WORLD if(stat == DEAD && (mob_icon_state_flags & MOB_ICON_HAS_DEAD_STATE)) icon_state += "-dead" - else if(!incapacitated() && resting && (mob_icon_state_flags & MOB_ICON_HAS_REST_STATE)) - icon_state += "-resting" - else if((lying || incapacitated()) && (mob_icon_state_flags & MOB_ICON_HAS_SLEEP_STATE)) + else if(stat == UNCONSCIOUS && (mob_icon_state_flags & MOB_ICON_HAS_SLEEP_STATE)) icon_state += "-sleeping" + else if(resting && (mob_icon_state_flags & MOB_ICON_HAS_REST_STATE)) + icon_state += "-resting" z_flags &= ~ZMM_MANGLE_PLANES if(stat == CONSCIOUS) diff --git a/code/modules/modular_computers/os/subtypes/device.dm b/code/modules/modular_computers/os/subtypes/device.dm index dc8f05fbc87..a786e8b4927 100644 --- a/code/modules/modular_computers/os/subtypes/device.dm +++ b/code/modules/modular_computers/os/subtypes/device.dm @@ -32,12 +32,6 @@ if(assembly && assembly.enabled) assembly.shutdown_device() -/datum/extension/interactive/os/device/system_boot() - ..() - if(holder) - var/datum/extension/assembly/modular_computer/assembly = get_extension(holder, /datum/extension/assembly) - return assembly && assembly.turn_on() - /datum/extension/interactive/os/device/extension_act(href, href_list, user) . = ..() var/obj/item/modular_computer/C = holder diff --git a/code/modules/nano/interaction/default.dm b/code/modules/nano/interaction/default.dm index 3c00638f3b6..307134c5b5e 100644 --- a/code/modules/nano/interaction/default.dm +++ b/code/modules/nano/interaction/default.dm @@ -25,7 +25,7 @@ var/global/datum/topic_state/default/default_topic_state = new return // robots can interact with things they can see within their view range - if((src_object in view(src)) && get_dist(src_object, src) <= get_effective_view(client)) + if((src_object in view(client?.view || world.view, src)) && get_dist(src_object, src) <= get_effective_view(client)) return STATUS_INTERACTIVE // interactive (green visibility) return STATUS_DISABLED // no updates, completely disabled (red visibility) @@ -42,7 +42,7 @@ var/global/datum/topic_state/default/default_topic_state = new return STATUS_CLOSE // If an object is in view then we can interact with it - if(src_object in view(get_effective_view(client), src)) + if(src_object in view(client.view, src)) return STATUS_INTERACTIVE // If we're installed in a chassi, rather than transfered to an inteliCard or other container, then check if we have camera view diff --git a/code/modules/nano/interaction/view.dm b/code/modules/nano/interaction/view.dm index 72c1ba2a7e9..328d83f20fa 100644 --- a/code/modules/nano/interaction/view.dm +++ b/code/modules/nano/interaction/view.dm @@ -9,7 +9,7 @@ var/global/datum/topic_state/view/view_topic_state = new /mob/proc/view_can_use_topic(src_object) if(!client) return STATUS_CLOSE - if(src_object in view(get_effective_view(client), src)) + if(src_object in view(client.view, src)) return shared_nano_interaction(src_object) return STATUS_CLOSE diff --git a/code/modules/overmap/events/event.dm b/code/modules/overmap/events/event.dm index d3a9289811d..e3ac5c555f4 100644 --- a/code/modules/overmap/events/event.dm +++ b/code/modules/overmap/events/event.dm @@ -14,7 +14,7 @@ // Acquire the list of not-yet utilized overmap turfs on this Z-level var/list/candidate_turfs = block(locate(OVERMAP_EDGE, OVERMAP_EDGE, overmap.assigned_z),locate(overmap.map_size_x - OVERMAP_EDGE, overmap.map_size_y - OVERMAP_EDGE, overmap.assigned_z)) - candidate_turfs = where(candidate_turfs, /proc/can_not_locate, /obj/effect/overmap/visitable) + candidate_turfs = where(candidate_turfs, /proc/can_not_locate, /obj/effect/overmap) for(var/i = 1 to overmap.event_areas) if(!candidate_turfs.len) diff --git a/code/modules/overmap/sectors.dm b/code/modules/overmap/sectors.dm index 1c6f6b034bc..89a5ac137b7 100644 --- a/code/modules/overmap/sectors.dm +++ b/code/modules/overmap/sectors.dm @@ -14,8 +14,11 @@ var/global/list/known_overmap_sectors var/list/restricted_waypoints = list() //waypoints for specific shuttle types var/docking_codes - var/start_x //Coordinates for self placing - var/start_y //will use random values if unset + // Custom spawn coordinates. Will pick random place if one of them or both not set. + /// Custom X coordinate to spawn. Require `start_y` set to work. + var/start_x + /// Custom Y coordinate to spawn. Require `start_x` set to work. + var/start_y var/sector_flags = OVERMAP_SECTOR_IN_SPACE @@ -96,9 +99,24 @@ var/global/list/known_overmap_sectors /obj/effect/overmap/visitable/proc/move_to_starting_location() var/datum/overmap/overmap = global.overmaps_by_name[overmap_id] - start_x = start_x || rand(OVERMAP_EDGE, overmap.map_size_x - OVERMAP_EDGE) - start_y = start_y || rand(OVERMAP_EDGE, overmap.map_size_y - OVERMAP_EDGE) - forceMove(locate(start_x, start_y, overmap.assigned_z)) + var/location + + if(start_x && start_y) + location = locate(start_x, start_y, overmap.assigned_z) + else + var/list/candidate_turfs = block( + locate(OVERMAP_EDGE, OVERMAP_EDGE, overmap.assigned_z), + locate(overmap.map_size_x - OVERMAP_EDGE, overmap.map_size_y - OVERMAP_EDGE, overmap.assigned_z) + ) + + candidate_turfs = where(candidate_turfs, /proc/can_not_locate, /obj/effect/overmap) + location = SAFEPICK(candidate_turfs) || locate( + rand(OVERMAP_EDGE, overmap.map_size_x - OVERMAP_EDGE), + rand(OVERMAP_EDGE, overmap.map_size_y - OVERMAP_EDGE), + overmap.assigned_z + ) + + forceMove(location) //This is called later in the init order by SSshuttle to populate sector objects. Importantly for subtypes, shuttles will be created by then. /obj/effect/overmap/visitable/proc/populate_sector_objects() diff --git a/code/modules/overmap/ships/computers/ship.dm b/code/modules/overmap/ships/computers/ship.dm index 015580998c3..915dc88f5b7 100644 --- a/code/modules/overmap/ships/computers/ship.dm +++ b/code/modules/overmap/ships/computers/ship.dm @@ -60,7 +60,11 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov if(linked) user.reset_view(linked) if(user.client) - user.client.view = world.view + extra_view + if(istext(user.client.view)) + var/list/retrieved_view = splittext(user.client.view, "x") + user.client.view = "[text2num(retrieved_view[1]) + extra_view]x[text2num(retrieved_view[2]) + extra_view]" + else + user.client.view = user.client.view + extra_view if(linked) for(var/obj/machinery/computer/ship/sensors/sensor in linked.get_linked_machines_of_type(/obj/machinery/computer/ship)) sensor.reveal_contacts(user) @@ -75,9 +79,7 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov /obj/machinery/computer/ship/proc/unlook(var/mob/user) user.reset_view() if(user.client) - user.client.view = world.view user.client.OnResize() - user.reset_view() if(linked) for(var/obj/machinery/computer/ship/sensors/sensor in linked.get_linked_machines_of_type(/obj/machinery/computer/ship)) sensor.hide_contacts(user) diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 1631ff94409..cb52bfce618 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -148,12 +148,14 @@ var/global/photo_count = 0 var/icon_on = "camera" var/icon_off = "camera_off" var/size = 3 + /obj/item/camera/on_update_icon() var/datum/extension/base_icon_state/bis = get_extension(src, /datum/extension/base_icon_state) if(on) icon_state = "[bis.base_icon_state]" else icon_state = "[bis.base_icon_state]_off" + /obj/item/camera/Initialize() set_extension(src, /datum/extension/base_icon_state, icon_state) update_icon() @@ -249,7 +251,7 @@ var/global/photo_count = 0 var/x_c = target.x - (size-1)/2 var/y_c = target.y - (size-1)/2 var/z_c = target.z - var/icon/photoimage = generate_image(x_c, y_c, z_c, size, CAPTURE_MODE_REGULAR, user, 0) + var/icon/photoimage = create_area_image(x_c, y_c, z_c, size, TRUE, user) var/obj/item/photo/p = new() p.img = photoimage diff --git a/icons/mob/simple_animal/mouse_brown.dmi b/icons/mob/simple_animal/mouse_brown.dmi index 07342b037bb..d0d96de3b96 100644 Binary files a/icons/mob/simple_animal/mouse_brown.dmi and b/icons/mob/simple_animal/mouse_brown.dmi differ diff --git a/icons/mob/simple_animal/mouse_gray.dmi b/icons/mob/simple_animal/mouse_gray.dmi index 75ae47282b0..b654709066e 100644 Binary files a/icons/mob/simple_animal/mouse_gray.dmi and b/icons/mob/simple_animal/mouse_gray.dmi differ diff --git a/icons/mob/simple_animal/mouse_white.dmi b/icons/mob/simple_animal/mouse_white.dmi index a555c025406..2117dde5251 100644 Binary files a/icons/mob/simple_animal/mouse_white.dmi and b/icons/mob/simple_animal/mouse_white.dmi differ diff --git a/nano/css/shared.css b/nano/css/shared.css index 5e22c05b339..787fd71b78c 100644 --- a/nano/css/shared.css +++ b/nano/css/shared.css @@ -41,8 +41,18 @@ hr { border: 1px solid #00ff00; padding: 0px 4px 4px 4px; margin: 0 2px 2px 0; - cursor: default; white-space: nowrap; + cursor: pointer; +} + +.link:hover, .greenButton:hover{ + background: #009c00 !important; +} +.redButton:hover{ + background: #9c0202 !important; +} +.yellowButton:hover{ + background: #848601 !important; } .hasIcon { @@ -86,10 +96,11 @@ a.white:hover { background: #2f943c; } -.linkOff, a.linkOff:link, a.linkOff:visited, a.linkOff:active, a.linkOff:hover, .disabled, a.disabled:link, a.disabled:visited, a.disabled:active, a.disabled:hover { +.linkOff, a.linkOff:link, a.linkOff:visited, a.linkOff:active, a.linkOff:hover, .disabled, .disabled:hover, a.disabled:link, a.disabled:visited, a.disabled:active, a.disabled:hover { color: #ffffff; - background: #999999; + background: #999999 !important; border-color: #666666; + cursor: default; } a.icon, .linkOn.icon, .linkOff.icon, .selected.icon, .disabled.icon { diff --git a/test/check-paths.sh b/test/check-paths.sh index 5e2265ea09a..4619de3b713 100755 --- a/test/check-paths.sh +++ b/test/check-paths.sh @@ -37,7 +37,7 @@ exactly 1 "world.log<< uses" 'world.log<<|world.log[[:space:]]<<' exactly 18 "<< uses" '(?> uses" '>>(?!>)' -P exactly 0 "incorrect indentations" '^( {4,})' -P -exactly 20 "text2path uses" 'text2path' +exactly 22 "text2path uses" 'text2path' exactly 4 "update_icon() override" '/update_icon\((.*)\)' -P exactly 0 "goto uses" 'goto ' exactly 6 "atom/New uses" '^/(obj|atom|area|mob|turf).*/New\('