Replaces /image with /mutable_appearance (#556)
* Replaces /image with /mutable_appearance, where appropriate * Update miscellaneous.dm * Delete miscellaneous.dm.rej * Delete pet.dm.rej * Update pet.dm * Update species.dm * Update miscellaneous.dm * Update species.dm * Update miscellaneous.dm * Delete species.dm.rej * Update species.dm pretty sure I got all the indentation correct THIS time, ffs * Update species.dm * Update species.dm fucking tabs man, fucking tabs.
This commit is contained in:
committed by
Poojawa
parent
a8c4c86e1c
commit
a905c15dad
@@ -110,12 +110,8 @@
|
||||
|
||||
/datum/action/proc/ApplyIcon(obj/screen/movable/action_button/current_button)
|
||||
if(icon_icon && button_icon_state && current_button.button_icon_state != button_icon_state)
|
||||
var/image/img
|
||||
img = image(icon_icon, current_button, button_icon_state)
|
||||
img.pixel_x = 0
|
||||
img.pixel_y = 0
|
||||
current_button.cut_overlays(TRUE)
|
||||
current_button.add_overlay(img)
|
||||
current_button.add_overlay(mutable_appearance(icon_icon, button_icon_state))
|
||||
current_button.button_icon_state = button_icon_state
|
||||
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
var/mob/living/silicon/ai/A = S
|
||||
A.can_be_carded = FALSE
|
||||
A.requires_power = POWER_REQ_CLOCKCULT
|
||||
var/list/AI_frame = list(image('icons/mob/clockwork_mobs.dmi', A, "aiframe")) //make the AI's cool frame
|
||||
var/list/AI_frame = list(mutable_appearance('icons/mob/clockwork_mobs.dmi', "aiframe")) //make the AI's cool frame
|
||||
for(var/d in GLOB.cardinal)
|
||||
AI_frame += image('icons/mob/clockwork_mobs.dmi', A, "eye[rand(1, 10)]", dir = d) //the eyes are randomly fast or slow
|
||||
A.add_overlay(AI_frame)
|
||||
|
||||
@@ -31,9 +31,9 @@
|
||||
if(speak_emote)
|
||||
D.speak_emote = speak_emote
|
||||
|
||||
/datum/dog_fashion/proc/get_image(var/dir)
|
||||
/datum/dog_fashion/proc/get_overlay(var/dir)
|
||||
if(icon_file && obj_icon_state)
|
||||
var/image/corgI = image(icon_file, icon_state = obj_icon_state, dir = dir)
|
||||
var/image/corgI = image(icon_file, obj_icon_state, dir = dir)
|
||||
corgI.alpha = obj_alpha
|
||||
corgI.color = obj_color
|
||||
return corgI
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// Mutable appearances are an inbuilt byond datastructure. Read the documentation on them by hitting F1 in DM.
|
||||
// Basically use them instead of images for overlays/underlays and when changing an object's appearance if you're doing so with any regularity.
|
||||
// Unless you need the overlay/underlay to have a different direction than the base object. Then you have to use an image due to a bug.
|
||||
|
||||
// Mutable appearances are children of images, just so you know.
|
||||
|
||||
/mutable_appearance/New()
|
||||
..()
|
||||
plane = FLOAT_PLANE // No clue why this is 0 by default yet images are on FLOAT_PLANE
|
||||
// And yes this does have to be in the constructor, BYOND ignores it if you set it as a normal var
|
||||
|
||||
// Helper similar to image()
|
||||
/proc/mutable_appearance(icon, icon_state = "", layer = FLOAT_LAYER)
|
||||
var/mutable_appearance/MA = new()
|
||||
MA.icon = icon
|
||||
MA.icon_state = icon_state
|
||||
MA.layer = layer
|
||||
return MA
|
||||
@@ -15,7 +15,7 @@ GLOBAL_LIST_EMPTY(mutations_list)
|
||||
var/lowest_value = 256 * 8
|
||||
var/text_gain_indication = ""
|
||||
var/text_lose_indication = ""
|
||||
var/list/visual_indicators = list()
|
||||
var/list/mutable_appearance/visual_indicators = list()
|
||||
var/layer_used = MUTATIONS_LAYER //which mutation layer to use
|
||||
var/list/species_allowed = list() //to restrict mutation to only certain species
|
||||
var/health_req //minimum health required to acquire the mutation
|
||||
@@ -161,7 +161,7 @@ GLOBAL_LIST_EMPTY(mutations_list)
|
||||
|
||||
/datum/mutation/human/telekinesis/New()
|
||||
..()
|
||||
visual_indicators |= image("icon"='icons/effects/genetics.dmi', "icon_state"="telekinesishead", "layer"=-MUTATIONS_LAYER)
|
||||
visual_indicators |= mutable_appearance('icons/effects/genetics.dmi', "telekinesishead", -MUTATIONS_LAYER)
|
||||
|
||||
/datum/mutation/human/telekinesis/get_visual_indicator(mob/living/carbon/human/owner)
|
||||
return visual_indicators[1]
|
||||
@@ -180,7 +180,7 @@ GLOBAL_LIST_EMPTY(mutations_list)
|
||||
|
||||
/datum/mutation/human/cold_resistance/New()
|
||||
..()
|
||||
visual_indicators |= image("icon"='icons/effects/genetics.dmi', "icon_state"="fire", "layer"=-MUTATIONS_LAYER)
|
||||
visual_indicators |= mutable_appearance('icons/effects/genetics.dmi', "fire", -MUTATIONS_LAYER)
|
||||
|
||||
/datum/mutation/human/cold_resistance/get_visual_indicator(mob/living/carbon/human/owner)
|
||||
return visual_indicators[1]
|
||||
@@ -618,7 +618,7 @@ GLOBAL_LIST_EMPTY(mutations_list)
|
||||
|
||||
/datum/mutation/human/laser_eyes/New()
|
||||
..()
|
||||
visual_indicators |= image("icon"='icons/effects/genetics.dmi', "icon_state"="lasereyes", "layer"=-FRONT_MUTATIONS_LAYER)
|
||||
visual_indicators |= mutable_appearance('icons/effects/genetics.dmi', "lasereyes", -FRONT_MUTATIONS_LAYER)
|
||||
|
||||
/datum/mutation/human/laser_eyes/get_visual_indicator(mob/living/carbon/human/owner)
|
||||
return visual_indicators[1]
|
||||
@@ -640,11 +640,11 @@ GLOBAL_LIST_EMPTY(mutations_list)
|
||||
var/list/mut_overlay = list()
|
||||
if(overlays_standing[CM.layer_used])
|
||||
mut_overlay = overlays_standing[CM.layer_used]
|
||||
var/image/V = CM.get_visual_indicator(src)
|
||||
var/mutable_appearance/V = CM.get_visual_indicator(src)
|
||||
if(!mut_overlay.Find(V)) //either we lack the visual indicator or we have the wrong one
|
||||
remove_overlay(CM.layer_used)
|
||||
for(var/image/I in CM.visual_indicators)
|
||||
mut_overlay.Remove(I)
|
||||
for(var/mutable_appearance/MA in CM.visual_indicators)
|
||||
mut_overlay.Remove(MA)
|
||||
mut_overlay |= V
|
||||
overlays_standing[CM.layer_used] = mut_overlay
|
||||
apply_overlay(CM.layer_used)
|
||||
|
||||
Reference in New Issue
Block a user