Merge pull request #16279 from Core0verload/HUDfuckery

Slot icons micro-refactor
This commit is contained in:
duncathan salt
2016-03-30 23:30:06 -06:00
25 changed files with 334 additions and 256 deletions
+2
View File
@@ -47,6 +47,8 @@
#define slot_legcuffed 19
#define slot_drone_storage 20
#define slots_amt 20 // Keep this up to date!
//Cant seem to find a mob bitflags area other than the powers one
// bitflags for clothing parts - also used for limbs
+14 -24
View File
@@ -37,50 +37,34 @@
//equippable shit
//hands
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "right hand"
inv_box.icon = 'icons/mob/screen_alien.dmi'
inv_box.icon_state = "hand_r_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
inv_box.icon_state = "hand_r_active"
inv_box.icon_state = "hand_r"
inv_box.screen_loc = ui_rhand
inv_box.layer = 19
inv_box.slot_id = slot_r_hand
r_hand_hud_object = inv_box
if(owner.handcuffed)
inv_box.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="markus")
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "left hand"
inv_box.icon = 'icons/mob/screen_alien.dmi'
inv_box.icon_state = "hand_l_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
inv_box.icon_state = "hand_l_active"
inv_box.icon_state = "hand_l"
inv_box.screen_loc = ui_lhand
inv_box.layer = 19
inv_box.slot_id = slot_l_hand
l_hand_hud_object = inv_box
if(owner.handcuffed)
inv_box.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="gabrielle")
static_inventory += inv_box
//begin buttons
using = new /obj/screen/inventory()
using.name = "hand"
using = new /obj/screen/swap_hand()
using.icon = 'icons/mob/screen_alien.dmi'
using.icon_state = "swap_1"
using.screen_loc = ui_swaphand1
using.layer = 19
static_inventory += using
using = new /obj/screen/inventory()
using.name = "hand"
using = new /obj/screen/swap_hand()
using.icon = 'icons/mob/screen_alien.dmi'
using.icon_state = "swap_2"
using.screen_loc = ui_swaphand2
using.layer = 19
static_inventory += using
using = new /obj/screen/act_intent/alien()
@@ -130,6 +114,12 @@
zone_select.update_icon(mymob)
static_inventory += zone_select
for(var/obj/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
inv_slots[inv.slot_id] = inv
inv.update_icon()
/datum/hud/alien/persistant_inventory_update()
if(!mymob)
return
+16 -22
View File
@@ -14,68 +14,62 @@
pull_icon.screen_loc = ui_drone_pull
static_inventory += pull_icon
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "right hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_r_inactive"
if(mymob && !mymob.hand) //Hand being true means the LEFT hand is active
inv_box.icon_state = "hand_r_active"
inv_box.icon_state = "hand_r"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
inv_box.layer = 19
r_hand_hud_object = inv_box
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "left hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_l_inactive"
if(mymob && mymob.hand) //Hand being true means the LEFT hand is active
inv_box.icon_state = "hand_l_active"
inv_box.icon_state = "hand_l"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
inv_box.layer = 19
l_hand_hud_object = inv_box
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "internal storage"
inv_box.icon = ui_style
inv_box.icon_state = "suit_storage"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_drone_storage
inv_box.slot_id = slot_drone_storage
inv_box.layer = 19
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "head/mask"
inv_box.icon = ui_style
inv_box.icon_state = "mask"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_drone_head
inv_box.slot_id = slot_head
inv_box.layer = 19
static_inventory += inv_box
using = new /obj/screen/inventory()
using.name = "hand"
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon_state = "swap_1_m"
using.screen_loc = ui_swaphand1
using.layer = 19
static_inventory += using
using = new /obj/screen/inventory()
using.name = "hand"
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon_state = "swap_2"
using.screen_loc = ui_swaphand2
using.layer = 19
static_inventory += using
zone_select = new /obj/screen/zone_sel()
zone_select.icon = ui_style
zone_select.update_icon(mymob)
for(var/obj/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
inv_slots[inv.slot_id] = inv
inv.update_icon()
/datum/hud/drone/persistant_inventory_update()
if(!mymob)
+6 -8
View File
@@ -24,8 +24,6 @@
var/obj/screen/deity_follower_display
var/obj/screen/nightvisionicon
var/obj/screen/r_hand_hud_object
var/obj/screen/l_hand_hud_object
var/obj/screen/action_intent
var/obj/screen/zone_select
var/obj/screen/pull_icon
@@ -37,6 +35,7 @@
var/list/obj/screen/hotkeybuttons = list() //the buttons that can be used via hotkeys
var/list/infodisplay = list() //the screen objects that display mob info (health, alien plasma, etc...)
var/list/screenoverlays = list() //the screen objects used as whole screen overlays (flash, damageoverlay, etc...)
var/list/inv_slots[slots_amt] // /obj/screen/inventory objects, ordered by their slot ID.
var/obj/screen/movable/action_button/hide_toggle/hide_actions_toggle
var/action_buttons_hidden = 0
@@ -65,8 +64,7 @@
qdel(thing)
static_inventory.Cut()
r_hand_hud_object = null
l_hand_hud_object = null
inv_slots.Cut()
action_intent = null
zone_select = null
pull_icon = null
@@ -154,10 +152,10 @@
mymob.client.screen += infodisplay
//These ones are a part of 'static_inventory', 'toggleable_inventory' or 'hotkeybuttons' but we want them to stay
if(l_hand_hud_object)
mymob.client.screen += l_hand_hud_object //we want the hands to be visible
if(r_hand_hud_object)
mymob.client.screen += r_hand_hud_object //we want the hands to be visible
if(inv_slots[slot_l_hand])
mymob.client.screen += inv_slots[slot_l_hand] //we want the hands to be visible
if(inv_slots[slot_r_hand])
mymob.client.screen += inv_slots[slot_r_hand] //we want the hands to be visible
if(action_intent)
mymob.client.screen += action_intent //we want the intent switcher visible
action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
+28 -38
View File
@@ -76,8 +76,8 @@
inv_box.icon = ui_style
inv_box.slot_id = slot_w_uniform
inv_box.icon_state = "uniform"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_iclothing
inv_box.layer = 19
toggleable_inventory += inv_box
inv_box = new /obj/screen/inventory()
@@ -85,106 +85,90 @@
inv_box.icon = ui_style
inv_box.slot_id = slot_wear_suit
inv_box.icon_state = "suit"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_oclothing
inv_box.layer = 19
toggleable_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "right hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_r_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
inv_box.icon_state = "hand_r_active"
inv_box.icon_state = "hand_r"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
inv_box.layer = 19
r_hand_hud_object = inv_box
if(owner.handcuffed)
inv_box.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="markus")
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "left hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_l_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
inv_box.icon_state = "hand_l_active"
inv_box.icon_state = "hand_l"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
inv_box.layer = 19
l_hand_hud_object = inv_box
if(owner.handcuffed)
inv_box.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="gabrielle")
static_inventory += inv_box
using = new /obj/screen/inventory()
using.name = "hand"
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon_state = "swap_1"
using.screen_loc = ui_swaphand1
using.layer = 19
static_inventory += using
using = new /obj/screen/inventory()
using.name = "hand"
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon_state = "swap_2"
using.screen_loc = ui_swaphand2
using.layer = 19
static_inventory += using
inv_box = new /obj/screen/inventory()
inv_box.name = "id"
inv_box.icon = ui_style
inv_box.icon_state = "id"
// inv_box.icon_full = "template_small"
inv_box.screen_loc = ui_id
inv_box.slot_id = slot_wear_id
inv_box.layer = 19
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "mask"
inv_box.icon = ui_style
inv_box.icon_state = "mask"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_mask
inv_box.slot_id = slot_wear_mask
inv_box.layer = 19
toggleable_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "back"
inv_box.icon = ui_style
inv_box.icon_state = "back"
// inv_box.icon_full = "template_small"
inv_box.screen_loc = ui_back
inv_box.slot_id = slot_back
inv_box.layer = 19
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "storage1"
inv_box.icon = ui_style
inv_box.icon_state = "pocket"
// inv_box.icon_full = "template_small"
inv_box.screen_loc = ui_storage1
inv_box.slot_id = slot_l_store
inv_box.layer = 19
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "storage2"
inv_box.icon = ui_style
inv_box.icon_state = "pocket"
// inv_box.icon_full = "template_small"
inv_box.screen_loc = ui_storage2
inv_box.slot_id = slot_r_store
inv_box.layer = 19
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "suit storage"
inv_box.icon = ui_style
inv_box.icon_state = "suit_storage"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_sstore1
inv_box.slot_id = slot_s_store
inv_box.layer = 19
static_inventory += inv_box
using = new /obj/screen/resist()
@@ -206,54 +190,54 @@
inv_box.name = "gloves"
inv_box.icon = ui_style
inv_box.icon_state = "gloves"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_gloves
inv_box.slot_id = slot_gloves
inv_box.layer = 19
toggleable_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "eyes"
inv_box.icon = ui_style
inv_box.icon_state = "glasses"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_glasses
inv_box.slot_id = slot_glasses
inv_box.layer = 19
toggleable_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "ears"
inv_box.icon = ui_style
inv_box.icon_state = "ears"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_ears
inv_box.slot_id = slot_ears
inv_box.layer = 19
toggleable_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "head"
inv_box.icon = ui_style
inv_box.icon_state = "head"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_head
inv_box.slot_id = slot_head
inv_box.layer = 19
toggleable_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "shoes"
inv_box.icon = ui_style
inv_box.icon_state = "shoes"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_shoes
inv_box.slot_id = slot_shoes
inv_box.layer = 19
toggleable_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "belt"
inv_box.icon = ui_style
inv_box.icon_state = "belt"
// inv_box.icon_full = "template_small"
inv_box.screen_loc = ui_belt
inv_box.slot_id = slot_belt
inv_box.layer = 19
static_inventory += inv_box
throw_icon = new /obj/screen/throw_catch()
@@ -290,6 +274,12 @@
inventory_shown = 0
for(var/obj/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
inv_slots[inv.slot_id] = inv
inv.update_icon()
/datum/hud/human/hidden_inventory_update()
if(!mymob)
return
+17 -27
View File
@@ -21,75 +21,59 @@
using.screen_loc = ui_drop_throw
static_inventory += using
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "right hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_r_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
inv_box.icon_state = "hand_r_active"
inv_box.icon_state = "hand_r"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
inv_box.layer = 19
r_hand_hud_object = inv_box
if(owner.handcuffed)
inv_box.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="markus")
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "left hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_l_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
inv_box.icon_state = "hand_l_active"
inv_box.icon_state = "hand_l"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
inv_box.layer = 19
l_hand_hud_object = inv_box
if(owner.handcuffed)
inv_box.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="gabrielle")
static_inventory += inv_box
using = new /obj/screen/inventory()
using.name = "hand"
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon_state = "swap_1_m" //extra wide!
using.screen_loc = ui_swaphand1
using.layer = 19
static_inventory += using
using = new /obj/screen/inventory()
using.name = "hand"
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon_state = "swap_2"
using.screen_loc = ui_swaphand2
using.layer = 19
static_inventory += using
inv_box = new /obj/screen/inventory()
inv_box.name = "mask"
inv_box.icon = ui_style
inv_box.icon_state = "mask"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_monkey_mask
inv_box.slot_id = slot_wear_mask
inv_box.layer = 19
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "head"
inv_box.icon = ui_style
inv_box.icon_state = "head"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_monkey_head
inv_box.slot_id = slot_head
inv_box.layer = 19
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "back"
inv_box.icon = ui_style
inv_box.icon_state = "back"
inv_box.icon_full = "template_small"
inv_box.screen_loc = ui_back
inv_box.slot_id = slot_back
inv_box.layer = 19
static_inventory += inv_box
throw_icon = new /obj/screen/throw_catch()
@@ -128,6 +112,12 @@
using.screen_loc = ui_pull_resist
hotkeybuttons += using
for(var/obj/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
inv_slots[inv.slot_id] = inv
inv.update_icon()
/datum/hud/monkey/persistant_inventory_update()
if(!mymob)
return
+94 -37
View File
@@ -13,6 +13,7 @@
unacidable = 1
appearance_flags = APPEARANCE_UI
var/obj/master = null //A reference to the object in the slot. Grabs or items, generally.
var/datum/hud/hud = null // A reference to the owner HUD, if any.
/obj/screen/Destroy()
master = null
@@ -27,19 +28,107 @@
maptext_height = 480
maptext_width = 480
/obj/screen/swap_hand
layer = 19
name = "swap hand"
/obj/screen/swap_hand/Click()
// At this point in client Click() code we have passed the 1/10 sec check and little else
// We don't even know if it's a middle click
if(world.time <= usr.next_move)
return 1
if(usr.incapacitated())
return 1
if(ismob(usr))
var/mob/M = usr
M.swap_hand()
return 1
/obj/screen/inventory
var/slot_id //The indentifier for the slot. It has nothing to do with ID cards.
var/slot_id // The indentifier for the slot. It has nothing to do with ID cards.
var/icon_empty // Icon when empty. For now used only by humans.
var/icon_full // Icon when contains an item. For now used only by humans.
layer = 19
/obj/screen/inventory/Click()
// At this point in client Click() code we have passed the 1/10 sec check and little else
// We don't even know if it's a middle click
if(world.time <= usr.next_move)
return 1
if(usr.incapacitated())
return 1
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
return 1
if(usr.attack_ui(slot_id))
usr.update_inv_l_hand(0)
usr.update_inv_r_hand(0)
return 1
/obj/screen/inventory/update_icon()
if(!icon_empty)
icon_empty = icon_state
if(hud && hud.mymob && slot_id && icon_full)
if(hud.mymob.get_item_by_slot(slot_id))
icon_state = icon_full
else
icon_state = icon_empty
/obj/screen/inventory/hand
var/image/active_overlay
var/image/handcuff_overlay
/obj/screen/inventory/hand/update_icon()
..()
if(!active_overlay)
active_overlay = image("icon"=icon, "icon_state"="hand_active")
if(!handcuff_overlay)
var/state = (slot_id == slot_r_hand) ? "markus" : "gabrielle"
handcuff_overlay = image("icon"='icons/mob/screen_gen.dmi', "icon_state"=state)
overlays.Cut()
if(hud && hud.mymob)
if(iscarbon(hud.mymob))
var/mob/living/carbon/C = hud.mymob
if(C.handcuffed)
overlays += handcuff_overlay
if(slot_id == slot_l_hand && hud.mymob.hand)
overlays += active_overlay
else if(slot_id == slot_r_hand && !hud.mymob.hand)
overlays += active_overlay
/obj/screen/inventory/hand/Click()
// At this point in client Click() code we have passed the 1/10 sec check and little else
// We don't even know if it's a middle click
if(world.time <= usr.next_move)
return 1
if(usr.incapacitated())
return 1
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
return 1
if(ismob(usr))
var/mob/M = usr
switch(name)
if("right hand", "r_hand")
M.activate_hand("r")
if("left hand", "l_hand")
M.activate_hand("l")
return 1
/obj/screen/close
name = "close"
/obj/screen/close/Click()
if(master)
if(istype(master, /obj/item/weapon/storage))
var/obj/item/weapon/storage/S = master
S.close(usr)
if(istype(master, /obj/item/weapon/storage))
var/obj/item/weapon/storage/S = master
S.close(usr)
return 1
@@ -304,38 +393,6 @@
/obj/screen/zone_sel/robot
icon = 'icons/mob/screen_cyborg.dmi'
/obj/screen/inventory/Click()
// At this point in client Click() code we have passed the 1/10 sec check and little else
// We don't even know if it's a middle click
if(world.time <= usr.next_move)
return 1
if(usr.incapacitated())
return 1
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
return 1
switch(name)
if("r_hand")
if(ismob(usr))
var/mob/Mr = usr
Mr.activate_hand("r")
if("l_hand")
if(ismob(usr))
var/mob/Ml = usr
Ml.activate_hand("l")
if("swap")
if(ismob(usr))
var/mob/Ms = usr
Ms.swap_hand()
if("hand")
if(ismob(usr))
var/mob/Mh = usr
Mh.swap_hand()
else
if(usr.attack_ui(slot_id))
usr.update_inv_l_hand(0)
usr.update_inv_r_hand(0)
return 1
/obj/screen/flash
name = "flash"
+10 -10
View File
@@ -864,17 +864,17 @@
M.put_in_hands(src)
usr << "<span class='notice'>You pick up the deck.</span>"
else if(istype(over_object, /obj/screen))
switch(over_object.name)
if("l_hand")
if(!remove_item_from_storage(M))
M.unEquip(src)
M.put_in_l_hand(src)
else if("r_hand")
if(!remove_item_from_storage(M))
M.unEquip(src)
else if(istype(over_object, /obj/screen/inventory/hand))
var/obj/screen/inventory/hand/H = over_object
if(!remove_item_from_storage(M))
M.unEquip(src)
switch(H.slot_id)
if(slot_r_hand)
M.put_in_r_hand(src)
usr << "<span class='notice'>You pick up the deck.</span>"
if(slot_l_hand)
M.put_in_l_hand(src)
usr << "<span class='notice'>You pick up the deck.</span>"
else
usr << "<span class='warning'>You can't reach it from here!</span>"
+1 -4
View File
@@ -125,9 +125,6 @@ var/global/list/RPD_recipes=list(
desc = "A device used to rapidly pipe things."
icon = 'icons/obj/items.dmi'
icon_state = "rpd"
opacity = 0
density = 0
anchored = 0
flags = CONDUCT
force = 10
throwforce = 10
@@ -529,7 +526,7 @@ var/global/list/RPD_recipes=list(
if(istype(A,/area/shuttle)||istype(A,/turf/space/transit))
return 0
//So that changing the menu settings doesn't affect the pipes already being built.
var/queued_p_type = p_type
var/queued_p_dir = p_dir
+16 -13
View File
@@ -91,19 +91,22 @@
/obj/item/weapon/defibrillator/MouseDrop(obj/over_object)
if(ismob(src.loc))
var/mob/M = src.loc
switch(over_object.name)
if("r_hand")
if(M.r_hand)
return
if(!M.unEquip(src))
return
M.put_in_r_hand(src)
if("l_hand")
if(M.l_hand)
return
if(!M.unEquip(src))
return
M.put_in_l_hand(src)
if(istype(over_object, /obj/screen/inventory/hand))
var/obj/screen/inventory/hand/H = over_object
switch(H.slot_id)
if(slot_r_hand)
if(M.r_hand)
return
if(!M.unEquip(src))
return
M.put_in_r_hand(src)
if(slot_l_hand)
if(M.l_hand)
return
if(!M.unEquip(src))
return
M.put_in_l_hand(src)
/obj/item/weapon/defibrillator/attackby(obj/item/weapon/W, mob/user, params)
if(W == paddles)
@@ -138,13 +138,14 @@
var/mob/M = usr
if(!istype(over_object, /obj/screen) || !Adjacent(M))
return ..()
if((!( M.restrained() ) && !( M.stat ) /*&& M.pocket == src*/))
switch(over_object.name)
if("r_hand")
M.unEquip(src)
if(!M.restrained() && !M.stat && istype(over_object, /obj/screen/inventory/hand))
var/obj/screen/inventory/hand/H = over_object
if(!M.unEquip(src))
return
switch(H.slot_id)
if(slot_r_hand)
M.put_in_r_hand(src)
if("l_hand")
M.unEquip(src)
if(slot_l_hand)
M.put_in_l_hand(src)
src.add_fingerprint(usr)
return
@@ -163,7 +164,7 @@
..()
for(var/i in 1 to 7)
new /obj/item/weapon/reagent_containers/pill/patch/silver_sulf(src)
/obj/item/weapon/storage/pill_bottle/charcoal
name = "bottle of charcoal pills"
desc = "Contains pills used to counter toxins."
@@ -172,7 +173,7 @@
..()
for(var/i in 1 to 7)
new /obj/item/weapon/reagent_containers/pill/charcoal(src)
/obj/item/weapon/storage/pill_bottle/epinephrine
name = "bottle of epinephrine pills"
desc = "Contains pills used to stabilize patients."
@@ -181,7 +182,7 @@
..()
for(var/i in 1 to 7)
new /obj/item/weapon/reagent_containers/pill/epinephrine(src)
/obj/item/weapon/storage/pill_bottle/mutadone
name = "bottle of mutadone pills"
desc = "Contains pills used to treat genetic abnormalities."
@@ -190,7 +191,7 @@
..()
for(var/i in 1 to 7)
new /obj/item/weapon/reagent_containers/pill/mutadone(src)
/obj/item/weapon/storage/pill_bottle/mannitol
name = "bottle of mannitol pills"
desc = "Contains pills used to treat brain damage."
@@ -199,7 +200,7 @@
..()
for(var/i in 1 to 7)
new /obj/item/weapon/reagent_containers/pill/mannitol(src)
/obj/item/weapon/storage/pill_bottle/stimulant
name = "bottle of stimulant pills"
desc = "Guaranteed to give you that extra burst of energy during a long shift!"
@@ -51,15 +51,18 @@
return
playsound(loc, "rustle", 50, 1, -5)
switch(over_object.name)
if("r_hand")
if(!M.unEquip(src))
return
M.put_in_r_hand(src)
if("l_hand")
if(!M.unEquip(src))
return
M.put_in_l_hand(src)
if(istype(over_object, /obj/screen/inventory/hand))
var/obj/screen/inventory/hand/H = over_object
if(!M.unEquip(src))
return
switch(H.slot_id)
if(slot_r_hand)
M.put_in_r_hand(src)
if(slot_l_hand)
M.put_in_l_hand(src)
add_fingerprint(usr)
//Check if this storage can dump the items
@@ -81,15 +81,16 @@
/obj/item/weapon/watertank/MouseDrop(obj/over_object)
var/mob/M = src.loc
if(istype(M))
switch(over_object.name)
if("r_hand")
if(istype(M) && istype(over_object, /obj/screen/inventory/hand))
var/obj/screen/inventory/hand/H = over_object
switch(H.slot_id)
if(slot_r_hand)
if(M.r_hand)
return
if(!M.unEquip(src))
return
M.put_in_r_hand(src)
if("l_hand")
if(slot_l_hand)
if(M.l_hand)
return
if(!M.unEquip(src))
+7 -8
View File
@@ -111,13 +111,12 @@
usr << "<span class='warning'>Your other hand is too busy holding the [item_in_hand.name]</span>"
return
src.hand = !( src.hand )
if(hud_used.l_hand_hud_object && hud_used.r_hand_hud_object)
if(hand) //This being 1 means the left hand is in use
hud_used.l_hand_hud_object.icon_state = "hand_l_active"
hud_used.r_hand_hud_object.icon_state = "hand_r_inactive"
else
hud_used.l_hand_hud_object.icon_state = "hand_l_inactive"
hud_used.r_hand_hud_object.icon_state = "hand_r_active"
if(hud_used && hud_used.inv_slots[slot_l_hand] && hud_used.inv_slots[slot_r_hand])
var/obj/screen/inventory/hand/H
H = hud_used.inv_slots[slot_l_hand]
H.update_icon()
H = hud_used.inv_slots[slot_r_hand]
H.update_icon()
/*if (!( src.hand ))
src.hands.dir = NORTH
else
@@ -170,7 +169,7 @@
return
if(weakeyes)
Stun(2)
if (damage == 1)
src << "<span class='warning'>Your eyes sting a little.</span>"
if(prob(40))
@@ -155,6 +155,10 @@ Please contact me on #coderbus IRC. ~Carnie x
/mob/living/carbon/human/update_inv_w_uniform()
remove_overlay(UNIFORM_LAYER)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_w_uniform]
inv.update_icon()
if(istype(w_uniform, /obj/item/clothing/under))
var/obj/item/clothing/under/U = w_uniform
if(client && hud_used && hud_used.hud_shown)
@@ -192,6 +196,11 @@ Please contact me on #coderbus IRC. ~Carnie x
/mob/living/carbon/human/update_inv_wear_id()
remove_overlay(ID_LAYER)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_wear_id]
inv.update_icon()
if(wear_id)
if(client && hud_used && hud_used.hud_shown)
wear_id.screen_loc = ui_id
@@ -206,6 +215,11 @@ Please contact me on #coderbus IRC. ~Carnie x
/mob/living/carbon/human/update_inv_gloves()
remove_overlay(GLOVES_LAYER)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_gloves]
inv.update_icon()
if(gloves)
if(client && hud_used && hud_used.hud_shown)
if(hud_used.inventory_shown) //if the inventory is open ...
@@ -231,6 +245,10 @@ Please contact me on #coderbus IRC. ~Carnie x
/mob/living/carbon/human/update_inv_glasses()
remove_overlay(GLASSES_LAYER)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_glasses]
inv.update_icon()
if(glasses)
if(client && hud_used && hud_used.hud_shown)
if(hud_used.inventory_shown) //if the inventory is open ...
@@ -248,6 +266,10 @@ Please contact me on #coderbus IRC. ~Carnie x
/mob/living/carbon/human/update_inv_ears()
remove_overlay(EARS_LAYER)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_ears]
inv.update_icon()
if(ears)
if(client && hud_used && hud_used.hud_shown)
if(hud_used.inventory_shown) //if the inventory is open ...
@@ -263,6 +285,10 @@ Please contact me on #coderbus IRC. ~Carnie x
/mob/living/carbon/human/update_inv_shoes()
remove_overlay(SHOES_LAYER)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_shoes]
inv.update_icon()
if(shoes)
if(client && hud_used && hud_used.hud_shown)
if(hud_used.inventory_shown) //if the inventory is open ...
@@ -278,6 +304,10 @@ Please contact me on #coderbus IRC. ~Carnie x
/mob/living/carbon/human/update_inv_s_store()
remove_overlay(SUIT_STORE_LAYER)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_s_store]
inv.update_icon()
if(s_store)
if(client && hud_used && hud_used.hud_shown)
s_store.screen_loc = ui_sstore1
@@ -294,17 +324,25 @@ Please contact me on #coderbus IRC. ~Carnie x
/mob/living/carbon/human/update_inv_head()
..()
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_head]
inv.update_icon()
update_mutant_bodyparts()
/mob/living/carbon/human/update_inv_belt()
remove_overlay(BELT_LAYER)
if(belt)
if(client && hud_used && hud_used.hud_shown)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_belt]
inv.update_icon()
if(hud_used.hud_shown && belt)
client.screen += belt
belt.screen_loc = ui_belt
if(belt)
var/t_state = belt.item_state
if(!t_state)
t_state = belt.icon_state
@@ -320,6 +358,10 @@ Please contact me on #coderbus IRC. ~Carnie x
/mob/living/carbon/human/update_inv_wear_suit()
remove_overlay(SUIT_LAYER)
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_wear_suit]
inv.update_icon()
if(istype(wear_suit, /obj/item/clothing/suit))
if(client && hud_used && hud_used.hud_shown)
if(hud_used.inventory_shown) //if the inventory is open ...
@@ -340,19 +382,30 @@ Please contact me on #coderbus IRC. ~Carnie x
/mob/living/carbon/human/update_inv_pockets()
if(l_store)
if(client && hud_used && hud_used.hud_shown)
client.screen += l_store
l_store.screen_loc = ui_storage1
if(r_store)
if(client && hud_used && hud_used.hud_shown)
client.screen += r_store
r_store.screen_loc = ui_storage2
if(client && hud_used)
var/obj/screen/inventory/inv
inv = hud_used.inv_slots[slot_l_store]
inv.update_icon()
inv = hud_used.inv_slots[slot_r_store]
inv.update_icon()
if(hud_used.hud_shown)
if(l_store)
client.screen += l_store
l_store.screen_loc = ui_storage1
if(r_store)
client.screen += r_store
r_store.screen_loc = ui_storage2
/mob/living/carbon/human/update_inv_wear_mask()
..()
if(client && hud_used)
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_wear_mask]
inv.update_icon()
update_mutant_bodyparts()
/mob/living/carbon/human/update_inv_handcuffed()
@@ -105,6 +105,11 @@
/mob/living/carbon/update_inv_back()
remove_overlay(BACK_LAYER)
if(client && hud_used && hud_used.inv_slots[slot_back])
var/obj/screen/inventory/inv = hud_used.inv_slots[slot_back]
inv.update_icon()
if(back)
var/image/standing = back.build_worn_icon(state = back.icon_state, default_layer = BACK_LAYER, default_icon_file = 'icons/mob/back.dmi')
overlays_standing[BACK_LAYER] = standing
@@ -128,15 +133,11 @@
//update whether handcuffs appears on our hud.
/mob/living/carbon/proc/update_hud_handcuffed()
if(hud_used)
var/obj/screen/inventory/R = hud_used.r_hand_hud_object
var/obj/screen/inventory/L = hud_used.l_hand_hud_object
var/obj/screen/inventory/R = hud_used.inv_slots[slot_r_hand]
var/obj/screen/inventory/L = hud_used.inv_slots[slot_l_hand]
if(R && L)
if(handcuffed) //hud handcuff icons
R.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="markus")
L.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="gabrielle")
else
R.overlays = null
L.overlays = null
R.update_icon()
L.update_icon()
//update whether our head item appears on our hud.
/mob/living/carbon/proc/update_hud_head(obj/item/I)
@@ -34,13 +34,12 @@
return
hand = !hand
if(hud_used.l_hand_hud_object && hud_used.r_hand_hud_object)
if(hand)
hud_used.l_hand_hud_object.icon_state = "hand_l_active"
hud_used.r_hand_hud_object.icon_state = "hand_r_inactive"
else
hud_used.l_hand_hud_object.icon_state = "hand_l_inactive"
hud_used.r_hand_hud_object.icon_state = "hand_r_active"
if(hud_used && hud_used.inv_slots[slot_l_hand] && hud_used.inv_slots[slot_r_hand])
var/obj/screen/inventory/hand/H
H = hud_used.inv_slots[slot_l_hand]
H.update_icon()
H = hud_used.inv_slots[slot_r_hand]
H.update_icon()
/mob/living/simple_animal/drone/unEquip(obj/item/I, force)
+8 -8
View File
@@ -92,15 +92,15 @@
if(over_object == M)
M.put_in_hands(src)
else if(istype(over_object, /obj/screen))
switch(over_object.name)
if("r_hand")
if(!remove_item_from_storage(M))
M.unEquip(src)
else if(istype(over_object, /obj/screen/inventory/hand))
var/obj/screen/inventory/hand/H = over_object
if(!remove_item_from_storage(M))
if(!M.unEquip(src))
return
switch(H.slot_id)
if(slot_r_hand)
M.put_in_r_hand(src)
if("l_hand")
if(!remove_item_from_storage(M))
M.unEquip(src)
if(slot_l_hand)
M.put_in_l_hand(src)
add_fingerprint(M)
+8 -8
View File
@@ -31,15 +31,15 @@
if(over_object == M)
M.put_in_hands(src)
else if(istype(over_object, /obj/screen))
switch(over_object.name)
if("r_hand")
if(!remove_item_from_storage(M))
M.unEquip(src)
else if(istype(over_object, /obj/screen/inventory/hand))
var/obj/screen/inventory/hand/H = over_object
if(!remove_item_from_storage(M))
if(!M.unEquip(src))
return
switch(H.slot_id)
if(slot_r_hand)
M.put_in_r_hand(src)
if("l_hand")
if(!remove_item_from_storage(M))
M.unEquip(src)
if(slot_l_hand)
M.put_in_l_hand(src)
add_fingerprint(M)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 26 KiB