Fix mecha mouse pointer issues (#38213)

* Fix mecha mouse pointer issues

* Migrate ranged ability mouse pointers to new system
This commit is contained in:
Tad Hardesty
2018-06-02 17:41:57 -07:00
committed by letterjay
parent 5bf3bd761d
commit 95bbfb29d1
9 changed files with 22 additions and 46 deletions
@@ -271,7 +271,6 @@
attached_action.desc += "<br><b><u>Has [attached_action.charges] use\s remaining</u></b>."
attached_action.UpdateButtonIcon()
if(attached_action.charges <= 0)
remove_mousepointer(ranged_ability_user.client)
remove_ranged_ability("<span class='cult'>You have exhausted the spell's power!</span>")
qdel(src)
@@ -457,7 +457,6 @@
new /obj/effect/temp_visual/cult/sparks(get_turf(target), ranged_ability_user.dir)
attached_action.throwing = FALSE
attached_action.cooldown = world.time + attached_action.base_cooldown
remove_mousepointer(ranged_ability_user.client)
remove_ranged_ability("<span class='cult'>A pulse of blood magic surges through you as you shift [attached_action.throwee] through time and space.</span>")
caller.update_action_buttons_icon()
addtimer(CALLBACK(caller, /mob.proc/update_action_buttons_icon), attached_action.base_cooldown)
+5 -8
View File
@@ -35,14 +35,6 @@
QDEL_LIST(diseases)
return ..()
/mob/living/ghostize(can_reenter_corpse = 1)
var/prev_client = client
. = ..()
if(.)
if(ranged_ability && prev_client)
ranged_ability.remove_mousepointer(prev_client)
/mob/living/proc/OpenCraftingMenu()
return
@@ -1149,6 +1141,11 @@
clear_fullscreen("remote_view", 0)
update_pipe_vision()
/mob/living/update_mouse_pointer()
..()
if (client && ranged_ability && ranged_ability.ranged_mousepointer)
client.mouse_pointer_icon = ranged_ability.ranged_mousepointer
/mob/living/vv_edit_var(var_name, var_value)
switch(var_name)
if("stat")
-2
View File
@@ -1,7 +1,5 @@
/mob/living/Logout()
update_z(null)
if(ranged_ability && client)
ranged_ability.remove_mousepointer(client)
..()
if(!key && mind) //key and mind have become separated.
mind.active = 0 //This is to stop say, a mind.transfer_to call on a corpse causing a ghost to re-enter its body.
+1
View File
@@ -38,6 +38,7 @@
AA.onNewMob(src)
update_client_colour()
update_mouse_pointer()
if(client)
client.click_intercept = null
+9
View File
@@ -849,6 +849,15 @@
if (L)
L.alpha = lighting_alpha
/mob/proc/update_mouse_pointer()
if (!client)
return
client.mouse_pointer_icon = initial(client.mouse_pointer_icon)
if (ismecha(loc))
var/obj/mecha/M = loc
if(M.mouse_pointer)
client.mouse_pointer_icon = M.mouse_pointer
/mob/proc/is_literate()
return 0
+2 -10
View File
@@ -68,27 +68,19 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th
return
user.ranged_ability = src
user.click_intercept = src
add_mousepointer(user.client)
user.update_mouse_pointer()
ranged_ability_user = user
if(msg)
to_chat(ranged_ability_user, msg)
active = TRUE
update_icon()
/obj/effect/proc_holder/proc/add_mousepointer(client/C)
if(C && ranged_mousepointer && C.mouse_pointer_icon == initial(C.mouse_pointer_icon))
C.mouse_pointer_icon = ranged_mousepointer
/obj/effect/proc_holder/proc/remove_mousepointer(client/C)
if(C && ranged_mousepointer && C.mouse_pointer_icon == ranged_mousepointer)
C.mouse_pointer_icon = initial(C.mouse_pointer_icon)
/obj/effect/proc_holder/proc/remove_ranged_ability(msg)
if(!ranged_ability_user || !ranged_ability_user.client || (ranged_ability_user.ranged_ability && ranged_ability_user.ranged_ability != src)) //To avoid removing the wrong ability
return
ranged_ability_user.ranged_ability = null
ranged_ability_user.click_intercept = null
remove_mousepointer(ranged_ability_user.client)
ranged_ability_user.update_mouse_pointer()
if(msg)
to_chat(ranged_ability_user, msg)
ranged_ability_user = null