mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 20:16:55 +01:00
Port TG updating appearances (#17943)
* Get pants that match or else you gonna look silly yo
* Posters
* Fix other hud elements
* Rereviewed
* Update shotglass.dm
* Fix for new merged PRs
* Typo
* Coming across other stuff
* Update theblob.dm
* No takebacksies
* smh i forget to leave a comment
* Updated for the detgun and cards
* Should have rerun langserver again
* No longer plastic, more in scope
* Damn you bluespace
* Reverting turret logic, out of scope at this point
* Tweak that part
* Went over energy guns again, and fixed UI White's sprite sheet
* Welding masks, glasses, and JUSTICE
* Update portable_atmospherics.dm
* Cleaning up, clearing things up
* Review and suggestions
* Update valve.dm
* More tweaks
* Missing character
* Not distinct lightmasks, so they can be overlays
* Update generator.dm
* Add parameter so holodeck doesn't try to make a perfect copy
* Update unsorted.dm
* Spiders
* Better fix for spiders, fix vamps too
* Ghosts
* Update telekinesis.dm
* Cleaning up old procs
* It's set up to not copy datums... Unless they're in a list
* Donuts, duct tape, and detgun. D3VR coming to Early Access
* Update procs that interact with doors so they call update_state instead
* Forgot one spot, and actually might as well just force lock
* Cleaning up other things... Sigh, and kitty ears
* oops
* Getting used to how it works
* blinds
* Going back to the suit obscuring thing, so it doesn't update all the time
* Missed that from merging master
* I made this PR and forgot about it
* Fix runtimes in cards
* Make things a bit more unified
* Update update_icons.dm
* yarn, really?
* Update library_equipment.dm
* Update shieldgen.dm
* Every time Charlie merges something, I go back and see if I can improve things further
* what's this? more?
* Update misc_special.dm
* wow, paper
* Review
* More reviews
* To be sure, seems like being broken messed something sometimes
* Brought airlocks closer to how TG works to iron out some stuff
* Pizza and morgue
* Doesn't seem to hurt, tried with holodeck
* Revert "Doesn't seem to hurt, tried with holodeck"
This reverts commit 158529302b.
* Icon conflict
* Fix organ damage
* Don't ask how. Why. It's like that on prod too.
* Cutting down on things and updating from TG.
* More flexible. Just in case the thing you stuck it on didn't destroy.
* Hydro was one the things I touched earlier on, better rework it
* Reviews
* Cleaning up further, also bri'ish
* Undo a change I did, and switch over to a more recent implementation
* Update biogenerator.dm
* Rolling back to old airlocks, but with new duct taped note
* Functionally the same. I'd just rather not have the smoothing happen there
* Went over APCs again
* Fix welding helmet names in species files
* Update airlock.dm
* Update persistent_overlay.dm
* Oh, topic
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
for(var/jokers in 1 to 2)
|
||||
cards += new /datum/playingcard("Joker", "sc_Joker_[card_style]", "singlecard_down_[card_style]")
|
||||
|
||||
/obj/item/deck/cards/update_icon()
|
||||
/obj/item/deck/cards/update_icon_state()
|
||||
if(!length(cards))
|
||||
icon_state = "deck_[card_style]_empty"
|
||||
return
|
||||
@@ -78,7 +78,7 @@
|
||||
card_style = "simple"
|
||||
simple_deck = TRUE
|
||||
|
||||
/obj/item/deck/cards/tiny/update_icon()
|
||||
/obj/item/deck/cards/tiny/update_icon_state()
|
||||
return
|
||||
|
||||
/obj/item/deck/cards/tiny/doublecards
|
||||
|
||||
+53
-24
@@ -53,7 +53,7 @@
|
||||
for(var/deck in 1 to deck_size)
|
||||
build_deck()
|
||||
deck_total = length(cards)
|
||||
update_icon()
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
/obj/item/deck/proc/build_deck()
|
||||
return
|
||||
@@ -66,7 +66,7 @@
|
||||
cards += P
|
||||
qdel(H)
|
||||
to_chat(user,"<span class='notice'>You place your cards on the bottom of [src]</span>.")
|
||||
update_icon()
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
return
|
||||
else
|
||||
to_chat(user,"<span class='warning'>You can't mix cards from different decks!</span>")
|
||||
@@ -159,10 +159,10 @@
|
||||
var/datum/playingcard/P = cards[1]
|
||||
H.cards += P
|
||||
cards -= P
|
||||
update_icon()
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
H.parentdeck = src
|
||||
H.update_values()
|
||||
H.update_icon()
|
||||
H.update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
|
||||
user.visible_message("<span class='notice'>[user] draws a card.</span>","<span class='notice'>You draw a card.</span>")
|
||||
to_chat(user,"<span class='notice'>It's the [P].</span>")
|
||||
|
||||
@@ -224,11 +224,11 @@
|
||||
for(var/i in 1 to dcard)
|
||||
H.cards += cards[1]
|
||||
cards -= cards[1]
|
||||
update_icon()
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
H.parentdeck = src
|
||||
H.update_values()
|
||||
H.concealed = TRUE
|
||||
H.update_icon()
|
||||
H.update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
|
||||
if(user == target)
|
||||
user.visible_message("<span class='notice'>[user] deals [dcard] card(s) to \himself.</span>")
|
||||
else
|
||||
@@ -298,7 +298,7 @@
|
||||
user.unEquip(src, force = 1)
|
||||
qdel(src)
|
||||
|
||||
H.update_icon()
|
||||
H.update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
|
||||
user.put_in_hands(H)
|
||||
|
||||
/obj/item/cardhand
|
||||
@@ -341,7 +341,7 @@
|
||||
P.name = t
|
||||
// SNOWFLAKE FOR CAG, REMOVE IF OTHER CARDS ARE ADDED THAT USE THIS.
|
||||
P.card_icon = "cag_white_card"
|
||||
update_icon()
|
||||
update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
|
||||
else if(istype(O,/obj/item/cardhand))
|
||||
var/obj/item/cardhand/H = O
|
||||
if((length(H.cards) + length(cards)) > maxcardlen)
|
||||
@@ -352,7 +352,7 @@
|
||||
H.cards += P
|
||||
H.concealed = concealed
|
||||
qdel(src)
|
||||
H.update_icon()
|
||||
H.update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
|
||||
return
|
||||
else
|
||||
to_chat(user,"<span class='notice'>You cannot mix cards from other deck!</span>")
|
||||
@@ -368,7 +368,7 @@
|
||||
|
||||
/obj/item/cardhand/proc/turn_hand(mob/user)
|
||||
concealed = !concealed
|
||||
update_icon()
|
||||
update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
|
||||
user.visible_message("<span class='notice'>[user] [concealed ? "conceals" : "reveals"] their hand.</span>")
|
||||
|
||||
/obj/item/cardhand/interact(mob/user)
|
||||
@@ -411,7 +411,18 @@
|
||||
button_icon_state = "remove_card"
|
||||
use_itemicon = FALSE
|
||||
|
||||
/datum/action/item_action/remove_card/IsAvailable()
|
||||
var/obj/item/cardhand/C = target
|
||||
if(length(C.cards) <= 1)
|
||||
return FALSE
|
||||
var/mob/living/carbon/human/O = owner
|
||||
if(O.l_hand && O.r_hand)
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/action/item_action/remove_card/Trigger()
|
||||
if(!IsAvailable())
|
||||
return
|
||||
if(istype(target, /obj/item/cardhand))
|
||||
var/obj/item/cardhand/C = target
|
||||
return C.Removecard()
|
||||
@@ -464,11 +475,11 @@
|
||||
H.parentdeck = parentdeck
|
||||
H.update_values()
|
||||
H.concealed = concealed
|
||||
H.update_icon()
|
||||
H.update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
|
||||
if(!length(cards))
|
||||
qdel(src)
|
||||
return
|
||||
update_icon()
|
||||
update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/cardhand/verb/discard()
|
||||
|
||||
@@ -487,7 +498,10 @@
|
||||
for(var/datum/playingcard/P in cards)
|
||||
to_discard[P.name] = P
|
||||
var/discarding = input("Which card do you wish to put down?") as null|anything in to_discard
|
||||
|
||||
|
||||
if(!discarding)
|
||||
continue
|
||||
|
||||
if(QDELETED(src))
|
||||
return
|
||||
|
||||
@@ -501,9 +515,9 @@
|
||||
H.parentdeck = parentdeck
|
||||
H.update_values()
|
||||
H.direction = user.dir
|
||||
H.update_icon()
|
||||
H.update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
|
||||
if(length(cards))
|
||||
update_icon()
|
||||
update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
|
||||
if(length(H.cards))
|
||||
user.visible_message("<span class='notice'>[user] plays the [discarding].</span>", "<span class='notice'>You play the [discarding].</span>")
|
||||
H.loc = get_step(user, user.dir)
|
||||
@@ -511,19 +525,34 @@
|
||||
if(!length(cards))
|
||||
qdel(src)
|
||||
|
||||
/obj/item/cardhand/update_icon()
|
||||
|
||||
/obj/item/cardhand/update_appearance(updates=ALL)
|
||||
if(!length(cards))
|
||||
return
|
||||
else if(length(cards) > 1)
|
||||
if(length(cards) <= 2)
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
..()
|
||||
|
||||
/obj/item/cardhand/update_name()
|
||||
. = ..()
|
||||
if(length(cards) > 1)
|
||||
name = "hand of cards"
|
||||
desc = "Some playing cards."
|
||||
else
|
||||
name = "a playing card"
|
||||
|
||||
/obj/item/cardhand/update_desc()
|
||||
. = ..()
|
||||
if(length(cards) > 1)
|
||||
desc = "Some playing cards."
|
||||
else
|
||||
desc = "A playing card."
|
||||
|
||||
cut_overlays()
|
||||
/obj/item/cardhand/update_icon_state()
|
||||
return
|
||||
|
||||
/obj/item/cardhand/update_overlays()
|
||||
. = ..()
|
||||
var/matrix/M = matrix()
|
||||
switch(direction)
|
||||
if(NORTH)
|
||||
@@ -544,7 +573,7 @@
|
||||
I.transform = M
|
||||
I.pixel_x += (-5+rand(10))
|
||||
I.pixel_y += (-5+rand(10))
|
||||
add_overlay(I)
|
||||
. += I
|
||||
return
|
||||
|
||||
var/offset = FLOOR(20/length(cards) + 1, 1)
|
||||
@@ -562,7 +591,7 @@
|
||||
else
|
||||
I.pixel_x = -7+(offset*i)
|
||||
I.transform = M
|
||||
add_overlay(I)
|
||||
. += I
|
||||
i++
|
||||
|
||||
/obj/item/cardhand/dropped(mob/user)
|
||||
@@ -571,9 +600,9 @@
|
||||
direction = user.dir
|
||||
else
|
||||
direction = NORTH
|
||||
update_icon()
|
||||
update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/cardhand/pickup(mob/user as mob)
|
||||
. = ..()
|
||||
direction = NORTH
|
||||
update_icon()
|
||||
update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS)
|
||||
|
||||
Reference in New Issue
Block a user