diff --git a/code/__DEFINES/clothing.dm b/code/__DEFINES/clothing.dm index a9474044978..83a6ac5b20a 100644 --- a/code/__DEFINES/clothing.dm +++ b/code/__DEFINES/clothing.dm @@ -32,6 +32,7 @@ #define slot_r_ear 20 #define slot_wear_pda 21 #define slot_tie 22 +#define slots_amt 22 //Cant seem to find a mob bitflags area other than the powers one diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index ced289358e0..0dd40091e1e 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -184,8 +184,18 @@ /proc/ui_style2icon(ui_style) switch(ui_style) - if("Midnight") return 'icons/mob/screen1_Midnight.dmi' - else return 'icons/mob/screen1_White.dmi' + if("Retro") + return 'icons/mob/screen_retro.dmi' + if("Plasmafire") + return 'icons/mob/screen_plasmafire.dmi' + if("Slimecore") + return 'icons/mob/screen_slimecore.dmi' + if("Operative") + return 'icons/mob/screen_operative.dmi' + if("White") + return 'icons/mob/screen_white.dmi' + else + return 'icons/mob/screen_midnight.dmi' //colour formats /proc/rgb2hsl(red, green, blue) diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm index 50527c33329..c6ad076b102 100644 --- a/code/_onclick/hud/_defines.dm +++ b/code/_onclick/hud/_defines.dm @@ -142,4 +142,15 @@ // Bots #define ui_bot_radio "EAST-1:28,SOUTH:7" -#define ui_bot_pull "EAST-2:26,SOUTH:7" \ No newline at end of file +#define ui_bot_pull "EAST-2:26,SOUTH:7" + +//HUD styles. Please ensure HUD_VERSIONS is the same as the maximum index. Index order defines how they are cycled in F12. +#define HUD_STYLE_STANDARD 1 +#define HUD_STYLE_REDUCED 2 +#define HUD_STYLE_NOHUD 3 + + +#define HUD_VERSIONS 3 //used in show_hud() +//1 = standard hud +//2 = reduced hud (just hands and intent switcher) +//3 = no hud (for screenshots) \ No newline at end of file diff --git a/code/_onclick/hud/ai.dm b/code/_onclick/hud/ai.dm index d98851fc443..0a3ca11f315 100644 --- a/code/_onclick/hud/ai.dm +++ b/code/_onclick/hud/ai.dm @@ -84,7 +84,7 @@ AI.ai_call_shuttle() /obj/screen/ai/state_laws - name = "State Laws" + name = "Law Manager" icon_state = "state_laws" /obj/screen/ai/state_laws/Click() @@ -129,7 +129,7 @@ AI.aiCamera.viewpictures() /obj/screen/ai/sensors - name = "Sensor Augmentation" + name = "Toggle Sensor Augmentation" icon_state = "ai_sensor" /obj/screen/ai/sensors/Click() @@ -141,146 +141,86 @@ borg.sensor_mode() -/datum/hud/proc/ai_hud() - adding = list() - other = list() +/mob/living/silicon/ai/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/ai(src) + +/datum/hud/ai/New(mob/owner) + ..() var/obj/screen/using //AI core using = new /obj/screen/ai/aicore() - using.name = "AI Core" - using.icon = 'icons/mob/screen_ai.dmi' - using.icon_state = "ai_core" using.screen_loc = ui_ai_core - using.layer = 20 - adding += using + static_inventory += using //Camera list using = new /obj/screen/ai/camera_list() - using.name = "Show Camera List" - using.icon = 'icons/mob/screen_ai.dmi' - using.icon_state = "camera" using.screen_loc = ui_ai_camera_list - using.layer = 20 - adding += using + static_inventory += using //Track using = new /obj/screen/ai/camera_track() - using.name = "Track With Camera" - using.icon = 'icons/mob/screen_ai.dmi' - using.icon_state = "track" using.screen_loc = ui_ai_track_with_camera - using.layer = 20 - adding += using + static_inventory += using //Camera light using = new /obj/screen/ai/camera_light() - using.name = "Toggle Camera Light" - using.icon = 'icons/mob/screen_ai.dmi' - using.icon_state = "camera_light" using.screen_loc = ui_ai_camera_light - using.layer = 20 - adding += using + static_inventory += using //Crew Monitorting using = new /obj/screen/ai/crew_monitor() - using.name = "Crew Monitoring" - using.icon = 'icons/mob/screen_ai.dmi' - using.icon_state = "crew_monitor" using.screen_loc = ui_ai_crew_monitor - using.layer = 20 - adding += using + static_inventory += using //Crew Manifest using = new /obj/screen/ai/crew_manifest() - using.name = "Show Crew Manifest" - using.icon = 'icons/mob/screen_ai.dmi' - using.icon_state = "manifest" using.screen_loc = ui_ai_crew_manifest - using.layer = 20 - adding += using + static_inventory += using //Alerts using = new /obj/screen/ai/alerts() - using.name = "Show Alerts" - using.icon = 'icons/mob/screen_ai.dmi' - using.icon_state = "alerts" using.screen_loc = ui_ai_alerts - using.layer = 20 - adding += using + static_inventory += using //Announcement using = new /obj/screen/ai/announcement() - using.name = "Announcement" - using.icon = 'icons/mob/screen_ai.dmi' - using.icon_state = "announcement" using.screen_loc = ui_ai_announcement - using.layer = 20 - adding += using + static_inventory += using //Shuttle using = new /obj/screen/ai/call_shuttle() - using.name = "Call Emergency Shuttle" - using.icon = 'icons/mob/screen_ai.dmi' - using.icon_state = "call_shuttle" using.screen_loc = ui_ai_shuttle - using.layer = 20 - adding += using + static_inventory += using //Laws using = new /obj/screen/ai/state_laws() - using.name = "Law Manager" - using.icon = 'icons/mob/screen_ai.dmi' - using.icon_state = "state_laws" using.screen_loc = ui_ai_state_laws - using.layer = 20 - adding += using + static_inventory += using //PDA message using = new /obj/screen/ai/pda_msg_send() - using.name = "PDA - Send Message" - using.icon = 'icons/mob/screen_ai.dmi' - using.icon_state = "pda_send" using.screen_loc = ui_ai_pda_send - using.layer = 20 - adding += using + static_inventory += using //PDA log using = new /obj/screen/ai/pda_msg_show() - using.name = "PDA - Show Message Log" - using.icon = 'icons/mob/screen_ai.dmi' - using.icon_state = "pda_receive" using.screen_loc = ui_ai_pda_log - using.layer = 20 - adding += using + static_inventory += using //Take image using = new /obj/screen/ai/image_take() - using.name = "Take Image" - using.icon = 'icons/mob/screen_ai.dmi' - using.icon_state = "take_picture" using.screen_loc = ui_ai_take_picture - using.layer = 20 - adding += using + static_inventory += using //View images using = new /obj/screen/ai/image_view() - using.name = "View Images" - using.icon = 'icons/mob/screen_ai.dmi' - using.icon_state = "view_images" using.screen_loc = ui_ai_view_images - using.layer = 20 - adding += using + static_inventory += using //Medical/Security sensors using = new /obj/screen/ai/sensors() - using.name = "Set Sensor Augmentation" - using.icon = 'icons/mob/screen_ai.dmi' - using.icon_state = "ai_sensor" using.screen_loc = ui_ai_sensor - using.layer = 20 - adding += using - - mymob.client.screen += adding + other - return \ No newline at end of file + static_inventory += using diff --git a/code/_onclick/hud/alien.dm b/code/_onclick/hud/alien.dm index 2842facc713..70d121a190b 100644 --- a/code/_onclick/hud/alien.dm +++ b/code/_onclick/hud/alien.dm @@ -18,143 +18,133 @@ var/mob/living/carbon/alien/humanoid/A = usr A.nightvisiontoggle() -/datum/hud/proc/embryo_hud() - return -/datum/hud/proc/alien_hud() - src.adding = list() - src.other = list() +/obj/screen/alien/plasma_display + icon = 'icons/mob/screen_gen.dmi' + icon_state = "power_display2" + name = "plasma stored" + screen_loc = ui_alienplasmadisplay + + +/mob/living/carbon/alien/humanoid/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/alien(src) + +/datum/hud/alien/New(mob/living/carbon/alien/humanoid/owner) + ..() var/obj/screen/using var/obj/screen/inventory/inv_box - using = new /obj/screen/act_intent() - using.name = "act_intent" - using.dir = SOUTHWEST - using.icon = 'icons/mob/screen1_alien.dmi' + using = new /obj/screen/act_intent/alien() using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent) using.screen_loc = ui_acti - using.layer = 20 - src.adding += using + static_inventory += using action_intent = using using = new /obj/screen/mov_intent() - using.name = "mov_intent" - using.dir = SOUTHWEST - using.icon = 'icons/mob/screen1_alien.dmi' + using.icon = 'icons/mob/screen_alien.dmi' using.icon_state = (mymob.m_intent == "run" ? "running" : "walking") using.screen_loc = ui_movi - using.layer = 20 - src.adding += using + static_inventory += using move_intent = using if(istype(mymob, /mob/living/carbon/alien/humanoid/hunter)) mymob.leap_icon = new /obj/screen/alien/leap() - mymob.leap_icon.icon = 'icons/mob/screen1_alien.dmi' - mymob.leap_icon.name = "toggle leap" - mymob.leap_icon.icon_state = "leap_off" + mymob.leap_icon.icon = 'icons/mob/screen_alien.dmi' mymob.leap_icon.screen_loc = ui_alien_storage_r - src.adding += mymob.leap_icon + static_inventory += mymob.leap_icon //equippable shit - inv_box = new /obj/screen/inventory() + inv_box = new /obj/screen/inventory/hand() inv_box.name = "r_hand" - inv_box.dir = WEST - inv_box.icon = 'icons/mob/screen1_alien.dmi' - inv_box.icon_state = "hand_inactive" - if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use - inv_box.icon_state = "hand_active" + inv_box.icon = 'icons/mob/screen_alien.dmi' + inv_box.icon_state = "hand_r" inv_box.screen_loc = ui_rhand - inv_box.layer = 19 - src.r_hand_hud_object = inv_box inv_box.slot_id = slot_r_hand - src.adding += inv_box + static_inventory += inv_box - inv_box = new /obj/screen/inventory() + inv_box = new /obj/screen/inventory/hand() inv_box.name = "l_hand" - inv_box.dir = EAST - inv_box.icon = 'icons/mob/screen1_alien.dmi' - inv_box.icon_state = "hand_inactive" - if(mymob && mymob.hand) //This being 1 means the left hand is in use - inv_box.icon_state = "hand_active" + inv_box.icon = 'icons/mob/screen_alien.dmi' + inv_box.icon_state = "hand_l" inv_box.screen_loc = ui_lhand - inv_box.layer = 19 inv_box.slot_id = slot_l_hand - src.l_hand_hud_object = inv_box - src.adding += inv_box + static_inventory += inv_box - using = new /obj/screen/inventory() + using = new /obj/screen/swap_hand() using.name = "hand" - using.dir = SOUTH - using.icon = 'icons/mob/screen1_alien.dmi' + using.icon = 'icons/mob/screen_alien.dmi' using.icon_state = "hand1" using.screen_loc = ui_swaphand1 - using.layer = 19 - src.adding += using + static_inventory += using - using = new /obj/screen/inventory() + using = new /obj/screen/swap_hand() using.name = "hand" - using.dir = SOUTH - using.icon = 'icons/mob/screen1_alien.dmi' + using.icon = 'icons/mob/screen_alien.dmi' using.icon_state = "hand2" using.screen_loc = ui_swaphand2 - using.layer = 19 - src.adding += using + static_inventory += using //end of equippable shit using = new /obj/screen/resist() using.name = "resist" - using.icon = 'icons/mob/screen1_alien.dmi' + using.icon = 'icons/mob/screen_alien.dmi' using.icon_state = "act_resist" using.screen_loc = ui_pull_resist - using.layer = 19 - src.adding += using + static_inventory += using using = new /obj/screen/drop() using.name = "drop" - using.icon = 'icons/mob/screen1_alien.dmi' + using.icon = 'icons/mob/screen_alien.dmi' using.icon_state = "act_drop" using.screen_loc = ui_drop_throw - using.layer = 19 - src.adding += using + static_inventory += using mymob.throw_icon = new /obj/screen/throw_catch() - mymob.throw_icon.icon = 'icons/mob/screen1_alien.dmi' - mymob.throw_icon.icon_state = "act_throw_off" - mymob.throw_icon.name = "throw" + mymob.throw_icon.icon = 'icons/mob/screen_alien.dmi' mymob.throw_icon.screen_loc = ui_drop_throw + static_inventory += mymob.throw_icon - mymob.healths = new /obj/screen() - mymob.healths.icon = 'icons/mob/screen1_alien.dmi' - mymob.healths.icon_state = "health0" - mymob.healths.name = "health" - mymob.healths.screen_loc = ui_alien_health + mymob.healths = new /obj/screen/healths/alien() + infodisplay += mymob.healths nightvisionicon = new /obj/screen/alien/nightvision() - nightvisionicon.icon = 'icons/mob/screen1_alien.dmi' - nightvisionicon.icon_state = "nightvision1" - nightvisionicon.name = "night vision" - nightvisionicon.screen_loc = ui_alien_nightvision + infodisplay += nightvisionicon mymob.pullin = new /obj/screen/pull() - mymob.pullin.icon = 'icons/mob/screen1_alien.dmi' + mymob.pullin.icon = 'icons/mob/screen_alien.dmi' mymob.pullin.update_icon(mymob) mymob.pullin.screen_loc = ui_pull_resist + hotkeybuttons += mymob.pullin - alien_plasma_display = new /obj/screen() - alien_plasma_display.icon = 'icons/mob/screen_gen.dmi' - alien_plasma_display.icon_state = "power_display" - alien_plasma_display.name = "plasma stored" - alien_plasma_display.screen_loc = ui_alienplasmadisplay + alien_plasma_display = new /obj/screen/alien/plasma_display() + infodisplay += alien_plasma_display - mymob.zone_sel = new /obj/screen/zone_sel() - mymob.zone_sel.icon = 'icons/mob/screen1_alien.dmi' - mymob.zone_sel.overlays.Cut() - mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]") + mymob.zone_sel = new /obj/screen/zone_sel/alien() + mymob.zone_sel.update_icon(mymob) + static_inventory += mymob.zone_sel - mymob.client.screen = list() + 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() - mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.healths, nightvisionicon, mymob.pullin, alien_plasma_display, mymob.pullin) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach ) - mymob.client.screen += src.adding + src.other - mymob.client.screen += mymob.client.void \ No newline at end of file +/datum/hud/alien/persistant_inventory_update() + if(!mymob) + return + var/mob/living/carbon/alien/humanoid/H = mymob + if(hud_version != HUD_STYLE_NOHUD) + if(H.r_hand) + H.r_hand.screen_loc = ui_rhand + H.client.screen += H.r_hand + if(H.l_hand) + H.l_hand.screen_loc = ui_lhand + H.client.screen += H.l_hand + else + if(H.r_hand) + H.r_hand.screen_loc = null + if(H.l_hand) + H.l_hand.screen_loc = null diff --git a/code/_onclick/hud/alien_larva.dm b/code/_onclick/hud/alien_larva.dm index dca63c7d2ae..6ab416259e7 100644 --- a/code/_onclick/hud/alien_larva.dm +++ b/code/_onclick/hud/alien_larva.dm @@ -1,53 +1,35 @@ -/datum/hud/proc/larva_hud() - src.adding = list() - src.other = list() +/mob/living/carbon/alien/larva/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/larva(src) + +/datum/hud/larva/New(mob/owner) + ..() var/obj/screen/using - using = new /obj/screen/act_intent() - using.name = "act_intent" - using.dir = SOUTHWEST - using.icon = 'icons/mob/screen1_alien.dmi' - using.icon_state = (mymob.a_intent == "harm" ? "harm" : mymob.a_intent) - using.screen_loc = ui_acti - using.layer = 20 - src.adding += using + using = new /obj/screen/act_intent/alien() + using.icon_state = mymob.a_intent + static_inventory += using action_intent = using using = new /obj/screen/mov_intent() - using.name = "mov_intent" - using.dir = SOUTHWEST - using.icon = 'icons/mob/screen1_alien.dmi' + using.icon = 'icons/mob/screen_alien.dmi' using.icon_state = (mymob.m_intent == "run" ? "running" : "walking") - using.screen_loc = ui_movi - using.layer = 20 - src.adding += using + static_inventory += using move_intent = using - mymob.healths = new /obj/screen() - mymob.healths.icon = 'icons/mob/screen1_alien.dmi' - mymob.healths.icon_state = "health0" - mymob.healths.name = "health" - mymob.healths.screen_loc = ui_alien_health + mymob.healths = new /obj/screen/healths/alien() + infodisplay += mymob.healths nightvisionicon = new /obj/screen/alien/nightvision() - nightvisionicon.icon = 'icons/mob/screen1_alien.dmi' - nightvisionicon.icon_state = "nightvision1" - nightvisionicon.name = "night vision" - nightvisionicon.screen_loc = ui_alien_nightvision + infodisplay += nightvisionicon mymob.pullin = new /obj/screen/pull() - mymob.pullin.icon = 'icons/mob/screen1_alien.dmi' + mymob.pullin.icon = 'icons/mob/screen_alien.dmi' mymob.pullin.update_icon(mymob) mymob.pullin.screen_loc = ui_pull_resist + hotkeybuttons += mymob.pullin - mymob.zone_sel = new /obj/screen/zone_sel() - mymob.zone_sel.icon = 'icons/mob/screen1_alien.dmi' - mymob.zone_sel.overlays.Cut() - mymob.zone_sel.overlays += image("icon" = 'icons/mob/zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting)) - - mymob.client.screen = list() - - mymob.client.screen += list( mymob.zone_sel, mymob.healths, nightvisionicon, mymob.pullin) //, mymob.rest, mymob.sleep, mymob.mach ) - mymob.client.screen += src.adding + src.other - mymob.client.screen += mymob.client.void \ No newline at end of file + mymob.zone_sel = new /obj/screen/zone_sel/alien() + mymob.zone_sel.update_icon(mymob) + static_inventory += mymob.zone_sel \ No newline at end of file diff --git a/code/_onclick/hud/bot.dm b/code/_onclick/hud/bot.dm index 4f205b04567..5f4ddbd7622 100644 --- a/code/_onclick/hud/bot.dm +++ b/code/_onclick/hud/bot.dm @@ -1,43 +1,33 @@ /obj/screen/bot - icon = 'icons/mob/screen1_bot.dmi' + icon = 'icons/mob/screen_bot.dmi' /obj/screen/bot/radio name = "radio" icon_state = "radio" + screen_loc = ui_bot_radio /obj/screen/bot/radio/Click() if(isbot(usr)) var/mob/living/simple_animal/bot/B = usr B.Radio.interact(usr) -/datum/hud/proc/bot_hud() - src.adding = list() - src.other = list() +/mob/living/simple_animal/bot/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/bot(src) +/datum/hud/bot/New(mob/owner) + ..() var/obj/screen/using using = new /obj/screen/bot/radio() - using.name = "radio" - using.dir = SOUTHWEST - using.icon_state = "radio" - using.screen_loc = ui_bot_radio - using.layer = 20 - src.adding += using + static_inventory += using - mymob.healths = new /obj/screen() - mymob.healths.icon = 'icons/mob/screen1_bot.dmi' - mymob.healths.icon_state = "health0" - mymob.healths.name = "health" + mymob.healths = new /obj/screen/healths/bot() mymob.healths.screen_loc = ui_borg_health + infodisplay += mymob.healths mymob.pullin = new /obj/screen/pull() - mymob.pullin.icon = 'icons/mob/screen1_bot.dmi' + mymob.pullin.icon = 'icons/mob/screen_bot.dmi' mymob.pullin.update_icon(mymob) mymob.pullin.screen_loc = ui_bot_pull - - mymob.client.screen = list() - - mymob.client.screen += list(mymob.healths, mymob.pullin) - mymob.client.screen += adding + other - mymob.client.screen += mymob.client.void - return \ No newline at end of file + static_inventory += mymob.pullin \ No newline at end of file diff --git a/code/_onclick/hud/guardian.dm b/code/_onclick/hud/guardian.dm new file mode 100644 index 00000000000..6da2a44b0f7 --- /dev/null +++ b/code/_onclick/hud/guardian.dm @@ -0,0 +1,89 @@ +/mob/living/simple_animal/hostile/guardian/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/guardian(src) + +/datum/hud/guardian/New(mob/owner) + ..() + var/obj/screen/using + + guardianhealthdisplay = new /obj/screen/healths/guardian() + infodisplay += guardianhealthdisplay + + using = new /obj/screen/guardian/Manifest() + using.screen_loc = ui_rhand + static_inventory += using + + using = new /obj/screen/guardian/Recall() + using.screen_loc = ui_lhand + static_inventory += using + + using = new /obj/screen/guardian/ToggleMode() + using.screen_loc = ui_storage1 + static_inventory += using + + using = new /obj/screen/guardian/ToggleLight() + using.screen_loc = ui_inventory + static_inventory += using + + using = new /obj/screen/guardian/Communicate() + using.screen_loc = ui_back + static_inventory += using + + +//HUD BUTTONS + +/obj/screen/guardian + icon = 'icons/mob/guardian.dmi' + icon_state = "base" + +/obj/screen/guardian/Manifest + icon_state = "manifest" + name = "Manifest" + desc = "Spring forth into battle!" + +/obj/screen/guardian/Manifest/Click() + if(isguardian(usr)) + var/mob/living/simple_animal/hostile/guardian/G = usr + G.Manifest() + + +/obj/screen/guardian/Recall + icon_state = "recall" + name = "Recall" + desc = "Return to your user." + +/obj/screen/guardian/Recall/Click() + if(isguardian(usr)) + var/mob/living/simple_animal/hostile/guardian/G = usr + G.Recall() + +/obj/screen/guardian/ToggleMode + icon_state = "toggle" + name = "Toggle Mode" + desc = "Switch between ability modes." + +/obj/screen/guardian/ToggleMode/Click() + if(isguardian(usr)) + var/mob/living/simple_animal/hostile/guardian/G = usr + G.ToggleMode() + +/obj/screen/guardian/Communicate + icon_state = "communicate" + name = "Communicate" + desc = "Communicate telepathically with your user." + +/obj/screen/guardian/Communicate/Click() + if(isguardian(usr)) + var/mob/living/simple_animal/hostile/guardian/G = usr + G.Communicate() + + +/obj/screen/guardian/ToggleLight + icon_state = "light" + name = "Toggle Light" + desc = "Glow like star dust." + +/obj/screen/guardian/ToggleLight/Click() + if(isguardian(usr)) + var/mob/living/simple_animal/hostile/guardian/G = usr + G.ToggleLight() \ No newline at end of file diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 3c11b91a9b0..eb5d99ac9a2 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -8,6 +8,7 @@ var/mob/mymob var/hud_shown = 1 //Used for the HUD toggle (F12) + var/hud_version = 1 //Current displayed version of the HUD var/inventory_shown = 1 //the inventory var/show_intent_icons = 0 var/hotkey_ui_hidden = 0 //This is to hide the buttons that can be used via hotkeys. (hotkeybuttons list of buttons) @@ -22,182 +23,167 @@ var/obj/screen/vampire_blood_display var/obj/screen/alien_plasma_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/move_intent + var/obj/screen/module_store_icon - var/list/adding - var/list/other - var/list/obj/screen/hotkeybuttons + var/list/static_inventory = list() //the screen objects which are static + var/list/toggleable_inventory = list() //the screen objects which can be hidden + var/list/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/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 -datum/hud/New(mob/owner) +/mob/proc/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud(src) + +/datum/hud/New(mob/owner) mymob = owner - instantiate() - ..() +/datum/hud/Destroy() + if(mymob.hud_used == src) + mymob.hud_used = null -/datum/hud/proc/hidden_inventory_update() - if(!mymob) return - if(ishuman(mymob)) - var/mob/living/carbon/human/H = mymob - if(inventory_shown && hud_shown) - if(H.shoes) H.shoes.screen_loc = ui_shoes - if(H.gloves) H.gloves.screen_loc = ui_gloves - if(H.l_ear) H.l_ear.screen_loc = ui_l_ear - if(H.r_ear) H.r_ear.screen_loc = ui_r_ear - if(H.glasses) H.glasses.screen_loc = ui_glasses - if(H.w_uniform) H.w_uniform.screen_loc = ui_iclothing - if(H.wear_suit) H.wear_suit.screen_loc = ui_oclothing - if(H.wear_mask) H.wear_mask.screen_loc = ui_mask - if(H.head) H.head.screen_loc = ui_head - else - if(H.shoes) H.shoes.screen_loc = null - if(H.gloves) H.gloves.screen_loc = null - if(H.l_ear) H.l_ear.screen_loc = null - if(H.r_ear) H.r_ear.screen_loc = null - if(H.glasses) H.glasses.screen_loc = null - if(H.w_uniform) H.w_uniform.screen_loc = null - if(H.wear_suit) H.wear_suit.screen_loc = null - if(H.wear_mask) H.wear_mask.screen_loc = null - if(H.head) H.head.screen_loc = null + qdel(hide_actions_toggle) + hide_actions_toggle = null + qdel(module_store_icon) + module_store_icon = null -/datum/hud/proc/persistant_inventory_update() - if(!mymob) - return + if(static_inventory.len) + for(var/thing in static_inventory) + qdel(thing) + static_inventory.Cut() - if(ishuman(mymob)) - var/mob/living/carbon/human/H = mymob - if(hud_shown) - if(H.s_store) H.s_store.screen_loc = ui_sstore1 - if(H.wear_id) H.wear_id.screen_loc = ui_id - if(H.wear_pda) H.wear_pda.screen_loc = ui_pda - if(H.belt) H.belt.screen_loc = ui_belt - if(H.back) H.back.screen_loc = ui_back - if(H.l_store) H.l_store.screen_loc = ui_storage1 - if(H.r_store) H.r_store.screen_loc = ui_storage2 - else - if(H.s_store) H.s_store.screen_loc = null - if(H.wear_id) H.wear_id.screen_loc = null - if(H.wear_pda) H.wear_pda.screen_loc = null - if(H.belt) H.belt.screen_loc = null - if(H.back) H.back.screen_loc = null - if(H.l_store) H.l_store.screen_loc = null - if(H.r_store) H.r_store.screen_loc = null + inv_slots.Cut() + action_intent = null + move_intent = null + if(toggleable_inventory.len) + for(var/thing in toggleable_inventory) + qdel(thing) + toggleable_inventory.Cut() -/datum/hud/proc/instantiate() - if(!ismob(mymob)) return 0 - if(!mymob.client) return 0 - var/ui_style = ui_style2icon(mymob.client.prefs.UI_style) - var/ui_color = mymob.client.prefs.UI_style_color - var/ui_alpha = mymob.client.prefs.UI_style_alpha + if(hotkeybuttons.len) + for(var/thing in hotkeybuttons) + qdel(thing) + hotkeybuttons.Cut() - if(issmall(mymob)) - monkey_hud(ui_style, ui_color, ui_alpha) - else if(ishuman(mymob)) - human_hud(ui_style, ui_color, ui_alpha) // Pass the player the UI style chosen in preferences - else if( islarva(mymob) || isfacehugger(mymob) ) - larva_hud() - else if (isembryo(mymob)) - embryo_hud() - else if(isalien(mymob)) - alien_hud() - else if(isAI(mymob)) - ai_hud() - else if(isrobot(mymob)) - robot_hud() - else if(isbot(mymob)) - bot_hud() - else if(isobserver(mymob)) - ghost_hud() - else if(isovermind(mymob)) - blob_hud() - else if(mymob.mind && mymob.mind.vampire) - vampire_hud() - else if(isswarmer(mymob)) - swarmer_hud() - else if(isguardian(mymob)) - guardian_hud() - else if(ispet(mymob)) - corgi_hud() + if(infodisplay.len) + for(var/thing in infodisplay) + qdel(thing) + infodisplay.Cut() - reload_fullscreen() + //clear mob refs to screen objects + mymob.throw_icon = null + mymob.internals = null + mymob.healths = null + mymob.healthdoll = null + mymob.pullin = null + mymob.zone_sel = null + + //clear the rest of our reload_fullscreen + lingchemdisplay = null + lingstingdisplay = null + blobpwrdisplay = null + alien_plasma_display = null + vampire_blood_display = null + nightvisionicon = null + + mymob = null + return ..() + +/datum/hud/proc/show_hud(version = 0) + if(!ismob(mymob)) + return 0 + if(!mymob.client) + return 0 + + mymob.client.screen = list() + + var/display_hud_version = version + if(!display_hud_version) //If 0 or blank, display the next hud version + display_hud_version = hud_version + 1 + if(display_hud_version > HUD_VERSIONS) //If the requested version number is greater than the available versions, reset back to the first version + display_hud_version = 1 + + switch(display_hud_version) + if(HUD_STYLE_STANDARD) //Default HUD + hud_shown = 1 //Governs behavior of other procs + if(static_inventory.len) + mymob.client.screen += static_inventory + if(toggleable_inventory.len && inventory_shown) + mymob.client.screen += toggleable_inventory + if(hotkeybuttons.len && !hotkey_ui_hidden) + mymob.client.screen += hotkeybuttons + if(infodisplay.len) + mymob.client.screen += infodisplay + + if(action_intent) + action_intent.screen_loc = initial(action_intent.screen_loc) //Restore intent selection to the original position + + if(HUD_STYLE_REDUCED) //Reduced HUD + hud_shown = 0 //Governs behavior of other procs + if(static_inventory.len) + mymob.client.screen -= static_inventory + if(toggleable_inventory.len) + mymob.client.screen -= toggleable_inventory + if(hotkeybuttons.len) + mymob.client.screen -= hotkeybuttons + if(infodisplay.len) + mymob.client.screen += infodisplay + + //These ones are a part of 'static_inventory', 'toggleable_inventory' or 'hotkeybuttons' but we want them to stay + 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. + + if(HUD_STYLE_NOHUD) //No HUD + hud_shown = 0 //Governs behavior of other procs + if(static_inventory.len) + mymob.client.screen -= static_inventory + if(toggleable_inventory.len) + mymob.client.screen -= toggleable_inventory + if(hotkeybuttons.len) + mymob.client.screen -= hotkeybuttons + if(infodisplay.len) + mymob.client.screen -= infodisplay + + hud_version = display_hud_version persistant_inventory_update() mymob.update_action_buttons() reorganize_alerts() + reload_fullscreen() + +/datum/hud/human/show_hud(version = 0) + ..() + hidden_inventory_update() + +/datum/hud/robot/show_hud(version = 0) + ..() + update_robot_modules_display() + +/datum/hud/proc/hidden_inventory_update() + return + +/datum/hud/proc/persistant_inventory_update() + return //Triggered when F12 is pressed (Unless someone changed something in the DMF) -/mob/verb/button_pressed_F12(var/full = 0 as null) +/mob/verb/button_pressed_F12() set name = "F12" set hidden = 1 - if(hud_used) - if(ishuman(src)) - if(!client) return - if(client.view != world.view) - return - if(hud_used.hud_shown) - hud_used.hud_shown = 0 - if(src.hud_used.adding) - src.client.screen -= src.hud_used.adding - if(src.hud_used.other) - src.client.screen -= src.hud_used.other - if(src.hud_used.hotkeybuttons) - src.client.screen -= src.hud_used.hotkeybuttons - - //Due to some poor coding some things need special treatment: - //These ones are a part of 'adding', 'other' or 'hotkeybuttons' but we want them to stay - if(!full) - src.client.screen += src.hud_used.l_hand_hud_object //we want the hands to be visible - src.client.screen += src.hud_used.r_hand_hud_object //we want the hands to be visible - src.client.screen += src.hud_used.action_intent //we want the intent swticher visible - src.hud_used.action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is. - else - src.client.screen -= src.healths - src.client.screen -= src.internals - src.client.screen -= src.healthdoll - src.client.screen -= src.gun_setting_icon - src.client.screen -= src.hud_used.lingstingdisplay - src.client.screen -= src.hud_used.lingchemdisplay - - //These ones are not a part of 'adding', 'other' or 'hotkeybuttons' but we want them gone. - src.client.screen -= src.zone_sel //zone_sel is a mob variable for some reason. - - else - hud_used.hud_shown = 1 - if(src.hud_used.adding) - src.client.screen += src.hud_used.adding - if(src.hud_used.other && src.hud_used.inventory_shown) - src.client.screen += src.hud_used.other - if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden) - src.client.screen += src.hud_used.hotkeybuttons - if(src.healths) - src.client.screen |= src.healths - if(src.healthdoll) - src.client.screen |= src.healthdoll - if(src.internals) - src.client.screen |= src.internals - if(src.gun_setting_icon) - src.client.screen |= src.gun_setting_icon - if(src.hud_used.lingstingdisplay) - src.client.screen |= src.hud_used.lingstingdisplay - if(src.hud_used.lingchemdisplay) - src.client.screen |= src.hud_used.lingchemdisplay - - src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position - src.client.screen += src.zone_sel //This one is a special snowflake - - hud_used.hidden_inventory_update() - hud_used.persistant_inventory_update() - update_action_buttons() - hud_used.reorganize_alerts() - - else - to_chat(usr, "\red Inventory hiding is currently only supported for human mobs, sorry.") + if(hud_used && client) + hud_used.show_hud() //Shows the next hud preset + usr << "Switched HUD mode. Press F12 to toggle." else - to_chat(usr, "\red This mob type does not use a HUD.") + usr << "This mob type does not use a HUD." + diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index d75f7c8ad61..3a6e9df5dae 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -1,5 +1,5 @@ /obj/screen/human - icon = 'icons/mob/screen1_midnight.dmi' + icon = 'icons/mob/screen_midnight.dmi' /obj/screen/human/toggle name = "toggle" @@ -8,10 +8,10 @@ /obj/screen/human/toggle/Click() if(usr.hud_used.inventory_shown) usr.hud_used.inventory_shown = 0 - usr.client.screen -= usr.hud_used.other + usr.client.screen -= usr.hud_used.toggleable_inventory else usr.hud_used.inventory_shown = 1 - usr.client.screen += usr.hud_used.other + usr.client.screen += usr.hud_used.toggleable_inventory usr.hud_used.hidden_inventory_update() @@ -30,6 +30,7 @@ /obj/screen/ling/sting name = "current sting" + screen_loc = ui_lingstingdisplay /obj/screen/ling/sting/Click() var/mob/living/carbon/U = usr @@ -38,175 +39,147 @@ /obj/screen/ling/chems name = "chemical storage" icon_state = "power_display" + screen_loc = ui_lingchemdisplay -/datum/hud/proc/human_hud(var/ui_style='icons/mob/screen1_White.dmi', var/ui_color = "#ffffff", var/ui_alpha = 255) - src.adding = list() - src.other = list() - src.hotkeybuttons = list() //These can be disabled for hotkey usersx +/mob/living/carbon/human/proc/remake_hud() //used for preference changes mid-round; can't change hud icons without remaking the hud. + if(hud_used) + qdel(hud_used) + hud_used = null + create_mob_hud() + if(hud_used) + hud_used.show_hud(hud_used.hud_version) + +/mob/living/carbon/human/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/human(src, ui_style2icon(client.prefs.UI_style), client.prefs.UI_style_color, client.prefs.UI_style_alpha) + +/datum/hud/human/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.name = "act_intent" - using.dir = SOUTHWEST - using.icon = ui_style - using.icon_state = "intent_"+mymob.a_intent - using.screen_loc = ui_acti + using.icon_state = mymob.a_intent using.color = ui_color using.alpha = ui_alpha - using.layer = 20 - src.adding += using + static_inventory += using action_intent = using - - using = new /obj/screen/mov_intent() - using.name = "mov_intent" - using.dir = SOUTHWEST using.icon = ui_style using.icon_state = (mymob.m_intent == "run" ? "running" : "walking") using.screen_loc = ui_movi - using.layer = 20 using.color = ui_color using.alpha = ui_alpha - src.adding += using + static_inventory += using move_intent = using using = new /obj/screen/drop() - using.name = "drop" using.icon = ui_style - using.icon_state = "act_drop" using.screen_loc = ui_drop_throw - using.layer = 19 using.color = ui_color using.alpha = ui_alpha - src.hotkeybuttons += using + static_inventory += using inv_box = new /obj/screen/inventory() inv_box.name = "i_clothing" - inv_box.dir = SOUTH inv_box.icon = ui_style inv_box.slot_id = slot_w_uniform - inv_box.icon_state = "center" + inv_box.icon_state = "uniform" inv_box.screen_loc = ui_iclothing - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha - src.other += inv_box + toggleable_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "o_clothing" - inv_box.dir = SOUTH inv_box.icon = ui_style inv_box.slot_id = slot_wear_suit - inv_box.icon_state = "equip" + inv_box.icon_state = "suit" inv_box.screen_loc = ui_oclothing inv_box.color = ui_color inv_box.alpha = ui_alpha - inv_box.layer = 19 - src.other += inv_box + toggleable_inventory += inv_box - inv_box = new /obj/screen/inventory() + inv_box = new /obj/screen/inventory/hand() inv_box.name = "r_hand" - inv_box.dir = WEST inv_box.icon = ui_style - inv_box.icon_state = "hand_inactive" - if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use - inv_box.icon_state = "hand_active" + 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 - inv_box.layer = 19 + 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 - src.r_hand_hud_object = inv_box - src.adding += inv_box - - inv_box = new /obj/screen/inventory() - inv_box.name = "l_hand" - inv_box.dir = EAST - inv_box.icon = ui_style - inv_box.icon_state = "hand_inactive" - if(mymob && mymob.hand) //This being 1 means the left hand is in use - inv_box.icon_state = "hand_active" inv_box.screen_loc = ui_lhand inv_box.slot_id = slot_l_hand - inv_box.layer = 19 - inv_box.color = ui_color - inv_box.alpha = ui_alpha - src.l_hand_hud_object = inv_box - src.adding += inv_box + static_inventory += inv_box - using = new /obj/screen/inventory() + using = new /obj/screen/swap_hand() using.name = "hand" - using.dir = SOUTH using.icon = ui_style - using.icon_state = "hand1" + using.icon_state = "swap_1" using.screen_loc = ui_swaphand1 - using.layer = 19 using.color = ui_color using.alpha = ui_alpha - src.adding += using + static_inventory += using - using = new /obj/screen/inventory() + using = new /obj/screen/swap_hand() using.name = "hand" - using.dir = SOUTH using.icon = ui_style - using.icon_state = "hand2" + using.icon_state = "swap_2" using.screen_loc = ui_swaphand2 - using.layer = 19 using.color = ui_color using.alpha = ui_alpha - src.adding += using + static_inventory += using inv_box = new /obj/screen/inventory() inv_box.name = "id" - inv_box.dir = NORTH inv_box.icon = ui_style inv_box.icon_state = "id" inv_box.screen_loc = ui_id inv_box.slot_id = slot_wear_id - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha - src.adding += inv_box + static_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "pda" - inv_box.dir = NORTH inv_box.icon = ui_style inv_box.icon_state = "pda" inv_box.screen_loc = ui_pda inv_box.slot_id = slot_wear_pda - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha - src.adding += inv_box + static_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "mask" - inv_box.dir = NORTH inv_box.icon = ui_style - inv_box.icon_state = "equip" + inv_box.icon_state = "mask" inv_box.screen_loc = ui_mask inv_box.slot_id = slot_wear_mask - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha - src.other += inv_box + toggleable_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "back" - inv_box.dir = NORTH inv_box.icon = ui_style inv_box.icon_state = "back" inv_box.screen_loc = ui_back inv_box.slot_id = slot_back - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha - src.adding += inv_box + static_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "storage1" @@ -214,10 +187,9 @@ inv_box.icon_state = "pocket" inv_box.screen_loc = ui_storage1 inv_box.slot_id = slot_l_store - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha - src.adding += inv_box + static_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "storage2" @@ -225,52 +197,40 @@ inv_box.icon_state = "pocket" inv_box.screen_loc = ui_storage2 inv_box.slot_id = slot_r_store - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha - src.adding += inv_box + static_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "suit storage" inv_box.icon = ui_style - inv_box.dir = 8 //The sprite at dir=8 has the background whereas the others don't. - inv_box.icon_state = "belt" - inv_box.screen_loc = ui_sstore1 - inv_box.slot_id = slot_s_store - inv_box.layer = 19 + inv_box.icon_state = "suit_storage" inv_box.color = ui_color inv_box.alpha = ui_alpha - src.adding += inv_box + inv_box.screen_loc = ui_sstore1 + inv_box.slot_id = slot_s_store + static_inventory += inv_box using = new /obj/screen/resist() - using.name = "resist" using.icon = ui_style - using.icon_state = "act_resist" - using.screen_loc = ui_pull_resist - using.layer = 19 using.color = ui_color using.alpha = ui_alpha - src.hotkeybuttons += using + using.screen_loc = ui_pull_resist + hotkeybuttons += using using = new /obj/screen/human/toggle() - using.name = "toggle" using.icon = ui_style - using.icon_state = "other" - using.screen_loc = ui_inventory - using.layer = 20 using.color = ui_color using.alpha = ui_alpha - src.adding += using + using.screen_loc = ui_inventory + static_inventory += using using = new /obj/screen/human/equip() - using.name = "equip" using.icon = ui_style - using.icon_state = "act_equip" - using.screen_loc = ui_equip - using.layer = 20 using.color = ui_color using.alpha = ui_alpha - src.adding += using + using.screen_loc = ui_equip + static_inventory += using inv_box = new /obj/screen/inventory() inv_box.name = "gloves" @@ -278,10 +238,9 @@ inv_box.icon_state = "gloves" inv_box.screen_loc = ui_gloves inv_box.slot_id = slot_gloves - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha - src.other += inv_box + toggleable_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "eyes" @@ -289,10 +248,9 @@ inv_box.icon_state = "glasses" inv_box.screen_loc = ui_glasses inv_box.slot_id = slot_glasses - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha - src.other += inv_box + toggleable_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "l_ear" @@ -300,10 +258,9 @@ inv_box.icon_state = "ears" inv_box.screen_loc = ui_l_ear inv_box.slot_id = slot_l_ear - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha - src.other += inv_box + toggleable_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "r_ear" @@ -311,21 +268,19 @@ inv_box.icon_state = "ears" inv_box.screen_loc = ui_r_ear inv_box.slot_id = slot_r_ear - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha - src.other += inv_box + toggleable_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "head" inv_box.icon = ui_style - inv_box.icon_state = "hair" + inv_box.icon_state = "head" inv_box.screen_loc = ui_head inv_box.slot_id = slot_head - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha - src.other += inv_box + toggleable_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "shoes" @@ -333,10 +288,9 @@ inv_box.icon_state = "shoes" inv_box.screen_loc = ui_shoes inv_box.slot_id = slot_shoes - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha - src.other += inv_box + toggleable_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "belt" @@ -344,85 +298,150 @@ inv_box.icon_state = "belt" inv_box.screen_loc = ui_belt inv_box.slot_id = slot_belt - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha - src.adding += inv_box + static_inventory += inv_box mymob.throw_icon = new /obj/screen/throw_catch() mymob.throw_icon.icon = ui_style - mymob.throw_icon.icon_state = "act_throw_off" - mymob.throw_icon.name = "throw" mymob.throw_icon.screen_loc = ui_drop_throw mymob.throw_icon.color = ui_color mymob.throw_icon.alpha = ui_alpha - src.hotkeybuttons += mymob.throw_icon + hotkeybuttons += mymob.throw_icon mymob.internals = new /obj/screen/internals() - mymob.internals.icon = ui_style - mymob.internals.icon_state = "internal0" - mymob.internals.name = "internal" - mymob.internals.screen_loc = ui_internal + infodisplay += mymob.internals - mymob.healths = new /obj/screen() - mymob.healths.icon = ui_style - mymob.healths.icon_state = "health0" - mymob.healths.name = "health" - mymob.healths.screen_loc = ui_health + mymob.healths = new /obj/screen/healths() + infodisplay += mymob.healths - mymob.healthdoll = new /obj/screen() - mymob.healthdoll.icon = ui_style - mymob.healthdoll.icon_state = "healthdoll_DEAD" - mymob.healthdoll.name = "health doll" - mymob.healthdoll.screen_loc = ui_healthdoll + 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 - src.hotkeybuttons += mymob.pullin + static_inventory += mymob.pullin lingchemdisplay = new /obj/screen/ling/chems() - lingchemdisplay.screen_loc = ui_lingchemdisplay + infodisplay += lingchemdisplay lingstingdisplay = new /obj/screen/ling/sting() - lingstingdisplay.screen_loc = ui_lingstingdisplay + infodisplay += lingstingdisplay - mymob.zone_sel = new /obj/screen/zone_sel( null ) + mymob.zone_sel = new /obj/screen/zone_sel() mymob.zone_sel.icon = ui_style - mymob.zone_sel.color = ui_color - mymob.zone_sel.alpha = ui_alpha - mymob.zone_sel.overlays.Cut() - mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]") + mymob.zone_sel.update_icon(mymob) + static_inventory += mymob.zone_sel - //Handle the gun settings buttons - mymob.gun_setting_icon = new /obj/screen/gun/mode(null) - //mymob.gun_setting_icon.color = ui_color - mymob.gun_setting_icon.alpha = ui_alpha - - mymob.item_use_icon = new /obj/screen/gun/item(null) - //mymob.item_use_icon.color = ui_color - mymob.item_use_icon.alpha = ui_alpha - - /*mymob.gun_move_icon = new /obj/screen/gun/move(null) - //mymob.gun_move_icon.color = ui_color - mymob.gun_move_icon.alpha = ui_alpha - - mymob.gun_run_icon = new /obj/screen/gun/run(null) - //mymob.gun_run_icon.color = ui_color - mymob.gun_run_icon.alpha = ui_alpha*/ - - if (mymob.client) - if (mymob.client.gun_mode) // If in aim mode, correct the sprite - mymob.gun_setting_icon.dir = 2 - - mymob.client.screen = list() - - mymob.client.screen += list(mymob.throw_icon, mymob.zone_sel, mymob.internals, mymob.healths, mymob.healthdoll, mymob.pullin, mymob.gun_setting_icon, lingchemdisplay, lingstingdisplay) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach ) - mymob.client.screen += src.adding + src.hotkeybuttons - mymob.client.screen += mymob.client.void 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 + var/mob/living/carbon/human/H = mymob + if(inventory_shown && hud_shown) + if(H.shoes) + H.shoes.screen_loc = ui_shoes + H.client.screen += H.shoes + if(H.gloves) + H.gloves.screen_loc = ui_gloves + H.client.screen += H.gloves + if(H.l_ear) + H.l_ear.screen_loc = ui_l_ear + H.client.screen += H.l_ear + if(H.r_ear) + H.r_ear.screen_loc = ui_r_ear + H.client.screen += H.r_ear + if(H.glasses) + H.glasses.screen_loc = ui_glasses + H.client.screen += H.glasses + if(H.w_uniform) + H.w_uniform.screen_loc = ui_iclothing + H.client.screen += H.w_uniform + if(H.wear_suit) + H.wear_suit.screen_loc = ui_oclothing + H.client.screen += H.wear_suit + if(H.wear_mask) + H.wear_mask.screen_loc = ui_mask + H.client.screen += H.wear_mask + if(H.head) + H.head.screen_loc = ui_head + H.client.screen += H.head + else + if(H.shoes) H.shoes.screen_loc = null + if(H.gloves) H.gloves.screen_loc = null + if(H.l_ear) H.l_ear.screen_loc = null + if(H.r_ear) H.r_ear.screen_loc = null + if(H.glasses) H.glasses.screen_loc = null + if(H.w_uniform) H.w_uniform.screen_loc = null + if(H.wear_suit) H.wear_suit.screen_loc = null + if(H.wear_mask) H.wear_mask.screen_loc = null + if(H.head) H.head.screen_loc = null + +/datum/hud/human/persistant_inventory_update() + if(!mymob) + return + var/mob/living/carbon/human/H = mymob + if(hud_shown) + if(H.s_store) + H.s_store.screen_loc = ui_sstore1 + H.client.screen += H.s_store + if(H.wear_id) + H.wear_id.screen_loc = ui_id + H.client.screen += H.wear_id + if(H.wear_pda) + H.wear_pda.screen_loc = ui_pda + H.client.screen += H.wear_pda + if(H.belt) + H.belt.screen_loc = ui_belt + H.client.screen += H.belt + if(H.back) + H.back.screen_loc = ui_back + H.client.screen += H.back + if(H.l_store) + H.l_store.screen_loc = ui_storage1 + H.client.screen += H.l_store + if(H.r_store) + H.r_store.screen_loc = ui_storage2 + H.client.screen += H.r_store + else + if(H.s_store) + H.s_store.screen_loc = null + if(H.wear_id) + H.wear_id.screen_loc = null + if(H.wear_pda) + H.wear_pda.screen_loc = null + if(H.belt) + H.belt.screen_loc = null + if(H.back) + H.back.screen_loc = null + if(H.l_store) + H.l_store.screen_loc = null + if(H.r_store) + H.r_store.screen_loc = null + + if(hud_version != HUD_STYLE_NOHUD) + if(H.r_hand) + H.r_hand.screen_loc = ui_rhand + H.client.screen += H.r_hand + if(H.l_hand) + H.l_hand.screen_loc = ui_lhand + H.client.screen += H.l_hand + else + if(H.r_hand) + H.r_hand.screen_loc = null + if(H.l_hand) + H.l_hand.screen_loc = null + + /mob/living/carbon/human/verb/toggle_hotkey_verbs() set category = "OOC" set name = "Toggle Hotkey Buttons" diff --git a/code/_onclick/hud/monkey.dm b/code/_onclick/hud/monkey.dm index 34d26e77d6d..ef87435c79f 100644 --- a/code/_onclick/hud/monkey.dm +++ b/code/_onclick/hud/monkey.dm @@ -1,194 +1,131 @@ -/datum/hud/proc/monkey_hud(var/ui_style='icons/mob/screen1_White.dmi', var/ui_color = "#ffffff", var/ui_alpha = 255) +/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) - src.adding = list() - src.other = list() - src.hotkeybuttons = list() //These can be disabled for hotkey usersx +/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.name = "act_intent" - using.dir = SOUTHWEST - using.icon = ui_style - using.icon_state = "intent_"+mymob.a_intent - using.screen_loc = ui_acti + using.icon_state = mymob.a_intent using.color = ui_color using.alpha = ui_alpha - using.layer = 20 - src.adding += using + static_inventory += using action_intent = using using = new /obj/screen/mov_intent() - using.name = "mov_intent" - using.dir = SOUTHWEST using.icon = ui_style using.icon_state = (mymob.m_intent == "run" ? "running" : "walking") using.screen_loc = ui_movi - using.layer = 20 using.color = ui_color using.alpha = ui_alpha - src.adding += using + static_inventory += using move_intent = using using = new /obj/screen/drop() - using.name = "drop" using.icon = ui_style - using.icon_state = "act_drop" using.screen_loc = ui_drop_throw - using.layer = 19 using.color = ui_color using.alpha = ui_alpha - src.adding += using + static_inventory += using - inv_box = new /obj/screen/inventory() + inv_box = new /obj/screen/inventory/hand() inv_box.name = "r_hand" - inv_box.dir = WEST inv_box.icon = ui_style - inv_box.icon_state = "hand_inactive" - if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use - inv_box.icon_state = "hand_active" + 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 - inv_box.layer = 19 + 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 - src.r_hand_hud_object = inv_box - src.adding += inv_box - - inv_box = new /obj/screen/inventory() - inv_box.name = "l_hand" - inv_box.dir = EAST - inv_box.icon = ui_style - inv_box.icon_state = "hand_inactive" - if(mymob && mymob.hand) //This being 1 means the left hand is in use - inv_box.icon_state = "hand_active" inv_box.screen_loc = ui_lhand inv_box.slot_id = slot_l_hand - inv_box.layer = 19 - inv_box.color = ui_color - inv_box.alpha = ui_alpha - src.l_hand_hud_object = inv_box - src.adding += inv_box + static_inventory += inv_box - using = new /obj/screen/inventory() + using = new /obj/screen/swap_hand() using.name = "hand" - using.dir = SOUTH using.icon = ui_style - using.icon_state = "hand1" + using.icon_state = "swap_1_m" using.screen_loc = ui_swaphand1 - using.layer = 19 using.color = ui_color using.alpha = ui_alpha - src.adding += using + static_inventory += using - using = new /obj/screen/inventory() + using = new /obj/screen/swap_hand() using.name = "hand" - using.dir = SOUTH using.icon = ui_style - using.icon_state = "hand2" + using.icon_state = "swap_2" using.screen_loc = ui_swaphand2 - using.layer = 19 using.color = ui_color using.alpha = ui_alpha - src.adding += using + static_inventory += using inv_box = new /obj/screen/inventory() inv_box.name = "mask" - inv_box.dir = NORTH inv_box.icon = ui_style - inv_box.icon_state = "equip" - inv_box.screen_loc = ui_monkey_mask + inv_box.icon_state = "mask" + inv_box.screen_loc = ui_mask inv_box.slot_id = slot_wear_mask - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha - src.adding += inv_box + toggleable_inventory += inv_box inv_box = new /obj/screen/inventory() inv_box.name = "back" - inv_box.dir = NORTHEAST inv_box.icon = ui_style - inv_box.icon_state = "equip" + inv_box.icon_state = "back" inv_box.screen_loc = ui_back inv_box.slot_id = slot_back - inv_box.layer = 19 inv_box.color = ui_color inv_box.alpha = ui_alpha - src.adding += inv_box + static_inventory += inv_box mymob.throw_icon = new /obj/screen/throw_catch() mymob.throw_icon.icon = ui_style - mymob.throw_icon.icon_state = "act_throw_off" - mymob.throw_icon.name = "throw" mymob.throw_icon.screen_loc = ui_drop_throw mymob.throw_icon.color = ui_color mymob.throw_icon.alpha = ui_alpha - src.hotkeybuttons += mymob.throw_icon + hotkeybuttons += mymob.throw_icon mymob.internals = new /obj/screen/internals() - mymob.internals.icon = ui_style - mymob.internals.icon_state = "internal0" - mymob.internals.name = "internal" - mymob.internals.screen_loc = ui_internal + infodisplay += mymob.internals - mymob.healths = new /obj/screen() - mymob.healths.icon = ui_style - mymob.healths.icon_state = "health0" - mymob.healths.name = "health" - mymob.healths.screen_loc = ui_health + mymob.healths = new /obj/screen/healths() + infodisplay += mymob.healths - mymob.healthdoll = new /obj/screen() - mymob.healthdoll.icon = ui_style - mymob.healthdoll.icon_state = "healthdoll_DEAD" - mymob.healthdoll.name = "health doll" - mymob.healthdoll.screen_loc = ui_healthdoll + 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 - src.hotkeybuttons += mymob.pullin + static_inventory += mymob.pullin lingchemdisplay = new /obj/screen/ling/chems() - lingchemdisplay.screen_loc = ui_lingchemdisplay + infodisplay += lingchemdisplay lingstingdisplay = new /obj/screen/ling/sting() - lingstingdisplay.screen_loc = ui_lingstingdisplay + infodisplay += lingstingdisplay - mymob.zone_sel = new /obj/screen/zone_sel( null ) + mymob.zone_sel = new /obj/screen/zone_sel() mymob.zone_sel.icon = ui_style - mymob.zone_sel.color = ui_color - mymob.zone_sel.alpha = ui_alpha - mymob.zone_sel.overlays.Cut() - mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]") + mymob.zone_sel.update_icon(mymob) + static_inventory += mymob.zone_sel - //Handle the gun settings buttons - mymob.gun_setting_icon = new /obj/screen/gun/mode(null) - //mymob.gun_setting_icon.color = ui_color - mymob.gun_setting_icon.alpha = ui_alpha + inventory_shown = 0 - mymob.item_use_icon = new /obj/screen/gun/item(null) - //mymob.item_use_icon.color = ui_color - mymob.item_use_icon.alpha = ui_alpha - - /*mymob.gun_move_icon = new /obj/screen/gun/move(null) - //mymob.gun_move_icon.color = ui_color - mymob.gun_move_icon.alpha = ui_alpha - - mymob.gun_run_icon = new /obj/screen/gun/run(null) - //mymob.gun_run_icon.color = ui_color - mymob.gun_run_icon.alpha = ui_alpha*/ - - if (mymob.client) - if (mymob.client.gun_mode) // If in aim mode, correct the sprite - mymob.gun_setting_icon.dir = 2 - - - mymob.client.screen = list() - - mymob.client.screen += list(mymob.throw_icon, mymob.zone_sel, mymob.internals, mymob.healths, mymob.healthdoll, mymob.pullin, mymob.gun_setting_icon, lingchemdisplay, lingstingdisplay) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach ) - mymob.client.screen += src.adding + src.hotkeybuttons - mymob.client.screen += mymob.client.void - - return \ No newline at end of file + 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() diff --git a/code/_onclick/hud/other_mobs.dm b/code/_onclick/hud/other_mobs.dm index 331c04fc69f..29d7295feac 100644 --- a/code/_onclick/hud/other_mobs.dm +++ b/code/_onclick/hud/other_mobs.dm @@ -1,41 +1,35 @@ +/mob/living/simple_animal/pet/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/corgi(src) -/datum/hud/proc/unplayer_hud() - return +/datum/hud/corgi/New(mob/user) + ..() -/datum/hud/proc/ghost_hud() - return - -/datum/hud/proc/corgi_hud(u) - mymob.healths = new /obj/screen() - mymob.healths.icon = 'icons/mob/screen1_corgi.dmi' - mymob.healths.icon_state = "health0" - mymob.healths.name = "health" - mymob.healths.screen_loc = ui_health + mymob.healths = new /obj/screen/healths/corgi() + infodisplay += mymob.healths mymob.pullin = new /obj/screen/pull() - mymob.pullin.icon = 'icons/mob/screen1_corgi.dmi' + mymob.pullin.icon = 'icons/mob/screen_corgi.dmi' mymob.pullin.update_icon(mymob) mymob.pullin.screen_loc = ui_construct_pull - - mymob.client.screen = list() - mymob.client.screen += list(mymob.healths, mymob.pullin) + static_inventory += mymob.pullin -/datum/hud/proc/blob_hud(ui_style = 'icons/mob/screen1_Midnight.dmi') +/mob/camera/blob/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/blob_overmind(src) + +/datum/hud/blob_overmind/New(mob/user) + ..() blobpwrdisplay = new /obj/screen() blobpwrdisplay.name = "blob power" blobpwrdisplay.icon_state = "block" blobpwrdisplay.screen_loc = ui_health - blobpwrdisplay.layer = 20 + static_inventory += blobpwrdisplay blobhealthdisplay = new /obj/screen() blobhealthdisplay.name = "blob health" blobhealthdisplay.icon_state = "block" blobhealthdisplay.screen_loc = ui_internal - blobhealthdisplay.layer = 20 - - mymob.client.screen = list() - - mymob.client.screen += list(blobpwrdisplay, blobhealthdisplay) - mymob.client.screen += mymob.client.void \ No newline at end of file + static_inventory += blobhealthdisplay \ No newline at end of file diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 8a0fadf4e26..7aa9839d663 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -1,5 +1,5 @@ /obj/screen/robot - icon = 'icons/mob/screen1_robot.dmi' + icon = 'icons/mob/screen_robot.dmi' /obj/screen/robot/module name = "cyborg module" @@ -61,8 +61,9 @@ R.hud_used.update_robot_modules_display() /obj/screen/robot/lamp - name = "headlamp" + name = "Toggle Headlamp" icon_state = "lamp0" + screen_loc = ui_borg_lamp /obj/screen/robot/lamp/Click() if(isrobot(usr)) @@ -78,161 +79,113 @@ var/mob/living/silicon/robot/R = usr R.installed_modules() -/datum/hud/proc/robot_hud() +/mob/living/silicon/robot/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/robot(src) - src.adding = list() - src.other = list() +/datum/hud/robot/New(mob/user) + ..() var/obj/screen/using - + var/mob/living/silicon/robot/mymobR = mymob //Radio using = new /obj/screen/robot/radio() - using.name = "radio" - using.dir = SOUTHWEST - using.icon = 'icons/mob/screen1_robot.dmi' - using.icon_state = "radio" using.screen_loc = ui_borg_radio - using.layer = 20 - src.adding += using + static_inventory += using //Module select - using = new /obj/screen/robot/module1() - using.name = "module1" - using.dir = SOUTHWEST - using.icon = 'icons/mob/screen1_robot.dmi' - using.icon_state = "inv1" using.screen_loc = ui_inv1 - using.layer = 20 - src.adding += using - mymob:inv1 = using + static_inventory += using + mymobR.inv1 = using using = new /obj/screen/robot/module2() - using.name = "module2" - using.dir = SOUTHWEST - using.icon = 'icons/mob/screen1_robot.dmi' - using.icon_state = "inv2" using.screen_loc = ui_inv2 - using.layer = 20 - src.adding += using - mymob:inv2 = using + static_inventory += using + mymobR.inv2 = using using = new /obj/screen/robot/module3() - using.name = "module3" - using.dir = SOUTHWEST - using.icon = 'icons/mob/screen1_robot.dmi' - using.icon_state = "inv3" using.screen_loc = ui_inv3 - using.layer = 20 - src.adding += using - mymob:inv3 = using + static_inventory += using + mymobR.inv3 = using //End of module select //Sec/Med HUDs using = new /obj/screen/ai/sensors() - using.name = "Toggle Sensor Augmentation" - using.icon = 'icons/mob/screen_ai.dmi' - using.icon_state = "ai_sensor" using.screen_loc = ui_borg_sensor - using.layer = 20 - adding += using + static_inventory += using -//Intent - using = new /obj/screen/act_intent() - using.name = "act_intent" - using.dir = SOUTHWEST - using.icon = 'icons/mob/screen1_robot.dmi' - using.icon_state = (mymob.a_intent == "harm" ? "harm" : mymob.a_intent) - using.screen_loc = ui_borg_intents - using.layer = 20 - src.adding += using +//Intent + using = new /obj/screen/act_intent/robot() + using.icon_state = mymob.a_intent + static_inventory += using action_intent = using //Health - mymob.healths = new /obj/screen() - mymob.healths.icon = 'icons/mob/screen1_robot.dmi' - mymob.healths.icon_state = "health0" - mymob.healths.name = "health" - mymob.healths.screen_loc = ui_borg_health + mymob.healths = new /obj/screen/healths/robot() + infodisplay += mymob.healths //Installed Module mymob.hands = new /obj/screen/robot/module() - mymob.hands.icon = 'icons/mob/screen1_robot.dmi' - mymob.hands.icon_state = "nomod" - mymob.hands.name = "module" mymob.hands.screen_loc = ui_borg_module + static_inventory += mymob.hands - -//Store - mymob.throw_icon = new /obj/screen/robot/store() - mymob.throw_icon.icon = 'icons/mob/screen1_robot.dmi' - mymob.throw_icon.icon_state = "store" - mymob.throw_icon.name = "store" - mymob.throw_icon.screen_loc = ui_borg_store - -//Headlamp - mymob:lamp_button = new /obj/screen/robot/lamp() - mymob:lamp_button.icon = 'icons/mob/screen1_robot.dmi' - mymob:lamp_button.icon_state = "lamp0" - mymob:lamp_button.name = "Toggle Headlamp" - mymob:lamp_button.screen_loc = ui_borg_lamp + module_store_icon = new /obj/screen/robot/store() + module_store_icon.screen_loc = ui_borg_store mymob.pullin = new /obj/screen/pull() - mymob.pullin.icon = 'icons/mob/screen1_robot.dmi' + mymob.pullin.icon = 'icons/mob/screen_robot.dmi' mymob.pullin.update_icon(mymob) mymob.pullin.screen_loc = ui_borg_pull + hotkeybuttons += mymob.pullin - mymob.zone_sel = new /obj/screen/zone_sel() - mymob.zone_sel.icon = 'icons/mob/screen1_robot.dmi' - mymob.zone_sel.overlays.Cut() - mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]") + mymob.zone_sel = new /obj/screen/zone_sel/robot() + mymob.zone_sel.update_icon(mymob) + static_inventory += mymob.zone_sel - mymob.gun_setting_icon = new /obj/screen/gun/mode(null) - mymob.item_use_icon = new /obj/screen/gun/item(null) - - mymob.client.screen = list() - - mymob.client.screen += list(mymob.zone_sel, mymob.hands, mymob.healths, mymob.pullin, mymob.gun_setting_icon, mymob:lamp_button) //, mymob.rest, mymob.sleep, mymob.mach ) - mymob.client.screen += src.adding + src.other - mymob.client.screen += mymob.client.void - return +//Headlamp + mymobR.lamp_button = new /obj/screen/robot/lamp() + mymobR.lamp_button.screen_loc = ui_borg_lamp + static_inventory += mymobR.lamp_button /datum/hud/proc/toggle_show_robot_modules() - if(!isrobot(mymob)) return + if(!isrobot(mymob)) + return - var/mob/living/silicon/robot/r = mymob + var/mob/living/silicon/robot/R = mymob - r.shown_robot_modules = !r.shown_robot_modules + R.shown_robot_modules = !R.shown_robot_modules update_robot_modules_display() /datum/hud/proc/update_robot_modules_display() - if(!isrobot(mymob)) return + if(!isrobot(mymob)) + return - var/mob/living/silicon/robot/r = mymob + var/mob/living/silicon/robot/R = mymob - if(!r.client) return + if(!R.client) + return - if(r.shown_robot_modules) + if(!R.module) + return + + if(R.shown_robot_modules && hud_shown) //Modules display is shown - r.client.screen += r.throw_icon //"store" icon + R.client.screen += module_store_icon //"store" icon - if(!r.module) - to_chat(usr, "\red No module selected") + if(!R.module.modules) + to_chat(usr, "Selected module has no modules to select.") return - if(!r.module.modules) - to_chat(usr, "\red Selected module has no modules to select") + if(!R.robot_modules_background) return - if(!r.robot_modules_background) - return - - var/display_rows = round((r.module.modules.len) / 8) +1 //+1 because round() returns floor of number - r.robot_modules_background.screen_loc = "CENTER-4:16,SOUTH+1:7 to CENTER+3:16,SOUTH+[display_rows]:7" - r.client.screen += r.robot_modules_background + var/display_rows = Ceiling(R.module.modules.len / 8) + R.robot_modules_background.screen_loc = "CENTER-4:16,SOUTH+1:7 to CENTER+3:16,SOUTH+[display_rows]:7" + R.client.screen += R.robot_modules_background var/x = -4 //Start at CENTER-4,SOUTH+1 var/y = 1 @@ -240,17 +193,17 @@ //Unfortunately adding the emag module to the list of modules has to be here. This is because a borg can //be emagged before they actually select a module. - or some situation can cause them to get a new module // - or some situation might cause them to get de-emagged or something. - if(r.emagged) - if(!(r.module.emag in r.module.modules)) - r.module.modules.Add(r.module.emag) + if(R.emagged) + if(!(R.module.emag in R.module.modules)) + R.module.modules.Add(R.module.emag) else - if(r.module.emag in r.module.modules) - r.module.modules.Remove(r.module.emag) + if(R.module.emag in R.module.modules) + R.module.modules.Remove(R.module.emag) - for(var/atom/movable/A in r.module.modules) - if( (A != r.module_state_1) && (A != r.module_state_2) && (A != r.module_state_3) ) + for(var/atom/movable/A in R.module.modules) + if( (A != R.module_state_1) && (A != R.module_state_2) && (A != R.module_state_3) ) //Module is not currently active - r.client.screen += A + R.client.screen += A if(x < 0) A.screen_loc = "CENTER[x]:16,SOUTH+[y]:7" else @@ -264,11 +217,11 @@ else //Modules display is hidden - r.client.screen -= r.throw_icon //"store" icon + R.client.screen -= module_store_icon - for(var/atom/A in r.module.modules) - if( (A != r.module_state_1) && (A != r.module_state_2) && (A != r.module_state_3) ) + for(var/atom/A in R.module.modules) + if( (A != R.module_state_1) && (A != R.module_state_2) && (A != R.module_state_3) ) //Module is not currently active - r.client.screen -= A - r.shown_robot_modules = 0 - r.client.screen -= r.robot_modules_background + R.client.screen -= A + R.shown_robot_modules = 0 + R.client.screen -= R.robot_modules_background diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 3ab8f58fd99..1f0e6205200 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -8,11 +8,11 @@ */ /obj/screen name = "" - icon = 'icons/mob/screen1.dmi' - layer = 20.0 + icon = 'icons/mob/screen_gen.dmi' + layer = 20 unacidable = 1 var/obj/master = null //A reference to the object in the slot. Grabs or items, generally. - var/gun_click_time = -100 //I'm lazy. + var/datum/hud/hud = null /obj/screen/Destroy() master = null @@ -26,11 +26,6 @@ maptext_height = 480 maptext_width = 480 - -/obj/screen/inventory - var/slot_id //The indentifier for the slot. It has nothing to do with ID cards. - - /obj/screen/close name = "close" @@ -43,7 +38,6 @@ /obj/screen/drop name = "drop" - icon = 'icons/mob/screen1_midnight.dmi' icon_state = "act_drop" layer = 19 @@ -66,6 +60,7 @@ /obj/screen/act_intent name = "intent" icon_state = "help" + screen_loc = ui_acti /obj/screen/act_intent/Click(location, control, params) if(ishuman(usr)) @@ -85,9 +80,18 @@ else usr.a_intent_change("right") +/obj/screen/act_intent/alien + icon = 'icons/mob/screen_alien.dmi' + screen_loc = ui_acti + +/obj/screen/act_intent/robot + icon = 'icons/mob/screen_robot.dmi' + screen_loc = ui_borg_intents + /obj/screen/internals name = "toggle internals" icon_state = "internal0" + screen_loc = ui_internal /obj/screen/internals/Click() if(iscarbon(usr)) @@ -201,7 +205,6 @@ /obj/screen/mov_intent name = "run/walk toggle" - icon = 'icons/mob/screen1_midnight.dmi' icon_state = "running" /obj/screen/mov_intent/Click() @@ -226,7 +229,6 @@ /obj/screen/pull name = "stop pulling" - icon = 'icons/mob/screen1_Midnight.dmi' icon_state = "pull" /obj/screen/pull/Click() @@ -241,7 +243,7 @@ /obj/screen/resist name = "resist" - icon = 'icons/mob/screen1_midnight.dmi' + icon = 'icons/mob/screen_midnight.dmi' icon_state = "act_resist" layer = 19 @@ -252,7 +254,7 @@ /obj/screen/throw_catch name = "throw/catch" - icon = 'icons/mob/screen1_midnight.dmi' + icon = 'icons/mob/screen_midnight.dmi' icon_state = "act_throw_off" /obj/screen/throw_catch/Click() @@ -347,59 +349,126 @@ overlays.Cut() overlays += image('icons/mob/zone_sel.dmi', "[selecting]") -/obj/screen/gun - name = "gun" - icon = 'icons/mob/screen1.dmi' - master = null - dir = 2 +/obj/screen/zone_sel/alien + icon = 'icons/mob/screen_alien.dmi' -/obj/screen/gun/mode - name = "Toggle Gun Mode" - icon_state = "gun0" - screen_loc = ui_gun_select +/obj/screen/zone_sel/alien/update_icon(mob/user) + overlays.Cut() + overlays += image('icons/mob/screen_alien.dmi', "[selecting]") -/obj/screen/gun/mode/Click() - usr.client.ToggleGunMode() - -/obj/screen/gun/item - name = "Allow Item Use" - icon_state = "no_item0" - screen_loc = ui_gun1 - -/obj/screen/gun/item/Click() - if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. - return - if(!istype(usr.get_active_hand(), /obj/item/weapon/gun)) - to_chat(usr, "You need your gun in your active hand to do that!") - return - usr.client.AllowTargetClick() - gun_click_time = world.time +/obj/screen/zone_sel/robot + icon = 'icons/mob/screen_robot.dmi' +/obj/screen/inventory + var/slot_id //The indentifier for the slot. It has nothing to do with ID cards. + 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.stat || usr.paralysis || usr.stunned || usr.weakened) + 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(iscarbon(usr)) - var/mob/living/carbon/C = usr - C.activate_hand("r") - if("l_hand") - if(iscarbon(usr)) - var/mob/living/carbon/C = usr - C.activate_hand("l") - if("swap") - usr:swap_hand() - if("hand") - usr:swap_hand() - else - if(usr.attack_ui(slot_id)) - usr.update_inv_l_hand(0) - usr.update_inv_r_hand(0) + if(usr.attack_ui(slot_id)) + usr.update_inv_l_hand(0) + usr.update_inv_r_hand(0) return 1 + +/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/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/healths + name = "health" + icon_state = "health0" + screen_loc = ui_health + +/obj/screen/healths/alien + icon = 'icons/mob/screen_alien.dmi' + screen_loc = ui_alien_health + +/obj/screen/healths/bot + icon = 'icons/mob/screen_bot.dmi' + screen_loc = ui_borg_health + +/obj/screen/healths/robot + icon = 'icons/mob/screen_robot.dmi' + screen_loc = ui_borg_health + +/obj/screen/healths/corgi + icon = 'icons/mob/screen_corgi.dmi' + + +/obj/screen/healths/guardian + name = "summoner health" + icon = 'icons/mob/guardian.dmi' + icon_state = "base" + screen_loc = ui_health + mouse_opacity = 0 + +/obj/screen/healthdoll + name = "health doll" + icon_state = "healthdoll_DEAD" + screen_loc = ui_healthdoll + diff --git a/code/_onclick/hud/swarmer.dm b/code/_onclick/hud/swarmer.dm new file mode 100644 index 00000000000..84f5811cc8d --- /dev/null +++ b/code/_onclick/hud/swarmer.dm @@ -0,0 +1,97 @@ + +////HUD NONSENSE//// +/obj/screen/swarmer + icon = 'icons/mob/swarmer.dmi' + +/obj/screen/swarmer/FabricateTrap + icon_state = "ui_trap" + name = "Create trap (Costs 5 Resources)" + desc = "Creates a trap that will nonlethally shock any non-swarmer that attempts to cross it. (Costs 5 resources)" + +/obj/screen/swarmer/FabricateTrap/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.CreateTrap() + +/obj/screen/swarmer/Barricade + icon_state = "ui_barricade" + name = "Create barricade (Costs 5 Resources)" + desc = "Creates a destructible barricade that will stop any non swarmer from passing it. Also allows disabler beams to pass through. (Costs 5 resources)" + +/obj/screen/swarmer/Barricade/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.CreateBarricade() + +/obj/screen/swarmer/Replicate + icon_state = "ui_replicate" + name = "Replicate (Costs 50 Resources)" + desc = "Creates a another of our kind." + +/obj/screen/swarmer/Replicate/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.CreateSwarmer() + +/obj/screen/swarmer/RepairSelf + icon_state = "ui_self_repair" + name = "Repair self" + desc = "Repairs damage to our body." + +/obj/screen/swarmer/RepairSelf/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.RepairSelf() + +/obj/screen/swarmer/ToggleLight + icon_state = "ui_light" + name = "Toggle light" + desc = "Toggles our inbuilt light on or off." + +/obj/screen/swarmer/ToggleLight/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.ToggleLight() + +/obj/screen/swarmer/ContactSwarmers + icon_state = "ui_contact_swarmers" + name = "Contact swarmers" + desc = "Sends a message to all other swarmers, should they exist." + +/obj/screen/swarmer/ContactSwarmers/Click() + if(isswarmer(usr)) + var/mob/living/simple_animal/hostile/swarmer/S = usr + S.ContactSwarmers() + +/mob/living/simple_animal/hostile/swarmer/create_mob_hud() + if(client && !hud_used) + hud_used = new /datum/hud/swarmer(src) + +/datum/hud/swarmer/New(mob/owner) + ..() + var/obj/screen/using + + using = new /obj/screen/swarmer/FabricateTrap() + using.screen_loc = ui_rhand + static_inventory += using + + using = new /obj/screen/swarmer/Barricade() + using.screen_loc = ui_lhand + static_inventory += using + + using = new /obj/screen/swarmer/Replicate() + using.screen_loc = ui_zonesel + static_inventory += using + + using = new /obj/screen/swarmer/RepairSelf() + using.screen_loc = ui_storage1 + static_inventory += using + + using = new /obj/screen/swarmer/ToggleLight() + using.screen_loc = ui_back + static_inventory += using + + using = new /obj/screen/swarmer/ContactSwarmers() + using.screen_loc = ui_inventory + static_inventory += using + diff --git a/code/game/dna/genes/monkey.dm b/code/game/dna/genes/monkey.dm index 48e7e3a580f..8ef0b7bb5f8 100644 --- a/code/game/dna/genes/monkey.dm +++ b/code/game/dna/genes/monkey.dm @@ -43,7 +43,11 @@ H.set_species(H.species.primitive_form) if(H.hud_used) - H.hud_used.instantiate() + qdel(H.hud_used) + H.hud_used = null + + if(H.client) + H.hud_used = new /datum/hud/monkey(H, ui_style2icon(H.client.prefs.UI_style), H.client.prefs.UI_style_color, H.client.prefs.UI_style_alpha) to_chat(H, "You are now a [H.species.name].") @@ -86,7 +90,11 @@ H.name = H.real_name if(H.hud_used) - H.hud_used.instantiate() + qdel(H.hud_used) + H.hud_used = null + + if(H.client) + H.hud_used = new /datum/hud/human(H, ui_style2icon(H.client.prefs.UI_style), H.client.prefs.UI_style_color, H.client.prefs.UI_style_alpha) to_chat(H, "You are now a [H.species.name].") diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index 773e81349a1..ccd498bb97f 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -531,102 +531,3 @@ if(isswarmer(M) || (M in dead_mob_list)) to_chat(M, "Swarm communication - [src] states: [message]") - - -////HUD NONSENSE//// -/obj/screen/swarmer - icon = 'icons/mob/swarmer.dmi' - -/obj/screen/swarmer/FabricateTrap - icon_state = "ui_trap" - name = "Create trap (Costs 5 Resources)" - desc = "Creates a trap that will nonlethally shock any non-swarmer that attempts to cross it. (Costs 5 resources)" - -/obj/screen/swarmer/FabricateTrap/Click() - if(isswarmer(usr)) - var/mob/living/simple_animal/hostile/swarmer/S = usr - S.CreateTrap() - -/obj/screen/swarmer/Barricade - icon_state = "ui_barricade" - name = "Create barricade (Costs 5 Resources)" - desc = "Creates a destructible barricade that will stop any non swarmer from passing it. Also allows disabler beams to pass through. (Costs 5 resources)" - -/obj/screen/swarmer/Barricade/Click() - if(isswarmer(usr)) - var/mob/living/simple_animal/hostile/swarmer/S = usr - S.CreateBarricade() - -/obj/screen/swarmer/Replicate - icon_state = "ui_replicate" - name = "Replicate (Costs 50 Resources)" - desc = "Creates a another of our kind." - -/obj/screen/swarmer/Replicate/Click() - if(isswarmer(usr)) - var/mob/living/simple_animal/hostile/swarmer/S = usr - S.CreateSwarmer() - -/obj/screen/swarmer/RepairSelf - icon_state = "ui_self_repair" - name = "Repair self" - desc = "Repairs damage to our body." - -/obj/screen/swarmer/RepairSelf/Click() - if(isswarmer(usr)) - var/mob/living/simple_animal/hostile/swarmer/S = usr - S.RepairSelf() - -/obj/screen/swarmer/ToggleLight - icon_state = "ui_light" - name = "Toggle light" - desc = "Toggles our inbuilt light on or off." - -/obj/screen/swarmer/ToggleLight/Click() - if(isswarmer(usr)) - var/mob/living/simple_animal/hostile/swarmer/S = usr - S.ToggleLight() - -/obj/screen/swarmer/ContactSwarmers - icon_state = "ui_contact_swarmers" - name = "Contact swarmers" - desc = "Sends a message to all other swarmers, should they exist." - -/obj/screen/swarmer/ContactSwarmers/Click() - if(isswarmer(usr)) - var/mob/living/simple_animal/hostile/swarmer/S = usr - S.ContactSwarmers() - -/datum/hud/proc/swarmer_hud(ui_style = 'icons/mob/screen1_midnight.dmi') - adding = list() - - var/obj/screen/using - - using = new /obj/screen/swarmer/FabricateTrap() - using.screen_loc = ui_rhand - adding += using - - using = new /obj/screen/swarmer/Barricade() - using.screen_loc = ui_lhand - adding += using - - using = new /obj/screen/swarmer/Replicate() - using.screen_loc = ui_zonesel - adding += using - - using = new /obj/screen/swarmer/RepairSelf() - using.screen_loc = ui_storage1 - adding += using - - using = new /obj/screen/swarmer/ToggleLight() - using.screen_loc = ui_back - adding += using - - using = new /obj/screen/swarmer/ContactSwarmers() - using.screen_loc = ui_inventory - adding += using - - mymob.client.screen = list() - //mymob.client.screen += mymob.client.void - mymob.client.screen += adding - diff --git a/code/game/gamemodes/miniantags/guardian/guardian.dm b/code/game/gamemodes/miniantags/guardian/guardian.dm index b987f2eb6f6..4f9b599ffde 100644 --- a/code/game/gamemodes/miniantags/guardian/guardian.dm +++ b/code/game/gamemodes/miniantags/guardian/guardian.dm @@ -839,99 +839,3 @@ new /obj/item/weapon/guardiancreator/tech/choose(src) new /obj/item/weapon/paper/guardian(src) return - - - -/datum/hud/proc/guardian_hud(ui_style = 'icons/mob/screen1_Midnight.dmi') - adding = list() - - var/obj/screen/using - - guardianhealthdisplay = new /obj/screen/guardian() - guardianhealthdisplay.name = "summoner health" - guardianhealthdisplay.screen_loc = ui_health - guardianhealthdisplay.mouse_opacity = 0 - adding += guardianhealthdisplay - - using = new /obj/screen/guardian/Manifest() - using.screen_loc = ui_rhand - adding += using - - using = new /obj/screen/guardian/Recall() - using.screen_loc = ui_lhand - adding += using - - using = new /obj/screen/guardian/ToggleMode() - using.screen_loc = ui_storage1 - adding += using - - using = new /obj/screen/guardian/ToggleLight() - using.screen_loc = ui_inventory - adding += using - - using = new /obj/screen/guardian/Communicate() - using.screen_loc = ui_back - adding += using - - mymob.client.screen = list() - mymob.client.screen += mymob.client.void - mymob.client.screen += adding - - -//HUD BUTTONS - -/obj/screen/guardian - icon = 'icons/mob/guardian.dmi' - icon_state = "base" - -/obj/screen/guardian/Manifest - icon_state = "manifest" - name = "Manifest" - desc = "Spring forth into battle!" - -/obj/screen/guardian/Manifest/Click() - if(isguardian(usr)) - var/mob/living/simple_animal/hostile/guardian/G = usr - G.Manifest() - - -/obj/screen/guardian/Recall - icon_state = "recall" - name = "Recall" - desc = "Return to your user." - -/obj/screen/guardian/Recall/Click() - if(isguardian(usr)) - var/mob/living/simple_animal/hostile/guardian/G = usr - G.Recall() - -/obj/screen/guardian/ToggleMode - icon_state = "toggle" - name = "Toggle Mode" - desc = "Switch between ability modes." - -/obj/screen/guardian/ToggleMode/Click() - if(isguardian(usr)) - var/mob/living/simple_animal/hostile/guardian/G = usr - G.ToggleMode() - -/obj/screen/guardian/Communicate - icon_state = "communicate" - name = "Communicate" - desc = "Communicate telepathically with your user." - -/obj/screen/guardian/Communicate/Click() - if(isguardian(usr)) - var/mob/living/simple_animal/hostile/guardian/G = usr - G.Communicate() - - -/obj/screen/guardian/ToggleLight - icon_state = "light" - name = "Toggle Light" - desc = "Glow like star dust." - -/obj/screen/guardian/ToggleLight/Click() - if(isguardian(usr)) - var/mob/living/simple_animal/hostile/guardian/G = usr - G.ToggleLight() \ No newline at end of file diff --git a/code/game/gamemodes/vampire/hud.dm b/code/game/gamemodes/vampire/hud.dm deleted file mode 100644 index 727ae3bdc25..00000000000 --- a/code/game/gamemodes/vampire/hud.dm +++ /dev/null @@ -1,9 +0,0 @@ -/datum/hud/proc/vampire_hud(ui_style = 'icons/mob/screen1_Midnight.dmi') - - vampire_blood_display = new /obj/screen() - vampire_blood_display.name = "Usable Blood" - vampire_blood_display.icon_state = "power_display" - vampire_blood_display.screen_loc = "WEST:6,CENTER-1:15" - vampire_blood_display.layer = 20 - - mymob.client.screen += list(vampire_blood_display) \ No newline at end of file diff --git a/code/game/gamemodes/vampire/vampire.dm b/code/game/gamemodes/vampire/vampire.dm index 1abed5ba4dd..88dc703d6a7 100644 --- a/code/game/gamemodes/vampire/vampire.dm +++ b/code/game/gamemodes/vampire/vampire.dm @@ -353,6 +353,13 @@ You are weak to holy things and starlight. Don't go into space and avoid the Cha update_vampire_icons_removed(vampire_mind) // to_chat(world, "Removed [vampire_mind.current.name] from vampire shit") to_chat(vampire_mind.current, "\red The fog clouding your mind clears. You remember nothing from the moment you were enthralled until now.") + if(vampire_mind.current.hud_used) + var/datum/hud/H = vampire_mind.current.hud_used + if(H.vampire_blood_display) + H.static_inventory -= H.vampire_blood_display + qdel(H.vampire_blood_display) + H.vampire_blood_display = null + /datum/vampire/proc/check_sun() var/ax = owner.x @@ -375,7 +382,12 @@ You are weak to holy things and starlight. Don't go into space and avoid the Cha if(owner.hud_used) var/datum/hud/hud = owner.hud_used if(!hud.vampire_blood_display) - hud.vampire_hud() + hud.vampire_blood_display = new /obj/screen() + hud.vampire_blood_display.name = "Usable Blood" + hud.vampire_blood_display.icon_state = "power_display" + hud.vampire_blood_display.screen_loc = "WEST:6,CENTER-1:15" + hud.static_inventory += hud.vampire_blood_display + hud.show_hud(hud.hud_version) hud.vampire_blood_display.maptext = "