Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update_Appearance Port #2170

Merged
merged 18 commits into from
Aug 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion check_regex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ standards:

- exactly:
[
290,
297,
"non-bitwise << uses",
'(?<!\d)(?<!\d\s)(?<!<)<<(?!=|\s\d|\d|<|\/)',
]
Expand Down
16 changes: 10 additions & 6 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,15 @@
#define COMSIG_ATOM_UPDATE_DESC "atom_update_desc"
///from base of atom/update_icon(): ()
#define COMSIG_ATOM_UPDATE_ICON "atom_update_icon"
#define COMSIG_ATOM_NO_UPDATE_ICON_STATE (1<<0)
#define COMSIG_ATOM_NO_UPDATE_OVERLAYS (1<<1)
///from base of atom/update_overlays(): (list/new_overlays)
/// If returned from [COMSIG_ATOM_UPDATE_ICON] it prevents the atom from updating its icon state.
#define COMSIG_ATOM_NO_UPDATE_ICON_STATE UPDATE_ICON_STATE
/// If returned from [COMSIG_ATOM_UPDATE_ICON] it prevents the atom from updating its overlays.
#define COMSIG_ATOM_NO_UPDATE_OVERLAYS UPDATE_OVERLAYS
///from base of [atom/update_icon_state]: ()
#define COMSIG_ATOM_UPDATE_ICON_STATE "atom_update_icon_state"
///from base of [/atom/update_overlays]: (list/new_overlays)
#define COMSIG_ATOM_UPDATE_OVERLAYS "atom_update_overlays"
///from base of atom/update_icon(): (signalOut, did_anything)
///from base of [/atom/update_icon]: (signalOut, did_anything)
#define COMSIG_ATOM_UPDATED_ICON "atom_updated_icon"
///from base of atom/Entered(): (atom/movable/entering, /atom)
#define COMSIG_ATOM_ENTERED "atom_entered"
Expand Down Expand Up @@ -188,9 +192,9 @@
#define COMSIG_ATOM_VIRTUAL_Z_CHANGE "atom_virtual_z_change"

//from base of atom/movable/on_enter_storage(): (datum/component/storage/concrete/master_storage)
#define COMISG_STORAGE_ENTERED "storage_entered"
#define COMSIG_STORAGE_ENTERED "storage_entered"
//from base of atom/movable/on_exit_storage(): (datum/component/storage/concrete/master_storage)
#define CONSIG_STORAGE_EXITED "storage_exited"
#define COMSIG_STORAGE_EXITED "storage_exited"

///from base of atom/expose_reagents():
#define COMSIG_ATOM_EXPOSE_REAGENTS "atom_expose_reagents"
Expand Down
10 changes: 4 additions & 6 deletions code/_onclick/hud/action_button.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
name = "Show Buttons"
else
name = "Hide Buttons"
update_icon()
update_appearance()
usr.update_action_buttons()

/atom/movable/screen/movable/action_button/hide_toggle/AltClick(mob/user)
Expand All @@ -151,14 +151,12 @@
hide_icon = settings["toggle_icon"]
hide_state = settings["toggle_hide"]
show_state = settings["toggle_show"]
update_icon()
update_appearance()

/atom/movable/screen/movable/action_button/hide_toggle/update_overlays()
. = ..()
if(hidden)
. += show_appearance
else
. += hide_appearance
. += hidden ? show_appearance : hide_appearance


/atom/movable/screen/movable/action_button/MouseEntered(location,control,params)
. = ..()
Expand Down
6 changes: 3 additions & 3 deletions code/_onclick/hud/alien.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@

pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_above_movement
pull_icon.hud = src
static_inventory += pull_icon
Expand All @@ -109,14 +109,14 @@

zone_select = new /atom/movable/screen/zone_sel/alien()
zone_select.hud = src
zone_select.update_icon()
zone_select.update_appearance()
static_inventory += zone_select

for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()
inv.update_appearance()

/datum/hud/alien/persistent_inventory_update()
if(!mymob)
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/hud/alien_larva.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = 'icons/hud/screen_alien.dmi'
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_above_movement
pull_icon.hud = src
hotkeybuttons += pull_icon
Expand All @@ -33,5 +33,5 @@

zone_select = new /atom/movable/screen/zone_sel/alien()
zone_select.hud = src
zone_select.update_icon()
zone_select.update_appearance()
static_inventory += zone_select
2 changes: 1 addition & 1 deletion code/_onclick/hud/constructs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
..()
pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_construct_pull
pull_icon.hud = src
static_inventory += pull_icon
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/hud/devil.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_drone_pull
pull_icon.hud = src
static_inventory += pull_icon
Expand Down Expand Up @@ -44,7 +44,7 @@
zone_select = new /atom/movable/screen/zone_sel()
zone_select.icon = ui_style
zone_select.hud = src
zone_select.update_icon()
zone_select.update_appearance()

lingchemdisplay = new /atom/movable/screen/ling/chems()
lingchemdisplay.hud = src
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/drones.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
if(inv.slot_id)
inv.hud = src
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()
inv.update_appearance()


