Refactors and Tguizes Orion Trail arcade machine (#57647)

Tguized orion trail. Orion code maybe less shit?

Orion Events use datums whew.

Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
This commit is contained in:
tralezab
2021-03-17 09:10:00 +02:00
committed by GitHub
co-authored by Aleksej Komarov
parent a849c9c427
commit 76ea56ff59
10 changed files with 2446 additions and 1590 deletions
+11
View File
@@ -169,6 +169,8 @@ GLOBAL_LIST_EMPTY(asset_datums)
I = icon(I, icon_state=icon_state, dir=dir, frame=frame, moving=moving)
if (!I || !length(icon_states(I))) // that direction or state doesn't exist
return
//any sprite modifications we want to do (aka, coloring a greyscaled asset)
I = ModifyInserted(I)
var/size_id = "[I.Width()]x[I.Height()]"
var/size = sizes[size_id]
@@ -185,6 +187,15 @@ GLOBAL_LIST_EMPTY(asset_datums)
sizes[size_id] = size = list(1, I, null)
sprites[sprite_name] = list(size_id, 0)
/**
* A simple proc handing the Icon for you to modify before it gets turned into an asset.
*
* Arguments:
* * I: icon being turned into an asset
*/
/datum/asset/spritesheet/proc/ModifyInserted(icon/pre_asset)
return pre_asset
/datum/asset/spritesheet/proc/InsertAll(prefix, icon/I, list/directions)
if (length(prefix))
prefix = "[prefix]-"
@@ -529,3 +529,32 @@
assets = list(
"chem_help_advisor.gif" = 'icons/UI_Icons/Advisors/chem_help_advisor.gif',
)
/datum/asset/spritesheet/moods
name = "moods"
var/iconinserted = 1
/datum/asset/spritesheet/moods/register()
for(var/i in 1 to 9)
var/target_to_insert = "mood"+"[iconinserted]"
Insert(target_to_insert, 'icons/hud/screen_gen.dmi', target_to_insert)
iconinserted++
..()
/datum/asset/spritesheet/moods/ModifyInserted(icon/pre_asset)
var/blended_color
switch(iconinserted)
if(1)
blended_color = "#f15d36"
if(2 to 3)
blended_color = "#f38943"
if(4)
blended_color = "#dfa65b"
if(5)
blended_color = "#4b96c4"
if(6)
blended_color = "#86d656"
else
blended_color = "#2eeb9a"
pre_asset.Blend(blended_color, ICON_MULTIPLY)
return pre_asset