Preperation for spell action buttons

This commit is contained in:
ZomgPonies
2014-07-15 11:20:43 -04:00
parent fa8ed8a5b1
commit ccb425bd44
6 changed files with 76 additions and 2 deletions
+11
View File
@@ -25,6 +25,17 @@
#define ui_action_slot9 "9:22,16:26"
#define ui_action_slot10 "10:24,16:26"
#define ui_power_slot1 "1:6,15:24"
#define ui_power_slot2 "2:8,15:24"
#define ui_power_slot3 "3:10,15:24"
#define ui_power_slot4 "4:12,15:24"
#define ui_power_slot5 "5:14,15:24"
#define ui_power_slot6 "6:16,15:24"
#define ui_power_slot7 "7:18,15:24"
#define ui_power_slot8 "8:20,15:24"
#define ui_power_slot9 "9:22,15:24"
#define ui_power_slot10 "10:24,15:24"
//Middle left indicators
#define ui_alienplasmadisplay "1,6:15"
+1 -1
View File
@@ -108,7 +108,7 @@ var/datum/global_hud/global_hud = new()
var/list/obj/screen/hotkeybuttons
var/list/obj/screen/item_action/item_action_list = list() //Used for the item action ui buttons.
var/list/obj/screen/item_action/power_action_list = list() //Used for the power action ui buttons.
datum/hud/New(mob/owner)
mymob = owner
+52 -1
View File
@@ -552,4 +552,55 @@
A.screen_loc = ui_action_slot10
break //5 slots available, so no more can be added.
num++
src.client.screen += src.hud_used.item_action_list
src.client.screen += src.hud_used.item_action_list
/mob/living/carbon/human/update_power_buttons()
var/num = 1
if(!hud_used) return
if(!client) return
if(!hud_used.hud_shown) //Hud toggled to minimal
return
client.screen -= hud_used.power_action_list
hud_used.power_action_list = list()
for(var/obj/effect/proc_holder/spell/S in spell_list)
if(S.icon_power_button)
var/obj/screen/power_action/P = new(hud_used)
P.icon = 'icons/mob/screen1_action.dmi'
P.icon_state = S.icon_power_button
if(S.power_button_name)
P.name = S.power_button_name
else
P.name = "Use [S.name]"
P.owner = S
hud_used.power_action_list += P
switch(num)
if(1)
P.screen_loc = ui_power_slot1
if(2)
P.screen_loc = ui_power_slot2
if(3)
P.screen_loc = ui_power_slot3
if(4)
P.screen_loc = ui_power_slot4
if(5)
P.screen_loc = ui_power_slot5
if(6)
P.screen_loc = ui_power_slot6
if(7)
P.screen_loc = ui_power_slot7
if(8)
P.screen_loc = ui_power_slot8
if(9)
P.screen_loc = ui_power_slot9
if(10)
P.screen_loc = ui_power_slot10
break //5 slots available, so no more can be added.
num++
src.client.screen += src.hud_used.power_action_list
+8
View File
@@ -41,6 +41,11 @@
S.close(usr)
return 1
/obj/screen/power_action
var/obj/effect/proc_holder/spell/owner
/obj/screen/power_action/Click()
/obj/screen/item_action
var/obj/item/owner
@@ -67,6 +72,9 @@
/mob/proc/update_action_buttons()
return
/mob/proc/update_power_buttons()
return
/obj/screen/grab
name = "grab"
+3
View File
@@ -45,6 +45,9 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
var/critfailchance = 0
var/centcom_cancast = 1 //Whether or not the spell should be allowed on z2
var/icon_power_button
var/power_button_name
/obj/effect/proc_holder/spell/proc/cast_check(skipcharge = 0,mob/user = usr) //checks if the spell can be cast based on its settings; skipcharge is used when an additional cast_check is called inside the spell
if(!(src in user.spell_list))
@@ -1411,6 +1411,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask/*, global_hud.nvg*/)
update_action_buttons()
update_power_buttons()
if(damageoverlay.overlays)
damageoverlay.overlays = list()