From 5b2e3fdfef8284a858166ffcf9de0887a8582943 Mon Sep 17 00:00:00 2001 From: Fluffy <65877598+FluffyGhoster@users.noreply.github.com> Date: Tue, 20 Aug 2024 21:19:17 +0200 Subject: [PATCH] Flags are now opaque when deployed, blocking the view (#19800) Flags are now opaque when deployed, blocking the view. Fixed a spelling error. Minimal code cleanup. --- code/game/objects/structures/flags_banners.dm | 38 +++++------- .../fluffyghost-flagsobscurevisual.yml | 60 +++++++++++++++++++ 2 files changed, 74 insertions(+), 24 deletions(-) create mode 100644 html/changelogs/fluffyghost-flagsobscurevisual.yml diff --git a/code/game/objects/structures/flags_banners.dm b/code/game/objects/structures/flags_banners.dm index 5f760916cad..ad1d8da05db 100644 --- a/code/game/objects/structures/flags_banners.dm +++ b/code/game/objects/structures/flags_banners.dm @@ -22,6 +22,7 @@ desc = "Nothing to see here." icon = 'icons/obj/structure/flags.dmi' icon_state = "flag" + opacity = TRUE ///If a big flag, the other half of the flag is referenced here var/obj/structure/sign/flag/linked_flag @@ -51,17 +52,6 @@ else flag_path = icon_state - if(deploy) - switch(dir) - if(NORTH) - pixel_y = 32 - if(SOUTH) - pixel_y = -32 - if(EAST) - pixel_x = 32 - if(WEST) - pixel_x = -32 - if(linked_flag_path) icon_state = "[linked_flag_path]_r" ripped_outline_state = "flag_ripped_r" @@ -74,23 +64,21 @@ //Handles the creation of the large flags and single flags if(flag_size) create_other_half(loc, dir, flag_path, icon, pixel_x, pixel_y) + else icon_state = "[flag_path]" flag_icon = new(icon, icon_state) shading_icon = new('icons/obj/structure/flags.dmi', "flag") flag_icon.Blend(shading_icon, ICON_MULTIPLY) - var/turf/T = get_step(loc, dir) - if(iswall(T)) + + //If on a wall or window, just use the icon, otherwise also add the stand the flag is hanged on + if(iswall(loc) || (locate(/obj/structure/window) in loc)) + icon = flag_icon + else + banner_icon = new('icons/obj/structure/flags.dmi', stand_icon) + flag_icon.Blend(banner_icon, ICON_UNDERLAY) + verbs += /obj/structure/sign/flag/proc/toggle icon = flag_icon - return - for(var/obj/A in T) - if(istype(A, /obj/structure/window)) - icon = flag_icon - return - banner_icon = new('icons/obj/structure/flags.dmi', stand_icon) - flag_icon.Blend(banner_icon, ICON_UNDERLAY) - verbs += /obj/structure/sign/flag/proc/toggle - icon = flag_icon /** * If the flag is a big flag, handles the creation and alignment of the other half of it @@ -184,7 +172,7 @@ user.visible_message(SPAN_NOTICE("\The [user] fastens \the [src] to \the [A]."), SPAN_NOTICE("You fasten \the [src] to \the [A].")) user.drop_from_inventory(src) - new flag_structure(user.loc, placement_dir, deploy = TRUE, item_flag_path = flag_path) + new flag_structure(get_turf(A), placement_dir, deploy = TRUE, item_flag_path = flag_path) qdel(src) @@ -240,7 +228,7 @@ user.visible_message(SPAN_WARNING("\The [user] starts to grab hold of \the [src] with destructive intent!"), SPAN_WARNING("You grab hold of \the [src] with destructive intent!"),) if(!do_after(user, 5 SECONDS, src)) return FALSE - user.visible_message(SPAN_WARNING("\The [user] rips \the [src] in a single, decisive motion!"), SPAN_WARNING("You \the [src] in a single, decisive motion!")) + user.visible_message(SPAN_WARNING("\The [user] rips \the [src] in a single, decisive motion!"), SPAN_WARNING("You rip \the [src] in a single, decisive motion!")) playsound(src.loc, 'sound/items/poster_ripped.ogg', 100, 1) add_fingerprint(user) rip(user) @@ -256,6 +244,8 @@ name = "ripped flag" desc = "You can't make out anything from the flag's original print. It's ruined." ripped = TRUE + opacity = FALSE + if(rip_linked) var/obj/item/stack/material/cloth/C = new(src.loc, flag_size ? 2 : 1) if(user) diff --git a/html/changelogs/fluffyghost-flagsobscurevisual.yml b/html/changelogs/fluffyghost-flagsobscurevisual.yml new file mode 100644 index 00000000000..808d9d7b54f --- /dev/null +++ b/html/changelogs/fluffyghost-flagsobscurevisual.yml @@ -0,0 +1,60 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: FluffyGhost + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Flags are now opaque when deployed, blocking the view." + - bugfix: "Fixed a spelling error." + - code_imp: "Minimal code cleanup."