Files
Paradise/code/_onclick/hud/monkey.dm
Tigercat2000 56a09db739 Action Button Update
- Refactors action button backend
   - Action buttons are no longer checked on Life(), items are responsible
     for adding/removing/updating them.
   - Item action buttons are no longer a static action_button_name define,
     items define actions_types, which is a list of paths.
   - Items can now have multiple action buttons.
     - This is handled by new arguments to ui_action_click, the first
       parameter is the user, the second is the path of the action datum
       that was invoked.
 - Refactored how internals function
   - You may now directly switch internals without breaking anything.
   - The internals icon has been updated to be more consistent.
 - Added action buttons for jetpacks
 - Added action buttons for oxygen tanks
 - Uses-based implants now qdel() themselves when they run out of uses.
   This is somewhat a buff to traitor implants, but it's such a minor
   change. The actual reasoning is so that the action buttons are properly
   removed.
 - Fixed a bug with the "Boo" spell which resulted in IsAvailable failing
   for certain ghosts.
 - You can now shift-click on movable HUD elements to reset them to the
   proper position (thank fucking christ)
2016-07-18 13:23:01 -07:00

132 lines
3.6 KiB
Plaintext

/mob/living/carbon/human/monkey/create_mob_hud()
if(client && !hud_used)
hud_used = new /datum/hud/monkey(src, ui_style2icon(client.prefs.UI_style), client.prefs.UI_style_color, client.prefs.UI_style_alpha)
/datum/hud/monkey/New(mob/living/carbon/human/owner, var/ui_style = 'icons/mob/screen_white.dmi', var/ui_color = "#ffffff", var/ui_alpha = 255)
..()
var/obj/screen/using
var/obj/screen/inventory/inv_box
using = new /obj/screen/act_intent()
using.icon_state = mymob.a_intent
using.color = ui_color
using.alpha = ui_alpha
static_inventory += using
action_intent = using
using = new /obj/screen/mov_intent()
using.icon = ui_style
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.color = ui_color
using.alpha = ui_alpha
static_inventory += using
move_intent = using
using = new /obj/screen/drop()
using.icon = ui_style
using.screen_loc = ui_drop_throw
using.color = ui_color
using.alpha = ui_alpha
static_inventory += using
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "r_hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_r"
inv_box.color = ui_color
inv_box.alpha = ui_alpha
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
static_inventory += inv_box
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "l_hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_l"
inv_box.color = ui_color
inv_box.alpha = ui_alpha
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
static_inventory += inv_box
using = new /obj/screen/swap_hand()
using.name = "hand"
using.icon = ui_style
using.icon_state = "swap_1_m"
using.screen_loc = ui_swaphand1
using.color = ui_color
using.alpha = ui_alpha
static_inventory += using
using = new /obj/screen/swap_hand()
using.name = "hand"
using.icon = ui_style
using.icon_state = "swap_2"
using.screen_loc = ui_swaphand2
using.color = ui_color
using.alpha = ui_alpha
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.screen_loc = ui_mask
inv_box.slot_id = slot_wear_mask
inv_box.color = ui_color
inv_box.alpha = ui_alpha
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.screen_loc = ui_back
inv_box.slot_id = slot_back
inv_box.color = ui_color
inv_box.alpha = ui_alpha
static_inventory += inv_box
mymob.throw_icon = new /obj/screen/throw_catch()
mymob.throw_icon.icon = ui_style
mymob.throw_icon.screen_loc = ui_drop_throw
mymob.throw_icon.color = ui_color
mymob.throw_icon.alpha = ui_alpha
hotkeybuttons += mymob.throw_icon
internals = new /obj/screen/internals()
infodisplay += internals
mymob.healths = new /obj/screen/healths()
infodisplay += mymob.healths
mymob.healthdoll = new /obj/screen/healthdoll()
infodisplay += mymob.healthdoll
mymob.pullin = new /obj/screen/pull()
mymob.pullin.icon = ui_style
mymob.pullin.update_icon(mymob)
mymob.pullin.screen_loc = ui_pull_resist
static_inventory += mymob.pullin
lingchemdisplay = new /obj/screen/ling/chems()
infodisplay += lingchemdisplay
lingstingdisplay = new /obj/screen/ling/sting()
infodisplay += lingstingdisplay
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = ui_style
mymob.zone_sel.update_icon(mymob)
static_inventory += mymob.zone_sel
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()