diff --git a/code/game/hud.dm b/code/game/hud.dm index a5adf04ed9f..8a7c2ecb628 100644 --- a/code/game/hud.dm +++ b/code/game/hud.dm @@ -41,6 +41,7 @@ #define ui_acti "13:26,1:5" #define ui_movi "12:24,1:5" #define ui_zonesel "14:28,1:5" +#define ui_acti_alt "14:28,1:5" //alternative intent switcher for when the interface is hidden (F12) #define ui_borg_pull "12:24,2:7" #define ui_borg_module "13:26,2:7" @@ -110,35 +111,54 @@ obj/hud/New(var/type = 0) return -/obj/hud/proc/other_update() - +/obj/hud/proc/hidden_inventory_update() if(!mymob) return - if(show_otherinventory) - if(mymob:shoes) mymob:shoes:screen_loc = ui_shoes - if(mymob:gloves) mymob:gloves:screen_loc = ui_gloves - if(mymob:ears) mymob:ears:screen_loc = ui_ears - //if(mymob:s_store) mymob:s_store:screen_loc = ui_sstore1 - if(mymob:glasses) mymob:glasses:screen_loc = ui_glasses - if(mymob:w_uniform) mymob:w_uniform:screen_loc = ui_iclothing - if(mymob:wear_suit) mymob:wear_suit:screen_loc = ui_oclothing - if(mymob:wear_mask) mymob:wear_mask:screen_loc = ui_mask - if(mymob:head) mymob:head:screen_loc = ui_head + if(inventory_shown && hud_shown) + if(ishuman(mymob)) + if(mymob:shoes) mymob:shoes:screen_loc = ui_shoes + if(mymob:gloves) mymob:gloves:screen_loc = ui_gloves + if(mymob:ears) mymob:ears:screen_loc = ui_ears + if(mymob:glasses) mymob:glasses:screen_loc = ui_glasses + if(mymob:w_uniform) mymob:w_uniform:screen_loc = ui_iclothing + if(mymob:wear_suit) mymob:wear_suit:screen_loc = ui_oclothing + if(mymob:wear_mask) mymob:wear_mask:screen_loc = ui_mask + if(mymob:head) mymob:head:screen_loc = ui_head else if(ishuman(mymob)) if(mymob:shoes) mymob:shoes:screen_loc = null if(mymob:gloves) mymob:gloves:screen_loc = null if(mymob:ears) mymob:ears:screen_loc = null - //if(mymob:s_store) mymob:s_store:screen_loc = null if(mymob:glasses) mymob:glasses:screen_loc = null if(mymob:w_uniform) mymob:w_uniform:screen_loc = null if(mymob:wear_suit) mymob:wear_suit:screen_loc = null if(mymob:wear_mask) mymob:wear_mask:screen_loc = null if(mymob:head) mymob:head:screen_loc = null +/obj/hud/proc/persistant_inventory_update() + if(!mymob) return + if(hud_shown) + if(ishuman(mymob)) + if(mymob:s_store) mymob:s_store:screen_loc = ui_sstore1 + if(mymob:wear_id) mymob:wear_id:screen_loc = ui_id + if(mymob:belt) mymob:belt:screen_loc = ui_belt + if(mymob:back) mymob:back:screen_loc = ui_back + if(mymob:l_store) mymob:l_store:screen_loc = ui_storage1 + if(mymob:r_store) mymob:r_store:screen_loc = ui_storage2 + else + if(ishuman(mymob)) + if(mymob:s_store) mymob:s_store:screen_loc = null + if(mymob:wear_id) mymob:wear_id:screen_loc = null + if(mymob:belt) mymob:belt:screen_loc = null + if(mymob:back) mymob:back:screen_loc = null + if(mymob:l_store) mymob:l_store:screen_loc = null + if(mymob:r_store) mymob:r_store:screen_loc = null -/obj/hud/var/show_otherinventory = 1 -/obj/hud/var/obj/screen/action_intent -/obj/hud/var/obj/screen/move_intent + +/obj/hud + var/obj/screen/action_intent + var/obj/screen/move_intent + var/hud_shown = 1 //Used for the HUD toggle (F12) + var/inventory_shown = 1 //the inventory /obj/hud/proc/instantiate(var/type = 0) diff --git a/code/modules/mob/living/carbon/human/hud.dm b/code/modules/mob/living/carbon/human/hud.dm index befd1c7a7c1..17040cbf97e 100644 --- a/code/modules/mob/living/carbon/human/hud.dm +++ b/code/modules/mob/living/carbon/human/hud.dm @@ -681,7 +681,7 @@ //, mymob.i_select, mymob.m_select mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.nutrition_icon, mymob.pullin, mymob.blind, mymob.flash) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach ) mymob.client.screen += src.adding + src.hotkeybuttons - show_otherinventory = 0; + inventory_shown = 0; //if(istype(mymob,/mob/living/carbon/monkey)) mymob.client.screen += src.mon_blo diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index a160a62955b..134ba694b16 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -588,7 +588,7 @@ Please contact me on #coderbus IRC. ~Carn x /mob/living/carbon/human/update_hud() //TODO: do away with this if possible if(client) client.screen |= contents - hud_used.other_update() //Updates the screenloc of the items on the 'other' inventory bar + hud_used.hidden_inventory_update() //Updates the screenloc of the items on the 'other' inventory bar /mob/living/carbon/human/update_inv_handcuffed(var/update_icons=1) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 679244fe446..45177c70ce1 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -5,9 +5,6 @@ flags = NOREACT var/datum/mind/mind - - - //MOB overhaul //Not in use yet diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 8ec036cd874..23d4bdb7128 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -268,3 +268,50 @@ It's fairly easy to fix if dealing with single letters but not so much with comp return 1 return 0 + +//Triggered when F12 is pressed (Unless someone changed something in the DMF) +/mob/verb/button_pressed_F12() + set name = "F12" + set hidden = 1 + + if(hud_used) + if(ishuman(src)) + if(!src.client) 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 + 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. + + //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 + + 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() + else + usr << "\red Inventory hiding is currently only supported for human mobs, sorry." + else + usr << "\red This mob type does not use a HUD." \ No newline at end of file diff --git a/code/modules/mob/screen.dm b/code/modules/mob/screen.dm index d3bce83024e..3bbf555bc08 100644 --- a/code/modules/mob/screen.dm +++ b/code/modules/mob/screen.dm @@ -205,14 +205,14 @@ switch(name) /* if("other") - if (usr.hud_used.show_otherinventory) - usr.hud_used.show_otherinventory = 0 + if (usr.hud_used.inventory_shown) + usr.hud_used.inventory_shown = 0 usr.client.screen -= usr.hud_used.other else - usr.hud_used.show_otherinventory = 1 + usr.hud_used.inventory_shown = 1 usr.client.screen += usr.hud_used.other - usr.hud_used.other_update()*/ + usr.hud_used.hidden_inventory_update()*/ if("act_intent") if(ishuman(usr) || istype(usr,/mob/living/carbon/alien/humanoid) || islarva(usr)) usr.hud_used.action_intent.icon_state = "intent_[usr.a_intent]" @@ -234,14 +234,14 @@ usr.clearmap() if("other") - if (usr.hud_used.show_otherinventory) - usr.hud_used.show_otherinventory = 0 + if (usr.hud_used.inventory_shown) + usr.hud_used.inventory_shown = 0 usr.client.screen -= usr.hud_used.other else - usr.hud_used.show_otherinventory = 1 + usr.hud_used.inventory_shown = 1 usr.client.screen += usr.hud_used.other - usr.hud_used.other_update() + usr.hud_used.hidden_inventory_update() if("equip") var/obj/item/I = usr.get_active_hand() diff --git a/html/changelog.html b/html/changelog.html index 0e186dd67a7..c50372388f8 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -52,10 +52,10 @@ should be listed in the changelog upon commit tho. Thanks. -->