[MIRROR] Makes it possible to edit the scaling of /obj subtypes in strongDMM and have it apply on initialization (#7975)

Co-authored-by: Runa Dacino <dacinoorder@gmail.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2
2024-03-16 14:10:21 +01:00
committed by GitHub
co-authored by Runa Dacino Kashargul
parent fa71e6d506
commit cffeba63d2
7 changed files with 17 additions and 8 deletions
+7
View File
@@ -0,0 +1,7 @@
/*
** Holds defines for code\game\atoms_movable.dm to avoid magic numbers and potential unexpected overwrites down the line
*/
#define DEFAULT_ICON_SCALE_X 1
#define DEFAULT_ICON_SCALE_Y 1
#define DEFAULT_ICON_ROTATION 0
+5 -3
View File
@@ -16,9 +16,9 @@
var/moved_recently = 0
var/mob/pulledby = null
var/item_state = null // Used to specify the item state for the on-mob overlays.
var/icon_scale_x = 1 // Used to scale icons up or down horizonally in update_transform().
var/icon_scale_y = 1 // Used to scale icons up or down vertically in update_transform().
var/icon_rotation = 0 // Used to rotate icons in update_transform()
var/icon_scale_x = DEFAULT_ICON_SCALE_X // Used to scale icons up or down horizonally in update_transform().
var/icon_scale_y = DEFAULT_ICON_SCALE_Y // Used to scale icons up or down vertically in update_transform().
var/icon_rotation = DEFAULT_ICON_ROTATION // Used to rotate icons in update_transform()
var/icon_expected_height = 32
var/icon_expected_width = 32
var/old_x = 0
@@ -47,6 +47,8 @@
add_overlay(list(em_block), TRUE)
if(opacity)
AddElement(/datum/element/light_blocking)
if(icon_scale_x != DEFAULT_ICON_SCALE_X || icon_scale_y != DEFAULT_ICON_SCALE_Y || icon_rotation != DEFAULT_ICON_ROTATION)
update_transform()
switch(light_system)
if(STATIC_LIGHT)
update_light()
@@ -1218,7 +1218,7 @@
if(species.default_language)
add_language(species.default_language)
if(species.icon_scale_x != 1 || species.icon_scale_y != 1)
if(species.icon_scale_x != DEFAULT_ICON_SCALE_X || species.icon_scale_y != DEFAULT_ICON_SCALE_Y)
update_transform()
if(example) //VOREStation Edit begin
@@ -35,8 +35,8 @@
var/tail_animation // If set, the icon to obtain tail animation states from.
var/tail_hair
var/icon_scale_x = 1 // Makes the icon wider/thinner.
var/icon_scale_y = 1 // Makes the icon taller/shorter.
var/icon_scale_x = DEFAULT_ICON_SCALE_X // Makes the icon wider/thinner.
var/icon_scale_y = DEFAULT_ICON_SCALE_Y // Makes the icon taller/shorter.
var/race_key = 0 // Used for mob icon cache string.
var/icon/icon_template // Used for mob icon generation for non-32x32 species.
+1 -1
View File
@@ -1368,5 +1368,5 @@
/mob/living/set_dir(var/new_dir)
. = ..()
if(size_multiplier != 1 || icon_scale_x != 1 && center_offset > 0)
if(size_multiplier != 1 || icon_scale_x != DEFAULT_ICON_SCALE_X && center_offset > 0)
update_transform(TRUE)
-1
View File
@@ -59,7 +59,6 @@
lastarea = get_area(src)
set_focus(src) // VOREStation Add - Key Handling
hook_vr("mob_new",list(src)) //VOREStation Code
update_transform() // Some mobs may start bigger or smaller than normal.
. = ..()
//return QDEL_HINT_HARDDEL_NOW Just keep track of mob references. They delete SO much faster now.
+1
View File
@@ -36,6 +36,7 @@
#include "code\__defines\appearance.dm"
#include "code\__defines\assert.dm"
#include "code\__defines\atmos.dm"
#include "code\__defines\atoms_movable.dm"
#include "code\__defines\belly_modes_ch.dm"
#include "code\__defines\belly_modes_vr.dm"
#include "code\__defines\callbacks.dm"