its a lil janky but we take those (#15834)
Co-authored-by: Hatterhat <Hatterhat@users.noreply.github.com>
This commit is contained in:
@@ -720,3 +720,28 @@
|
||||
/atom/movable/screen/component_button/Click(params)
|
||||
if(parent)
|
||||
parent.component_click(src, params)
|
||||
|
||||
/atom/movable/screen/combo
|
||||
icon_state = ""
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
screen_loc = ui_combo
|
||||
layer = ABOVE_HUD_LAYER
|
||||
var/timerid
|
||||
|
||||
/atom/movable/screen/combo/proc/clear_streak()
|
||||
cut_overlays()
|
||||
icon_state = ""
|
||||
|
||||
/atom/movable/screen/combo/update_icon_state(streak = "")
|
||||
clear_streak()
|
||||
if (timerid)
|
||||
deltimer(timerid)
|
||||
if (!streak)
|
||||
return
|
||||
timerid = addtimer(CALLBACK(src, .proc/clear_streak), 20, TIMER_UNIQUE | TIMER_STOPPABLE)
|
||||
icon_state = "combo"
|
||||
for (var/i = 1; i <= length(streak); ++i)
|
||||
var/intent_text = copytext(streak, i, i + 1)
|
||||
var/image/intent_icon = image(icon,src,"combo_[intent_text]")
|
||||
intent_icon.pixel_x = 16 * (i - 1) - 8 * length(streak)
|
||||
add_overlay(intent_icon)
|
||||
|
||||
Reference in New Issue
Block a user