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 = "
[bloodusable]
" handle_vampire_cloak() if(istype(owner.loc, /turf/space)) diff --git a/code/game/objects/effects/bump_teleporter.dm b/code/game/objects/effects/bump_teleporter.dm index 9379234ca68..bb9a34010c9 100644 --- a/code/game/objects/effects/bump_teleporter.dm +++ b/code/game/objects/effects/bump_teleporter.dm @@ -2,7 +2,7 @@ var/list/obj/effect/bump_teleporter/BUMP_TELEPORTERS = list() /obj/effect/bump_teleporter name = "bump-teleporter" - icon = 'icons/mob/screen1.dmi' + icon = 'icons/mob/screen_gen.dmi' icon_state = "x2" var/id = null //id of this bump_teleporter. var/id_target = null //id of bump_teleporter which this moves you to. diff --git a/code/game/objects/effects/decals/misc.dm b/code/game/objects/effects/decals/misc.dm index 4e86d96d0fc..9445b5aa626 100644 --- a/code/game/objects/effects/decals/misc.dm +++ b/code/game/objects/effects/decals/misc.dm @@ -1,7 +1,7 @@ /obj/effect/decal/point name = "arrow" desc = "It's an arrow hanging in mid-air. There may be a wizard about." - icon = 'icons/mob/screen1.dmi' + icon = 'icons/mob/screen_gen.dmi' icon_state = "arrow" layer = 16.0 anchored = 1 diff --git a/code/game/objects/effects/landmarks.dm b/code/game/objects/effects/landmarks.dm index 8d6aa799fd8..a074e269350 100644 --- a/code/game/objects/effects/landmarks.dm +++ b/code/game/objects/effects/landmarks.dm @@ -1,6 +1,6 @@ /obj/effect/landmark name = "landmark" - icon = 'icons/mob/screen1.dmi' + icon = 'icons/mob/screen_gen.dmi' icon_state = "x2" anchored = 1.0 unacidable = 1 @@ -104,7 +104,7 @@ /obj/effect/landmark/start name = "start" - icon = 'icons/mob/screen1.dmi' + icon = 'icons/mob/screen_gen.dmi' icon_state = "x" anchored = 1.0 diff --git a/code/game/objects/effects/manifest.dm b/code/game/objects/effects/manifest.dm index ec45c7a0894..4b5a2eebb7b 100644 --- a/code/game/objects/effects/manifest.dm +++ b/code/game/objects/effects/manifest.dm @@ -1,6 +1,6 @@ /obj/effect/manifest name = "manifest" - icon = 'icons/mob/screen1.dmi' + icon = 'icons/mob/screen_gen.dmi' icon_state = "x" unacidable = 1//Just to be sure. diff --git a/code/game/objects/effects/spawners/bombspawner.dm b/code/game/objects/effects/spawners/bombspawner.dm index e34b136cb45..e065941a947 100644 --- a/code/game/objects/effects/spawners/bombspawner.dm +++ b/code/game/objects/effects/spawners/bombspawner.dm @@ -1,113 +1,6 @@ -/* The old single tank bombs that dont really work anymore -/obj/effect/spawner/bomb - name = "bomb" - icon = 'icons/mob/screen1.dmi' - icon_state = "x" - var/btype = 0 //0 = radio, 1= prox, 2=time - var/explosive = 1 // 0= firebomb - var/btemp = 500 // bomb temperature (degC) - var/active = 0 - -/obj/effect/spawner/bomb/radio - btype = 0 - -/obj/effect/spawner/bomb/proximity - btype = 1 - -/obj/effect/spawner/bomb/timer - btype = 2 - -/obj/effect/spawner/bomb/timer/syndicate - btemp = 450 - -/obj/effect/spawner/bomb/suicide - btype = 3 - -/obj/effect/spawner/bomb/New() - ..() - - switch (src.btype) - // radio - if (0) - var/obj/item/assembly/r_i_ptank/R = new /obj/item/assembly/r_i_ptank(src.loc) - var/obj/item/weapon/tank/plasma/p3 = new /obj/item/weapon/tank/plasma(R) - var/obj/item/device/radio/signaler/p1 = new /obj/item/device/radio/signaler(R) - var/obj/item/device/igniter/p2 = new /obj/item/device/igniter(R) - R.part1 = p1 - R.part2 = p2 - R.part3 = p3 - p1.master = R - p2.master = R - p3.master = R - R.status = explosive - p1.b_stat = 0 - p2.secured = 1 - p3.air_contents.temperature = btemp + T0C - - // proximity - if (1) - var/obj/item/assembly/m_i_ptank/R = new /obj/item/assembly/m_i_ptank(src.loc) - var/obj/item/weapon/tank/plasma/p3 = new /obj/item/weapon/tank/plasma(R) - var/obj/item/device/prox_sensor/p1 = new /obj/item/device/prox_sensor(R) - var/obj/item/device/igniter/p2 = new /obj/item/device/igniter(R) - R.part1 = p1 - R.part2 = p2 - R.part3 = p3 - p1.master = R - p2.master = R - p3.master = R - R.status = explosive - - p3.air_contents.temperature = btemp + T0C - p2.secured = 1 - - if(src.active) - R.part1.secured = 1 - R.part1.icon_state = text("motion[]", 1) - R.c_state(1, src) - - // timer - if (2) - var/obj/item/assembly/t_i_ptank/R = new /obj/item/assembly/t_i_ptank(src.loc) - var/obj/item/weapon/tank/plasma/p3 = new /obj/item/weapon/tank/plasma(R) - var/obj/item/device/timer/p1 = new /obj/item/device/timer(R) - var/obj/item/device/igniter/p2 = new /obj/item/device/igniter(R) - R.part1 = p1 - R.part2 = p2 - R.part3 = p3 - p1.master = R - p2.master = R - p3.master = R - R.status = explosive - - p3.air_contents.temperature = btemp + T0C - p2.secured = 1 - //bombvest - if(3) - var/obj/item/clothing/suit/armor/a_i_a_ptank/R = new /obj/item/clothing/suit/armor/a_i_a_ptank(src.loc) - var/obj/item/weapon/tank/plasma/p4 = new /obj/item/weapon/tank/plasma(R) - var/obj/item/device/healthanalyzer/p1 = new /obj/item/device/healthanalyzer(R) - var/obj/item/device/igniter/p2 = new /obj/item/device/igniter(R) - var/obj/item/clothing/suit/armor/vest/p3 = new /obj/item/clothing/suit/armor/vest(R) - R.part1 = p1 - R.part2 = p2 - R.part3 = p3 - R.part4 = p4 - p1.master = R - p2.master = R - p3.master = R - p4.master = R - R.status = explosive - - p4.air_contents.temperature = btemp + T0C - p2.secured = 1 - - qdel(src) -*/ - /obj/effect/spawner/newbomb name = "bomb" - icon = 'icons/mob/screen1.dmi' + icon = 'icons/mob/screen_gen.dmi' icon_state = "x" var/btype = 0 // 0=radio, 1=prox, 2=time var/btemp1 = 1500 diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index d2fe7d2b319..ae8c888831d 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -288,8 +288,6 @@ var/global/list/default_medbay_channels = list( if(!M.IsVocal()) return 0 - M.last_target_click = world.time - /* Quick introduction: This new radio system uses a very robust FTL signaling technology unoriginally dubbed "subspace" which is somewhat similar to 'blue-space' but can't diff --git a/code/game/vehicles/spacepods/spacepod.dm b/code/game/vehicles/spacepods/spacepod.dm index 8ed498be025..bfa4cf1dd6a 100644 --- a/code/game/vehicles/spacepods/spacepod.dm +++ b/code/game/vehicles/spacepods/spacepod.dm @@ -883,7 +883,7 @@ /obj/effect/landmark/spacepod/random name = "spacepod spawner" invisibility = 101 - icon = 'icons/mob/screen1.dmi' + icon = 'icons/mob/screen_gen.dmi' icon_state = "x" anchored = 1 diff --git a/code/modules/awaymissions/loot.dm b/code/modules/awaymissions/loot.dm index 3ae2da35068..49af9a43ce6 100644 --- a/code/modules/awaymissions/loot.dm +++ b/code/modules/awaymissions/loot.dm @@ -1,5 +1,5 @@ /obj/effect/spawner/away/lootdrop - icon = 'icons/mob/screen1.dmi' + icon = 'icons/mob/screen_gen.dmi' icon_state = "x2" var/lootcount = 1 //how many items will be spawned var/lootdoubles = 0 //if the same item can be spawned twice diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index e458ebb7a14..264b286a383 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1561,10 +1561,22 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if("ui") switch(UI_style) if("Midnight") + UI_style = "Plasmafire" + if("Plasmafire") + UI_style = "Retro" + if("Retro") + UI_style = "Slimecore" + if("Slimecore") + UI_style = "Operative" + if("Operative") UI_style = "White" else UI_style = "Midnight" + if(ishuman(usr)) //mid-round preference changes, for aesthetics + var/mob/living/carbon/human/H = usr + H.remake_hud() + if("nanoui") nanoui_fancy = !nanoui_fancy @@ -1573,11 +1585,19 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts if(!UI_style_color_new) return UI_style_color = UI_style_color_new + if(ishuman(usr)) //mid-round preference changes, for aesthetics + var/mob/living/carbon/human/H = usr + H.remake_hud() + if("UIalpha") var/UI_style_alpha_new = input(user, "Select a new alpha(transparence) parameter for UI, between 50 and 255", UI_style_alpha) as num if(!UI_style_alpha_new | !(UI_style_alpha_new <= 255 && UI_style_alpha_new >= 50)) return UI_style_alpha = UI_style_alpha_new + if(ishuman(usr)) //mid-round preference changes, for aesthetics + var/mob/living/carbon/human/H = usr + H.remake_hud() + if("be_special") var/r = href_list["role"] if(!(r in special_roles)) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 25ce2b25a5f..369a8543691 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -119,7 +119,7 @@ /obj/item/clothing/ears/offear name = "Other ear" w_class = 5.0 - icon = 'icons/mob/screen1_Midnight.dmi' + icon = 'icons/mob/screen_gen.dmi' icon_state = "block" slot_flags = SLOT_EARS | SLOT_TWOEARS diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm index 066c4893f73..7e8a0a10613 100644 --- a/code/modules/clothing/spacesuits/rig/rig.dm +++ b/code/modules/clothing/spacesuits/rig/rig.dm @@ -871,7 +871,6 @@ return 0 // AIs are a bit slower than regular and ignore move intent. - wearer.last_move_intent = world.time + ai_controlled_move_delay wearer_move_delay = world.time + ai_controlled_move_delay var/tickcomp = 0 diff --git a/code/modules/mining/machine_input_output_plates.dm b/code/modules/mining/machine_input_output_plates.dm index e63918d77fa..7d28cedb3da 100644 --- a/code/modules/mining/machine_input_output_plates.dm +++ b/code/modules/mining/machine_input_output_plates.dm @@ -1,7 +1,7 @@ /**********************Input and output plates**************************/ /obj/machinery/mineral/input - icon = 'icons/mob/screen1.dmi' + icon = 'icons/mob/screen_gen.dmi' icon_state = "x2" name = "Input area" density = 0 @@ -10,7 +10,7 @@ icon_state = "blank" /obj/machinery/mineral/output - icon = 'icons/mob/screen1.dmi' + icon = 'icons/mob/screen_gen.dmi' icon_state = "x" name = "Output area" density = 0 diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 3d067d0c8fa..7a8e608c224 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -28,10 +28,9 @@ W.forceMove(src) //TODO: move to equipped? l_hand = W W.layer = 20 //TODO: move to equipped? -// l_hand.screen_loc = ui_lhand W.equipped(src,slot_l_hand) - if(client) client.screen |= W - if(pulling == W) stop_pulling() + if(pulling == W) + stop_pulling() update_inv_l_hand() return 1 return 0 @@ -44,10 +43,9 @@ W.forceMove(src) r_hand = W W.layer = 20 -// r_hand.screen_loc = ui_rhand W.equipped(src,slot_r_hand) - if(client) client.screen |= W - if(pulling == W) stop_pulling() + if(pulling == W) + stop_pulling() update_inv_r_hand() return 1 return 0 diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm index eb2ae210e71..831d01dbc87 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm @@ -23,7 +23,6 @@ large = 1 /mob/living/carbon/alien/humanoid/sentinel/large/update_icons() - update_hud() //TODO: remove the need for this to be here overlays.Cut() if(stat == DEAD) icon_state = "prat_dead" diff --git a/code/modules/mob/living/carbon/alien/humanoid/empress.dm b/code/modules/mob/living/carbon/alien/humanoid/empress.dm index d4716aafccb..ffc8e04429e 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/empress.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/empress.dm @@ -17,8 +17,6 @@ pixel_x = -32 /mob/living/carbon/alien/humanoid/empress/large/update_icons() - - update_hud() //TODO: remove the need for this to be here overlays.Cut() if(stat == DEAD) diff --git a/code/modules/mob/living/carbon/alien/humanoid/login.dm b/code/modules/mob/living/carbon/alien/humanoid/login.dm index 607a03fef0f..914371a969d 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/login.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/login.dm @@ -1,6 +1,5 @@ /mob/living/carbon/alien/humanoid/Login() ..() - update_hud() if(!isturf(loc)) client.eye = loc client.perspective = EYE_PERSPECTIVE diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index 5b2e19f011d..2b5060468a1 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -31,29 +31,26 @@ ..() -/mob/living/carbon/alien/humanoid/queen +/mob/living/carbon/alien/humanoid/queen/handle_regular_hud_updates() + ..() //-Yvarov - handle_regular_hud_updates() - - ..() //-Yvarov - - if (src.healths) - if (src.stat != 2) - switch(health) - if(250 to INFINITY) - src.healths.icon_state = "health0" - if(175 to 250) - src.healths.icon_state = "health1" - if(100 to 175) - src.healths.icon_state = "health2" - if(50 to 100) - src.healths.icon_state = "health3" - if(0 to 50) - src.healths.icon_state = "health4" - else - src.healths.icon_state = "health5" - else - src.healths.icon_state = "health6" + if (healths) + if (stat != DEAD) + switch(health) + if(250 to INFINITY) + healths.icon_state = "health0" + if(175 to 250) + healths.icon_state = "health1" + if(100 to 175) + healths.icon_state = "health2" + if(50 to 100) + healths.icon_state = "health3" + if(0 to 50) + healths.icon_state = "health4" + else + healths.icon_state = "health5" + else + healths.icon_state = "health6" //Queen verbs @@ -81,7 +78,6 @@ large = 1 /mob/living/carbon/alien/humanoid/queen/large/update_icons() - update_hud() //TODO: remove the need for this to be here overlays.Cut() if(stat == DEAD) diff --git a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm index 20622869e27..fb489552f78 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm @@ -12,12 +12,10 @@ var/list/overlays_standing[X_TOTAL_LAYERS] /mob/living/carbon/alien/humanoid/update_icons() - update_hud() //TODO: remove the need for this to be here overlays.Cut() for(var/image/I in overlays_standing) overlays += I - if(stat == DEAD) //If we mostly took damage from fire if(fireloss > 125) @@ -65,7 +63,6 @@ update_inv_r_hand(0) update_inv_l_hand(0) update_inv_pockets(0) - update_hud() update_icons() update_fire() update_transform() @@ -76,14 +73,6 @@ ..() update_icons() - -/mob/living/carbon/alien/humanoid/update_hud() - //TODO - if (client) -// if(other) client.screen |= hud_used.other //Not used -// else client.screen -= hud_used.other //Not used - client.screen |= contents - /mob/living/carbon/alien/humanoid/update_fire() overlays -= overlays_standing[X_FIRE_LAYER] if(on_fire) @@ -94,7 +83,16 @@ overlays_standing[X_FIRE_LAYER] = null /mob/living/carbon/alien/humanoid/update_inv_wear_suit(var/update_icons=1) + if(client && hud_used) + var/obj/screen/inventory/inv = hud_used.inv_slots[slot_wear_suit] + inv.update_icon() + if(wear_suit) + if(client && hud_used && hud_used.hud_shown) + if(hud_used.inventory_shown) //if the inventory is open ... + wear_suit.screen_loc = ui_oclothing //TODO //...draw the item in the inventory screen + client.screen += wear_suit //Either way, add the item to the HUD + var/t_state = wear_suit.item_state if(!t_state) t_state = wear_suit.icon_state var/image/standing = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "[t_state]") @@ -105,8 +103,6 @@ t_suit = "armor" standing.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "[t_suit]blood") - //TODO - wear_suit.screen_loc = ui_alien_oclothing if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket)) unEquip(handcuffed) drop_r_hand() @@ -139,6 +135,7 @@ /mob/living/carbon/alien/humanoid/update_inv_r_hand(var/update_icons=1) + ..(1) if(r_hand) var/t_state = r_hand.item_state if(!t_state) t_state = r_hand.icon_state @@ -149,6 +146,7 @@ if(update_icons) update_icons() /mob/living/carbon/alien/humanoid/update_inv_l_hand(var/update_icons=1) + ..(1) if(l_hand) var/t_state = l_hand.item_state if(!t_state) t_state = l_hand.icon_state @@ -158,15 +156,6 @@ overlays_standing[X_L_HAND_LAYER] = null if(update_icons) update_icons() -//Call when target overlay should be added/removed -/mob/living/carbon/alien/humanoid/update_targeted(var/update_icons=1) - if (targeted_by && target_locked) - overlays_standing[TARGETED_LAYER] = target_locked - else if (!targeted_by && target_locked) - qdel(target_locked) - if (!targeted_by) - overlays_standing[TARGETED_LAYER] = null - if(update_icons) update_icons() //Xeno Overlays Indexes////////// #undef X_HEAD_LAYER diff --git a/code/modules/mob/living/carbon/brain/brain_item.dm b/code/modules/mob/living/carbon/brain/brain_item.dm index 5fbfd6c5012..e10b3d257d3 100644 --- a/code/modules/mob/living/carbon/brain/brain_item.dm +++ b/code/modules/mob/living/carbon/brain/brain_item.dm @@ -59,8 +59,8 @@ to_chat(user, "This one seems particularly lifeless. Perhaps it will regain some of its luster later..") /obj/item/organ/internal/brain/remove(var/mob/living/user,special = 0) - - name = "[dna.real_name]'s [initial(name)]" + if(dna) + name = "[dna.real_name]'s [initial(name)]" if(!owner) return ..() // Probably a redundant removal; just bail diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 26def9b6520..5ba644b1abf 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -2,11 +2,6 @@ var/canEnterVentWith = "/obj/item/weapon/implant=0&/obj/item/clothing/mask/facehugger=0&/obj/item/device/radio/borg=0&/obj/machinery/camera=0" var/datum/middleClickOverride/middleClickOverride = null -/mob/living/carbon/Login() - ..() - update_hud() - return - /mob/living/carbon/prepare_huds() ..() prepare_data_huds() @@ -188,7 +183,7 @@ -/mob/living/carbon/proc/swap_hand() +/mob/living/carbon/swap_hand() var/obj/item/item_in_hand = src.get_active_hand() if(item_in_hand) //this segment checks if the item in your hand is twohanded. if(istype(item_in_hand,/obj/item/weapon/twohanded)) @@ -196,20 +191,15 @@ to_chat(usr, "Your other hand is too busy holding the [item_in_hand.name]") 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_active" - hud_used.r_hand_hud_object.icon_state = "hand_inactive" - else - hud_used.l_hand_hud_object.icon_state = "hand_inactive" - hud_used.r_hand_hud_object.icon_state = "hand_active" - /*if (!( src.hand )) - src.hands.dir = NORTH - else - src.hands.dir = SOUTH*/ - return + 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/carbon/proc/activate_hand(var/selhand) //0 or "r" or "right" for right hand; 1 or "l" or "left" for left hand. + +/mob/living/carbon/activate_hand(var/selhand) //0 or "r" or "right" for right hand; 1 or "l" or "left" for left hand. if(istext(selhand)) selhand = lowertext(selhand) @@ -856,6 +846,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, clear_alert("handcuffed") update_action_buttons() //some of our action buttons might be unusable when we're handcuffed. update_inv_handcuffed() + update_hud_handcuffed() /mob/living/carbon/get_standard_pixel_y_offset(lying = 0) if(lying) diff --git a/code/modules/mob/living/carbon/human/interactive/interactive.dm b/code/modules/mob/living/carbon/human/interactive/interactive.dm index 679fd55bb1f..14402788451 100644 --- a/code/modules/mob/living/carbon/human/interactive/interactive.dm +++ b/code/modules/mob/living/carbon/human/interactive/interactive.dm @@ -396,16 +396,15 @@ faction -= "neutral" faction += "hostile" +/mob/living/carbon/human/interactive/create_mob_hud() + if(!hud_used) + hud_used = new /datum/hud/human(src) + /mob/living/carbon/human/interactive/New() ..() snpc_list += src - // setup screen HUD because the game expects user mobs to have zone_sel etc - if(hud_used) - qdel(hud_used) //remove the hud objects - hud_used = null - hud_used = new /datum/hud(src) - hud_used.human_hud() + create_mob_hud() sync_mind() random() diff --git a/code/modules/mob/living/carbon/human/login.dm b/code/modules/mob/living/carbon/human/login.dm index c9c23b31857..d4b160509ea 100644 --- a/code/modules/mob/living/carbon/human/login.dm +++ b/code/modules/mob/living/carbon/human/login.dm @@ -4,5 +4,4 @@ if(species && species.ventcrawler) to_chat(src, "You can ventcrawl! Use alt+click on vents to quickly travel about the station.") update_pipe_vision() - update_hud() return diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 623cc9df1e9..24c07563644 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -72,7 +72,6 @@ There are several things that need to be remembered: update_body() //Handles updating your mob's icon to reflect their gender/race/complexion etc update_hair() //Handles updating your hair overlay (used to be update_face, but mouth and ...eyes were merged into update_body) - update_targeted() // Updates the target overlay when someone points a gun at you > All of these procs update our overlays_lying and overlays_standing, and then call update_icons() by default. If you wish to update several overlays at once, you can set the argument to 0 to disable the update and call @@ -124,9 +123,6 @@ Please contact me on #coderbus IRC. ~Carn x //this proc is messy as I was forced to include some old laggy cloaking code to it so that I don't break cloakers //I'll work on removing that stuff by rewriting some of the cloaking stuff at a later date. /mob/living/carbon/human/update_icons() - - update_hud() //TODO: remove the need for this - var/stealth = 0 var/obj/item/clothing/suit/armor/abductor/vest/V // Begin the most snowflakey bullshit code I've ever written. I'm so sorry, but there was no other way. for(V in list(wear_suit)) @@ -532,15 +528,6 @@ var/global/list/damage_icon_parts = list() update_fhair(0) if(update_icons) update_icons() -//Call when target overlay should be added/removed -/mob/living/carbon/human/update_targeted(var/update_icons=1) - if (targeted_by && target_locked) - overlays_standing[TARGETED_LAYER] = target_locked - else if (!targeted_by && target_locked) - qdel(target_locked) - if (!targeted_by) - overlays_standing[TARGETED_LAYER] = null - if(update_icons) update_icons() /mob/living/carbon/human/update_fire() remove_overlay(FIRE_LAYER) @@ -581,15 +568,23 @@ var/global/list/damage_icon_parts = list() update_inv_wear_pda(0) UpdateDamageIcon() update_icons() - //Hud Stuff - update_hud() update_fire() /* --------------------------------------- */ //vvvvvv UPDATE_INV PROCS vvvvvv /mob/living/carbon/human/update_inv_w_uniform(var/update_icons=1) - if(w_uniform && istype(w_uniform, /obj/item/clothing/under) ) - w_uniform.screen_loc = ui_iclothing + + if(client && hud_used) + var/obj/screen/inventory/inv = hud_used.inv_slots[slot_w_uniform] + if(inv) + inv.update_icon() + + if(w_uniform && istype(w_uniform, /obj/item/clothing/under)) + if(client && hud_used && hud_used.hud_shown) + if(hud_used.inventory_shown) //if the inventory is open ... + w_uniform.screen_loc = ui_iclothing //...draw the item in the inventory screen + client.screen += w_uniform //Either way, add the item to the HUD + var/t_color = w_uniform.item_color if(!t_color) t_color = icon_state var/image/standing = image("icon_state" = "[t_color]_s") @@ -637,8 +632,17 @@ var/global/list/damage_icon_parts = list() if(update_icons) update_icons() /mob/living/carbon/human/update_inv_wear_id(var/update_icons=1) + + if(client && hud_used) + var/obj/screen/inventory/inv = hud_used.inv_slots[slot_wear_id] + if(inv) + inv.update_icon() + if(wear_id) - wear_id.screen_loc = ui_id //TODO + if(client && hud_used && hud_used.hud_shown) + wear_id.screen_loc = ui_id + client.screen += wear_id + if(w_uniform && w_uniform:displays_id) overlays_standing[ID_LAYER] = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "id") else @@ -649,7 +653,18 @@ var/global/list/damage_icon_parts = list() if(update_icons) update_icons() /mob/living/carbon/human/update_inv_gloves(var/update_icons=1) + + if(client && hud_used) + var/obj/screen/inventory/inv = hud_used.inv_slots[slot_gloves] + if(inv) + inv.update_icon() + if(gloves) + if(client && hud_used && hud_used.hud_shown) + if(hud_used.inventory_shown) //if the inventory is open ... + gloves.screen_loc = ui_gloves //...draw the item in the inventory screen + client.screen += gloves //Either way, add the item to the HUD + var/t_state = gloves.item_state if(!t_state) t_state = gloves.icon_state @@ -678,7 +693,17 @@ var/global/list/damage_icon_parts = list() /mob/living/carbon/human/update_inv_glasses(var/update_icons=1) + + if(client && hud_used) + var/obj/screen/inventory/inv = hud_used.inv_slots[slot_glasses] + if(inv) + inv.update_icon() + if(glasses) + if(client && hud_used && hud_used.hud_shown) + if(hud_used.inventory_shown) //if the inventory is open ... + glasses.screen_loc = ui_glasses //...draw the item in the inventory screen + client.screen += glasses //Either way, add the item to the HUD if(glasses.icon_override) overlays_standing[GLASSES_LAYER] = image("icon" = glasses.icon_override, "icon_state" = "[glasses.icon_state]") @@ -692,8 +717,23 @@ var/global/list/damage_icon_parts = list() if(update_icons) update_icons() /mob/living/carbon/human/update_inv_ears(var/update_icons=1) + + if(client && hud_used) + var/obj/screen/inventory/inv = hud_used.inv_slots[slot_l_ear] + if(inv) + inv.update_icon() + + if(client && hud_used) + var/obj/screen/inventory/inv = hud_used.inv_slots[slot_r_ear] + if(inv) + inv.update_icon() + if(l_ear || r_ear) if(l_ear) + if(client && hud_used && hud_used.hud_shown) + if(hud_used.inventory_shown) //if the inventory is open ... + l_ear.screen_loc = ui_l_ear //...draw the item in the inventory screen + client.screen += l_ear //Either way, add the item to the HUD var/t_type = l_ear.icon_state if(l_ear.icon_override) @@ -706,6 +746,10 @@ var/global/list/damage_icon_parts = list() overlays_standing[EARS_LAYER] = image("icon" = 'icons/mob/ears.dmi', "icon_state" = "[t_type]") if(r_ear) + if(client && hud_used && hud_used.hud_shown) + if(hud_used.inventory_shown) //if the inventory is open ... + r_ear.screen_loc = ui_r_ear //...draw the item in the inventory screen + client.screen += r_ear //Either way, add the item to the HUD var/t_type = r_ear.icon_state if(r_ear.icon_override) @@ -722,7 +766,17 @@ var/global/list/damage_icon_parts = list() if(update_icons) update_icons() /mob/living/carbon/human/update_inv_shoes(var/update_icons=1) + + if(client && hud_used) + var/obj/screen/inventory/inv = hud_used.inv_slots[slot_shoes] + if(inv) + inv.update_icon() + if(shoes) + if(client && hud_used && hud_used.hud_shown) + if(hud_used.inventory_shown) //if the inventory is open ... + shoes.screen_loc = ui_shoes //...draw the item in the inventory screen + client.screen += shoes //Either way, add the item to the HUD var/image/standing if(shoes.icon_override) @@ -748,7 +802,17 @@ var/global/list/damage_icon_parts = list() if(update_icons) update_icons() /mob/living/carbon/human/update_inv_s_store(var/update_icons=1) + + if(client && hud_used) + var/obj/screen/inventory/inv = hud_used.inv_slots[slot_s_store] + if(inv) + inv.update_icon() + if(s_store) + if(client && hud_used && hud_used.hud_shown) + s_store.screen_loc = ui_sstore1 + client.screen += s_store + var/t_state = s_store.item_state if(!t_state) t_state = s_store.icon_state @@ -761,8 +825,13 @@ var/global/list/damage_icon_parts = list() /mob/living/carbon/human/update_inv_head(var/update_icons=1) + ..() + if(client && hud_used) + var/obj/screen/inventory/inv = hud_used.inv_slots[slot_head] + if(inv) + inv.update_icon() + if(head) - head.screen_loc = ui_head //TODO var/image/standing if(head.icon_override) standing = image("icon" = head.icon_override, "icon_state" = "[head.icon_state]") @@ -783,8 +852,17 @@ var/global/list/damage_icon_parts = list() if(update_icons) update_icons() /mob/living/carbon/human/update_inv_belt(var/update_icons=1) + + if(client && hud_used) + var/obj/screen/inventory/inv = hud_used.inv_slots[slot_belt] + if(inv) + inv.update_icon() + + if(hud_used.hud_shown && belt) + client.screen += belt + belt.screen_loc = ui_belt + if(belt) - belt.screen_loc = ui_belt //TODO var/t_state = belt.item_state if(!t_state) t_state = belt.icon_state @@ -801,8 +879,17 @@ var/global/list/damage_icon_parts = list() /mob/living/carbon/human/update_inv_wear_suit(var/update_icons=1) - if( wear_suit && istype(wear_suit, /obj/item/clothing/suit) ) //TODO check this - wear_suit.screen_loc = ui_oclothing //TODO + + if(client && hud_used) + var/obj/screen/inventory/inv = hud_used.inv_slots[slot_wear_suit] + if(inv) + inv.update_icon() + + if(wear_suit && 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 ... + wear_suit.screen_loc = ui_oclothing //TODO //...draw the item in the inventory screen + client.screen += wear_suit //Either way, add the item to the HUD var/image/standing if(wear_suit.icon_override) @@ -846,19 +933,44 @@ var/global/list/damage_icon_parts = list() if(update_icons) update_icons() -/mob/living/carbon/human/update_inv_pockets(var/update_icons=1) - if(l_store) l_store.screen_loc = ui_storage1 //TODO - if(r_store) r_store.screen_loc = ui_storage2 //TODO - if(update_icons) update_icons() +/mob/living/carbon/human/update_inv_pockets() + if(client && hud_used) + var/obj/screen/inventory/inv -/mob/living/carbon/human/update_inv_wear_pda(var/update_icons=1) - if(wear_pda) wear_pda.screen_loc = ui_pda - if(update_icons) update_icons() + inv = hud_used.inv_slots[slot_l_store] + if(inv) + inv.update_icon() -/mob/living/carbon/human/update_inv_wear_mask(var/update_icons=1) - if( wear_mask && ( istype(wear_mask, /obj/item/clothing/mask) || istype(wear_mask, /obj/item/clothing/accessory) ) ) - wear_mask.screen_loc = ui_mask //TODO + inv = hud_used.inv_slots[slot_r_store] + if(inv) + 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_pda() + if(client && hud_used) + var/obj/screen/inventory/inv = hud_used.inv_slots[slot_wear_pda] + if(inv) + inv.update_icon() + + if(wear_pda) + client.screen += wear_pda + wear_pda.screen_loc = ui_pda + +/mob/living/carbon/human/update_inv_wear_mask(var/update_icons = 1) + ..() + if(client && hud_used) + var/obj/screen/inventory/inv = hud_used.inv_slots[slot_wear_mask] + if(inv) + inv.update_icon() + if(wear_mask && (istype(wear_mask, /obj/item/clothing/mask) || istype(wear_mask, /obj/item/clothing/accessory))) var/image/standing if(wear_mask.icon_override) standing = image("icon" = wear_mask.icon_override, "icon_state" = "[wear_mask.icon_state]") @@ -867,10 +979,10 @@ var/global/list/damage_icon_parts = list() else standing = image("icon" = 'icons/mob/mask.dmi', "icon_state" = "[wear_mask.icon_state]") - if( !istype(wear_mask, /obj/item/clothing/mask/cigarette) && wear_mask.blood_DNA ) + if(!istype(wear_mask, /obj/item/clothing/mask/cigarette) && wear_mask.blood_DNA) var/image/bloodsies = image("icon" = species.blood_mask, "icon_state" = "maskblood") bloodsies.color = wear_mask.blood_color - standing.overlays += bloodsies + standing.overlays += bloodsies overlays_standing[FACEMASK_LAYER] = standing else overlays_standing[FACEMASK_LAYER] = null @@ -878,9 +990,8 @@ var/global/list/damage_icon_parts = list() /mob/living/carbon/human/update_inv_back(var/update_icons=1) + ..() if(back) - back.screen_loc = ui_back //TODO - //determine the icon to use var/icon/standing if(back.icon_override) @@ -894,15 +1005,6 @@ var/global/list/damage_icon_parts = list() else standing = image("icon" = 'icons/mob/back.dmi', "icon_state" = "[back.icon_state]") - /* - //determine state to use - var/overlay_state - if(back.item_state) - overlay_state = back.item_state - else - overlay_state = back.icon_state - */ - //create the image overlays_standing[BACK_LAYER] = standing else @@ -910,37 +1012,14 @@ var/global/list/damage_icon_parts = list() if(update_icons) update_icons() - -/mob/living/carbon/human/update_hud() //TODO: do away with this if possible - if(client) - for(var/obj/item/I in get_all_slots()) - client.screen |= I // Items only please, no arms allowed - if(hud_used) - hud_used.hidden_inventory_update() //Updates the screenloc of the items on the 'other' inventory bar - update_inv_handcuffed(0) // update handcuff overlay - - /mob/living/carbon/human/update_inv_handcuffed(var/update_icons=1) + overlays_standing[HANDCUFF_LAYER] = null if(handcuffed) - drop_r_hand() - drop_l_hand() - stop_pulling() //TODO: should be handled elsewhere - if(hud_used) //hud handcuff icons - var/obj/screen/inventory/R = hud_used.r_hand_hud_object - var/obj/screen/inventory/L = hud_used.l_hand_hud_object - R.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="markus") - L.overlays += image("icon"='icons/mob/screen_gen.dmi', "icon_state"="gabrielle") if(istype(handcuffed, /obj/item/weapon/restraints/handcuffs/pinkcuffs)) overlays_standing[HANDCUFF_LAYER] = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "pinkcuff1") else overlays_standing[HANDCUFF_LAYER] = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "handcuff1") - else - overlays_standing[HANDCUFF_LAYER] = null - 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 - R.overlays.Cut() - L.overlays.Cut() + if(update_icons) update_icons() @@ -961,36 +1040,57 @@ var/global/list/damage_icon_parts = list() /mob/living/carbon/human/update_inv_r_hand(var/update_icons=1) + ..() if(r_hand) - r_hand.screen_loc = ui_rhand //TODO var/t_state = r_hand.item_state - if(!t_state) t_state = r_hand.icon_state + if(!t_state) + t_state = r_hand.icon_state - var/image/I = image("icon" = r_hand.righthand_file, "icon_state"="[t_state]") + var/image/I = image("icon" = r_hand.righthand_file, "icon_state" = "[t_state]") I = center_image(I, r_hand.inhand_x_dimension, r_hand.inhand_y_dimension) overlays_standing[R_HAND_LAYER] = I - - if (handcuffed) drop_r_hand() else overlays_standing[R_HAND_LAYER] = null - if(update_icons) update_icons() + if(update_icons) + update_icons() /mob/living/carbon/human/update_inv_l_hand(var/update_icons=1) + ..() if(l_hand) - l_hand.screen_loc = ui_lhand //TODO var/t_state = l_hand.item_state - if(!t_state) t_state = l_hand.icon_state + if(!t_state) + t_state = l_hand.icon_state - var/image/I = image("icon" = l_hand.lefthand_file, "icon_state"="[t_state]") + var/image/I = image("icon" = l_hand.lefthand_file, "icon_state" = "[t_state]") I = center_image(I, l_hand.inhand_x_dimension, l_hand.inhand_y_dimension) overlays_standing[L_HAND_LAYER] = I - - if (handcuffed) drop_l_hand() else overlays_standing[L_HAND_LAYER] = null - if(update_icons) update_icons() + if(update_icons) + update_icons() +//human HUD updates for items in our inventory + +//update whether our head item appears on our hud. +/mob/living/carbon/human/update_hud_head(obj/item/I) + if(client && hud_used && hud_used.hud_shown) + if(hud_used.inventory_shown) + I.screen_loc = ui_head + client.screen += I + +//update whether our mask item appears on our hud. +/mob/living/carbon/human/update_hud_wear_mask(obj/item/I) + if(client && hud_used && hud_used.hud_shown) + if(hud_used.inventory_shown) + I.screen_loc = ui_mask + client.screen += I + +//update whether our back item appears on our hud. +/mob/living/carbon/human/update_hud_back(obj/item/I) + if(client && hud_used && hud_used.hud_shown) + I.screen_loc = ui_back + client.screen += I /mob/living/carbon/human/proc/update_tail_layer(var/update_icons=1) diff --git a/code/modules/mob/living/carbon/slime/login.dm b/code/modules/mob/living/carbon/slime/login.dm deleted file mode 100644 index d3ac320f2f4..00000000000 --- a/code/modules/mob/living/carbon/slime/login.dm +++ /dev/null @@ -1,4 +0,0 @@ -/mob/living/carbon/slime/Login() - ..() - update_hud() - return diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm index e22ad5e66dc..05224c28dde 100644 --- a/code/modules/mob/living/carbon/update_icons.dm +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -32,4 +32,59 @@ floating = 0 // If we were without gravity, the bouncing animation got stopped, so we make sure we restart it in next life(). /mob/living/carbon/proc/handle_transform_change() + return + +//update whether handcuffs appears on our hud. +/mob/living/carbon/proc/update_hud_handcuffed() + if(hud_used) + 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) + R.update_icon() + L.update_icon() + +/mob/living/carbon/update_inv_r_hand(ignore_cuffs) + if(handcuffed && !ignore_cuffs) + drop_r_hand() + return + if(r_hand) + if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD) + r_hand.screen_loc = ui_rhand + client.screen += r_hand + +/mob/living/carbon/update_inv_l_hand(ignore_cuffs) + if(handcuffed && !ignore_cuffs) + drop_l_hand() + return + if(l_hand) + if(client && hud_used && hud_used.hud_version != HUD_STYLE_NOHUD) + l_hand.screen_loc = ui_lhand + client.screen += l_hand + +/mob/living/carbon/update_inv_wear_mask() + if(istype(wear_mask, /obj/item/clothing/mask)) + update_hud_wear_mask(wear_mask) + +/mob/living/carbon/update_inv_back() + 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) + update_hud_back(back) + +/mob/living/carbon/update_inv_head() + if(head) + update_hud_head(head) + +//update whether our head item appears on our hud. +/mob/living/carbon/proc/update_hud_head(obj/item/I) + return + +//update whether our mask item appears on our hud. +/mob/living/carbon/proc/update_hud_wear_mask(obj/item/I) + return + +//update whether our back item appears on our hud. +/mob/living/carbon/proc/update_hud_back(obj/item/I) return \ No newline at end of file diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 59a208d7c2e..7e70e3a613f 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -265,7 +265,7 @@ if(!hud_used) return if(!client) return - if(hud_used.hud_shown != 1) //Hud toggled to minimal + if(!hud_used.hud_shown) return client.screen -= hud_used.hide_actions_toggle diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 58f965dad7e..cba9fb4c1e1 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -1023,14 +1023,6 @@ var/list/robot_verbs_default = list( overlays += "minerjetpack-[icon_state]" update_fire() -//Call when target overlay should be added/removed -/mob/living/silicon/robot/update_targeted() - if(!targeted_by && target_locked) - qdel(target_locked) - update_icons() - if (targeted_by && target_locked) - overlays += target_locked - /mob/living/silicon/robot/proc/installed_modules() if(weapon_lock) to_chat(src, "\red Weapon lock active, unable to use modules! Count:[weaponlock_time]") diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 84235f90979..5cf956e610a 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -31,12 +31,13 @@ client.images = null //remove the images such as AIs being unable to see runes client.screen = list() //remove hud items just in case - if(hud_used) - qdel(hud_used) //remove the hud objects - hud_used = null if(client.click_intercept) client.click_intercept.quit() // Let's not keep any old click_intercepts - hud_used = new /datum/hud(src) + + if(!hud_used) + create_mob_hud() + if(hud_used) + hud_used.show_hud(hud_used.hud_version) next_move = 1 sight |= SEE_SELF @@ -70,6 +71,8 @@ //readd this mob's HUDs (antag, med, etc) reload_huds() + add_click_catcher() + if(viewing_alternate_appearances && viewing_alternate_appearances.len) for(var/aakey in viewing_alternate_appearances) var/datum/alternate_appearance/AA = viewing_alternate_appearances[aakey] diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 4e5e6c9b21c..b5e54bc00ef 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1097,6 +1097,11 @@ var/list/slot_equipment_priority = list( \ /mob/proc/IsAdvancedToolUser()//This might need a rename but it should replace the can this mob use things check return 0 +/mob/proc/swap_hand() + return + +/mob/proc/activate_hand(selhand) + return /mob/proc/Jitter(amount) jitteriness = max(jitteriness, amount, 0) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index ac459679f10..8b4b39e006a 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -18,10 +18,6 @@ var/obj/screen/m_select = null var/obj/screen/healths = null var/obj/screen/throw_icon = null - var/obj/screen/gun/item/item_use_icon = null - var/obj/screen/gun/move/gun_move_icon = null - var/obj/screen/gun/run/gun_run_icon = null - var/obj/screen/gun/mode/gun_setting_icon = null /*A bunch of this stuff really needs to go under their own defines instead of being globally attached to mob. A variable should only be globally attached to turfs/objects/whatever, when it is in fact needed as such. diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index fcbcd410a89..98437a53ffd 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -24,6 +24,7 @@ layer = 21 item_state = "nothing" + icon = 'icons/mob/screen_gen.dmi' w_class = 5.0 diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index a967c2df779..468a6cfe9df 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -451,7 +451,7 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HARM) if("left") a_intent = intent_numeric((intent_numeric(a_intent)+3) % 4) if(hud_used && hud_used.action_intent) - hud_used.action_intent.icon_state = "intent_[a_intent]" + hud_used.action_intent.icon_state = "[a_intent]" else if(isrobot(src) || islarva(src)) switch(input) diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 68913c6ad25..117cf33ff52 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -149,11 +149,8 @@ winset(src, "mapwindow.map", "icon-size=[src.reset_stretch]") viewingCanvas = 0 mob.reset_view() - mob.button_pressed_F12() - if(!mob.hud_used.hud_shown) - mob.button_pressed_F12() - mob.update_hud() - mob.update_action_buttons() + if(mob.hud_used) + mob.hud_used.show_hud(HUD_STYLE_STANDARD) if(mob.control_object) Move_object(direct) @@ -240,7 +237,6 @@ move_delay = world.time//set move delay move_delay += T.slowdown mob.last_movement = world.time - mob.last_move_intent = world.time + 10 switch(mob.m_intent) if("run") if(mob.drowsyness > 0) diff --git a/code/modules/mob/update_icons.dm b/code/modules/mob/update_icons.dm index 0362ffa6097..8a1f1b04cb1 100644 --- a/code/modules/mob/update_icons.dm +++ b/code/modules/mob/update_icons.dm @@ -7,9 +7,6 @@ /mob/proc/update_icons() return -/mob/proc/update_hud() - return - /mob/proc/update_inv_handcuffed() return @@ -61,14 +58,11 @@ /mob/proc/update_inv_pockets() return -mob/proc/update_inv_wear_pda() +/mob/proc/update_inv_wear_pda() return /mob/proc/update_inv_ears() return -/mob/proc/update_targeted() - return - /mob/proc/update_transform() return \ No newline at end of file diff --git a/code/modules/ninja/suit/suit_initialisation.dm b/code/modules/ninja/suit/suit_initialisation.dm index f1abfbe725a..9954281b06f 100644 --- a/code/modules/ninja/suit/suit_initialisation.dm +++ b/code/modules/ninja/suit/suit_initialisation.dm @@ -28,7 +28,10 @@ sleep(10) to_chat(usr, "Disconnecting neural-net interface... Success.") - usr.hud_used.instantiate() + if(usr.hud_used) + qdel(usr.hud_used) + usr.hud_used = null + usr.create_mob_hud() usr.regenerate_icons() sleep(5) @@ -61,7 +64,12 @@ sleep(5) to_chat(usr, "Suit secured, extending neural-net interface...") - usr.hud_used.human_hud('icons/mob/screen1_NinjaHUD.dmi',"#ffffff",255) + if(usr.hud_used) + qdel(usr.hud_used) + usr.hud_used = null + usr.hud_used = new /datum/hud/human(usr, 'icons/mob/screen_ninja.dmi', "#ffffff", 255) + if(usr.hud_used) + usr.hud_used.show_hud(usr.hud_used.hud_version) usr.regenerate_icons() sleep(10) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 2aea246d314..2b53068bcf6 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -84,10 +84,7 @@ /obj/item/weapon/gun/afterattack(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, flag, params) if(flag) return //we're placing gun on a table or in backpack if(istype(target, /obj/machinery/recharger) && istype(src, /obj/item/weapon/gun/energy)) return//Shouldnt flag take care of this? - if(user && user.client && user.client.gun_mode && !(A in target)) - PreFire(A,user,params) //They're using the new gun system, locate what they're aiming at. - else - Fire(A,user,params) //Otherwise, fire normally. + Fire(A,user,params) //Otherwise, fire normally. /obj/item/weapon/gun/proc/isHandgun() return 1 diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index bb556a4f178..6f92bc79fca 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -181,15 +181,14 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. return if(usr.client.view == world.view) - if(!usr.hud_used.hud_shown) - usr.button_pressed_F12(1) // If the user has already limited their HUD this avoids them having a HUD when they zoom in - usr.button_pressed_F12(1) + if(usr.hud_used) + usr.hud_used.show_hud(HUD_STYLE_NOHUD) usr.client.view = 12 zoom = 1 else usr.client.view = world.view - if(!usr.hud_used.hud_shown) - usr.button_pressed_F12(1) + if(usr.hud_used) + usr.hud_used.show_hud(HUD_STYLE_STANDARD) zoom = 0 to_chat(usr, "Zoom mode [zoom?"en":"dis"]abled.") diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm deleted file mode 100644 index 2093b47a69c..00000000000 --- a/code/modules/projectiles/targeting.dm +++ /dev/null @@ -1,367 +0,0 @@ -/obj/item/weapon/gun/verb/toggle_firerate() - set name = "Toggle Firerate" - set category = "Object" - firerate = !firerate - if (firerate == 0) - to_chat(loc, "You will now continue firing when your target moves.") - else - to_chat(loc, "You will now only fire once, then lower your aim, when your target moves.") - -/obj/item/weapon/gun/verb/lower_aim() - set name = "Lower Aim" - set category = "Object" - if(target) - stop_aim() - usr.visible_message("\blue \The [usr] lowers \the [src]...") - -//Clicking gun will still lower aim for guns that don't overwrite this -/obj/item/weapon/gun/attack_self() - lower_aim() - -//Removing the lock and the buttons. -/obj/item/weapon/gun/dropped(mob/user as mob) - stop_aim() - if (user.client) - user.client.remove_gun_icons() - return ..() - -/obj/item/weapon/gun/equipped(var/mob/user, var/slot) - if (slot != slot_l_hand && slot != slot_r_hand) - stop_aim() - if (user.client) - user.client.remove_gun_icons() - return ..() - -//Removes lock fro mall targets -/obj/item/weapon/gun/proc/stop_aim() - if(target) - for(var/mob/living/M in target) - if(M) - M.NotTargeted(src) //Untargeting people. - qdel(target) - -//Compute how to fire..... -/obj/item/weapon/gun/proc/PreFire(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, params) - //Lets not spam it. - if(lock_time > world.time - 2) return - . - if(ismob(A) && isliving(A) && !(A in target)) - Aim(A) //Clicked a mob, aim at them - else //Didn't click someone, check if there is anyone along that guntrace - var/mob/living/M = GunTrace(user.x,user.y,A.x,A.y,user.z,user) //Find dat mob. - if(M && isliving(M) && M in view(user) && !(M in target)) - Aim(M) //Aha! Aim at them! - else if(!ismob(M) || (ismob(M) && !(M in view(user)))) //Nope! They weren't there! - Fire(A,user,params) //Fire like normal, then. - user.dir = get_cardinal_dir(src, A) - -//Aiming at the target mob. -/obj/item/weapon/gun/proc/Aim(var/mob/living/M) - if(!target || !(M in target)) - lock_time = world.time - if(target && !automatic) //If they're targeting someone and they have a non automatic weapon. - for(var/mob/living/L in target) - if(L) - L.NotTargeted(src) - qdel(target) - usr.visible_message("\red [usr] turns \the [src] on [M]!") - else - usr.visible_message("\red [usr] aims \a [src] at [M]!") - M.Targeted(src) - -//HE MOVED, SHOOT HIM! -/obj/item/weapon/gun/proc/TargetActed(var/mob/living/T) - var/mob/living/M = loc - if(M == T) return - if(!istype(M)) return - if(src != M.get_active_hand()) - stop_aim() - return - M.last_move_intent = world.time - if(can_fire()) - var/firing_check = can_hit(T,usr) //0 if it cannot hit them, 1 if it is capable of hitting, and 2 if a special check is preventing it from firing. - if(firing_check > 0) - if(firing_check == 1) - Fire(T,usr, reflex = 1) - else if(!told_cant_shoot) - to_chat(M, "\red They can't be hit from here!") - told_cant_shoot = 1 - spawn(30) - told_cant_shoot = 0 - else - click_empty(M) - - usr.dir = get_cardinal_dir(src, T) - - if (!firerate) // If firerate is set to lower aim after one shot, untarget the target - T.NotTargeted(src) - -//Yay, math! - -#define SIGN(X) ((X<0)?-1:1) - -proc/GunTrace(X1,Y1,X2,Y2,Z=1,exc_obj,PX1=16,PY1=16,PX2=16,PY2=16) -// to_chat(bluh, "Tracin' [X1],[Y1] to [X2],[Y2] on floor [Z].") - var/turf/T - var/mob/living/M - if(X1==X2) - if(Y1==Y2) return 0 //Light cannot be blocked on same tile - else - var/s = SIGN(Y2-Y1) - Y1+=s - while(1) - T = locate(X1,Y1,Z) - if(!T) return 0 - M = locate() in T - if(M) return M - M = locate() in orange(1,T)-exc_obj - if(M) return M - Y1+=s - else - var - m=(32*(Y2-Y1)+(PY2-PY1))/(32*(X2-X1)+(PX2-PX1)) - b=(Y1+PY1/32-0.015625)-m*(X1+PX1/32-0.015625) //In tiles - signX = SIGN(X2-X1) - signY = SIGN(Y2-Y1) - if(X1= 5) - if(ismob(I.loc)) - to_chat(I.loc, "You can only target 5 people at once!") - return - else - return - for(var/mob/living/K in viewers(usr)) - K << 'sound/weapons/TargetOn.ogg' - - if(!targeted_by) targeted_by = list() - targeted_by += I - I.lock_time = world.time + 20 //Target has 2 second to realize they're targeted and stop (or target the opponent). - to_chat(src, "((Your character is being targeted. They have 2 seconds to stop any click or move actions. \ - While targeted, they may drag and drop items in or into the map, speak, and click on interface buttons. \ - Clicking on the map objects (floors and walls are fine), their items (other than a weapon to de-target), or moving will result in being fired upon. \ - The aggressor may also fire manually, so try not to get on their bad side.))") - - if(targeted_by.len == 1) - spawn(0) - target_locked = image("icon" = 'icons/effects/Targeted.dmi', "icon_state" = "locking") - overlays += target_locked - spawn(0) - sleep(20) - if(target_locked) - target_locked = image("icon" = 'icons/effects/Targeted.dmi', "icon_state" = "locked") - update_targeted() - - //Adding the buttons to the controler person - var/mob/living/T = I.loc - if(T) - if(T.client) - T.client.add_gun_icons() - else - I.lower_aim() - return - /*if(m_intent == "run" && T.client.target_can_move == 1 && T.client.target_can_run == 0 && (ishuman(T))) - to_chat(src, "\red Your move intent is now set to walk, as your targeter permits it.")//Self explanitory. - - set_m_intent("walk")*/ - - //Processing the aiming. Should be probably in separate object with process() but lasy. - while(targeted_by && T.client) - if(last_move_intent > I.lock_time + 10 && !T.client.target_can_move) //If target moved when not allowed to - I.TargetActed(src) - if(I.last_moved_mob == src) //If they were the last ones to move, give them more of a grace period, so that an automatic weapon can hold down a room better. - I.lock_time = world.time + 5 - I.lock_time = world.time + 5 - I.last_moved_mob = src - else if(last_move_intent > I.lock_time + 10 && !T.client.target_can_run && m_intent == "run") //If the target ran while targeted - I.TargetActed(src) - if(I.last_moved_mob == src) //If they were the last ones to move, give them more of a grace period, so that an automatic weapon can hold down a room better. - I.lock_time = world.time + 5 - I.lock_time = world.time + 5 - I.last_moved_mob = src - if(last_target_click > I.lock_time + 10 && !T.client.target_can_click) //If the target clicked the map to pick something up/shoot/etc - I.TargetActed(src) - if(I.last_moved_mob == src) //If they were the last ones to move, give them more of a grace period, so that an automatic weapon can hold down a room better. - I.lock_time = world.time + 5 - I.lock_time = world.time + 5 - I.last_moved_mob = src - sleep(1) - -mob/living/proc/NotTargeted(var/obj/item/weapon/gun/I) - if(!I.silenced) - for(var/mob/living/M in viewers(src)) - M << 'sound/weapons/TargetOff.ogg' - targeted_by -= I - I.target.Remove(src) //De-target them - if(!I.target.len) - qdel(I.target) - var/mob/living/T = I.loc //Remove the targeting icons - if(T && ismob(T) && !I.target) - T.client.remove_gun_icons() - if(!targeted_by.len) - qdel(target_locked) //Remove the overlay - qdel(targeted_by) - spawn(1) update_targeted() - -mob/living/Move() - . = ..() - for(var/obj/item/weapon/gun/G in targeted_by) //Handle moving out of the gunner's view. - var/mob/living/M = G.loc - if(!(M in view(src))) - NotTargeted(G) - for(var/obj/item/weapon/gun/G in src) //Handle the gunner loosing sight of their target/s - if(G.target) - for(var/mob/living/M in G.target) - if(M && !(M in view(src))) - M.NotTargeted(G) - -//If you move out of range, it isn't going to still stay locked on you any more. -client/var - target_can_move = 0 - target_can_run = 0 - target_can_click = 0 - gun_mode = 0 - -//These are called by the on-screen buttons, adjusting what the victim can and cannot do. -client/proc/add_gun_icons() - screen += usr.item_use_icon - /*screen += usr.gun_move_icon - if (target_can_move) - screen += usr.gun_run_icon*/ - - - -client/proc/remove_gun_icons() - if(!usr) return - screen -= usr.item_use_icon - /*screen -= usr.gun_move_icon - if (target_can_move) - screen -= usr.gun_run_icon*/ - -client/verb/ToggleGunMode() - set hidden = 1 - gun_mode = !gun_mode - if(gun_mode) - to_chat(usr, "You will now take people captive.") - else - to_chat(usr, "You will now shoot where you target.") - for(var/obj/item/weapon/gun/G in usr) - G.stop_aim() - remove_gun_icons() - if(usr.gun_setting_icon) - usr.gun_setting_icon.icon_state = "gun[gun_mode]" - - -/*client/verb/AllowTargetMove() - set hidden=1 - - //Changing client's permissions - target_can_move = !target_can_move - if(target_can_move) - to_chat(usr, "Target may now walk.") - //usr.gun_run_icon = new /obj/screen/gun/run(null) //adding icon for running permission - screen += usr.gun_run_icon - else - to_chat(usr, "Target may no longer move.") - target_can_run = 0 - qdel(usr.gun_run_icon) //no need for icon for running permission - - //Updating walking permission button - if(usr.gun_move_icon) - usr.gun_move_icon.icon_state = "no_walk[target_can_move]" - usr.gun_move_icon.name = "[target_can_move ? "Disallow" : "Allow"] Walking" - - //Handling change for all the guns on client - for(var/obj/item/weapon/gun/G in usr) - G.lock_time = world.time + 5 - if(G.target) - for(var/mob/living/M in G.target) - if(target_can_move) - to_chat(M, "Your character may now walk at the discretion of their targeter.") - if(!target_can_run && (ishuman(M))) - to_chat(M, "\red Your move intent is now set to walk, as your targeter permits it.") - M.set_m_intent("walk") - else - to_chat(M, "\red Your character will now be shot if they move.") - -mob/living/proc/set_m_intent(var/intent) - if (intent != "walk" && intent != "run") - return 0 - m_intent = intent - if(hud_used) - if (hud_used.move_intent) - hud_used.move_intent.icon_state = intent == "walk" ? "walking" : "running" - -client/verb/AllowTargetRun() - set hidden=1 - - //Changing client's permissions - target_can_run = !target_can_run - if(target_can_run) - to_chat(usr, "Target may now run.") - else - to_chat(usr, "Target may no longer run.") - - //Updating running permission button - if(usr.gun_run_icon) - usr.gun_run_icon.icon_state = "no_run[target_can_run]" - usr.gun_run_icon.name = "[target_can_run ? "Disallow" : "Allow"] Running" - - //Handling change for all the guns on client - for(var/obj/item/weapon/gun/G in src) - G.lock_time = world.time + 5 - if(G.target) - for(var/mob/living/M in G.target) - if(target_can_run) - to_chat(M, "Your character may now run at the discretion of their targeter.") - else - to_chat(M, "\red Your character will now be shot if they run.")*/ - -client/verb/AllowTargetClick() - set hidden=1 - - //Changing client's permissions - target_can_click = !target_can_click - if(target_can_click) - to_chat(usr, "Target may now use items.") - else - to_chat(usr, "Target may no longer use items.") - - if(usr.item_use_icon) - usr.item_use_icon.icon_state = "no_item[target_can_click]" - usr.item_use_icon.name = "[target_can_click ? "Disallow" : "Allow"] Item Use" - - //Handling change for all the guns on client - for(var/obj/item/weapon/gun/G in src) - G.lock_time = world.time + 5 - if(G.target) - for(var/mob/living/M in G.target) - if(target_can_click) - to_chat(M, "Your character may now use items at the discretion of their targeter.") - else - to_chat(M, "\red Your character will now be shot if they use items.") diff --git a/icons/mob/screen1.dmi b/icons/mob/screen1.dmi deleted file mode 100644 index 27f7a09e530..00000000000 Binary files a/icons/mob/screen1.dmi and /dev/null differ diff --git a/icons/mob/screen1_Midnight.dmi b/icons/mob/screen1_Midnight.dmi deleted file mode 100644 index 808734a832e..00000000000 Binary files a/icons/mob/screen1_Midnight.dmi and /dev/null differ diff --git a/icons/mob/screen1_Orange.dmi b/icons/mob/screen1_Orange.dmi deleted file mode 100644 index 15964ad65d0..00000000000 Binary files a/icons/mob/screen1_Orange.dmi and /dev/null differ diff --git a/icons/mob/screen1_White.dmi b/icons/mob/screen1_White.dmi deleted file mode 100644 index 2b6e99bbb33..00000000000 Binary files a/icons/mob/screen1_White.dmi and /dev/null differ diff --git a/icons/mob/screen1_alien.dmi b/icons/mob/screen1_alien.dmi deleted file mode 100644 index 0ca5b617c7e..00000000000 Binary files a/icons/mob/screen1_alien.dmi and /dev/null differ diff --git a/icons/mob/screen1_corgi.dmi b/icons/mob/screen1_corgi.dmi deleted file mode 100644 index dafa9ae2b44..00000000000 Binary files a/icons/mob/screen1_corgi.dmi and /dev/null differ diff --git a/icons/mob/screen1_old.dmi b/icons/mob/screen1_old.dmi deleted file mode 100644 index 7da629f1dae..00000000000 Binary files a/icons/mob/screen1_old.dmi and /dev/null differ diff --git a/icons/mob/screen_alien.dmi b/icons/mob/screen_alien.dmi index 822cbec7d0e..c254b276bc5 100644 Binary files a/icons/mob/screen_alien.dmi and b/icons/mob/screen_alien.dmi differ diff --git a/icons/mob/screen1_bot.dmi b/icons/mob/screen_bot.dmi similarity index 100% rename from icons/mob/screen1_bot.dmi rename to icons/mob/screen_bot.dmi diff --git a/icons/mob/screen_corgi.dmi b/icons/mob/screen_corgi.dmi new file mode 100644 index 00000000000..81a8a2ab890 Binary files /dev/null and b/icons/mob/screen_corgi.dmi differ diff --git a/icons/mob/screen_gen.dmi b/icons/mob/screen_gen.dmi index a97f1abc5a0..4936936afde 100644 Binary files a/icons/mob/screen_gen.dmi and b/icons/mob/screen_gen.dmi differ diff --git a/icons/mob/screen_midnight.dmi b/icons/mob/screen_midnight.dmi new file mode 100644 index 00000000000..25b3d7355d9 Binary files /dev/null and b/icons/mob/screen_midnight.dmi differ diff --git a/icons/mob/screen1_NinjaHUD.dmi b/icons/mob/screen_ninja.dmi similarity index 100% rename from icons/mob/screen1_NinjaHUD.dmi rename to icons/mob/screen_ninja.dmi diff --git a/icons/mob/screen_operative.dmi b/icons/mob/screen_operative.dmi new file mode 100644 index 00000000000..d14e354d7f4 Binary files /dev/null and b/icons/mob/screen_operative.dmi differ diff --git a/icons/mob/screen_plasmafire.dmi b/icons/mob/screen_plasmafire.dmi new file mode 100644 index 00000000000..9e22298fc27 Binary files /dev/null and b/icons/mob/screen_plasmafire.dmi differ diff --git a/icons/mob/screen_retro.dmi b/icons/mob/screen_retro.dmi new file mode 100644 index 00000000000..ec36561ea0c Binary files /dev/null and b/icons/mob/screen_retro.dmi differ diff --git a/icons/mob/screen1_robot.dmi b/icons/mob/screen_robot.dmi similarity index 100% rename from icons/mob/screen1_robot.dmi rename to icons/mob/screen_robot.dmi diff --git a/icons/mob/screen_slimecore.dmi b/icons/mob/screen_slimecore.dmi new file mode 100644 index 00000000000..0e412d41c9c Binary files /dev/null and b/icons/mob/screen_slimecore.dmi differ diff --git a/icons/mob/screen_white.dmi b/icons/mob/screen_white.dmi new file mode 100644 index 00000000000..a30d30bd3ef Binary files /dev/null and b/icons/mob/screen_white.dmi differ diff --git a/paradise.dme b/paradise.dme index 2b31b12a8c4..d7ada13409f 100644 --- a/paradise.dme +++ b/paradise.dme @@ -103,6 +103,7 @@ #include "code\_onclick\hud\alien_larva.dm" #include "code\_onclick\hud\bot.dm" #include "code\_onclick\hud\fullscreen.dm" +#include "code\_onclick\hud\guardian.dm" #include "code\_onclick\hud\hud.dm" #include "code\_onclick\hud\human.dm" #include "code\_onclick\hud\monkey.dm" @@ -110,6 +111,7 @@ #include "code\_onclick\hud\other_mobs.dm" #include "code\_onclick\hud\robot.dm" #include "code\_onclick\hud\screen_objects.dm" +#include "code\_onclick\hud\swarmer.dm" #include "code\ATMOSPHERICS\atmospherics.dm" #include "code\ATMOSPHERICS\datum_icon_manager.dm" #include "code\ATMOSPHERICS\datum_pipeline.dm" @@ -451,7 +453,6 @@ #include "code\game\gamemodes\shadowling\shadowling_items.dm" #include "code\game\gamemodes\shadowling\special_shadowling_abilities.dm" #include "code\game\gamemodes\traitor\traitor.dm" -#include "code\game\gamemodes\vampire\hud.dm" #include "code\game\gamemodes\vampire\traitor_vamp.dm" #include "code\game\gamemodes\vampire\vampire.dm" #include "code\game\gamemodes\vampire\vampire_powers.dm" @@ -1492,7 +1493,6 @@ #include "code\modules\mob\living\carbon\slime\emote.dm" #include "code\modules\mob\living\carbon\slime\examine.dm" #include "code\modules\mob\living\carbon\slime\life.dm" -#include "code\modules\mob\living\carbon\slime\login.dm" #include "code\modules\mob\living\carbon\slime\powers.dm" #include "code\modules\mob\living\carbon\slime\say.dm" #include "code\modules\mob\living\carbon\slime\slime.dm" @@ -1736,7 +1736,6 @@ #include "code\modules\projectiles\gun.dm" #include "code\modules\projectiles\medbeam.dm" #include "code\modules\projectiles\projectile.dm" -#include "code\modules\projectiles\targeting.dm" #include "code\modules\projectiles\ammunition\ammo_casings.dm" #include "code\modules\projectiles\ammunition\boxes.dm" #include "code\modules\projectiles\ammunition\magazines.dm"