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

Add icons for the progress bars for when you put or remove items from someone #816

Merged
merged 1 commit into from May 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 13 additions & 5 deletions code/datums/controllers/action_controls.dm
Expand Up @@ -442,13 +442,15 @@ var/datum/action_controller/actions
var/mob/living/carbon/human/target //The target of the action
var/obj/item/item //The item if any. If theres no item, we tried to remove something from that slot instead of putting an item there.
var/slot //The slot number
var/hidden


New(var/Source, var/Target, var/Item, var/Slot, var/ExtraDuration = 0)
New(var/Source, var/Target, var/Item, var/Slot, var/ExtraDuration = 0, var/Hidden = 0)
source = Source
target = Target
item = Item
slot = Slot
hidden = Hidden

if(item)
if(item.duration_put > 0)
Expand All @@ -470,7 +472,6 @@ var/datum/action_controller/actions
..()

onStart()
..()

target.add_fingerprint(source) // Added for forensics (Convair880).

Expand All @@ -492,11 +493,12 @@ var/datum/action_controller/actions
interrupt(INTERRUPT_ALWAYS)
return
logTheThing("combat", source, target, "tries to put \an [item] on %target% at at [log_loc(target)].")
icon = item.icon
icon_state = item.icon_state
for(var/mob/O in AIviewers(owner))
O.show_message("<span class='alert'><B>[source] tries to put [item] on [target]!</B></span>", 1)
else
var/obj/item/I = target.get_slot(slot)

if(!I)
boutput(source, "<span class='alert'>There's nothing in that slot.</span>")
interrupt(INTERRUPT_ALWAYS)
Expand All @@ -511,11 +513,17 @@ var/datum/action_controller/actions
interrupt(INTERRUPT_ALWAYS)
return
*/

logTheThing("combat", source, target, "tries to remove \an [I] from %target% at [log_loc(target)].")
var/name = "something"
if (!hidden)
icon = I.icon
icon_state = I.icon_state
name = I.name

for(var/mob/O in AIviewers(owner))
O.show_message("<span class='alert'><B>[source] tries to remove something from [target]!</B></span>", 1)
O.show_message("<span class='alert'><B>[source] tries to remove [name] from [target]!</B></span>", 1)

..() // we call our parents here because we need to set our icon and icon_state before calling them

onEnd()
..()
Expand Down
2 changes: 1 addition & 1 deletion code/mob/living/carbon/human.dm
Expand Up @@ -1568,7 +1568,7 @@
else if (href_list["slot"] == "internal")
actions.start(new/datum/action/bar/icon/internalsOther(src), usr)
else if (href_list["item"])
actions.start(new/datum/action/bar/icon/otherItem(usr, src, usr.equipped(), text2num(href_list["slot"])) , usr)
actions.start(new/datum/action/bar/icon/otherItem(usr, src, usr.equipped(), text2num(href_list["slot"]), 0, href_list["item"] == "pockets") , usr)

/* ----------------------------------------------------------------------------------------------------------------- */

Expand Down
2 changes: 1 addition & 1 deletion code/obj/item/clothing/glasses.dm
Expand Up @@ -46,7 +46,7 @@
if(target.glasses)
boutput(user, "<span class='alert'>[target] is already wearing something on their eyes!</span>")
return
actions.start(new/datum/action/bar/icon/otherItem(user, target, user.equipped() , target.slot_glasses, 1.3 SECONDS) , user) //Uses extended timer to make up for previously having to manually equip to someone's eyes.
actions.start(new/datum/action/bar/icon/otherItem(user, target, user.equipped(), target.slot_glasses, 1.3 SECONDS) , user) //Uses extended timer to make up for previously having to manually equip to someone's eyes.
return
..() //if not selecting the head of a human or monkey, just do normal attack.

Expand Down