Ports some hud and update_icon code updates.

This commit is contained in:
Ghommie
2019-12-16 23:29:20 +01:00
parent 447f416ca6
commit 80402a0d88
56 changed files with 424 additions and 265 deletions
+2 -2
View File
@@ -39,7 +39,7 @@
if(flash)
add_overlay(flashing_overlay)
attached_overlays += flashing_overlay
addtimer(CALLBACK(src, .proc/update_icon), 5)
addtimer(CALLBACK(src, /atom/.proc/update_icon), 5)
if(holder)
holder.update_icon()
@@ -308,7 +308,7 @@
else if(flash)
icon_state = "flashshield_flash"
item_state = "flashshield_flash"
addtimer(CALLBACK(src, .proc/update_icon), 5)
addtimer(CALLBACK(src, /atom/.proc/update_icon), 5)
if(holder)
holder.update_icon()
+1 -1
View File
@@ -29,7 +29,7 @@
name = linked_pod.name
. = ..()
/mob/living/simple_animal/pet/gondola/gondolapod/proc/update_icon()
/mob/living/simple_animal/pet/gondola/gondolapod/update_icon_state()
if(opened)
icon_state = "gondolapod_open"
else
@@ -55,7 +55,7 @@
mix_filling_color(S)
S.reagents.trans_to(src,min(S.reagents.total_volume, 15)) //limit of 15, we don't want our custom food to be completely filled by just one ingredient with large reagent volume.
foodtype |= S.foodtype
update_overlays(S)
update_snack_overlays(S)
to_chat(user, "<span class='notice'>You add the [I.name] to the [name].</span>")
update_name(S)
else
@@ -103,7 +103,7 @@
rgbcolor[4] = (customcolor[4]+ingcolor[4])/2
filling_color = rgb(rgbcolor[1], rgbcolor[2], rgbcolor[3], rgbcolor[4])
/obj/item/reagent_containers/food/snacks/customizable/update_overlays(obj/item/reagent_containers/food/snacks/S)
/obj/item/reagent_containers/food/snacks/customizable/update_snack_overlays(obj/item/reagent_containers/food/snacks/S)
var/mutable_appearance/filling = mutable_appearance(icon, "[initial(icon_state)]_filling")
if(S.filling_color == "#FFFFFF")
filling.color = pick("#FF0000","#0000FF","#008000","#FFFF00")
@@ -139,7 +139,7 @@
/obj/item/reagent_containers/food/snacks/customizable/initialize_slice(obj/item/reagent_containers/food/snacks/slice, reagents_per_slice)
..()
slice.filling_color = filling_color
slice.update_overlays(src)
slice.update_snack_overlays(src)
/obj/item/reagent_containers/food/snacks/customizable/Destroy()
+1 -1
View File
@@ -267,7 +267,7 @@ All foods are distributed among various categories. Use common sense.
trash = null
return
/obj/item/reagent_containers/food/snacks/proc/update_overlays(obj/item/reagent_containers/food/snacks/S)
/obj/item/reagent_containers/food/snacks/proc/update_snack_overlays(obj/item/reagent_containers/food/snacks/S)
cut_overlays()
var/mutable_appearance/filling = mutable_appearance(icon, "[initial(icon_state)]_filling")
if(S.filling_color == "#FFFFFF")
@@ -465,13 +465,13 @@
to_chat(user, "<span class='notice'>You add the [I] to the [name].</span>")
P.name = initial(P.name)
contents += P
update_overlays(P)
update_snack_overlays(P)
if (P.contents.len)
for(var/V in P.contents)
P = V
P.name = initial(P.name)
contents += P
update_overlays(P)
update_snack_overlays(P)
P = I
clearlist(P.contents)
return
@@ -480,7 +480,7 @@
return O.attackby(I, user, params)
..()
/obj/item/reagent_containers/food/snacks/pancakes/update_overlays(obj/item/reagent_containers/food/snacks/P)
/obj/item/reagent_containers/food/snacks/pancakes/update_snack_overlays(obj/item/reagent_containers/food/snacks/P)
var/mutable_appearance/pancake = mutable_appearance(icon, "[P.item_state]_[rand(1,3)]")
pancake.pixel_x = rand(-1,1)
pancake.pixel_y = 3 * contents.len - 1
+2 -3
View File
@@ -111,11 +111,10 @@
/turf/open/floor/holofloor/carpet/Initialize()
. = ..()
addtimer(CALLBACK(src, .proc/update_icon), 1)
addtimer(CALLBACK(src, /atom/.proc/update_icon), 1)
/turf/open/floor/holofloor/carpet/update_icon()
if(!..())
return 0
. = ..()
if(intact)
queue_smooth(src)
+2 -1
View File
@@ -178,7 +178,8 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
* Hair will always update its dir, so if your sprite has no dirs the haircut will go all over the place.
* |- Ricotez
*/
/mob/dead/observer/proc/update_icon(new_form)
/mob/dead/observer/update_icon(new_form)
. = ..()
if(client) //We update our preferences in case they changed right before update_icon was called.
ghost_accs = client.prefs.ghost_accs
ghost_others = client.prefs.ghost_others
@@ -803,10 +803,8 @@
else
hud_used.healthdoll.icon_state = "healthdoll_DEAD"
if(hud_used.staminas)
hud_used.staminas.icon_state = staminahudamount()
if(hud_used.staminabuffer)
hud_used.staminabuffer.icon_state = staminabufferhudamount()
hud_used.staminas?.update_icon_state()
hud_used.staminabuffer?.update_icon_state()
/mob/living/carbon/human/fully_heal(admin_revive = 0)
if(admin_revive)
@@ -51,7 +51,7 @@
weapon.attack(C, src)
playsound(src, 'sound/weapons/blade1.ogg', 50, TRUE, -1)
if(C.stat == DEAD)
addtimer(CALLBACK(src, .proc/update_icon), 2)
addtimer(CALLBACK(src, /atom/.proc/update_icon), 2)
back_to_idle()
@@ -840,7 +840,7 @@ Pass a positive integer as an argument to override a bot's default speed.
ejectpai(usr)
update_controls()
/mob/living/simple_animal/bot/proc/update_icon()
/mob/living/simple_animal/bot/update_icon_state()
icon_state = "[initial(icon_state)][on]"
// Machinery to simplify topic and access calls
@@ -50,7 +50,7 @@
/mob/living/simple_animal/bot/honkbot/proc/sensor_blink()
icon_state = "honkbot-c"
addtimer(CALLBACK(src, .proc/update_icon), 5, TIMER_OVERRIDE|TIMER_UNIQUE)
addtimer(CALLBACK(src, /atom/.proc/update_icon), 5, TIMER_OVERRIDE|TIMER_UNIQUE)
//honkbots react with sounds.
/mob/living/simple_animal/bot/honkbot/proc/react_ping()
@@ -177,7 +177,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
playsound(src, "honkbot_e", 50, 0)
spam_flag = TRUE // prevent spam
icon_state = "honkbot-e"
addtimer(CALLBACK(src, .proc/update_icon), 30, TIMER_OVERRIDE|TIMER_UNIQUE)
addtimer(CALLBACK(src, /atom/.proc/update_icon), 30, TIMER_OVERRIDE|TIMER_UNIQUE)
addtimer(CALLBACK(src, .proc/spam_flag_false), cooldowntimehorn)
/mob/living/simple_animal/bot/honkbot/proc/honk_attack(mob/living/carbon/C) // horn attack
@@ -250,7 +250,7 @@ Auto Patrol: []"},
var/judgement_criteria = judgement_criteria()
playsound(src, 'sound/weapons/egloves.ogg', 50, TRUE, -1)
icon_state = "secbot-c"
addtimer(CALLBACK(src, .proc/update_icon), 2)
addtimer(CALLBACK(src, /atom/.proc/update_icon), 2)
var/threat = 5
if(ishuman(C))
C.stuttering = 5
+2 -6
View File
@@ -380,14 +380,10 @@ mob/visible_message(message, self_message, blind_message, vision_distance = DEFA
spintime -= speed
/mob/proc/update_pull_hud_icon()
if(hud_used)
if(hud_used.pull_icon)
hud_used.pull_icon.update_icon(src)
hud_used?.pull_icon?.update_icon()
/mob/proc/update_rest_hud_icon()
if(hud_used)
if(hud_used.rest_icon)
hud_used.rest_icon.update_icon(src)
hud_used?.rest_icon?.update_icon()
/mob/verb/mode()
set name = "Activate Held Object"
+1 -1
View File
@@ -22,7 +22,7 @@
I'll make some notes on where certain variable defines should probably go.
Changing this around would probably require a good look-over the pre-existing code.
*/
var/zone_selected = null
var/zone_selected = BODY_ZONE_CHEST
var/computer_id = null
var/list/logging = list()
+1 -1
View File
@@ -372,7 +372,7 @@
m_intent = MOVE_INTENT_RUN
if(hud_used && hud_used.static_inventory)
for(var/obj/screen/mov_intent/selector in hud_used.static_inventory)
selector.update_icon(src)
selector.update_icon()
/mob/verb/up()
set name = "Move Upwards"