/datum/hud/dextrous/drone/persistent_inventory_update()
Expand Down
7 changes: 4 additions & 3 deletions code/_onclick/hud/families.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
desc = "Shows the current level of hostility the space police is planning to rain down on you. Better be careful."
icon = 'icons/obj/gang/wanted_160x32.dmi'
icon_state = "wanted_0"
base_icon_state = "wanted"
screen_loc = ui_wanted_lvl
///Wanted level, affects the hud icon.
var/level
Expand All @@ -14,7 +15,7 @@
var/datum/game_mode/gang/F = SSticker.mode
level = F.wanted_level
cops_arrived = F.cops_arrived
update_icon()
update_appearance()

/atom/movable/screen/wanted/MouseEntered(location,control,params)
. = ..()
Expand All @@ -24,5 +25,5 @@
closeToolTip(usr)

/atom/movable/screen/wanted/update_icon_state()
. = ..()
icon_state = "wanted_[level][cops_arrived ? "_active" : ""]"
icon_state = "[base_icon_state]_[level][cops_arrived ? "_active" : null]"
return ..()
6 changes: 3 additions & 3 deletions code/_onclick/hud/generic_dextrous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_drone_pull
pull_icon.hud = src
static_inventory += pull_icon
Expand Down Expand Up @@ -47,7 +47,7 @@
zone_select = new /atom/movable/screen/zone_sel()
zone_select.icon = ui_style
zone_select.hud = src
zone_select.update_icon()
zone_select.update_appearance()
static_inventory += zone_select

using = new /atom/movable/screen/area_creator
Expand All @@ -61,7 +61,7 @@
if(inv.slot_id)
inv.hud = src
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()
inv.update_appearance()

/datum/hud/dextrous/persistent_inventory_update()
if(!mymob)
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/hud/guardian.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_living_pull
pull_icon.hud = src
static_inventory += pull_icon
Expand Down Expand Up @@ -70,7 +70,7 @@

pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = 'icons/mob/guardian.dmi'
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_living_pull
pull_icon.hud = src
static_inventory += pull_icon
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/hud/holograms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_above_intent
pull_icon.hud = src
static_inventory += pull_icon
Expand All @@ -40,7 +40,7 @@
if(inv.slot_id)
inv.hud = src
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()
inv.update_appearance()


/datum/hud/dextrous/hologram/persistent_inventory_update()
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
hand_slots["[i]"] = hand_box
hand_box.hud = src
static_inventory += hand_box
hand_box.update_icon()
hand_box.update_appearance()

var/i = 1
for(var/atom/movable/screen/swap_hand/SH in static_inventory)
Expand Down
6 changes: 3 additions & 3 deletions code/_onclick/hud/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@

pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_above_intent
pull_icon.hud = src
static_inventory += pull_icon
Expand All @@ -345,7 +345,7 @@
zone_select = new /atom/movable/screen/zone_sel()
zone_select.icon = ui_style
zone_select.hud = src
zone_select.update_icon()
zone_select.update_appearance()
static_inventory += zone_select

combo_display = new /atom/movable/screen/combo()
Expand All @@ -355,7 +355,7 @@
if(inv.slot_id)
inv.hud = src
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()
inv.update_appearance()

update_locked_slots()

Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_living_pull
pull_icon.hud = src
static_inventory += pull_icon
Expand Down
6 changes: 3 additions & 3 deletions code/_onclick/hud/monkey.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@

pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_above_movement
pull_icon.hud = src
static_inventory += pull_icon
Expand All @@ -116,7 +116,7 @@
zone_select = new /atom/movable/screen/zone_sel()
zone_select.icon = ui_style
zone_select.hud = src
zone_select.update_icon()
zone_select.update_appearance()
static_inventory += zone_select

mymob.client.screen = list()
Expand All @@ -131,7 +131,7 @@
if(inv.slot_id)
inv.hud = src
inv_slots[TOBITSHIFT(inv.slot_id) + 1] = inv
inv.update_icon()
inv.update_appearance()

/datum/hud/monkey/persistent_inventory_update()
if(!mymob)
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/hud/revenanthud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon()
pull_icon.update_appearance()
pull_icon.screen_loc = ui_living_pull
pull_icon.hud = src
static_inventory += pull_icon
Expand Down
15 changes: 7 additions & 8 deletions code/_onclick/hud/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@
pull_icon.icon = 'icons/hud/screen_cyborg.dmi'
pull_icon.screen_loc = ui_borg_pull
pull_icon.hud = src
pull_icon.update_icon()
pull_icon.update_appearance()
hotkeybuttons += pull_icon


zone_select = new /atom/movable/screen/zone_sel/robot()
zone_select.hud = src
zone_select.update_icon()
zone_select.update_appearance()
static_inventory += zone_select


Expand Down Expand Up @@ -269,20 +269,19 @@
/atom/movable/screen/robot/lamp
name = "headlamp"
icon_state = "lamp_off"
base_icon_state = "lamp"
var/mob/living/silicon/robot/robot

/atom/movable/screen/robot/lamp/Click()
. = ..()
if(.)
return
robot?.toggle_headlamp()
update_icon()
update_appearance()

/atom/movable/screen/robot/lamp/update_icon()
if(robot?.lamp_enabled)
icon_state = "lamp_on"
else
icon_state = "lamp_off"
/atom/movable/screen/robot/lamp/update_icon_state()
icon_state = "[base_icon_state]_[robot?.lamp_enabled ? "on" : "off"]"
return ..()

/atom/movable/screen/robot/modPC
name = "Modular Interface"
Expand Down
Loading