its a lil janky but we take those (#15834)
Co-authored-by: Hatterhat <Hatterhat@users.noreply.github.com>
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
#define ui_back "CENTER-2:14,SOUTH:5"
|
||||
#define ui_storage1 "CENTER+1:18,SOUTH:5"
|
||||
#define ui_storage2 "CENTER+2:20,SOUTH:5"
|
||||
#define ui_combo "CENTER+4:24,SOUTH+1:7" // combo meter for martial arts
|
||||
|
||||
//Lower right, persistent menu
|
||||
#define ui_drop_throw "EAST-1:28,SOUTH+1:7"
|
||||
|
||||
@@ -33,6 +33,8 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
|
||||
var/atom/movable/screen/alien_plasma_display
|
||||
var/atom/movable/screen/alien_queen_finder
|
||||
|
||||
var/atom/movable/screen/combo/combo_display
|
||||
|
||||
var/atom/movable/screen/devil/soul_counter/devilsouldisplay
|
||||
|
||||
var/atom/movable/screen/synth/coolant_counter/coolant_display
|
||||
@@ -130,6 +132,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
|
||||
blobpwrdisplay = null
|
||||
alien_plasma_display = null
|
||||
alien_queen_finder = null
|
||||
combo_display = null
|
||||
|
||||
QDEL_LIST_ASSOC_VAL(plane_masters)
|
||||
QDEL_LIST(screenoverlays)
|
||||
|
||||
@@ -461,6 +461,9 @@
|
||||
zone_select.update_icon()
|
||||
static_inventory += zone_select
|
||||
|
||||
combo_display = new /atom/movable/screen/combo()
|
||||
infodisplay += combo_display
|
||||
|
||||
for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory))
|
||||
if(inv.slot_id)
|
||||
inv.hud = src
|
||||
|
||||
@@ -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