From a451932e74c1efdcb8e2c049e78ab00cc835b2ce Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Mon, 30 Nov 2015 00:17:38 -0500 Subject: [PATCH] Fized intents, gun toggle is odd... --- code/_onclick/hud/human.dm | 3 +- code/_onclick/hud/monkey.dm | 4 +- code/_onclick/hud/screen_objects.dm | 61 ++++++++++++++++------------- 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 6e6f1d0e651..aa9da33ca78 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -47,7 +47,7 @@ action_intent = using //intent small hud objects - var/icon/ico +/* var/icon/ico ico = new(ui_style, "black") ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) @@ -96,6 +96,7 @@ using.layer = 21 src.adding += using hurt_intent = using +*/ //end intent small hud objects diff --git a/code/_onclick/hud/monkey.dm b/code/_onclick/hud/monkey.dm index 09a2dce5b4f..85f91e53e30 100644 --- a/code/_onclick/hud/monkey.dm +++ b/code/_onclick/hud/monkey.dm @@ -20,7 +20,7 @@ action_intent = using //intent small hud objects - var/icon/ico +/* var/icon/ico ico = new(ui_style, "black") ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1) @@ -69,7 +69,7 @@ using.layer = 21 src.adding += using hurt_intent = using - +*/ //end intent small hud objects using = new /obj/screen/mov_intent() diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 0041e1d4bbc..d06ae59ab87 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -68,19 +68,22 @@ icon_state = "help" /obj/screen/act_intent/Click(location, control, params) - usr.a_intent_change("right") - if("help") - usr.a_intent = I_HELP - usr.hud_used.action_intent.icon_state = "intent_help" - if("harm") - usr.a_intent = I_HARM - usr.hud_used.action_intent.icon_state = "intent_harm" - if("grab") - usr.a_intent = I_GRAB - usr.hud_used.action_intent.icon_state = "intent_grab" - if("disarm") - usr.a_intent = I_DISARM - usr.hud_used.action_intent.icon_state = "intent_disarm" + if(ishuman(usr)) + var/_x = text2num(params2list(params)["icon-x"]) + var/_y = text2num(params2list(params)["icon-y"]) + + if(_x<=16 && _y<=16) + usr.a_intent_change(I_HARM) + else if(_x<=16 && _y>=17) + usr.a_intent_change(I_HELP) + else if(_x>=17 && _y<=16) + usr.a_intent_change(I_GRAB) + + else if(_x>=17 && _y>=17) + usr.a_intent_change(I_DISARM) + + else + usr.a_intent_change("right") /obj/screen/internals name = "toggle internals" @@ -196,7 +199,6 @@ else C << "You don't have a[breathes=="oxygen" ? "n oxygen" : addtext(" ",breathes)] tank." - /obj/screen/mov_intent name = "run/walk toggle" icon = 'icons/mob/screen1_midnight.dmi' @@ -220,6 +222,8 @@ if(istype(usr,/mob/living/carbon/alien/humanoid)) usr.update_icons() + + /obj/screen/pull name = "stop pulling" icon = 'icons/mob/screen1_Midnight.dmi' @@ -349,26 +353,27 @@ master = null dir = 2 - /*move - name = "Allow Walking" - icon_state = "no_walk0" - screen_loc = ui_gun2 +/obj/screen/gun/mode + name = "Toggle Gun Mode" + icon_state = "gun0" + screen_loc = ui_gun_select - run - name = "Allow Running" - icon_state = "no_run0" - screen_loc = ui_gun3*/ +/obj/screen/gun/mode/Click() + usr.client.ToggleGunMode() - item +/obj/screen/gun/item name = "Allow Item Use" icon_state = "no_item0" screen_loc = ui_gun1 - mode - name = "Toggle Gun Mode" - icon_state = "gun0" - screen_loc = ui_gun_select - //dir = 1 +/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)) + usr << "You need your gun in your active hand to do that!" + return + usr.client.AllowTargetClick() + gun_click_time = world.time /obj/screen/inventory/Click()