Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Barsigns now start always showing closed #2031

Merged
merged 3 commits into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 10 additions & 21 deletions code/game/objects/structures/barsign.dm
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
/obj/structure/sign/double/barsign
desc = "A jumbo-sized LED sign. This one seems to be showing its age."
icon = 'icons/obj/structures/barsigns.dmi'
icon_state = "on"
icon_state = "Closed"
appearance_flags = DEFAULT_APPEARANCE_FLAGS
anchored = TRUE
var/cult = 0

/obj/structure/sign/double/barsign/proc/get_valid_states(initial=1)
. = icon_states(icon)
. -= ""
. -= "on"
. -= "narsiebistro"
. -= "empty"
if(initial)
. -= "Off"

/obj/structure/sign/double/barsign/examine(mob/user)
. = ..()
Expand Down Expand Up @@ -57,23 +47,15 @@
else
to_chat(user, "It says '[icon_state]'")

/obj/structure/sign/double/barsign/New()
..()
icon_state = pick(get_valid_states())


/obj/structure/sign/double/barsign/use_tool(obj/item/tool, mob/user, list/click_params)
// ID Card - Change barsign
var/obj/item/card/id/id = tool.GetIdCard()
if (istype(id))
var/id_name = GET_ID_NAME(id, tool)
if (!check_access(id))
USE_FEEDBACK_ID_CARD_DENIED(src, id_name)
return TRUE
if (cult)
USE_FEEDBACK_FAILURE("\The [src]'s display can't be changed.")
return TRUE
var/input = input(user, "What would you like to change the barsign to?") as null|anything in get_valid_states(FALSE)
var/input = input(user, "What would you like to change the barsign to?") as null|anything in get_valid_states()
if (!input || input == icon_state || !user.use_sanity_check(src, tool))
return TRUE
icon_state = input
Expand All @@ -82,5 +64,12 @@
SPAN_NOTICE("You update \the [src]'s display with [id_name].")
)
return TRUE

return ..()


/obj/structure/sign/double/barsign/proc/get_valid_states()
return icon_states(icon) - list(
"empty",
"narsiebistro",
"on"
)