Skip to content

Commit

Permalink
crate shelf UX tweaks (#2605)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
changes up description and UI interactions of crate shelves. Mouse
cursor will now switch to a drag+drop cursor when clickdragging crates,
and the description is more descriptive. also changes spans to use the
cleaner span_blahblah() proc
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

🆑 
tweak: cursor will now switch to a clickdrag cursor when clickdragging
crates
tweak: crate shelf description improved
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
GenericDM authored Dec 22, 2023
1 parent be80cd1 commit 2bac953
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions code/game/objects/structures/crates_lockers/crates.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
allow_dense = TRUE
dense_when_open = TRUE
climbable = TRUE
mouse_drag_pointer = TRUE
climb_time = 10 //real fast, because let's be honest stepping into or onto a crate is easy
delivery_icon = "deliverycrate"
open_sound = 'sound/machines/crate_open.ogg'
Expand Down
24 changes: 12 additions & 12 deletions code/game/objects/structures/crateshelf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
var/use_delay = DEFAULT_SHELF_USE_DELAY
var/list/shelf_contents

/obj/structure/crate_shelf/tall
/obj/structure/crate_shelf/debug
capacity = 12

/obj/structure/crate_shelf/Initialize()
Expand All @@ -38,12 +38,12 @@

/obj/structure/crate_shelf/examine(mob/user)
. = ..()
. += "<span class='notice'>There are some <b>bolts</b> holding [src] together.</span>"
. += span_notice("There are some <b>bolts</b> holding [src] together.")
if(shelf_contents.Find(null)) // If there's an empty space in the shelf, let the examiner know.
. += "<span class='notice'>You could <b>drag</b> a crate into [src]."
. += span_notice("You could <b>drag and drop</b> a crate into [src].")
if(contents.len) // If there are any crates in the shelf, let the examiner know.
. += "<span class='notice'>You could <b>drag</b> a crate out of [src]."
. += "<span class='notice'>[src] contains:</span>"
. += span_notice("You could <b>drag and drop</b> a crate out of [src].")
. += span_notice("[src] contains:")
for(var/obj/structure/closet/crate/crate in shelf_contents)
. += " [icon2html(crate, user)] [crate]"

Expand All @@ -56,13 +56,13 @@
return ..()

/obj/structure/crate_shelf/relay_container_resist_act(mob/living/user, obj/structure/closet/crate)
to_chat(user, "<span class='notice'>You begin attempting to knock [crate] out of [src].</span>")
to_chat(user, span_notice("You begin attempting to knock [crate] out of [src]"))
if(do_after(user, 30 SECONDS, target = crate))
if(!user || user.stat != CONSCIOUS || user.loc != crate || crate.loc != src)
return // If the user is in a strange condition, return early.
visible_message("<span class='warning'>[crate] falls off of [src]!</span>",
"<span class='notice'>You manage to knock [crate] free of [src].</span>",
"<span class='notice>You hear a thud.</span>")
visible_message(span_warning("[crate] falls off of [src]!"),
span_notice("You manage to knock [crate] free of [src]"),
span_notice("You hear a thud."))
crate.forceMove(drop_location()) // Drop the crate onto the shelf,
step_rand(crate, 1) // Then try to push it somewhere.
crate.layer = initial(crate.layer) // Reset the crate back to having the default layer, otherwise we might get strange interactions.
Expand Down Expand Up @@ -125,12 +125,12 @@
if(1) // Believe it or not, this does nothing.
if(2) // Open the crate!
if(crate.open()) // Break some open, cause a little chaos.
crate.visible_message("<span class='warning'>[crate]'s lid falls open!</span>")
crate.visible_message(span_warning("[crate]'s lid falls open!"))
else // If we somehow fail to open the crate, just break it instead!
crate.visible_message("<span class='warning'>[crate] falls apart!")
crate.visible_message(span_warning("[crate] falls apart!"))
crate.deconstruct()
if(3) // Break that crate!
crate.visible_message("<span class='warning'>[crate] falls apart!")
crate.visible_message(span_warning("[crate] falls apart!"))
crate.deconstruct()
shelf_contents[shelf_contents.Find(crate)] = null
if(!(flags_1&NODECONSTRUCT_1))
Expand Down

0 comments on commit 2bac953

Please sign in to comment.