mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Updates to gun targeting UI. Fixes #5710
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
using.icon = ui_style
|
||||
using.icon_state = "intent_"+mymob.a_intent
|
||||
using.screen_loc = ui_acti
|
||||
using.color = ui_color
|
||||
using.alpha = ui_alpha
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
action_intent = using
|
||||
@@ -27,6 +29,7 @@
|
||||
using.name = "help"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.alpha = ui_alpha
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
help_intent = using
|
||||
@@ -38,6 +41,7 @@
|
||||
using.name = "disarm"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.alpha = ui_alpha
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
disarm_intent = using
|
||||
@@ -49,6 +53,7 @@
|
||||
using.name = "grab"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.alpha = ui_alpha
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
grab_intent = using
|
||||
@@ -60,6 +65,7 @@
|
||||
using.name = "harm"
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.alpha = ui_alpha
|
||||
using.layer = 21
|
||||
src.adding += using
|
||||
hurt_intent = using
|
||||
@@ -440,23 +446,24 @@
|
||||
|
||||
//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
|
||||
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
|
||||
if (G.target)
|
||||
mymob.item_use_icon = new /obj/screen/gun/item(null)
|
||||
if (mymob.client.target_can_click)
|
||||
mymob.item_use_icon.dir = 1
|
||||
src.adding += mymob.item_use_icon
|
||||
mymob.gun_move_icon = new /obj/screen/gun/move(null)
|
||||
if (mymob.client.target_can_move)
|
||||
mymob.gun_move_icon.dir = 1
|
||||
mymob.gun_run_icon = new /obj/screen/gun/run(null)
|
||||
if (mymob.client.target_can_run)
|
||||
mymob.gun_run_icon.dir = 1
|
||||
src.adding += mymob.gun_run_icon
|
||||
src.adding += mymob.gun_move_icon
|
||||
|
||||
|
||||
mymob.client.screen = null
|
||||
@@ -495,7 +502,7 @@
|
||||
for(var/obj/item/I in src)
|
||||
if(I.icon_action_button)
|
||||
var/obj/screen/item_action/A = new(hud_used)
|
||||
|
||||
|
||||
//A.icon = 'icons/mob/screen1_action.dmi'
|
||||
//A.icon_state = I.icon_action_button
|
||||
A.icon = ui_style2icon(client.prefs.UI_style)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
src << "As a ghost, you will now [(prefs.toggles & CHAT_GHOSTRADIO) ? "hear all radio chat in the world" : "only hear from nearby speakers"]."
|
||||
prefs.save_preferences()
|
||||
feedback_add_details("admin_verb","TGR")
|
||||
|
||||
|
||||
/client/proc/toggle_hear_radio()
|
||||
set name = "Show/Hide RadioChatter"
|
||||
set category = "Preferences"
|
||||
|
||||
@@ -250,42 +250,25 @@ client/var
|
||||
|
||||
//These are called by the on-screen buttons, adjusting what the victim can and cannot do.
|
||||
client/proc/add_gun_icons()
|
||||
if (!usr.item_use_icon)
|
||||
usr.item_use_icon = new /obj/screen/gun/item(null)
|
||||
usr.item_use_icon.icon_state = "no_item[target_can_click]"
|
||||
usr.item_use_icon.name = "[target_can_click ? "Disallow" : "Allow"] Item Use"
|
||||
|
||||
if (!usr.gun_move_icon)
|
||||
usr.gun_move_icon = new /obj/screen/gun/move(null)
|
||||
usr.gun_move_icon.icon_state = "no_walk[target_can_move]"
|
||||
usr.gun_move_icon.name = "[target_can_move ? "Disallow" : "Allow"] Walking"
|
||||
|
||||
if (target_can_move && !usr.gun_run_icon)
|
||||
usr.gun_run_icon = new /obj/screen/gun/run(null)
|
||||
usr.gun_run_icon.icon_state = "no_run[target_can_run]"
|
||||
usr.gun_run_icon.name = "[target_can_run ? "Disallow" : "Allow"] Running"
|
||||
|
||||
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 1 // Runtime prevention on N00k agents spawning with SMG
|
||||
screen -= usr.item_use_icon
|
||||
screen -= usr.gun_move_icon
|
||||
if (target_can_move)
|
||||
screen -= usr.gun_run_icon
|
||||
del usr.gun_move_icon
|
||||
del usr.item_use_icon
|
||||
del usr.gun_run_icon
|
||||
|
||||
client/verb/ToggleGunMode()
|
||||
set hidden = 1
|
||||
gun_mode = !gun_mode
|
||||
if(gun_mode)
|
||||
usr << "You will now take people captive."
|
||||
add_gun_icons()
|
||||
else
|
||||
usr << "You will now shoot where you target."
|
||||
for(var/obj/item/weapon/gun/G in usr)
|
||||
@@ -302,7 +285,7 @@ client/verb/AllowTargetMove()
|
||||
target_can_move = !target_can_move
|
||||
if(target_can_move)
|
||||
usr << "Target may now walk."
|
||||
usr.gun_run_icon = new /obj/screen/gun/run(null) //adding icon for running permission
|
||||
//usr.gun_run_icon = new /obj/screen/gun/run(null) //adding icon for running permission
|
||||
screen += usr.gun_run_icon
|
||||
else
|
||||
usr << "Target may no longer move."
|
||||
|
||||
Reference in New Issue
Block a user