Skip to content

Commit

Permalink
Abnormality Portrait Refactor (#2411)
Browse files Browse the repository at this point in the history
* Image Optimization

* Update lobotomy-corp13.dme

* Even Cooler

* Bestest
  • Loading branch information
LanceSmites328 authored Sep 16, 2024
1 parent daa8725 commit fc1d461
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 185 deletions.
14 changes: 14 additions & 0 deletions code/__HELPERS/abnormalities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,17 @@
return "High"

return "Unknown ([rate])"

/*
Try to keep images 256px on at least one side to keep file sizes small - Coxswain
*/
GLOBAL_LIST_EMPTY(abnormality_portraits)
#define PORTRAIT_PATH "icons/UI_Icons/abnormality_portraits/"
/proc/create_portrait_paths()
. = list()
for(var/file in flist(PORTRAIT_PATH))
if(copytext("[file]", -1) == "/")
continue
. += file("[PORTRAIT_PATH][file]")
GLOB.abnormality_portraits = .
#undef PORTRAIT_PATH
4 changes: 4 additions & 0 deletions code/game/gamemodes/management/management.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
)
var/list/gamemode_abnos = list(ZAYIN_LEVEL = list(), TETH_LEVEL = list(), HE_LEVEL = list(), WAW_LEVEL = list(), ALEPH_LEVEL = list())

/datum/game_mode/management/pre_setup()
create_portrait_paths()
return ..()

/datum/game_mode/management/post_setup()
SSpersistence.LoadAbnoPicks() // Persistence system WILL have loaded at this point. Functionally means 0 abnos are slotted/loaded before the game itself is ready.
var/list/all_abnos = SSpersistence.abno_rates
Expand Down
182 changes: 0 additions & 182 deletions code/game/machinery/computer/abnormality_portraits.dm

This file was deleted.

3 changes: 1 addition & 2 deletions code/game/machinery/computer/abnormality_work.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@
dat += "<br>"

//Abnormality portraits
var/list/paths = get_portrait_path()
for(var/pahs in paths)
for(var/pahs in GLOB.abnormality_portraits)
user << browse_rsc(pahs)
dat += {"<div style="float:right; width: 60%;">
<img src='[datum_reference.GetPortrait()].png' class="fit-picture" width="192" height="192">
Expand Down
1 change: 0 additions & 1 deletion lobotomy-corp13.dme
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,6 @@
#include "code\game\machinery\computer\abnormality_auxiliary.dm"
#include "code\game\machinery\computer\abnormality_ego.dm"
#include "code\game\machinery\computer\abnormality_logs.dm"
#include "code\game\machinery\computer\abnormality_portraits.dm"
#include "code\game\machinery\computer\abnormality_queue.dm"
#include "code\game\machinery\computer\abnormality_work.dm"
#include "code\game\machinery\computer\aifixer.dm"
Expand Down

0 comments on commit fc1d461

Please sign in to comment.