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

[TM] TGUIv4: Core backend updates, TGchat, Asset cache updates #905

Closed
wants to merge 102 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
900fb18
TGUI upgrade project: Port initial TGUI 4.0 changes from TG (#23440)
S34NW Dec 10, 2023
54a7c26
TGUIv4 - Moves TGUI Window Sizing from DM to JS (#23524)
Burzah Dec 12, 2023
39f284f
TGUIv4: Remove force_open (#23537)
AyIong Dec 12, 2023
d187cd9
TGUIv4 - TGUI Version 4.1 (#23547)
Burzah Dec 15, 2023
ae7fc2b
dev server hotfix (#23584)
S34NW Dec 16, 2023
08ce1f0
ui_interact object constructor argument check (#23594)
Burzah Dec 18, 2023
7ac172d
feat: add smart asset cache, add CDN support for assets, properly gro…
Gaxeer Dec 24, 2023
824598a
TGUI 4.2: TGchat + Refactor Asset Delivery + Yarn Berry (#23643)
AyIong Dec 27, 2023
a10fa70
revert test_TGUI map addition
S34NW Dec 29, 2023
df50dae
TGUI 4.3: Stack, Webpack 5 & UI Tweaks, Yarn 3.6.4, TS support, Jest …
AyIong Jan 4, 2024
95e794c
we moved these
S34NW Jan 4, 2024
fee8094
change test values
S34NW Jan 4, 2024
65ba116
ignore scss files
S34NW Jan 4, 2024
22ae852
change hash function
S34NW Jan 4, 2024
829b6da
TGUIv4: TGchat fix traitor codeword highlighting (#23720)
S34NW Jan 4, 2024
d2eadb9
TGUIv4 - updates standalone build tooling (#23721)
S34NW Jan 4, 2024
c26b818
swap `xxhash64` for `md4`
S34NW Jan 4, 2024
a37de61
remove hash function
S34NW Jan 4, 2024
c2233a2
remove old file
S34NW Jan 4, 2024
ef1a1bc
TGUI 4.3+4.4: Newscaster fix, `inline-block` replacements and other f…
AyIong Jan 5, 2024
4004718
TGUIv4 - Removes resizable and improves drag code (#23719)
Burzah Jan 5, 2024
fab02e2
fix hotkeys not being passed to BYOND
S34NW Jan 5, 2024
317a301
Apply suggestions from code review
S34NW Jan 5, 2024
1043149
bump deps
S34NW Jan 6, 2024
ac32460
forgot these deps
S34NW Jan 6, 2024
312c8d4
ci fix
S34NW Jan 6, 2024
3137fe9
ChemDispenser fixes and HoloControl cooldown
AyIong Jan 7, 2024
2426184
Station Traits TGUI
AyIong Jan 8, 2024
483419f
CI
S34NW Jan 8, 2024
12ab1ca
fix CI for real this time
S34NW Jan 8, 2024
2a45215
I have no idea
AyIong Jan 8, 2024
adac632
fix station trait panel
S34NW Jan 8, 2024
ac0eb86
Update code/controllers/subsystem/SSping.dm
S34NW Jan 10, 2024
9ec3ae0
Update code/controllers/subsystem/SSticker.dm
S34NW Jan 10, 2024
dd447a5
Update code/controllers/subsystem/SSping.dm
S34NW Jan 10, 2024
d337d0d
deterministic module IDs
S34NW Jan 10, 2024
37fcfc7
TGUI fixes. Again... (#23762)
AyIong Jan 11, 2024
f4ef864
fix material name in protolathe
S34NW Jan 11, 2024
60f1a07
fix various UI interacts
S34NW Jan 11, 2024
b295d98
card machine runtime fix
S34NW Jan 11, 2024
06f86c8
remove legacy folders
S34NW Jan 11, 2024
1e024fe
TGUIv4 - TGchat Theme Adjustments (#23772)
Burzah Jan 11, 2024
8eaa1a6
revert a state changed in error
S34NW Jan 11, 2024
a94e796
fix uninteractable UIs due to chunky fingers
S34NW Jan 11, 2024
54387b1
TGUIv4: More fixes, tweaks and fixes for tweaks (#23781)
AyIong Jan 12, 2024
7b3e1d1
TGUIv4 - Abductor Experiment Machine TGUI (#23776)
Burzah Jan 12, 2024
39138f2
fix
S34NW Jan 12, 2024
c411368
TGUIv4 - Adjustments, Fixes, and Tweaks (#23785)
Burzah Jan 12, 2024
c2f5583
fix possible wonky json payloads
S34NW Jan 13, 2024
068b228
fix admin log input list stuff
S34NW Jan 13, 2024
9c27e3b
TGUIv4: Reconnect fix and some other fixes + tweaks (#23790)
AyIong Jan 13, 2024
800e306
make input bar mode more prominent
S34NW Jan 13, 2024
322ff3c
fix chem master icons
S34NW Jan 13, 2024
767560c
tab fix
S34NW Jan 13, 2024
57ea7b4
TGUIv4 Adaptations
AyIong Jan 5, 2024
1cedb41
TGUIv4 - Adjustments, Fixes, and Tweaks v2 (#23795)
Burzah Jan 14, 2024
682c77b
Rebuild
AyIong Jan 14, 2024
e2c3c1e
Revert "Revert "Properly sanitizes loaded messages in tgui chat""
S34NW Jan 14, 2024
3399374
Changes how tgui handles static data
S34NW Jan 14, 2024
3576060
Rebuild
AyIong Jan 14, 2024
229b7f7
Merge branch 'master' into TGUIv4-TestMerge
AyIong Jan 15, 2024
0805946
pda scanner message improvements
S34NW Jan 14, 2024
53444a7
fix mentor/admin PMs being sent to the "unsorted" category
S34NW Jan 14, 2024
9e7505a
fix garbled custom vote messages
S34NW Jan 14, 2024
ac56806
moves cyborg analyser to use chatboxes
S34NW Jan 14, 2024
73a77df
TGUIv4: Themes polish and some new ones
AyIong Jan 15, 2024
9811c7e
Rebuild
AyIong Jan 15, 2024
cefb4b5
Merge branch 'translate' into TGUIv4-TestMerge
AyIong Jan 15, 2024
69f1fbc
CI
AyIong Jan 15, 2024
81119c8
Test
AyIong Jan 15, 2024
9c44962
NoCapitalize
AyIong Jan 15, 2024
443aff5
Rebuild
AyIong Jan 15, 2024
e10187f
Delete Paradise.scss
AyIong Jan 15, 2024
abbc4ef
Create paradise.scss
AyIong Jan 15, 2024
5b625c8
Блять
AyIong Jan 15, 2024
ae52190
Fix Cyrillic Highlights
AyIong Jan 15, 2024
75e8ad7
Revert "Fix Cyrillic Highlights"
AyIong Jan 15, 2024
05be39b
Rewritten Security Records Console
AyIong Jan 16, 2024
cafdbb2
Rebuild
AyIong Jan 16, 2024
600a744
Vending and Wires sizes tweaks
AyIong Jan 17, 2024
20b7d47
ThermoMachine
AyIong Jan 17, 2024
b34d70b
Rebuild
AyIong Jan 17, 2024
0839734
Merge branch 'translate' into TGUIv4-TestMerge
AyIong Jan 17, 2024
ed44fc9
Syndicate Theme
AyIong Jan 18, 2024
1e2360a
Little darker
AyIong Jan 18, 2024
3917b32
Rebuild
AyIong Jan 18, 2024
7efdee6
Rewritten Medical Records Console
AyIong Jan 18, 2024
4017f6c
PDA Nanobank fix
AyIong Jan 18, 2024
0235560
Rebuild
AyIong Jan 18, 2024
b8230a7
Prevent F5 reload
S34NW Jan 19, 2024
84fd079
Syndicate Theme Darker
AyIong Jan 19, 2024
1f431da
Re-Fuckin-Build
AyIong Jan 19, 2024
b3b6d2b
Wires section grow fix
AyIong Jan 20, 2024
d076a5f
Rebuild
AyIong Jan 20, 2024
cbe6148
fixes the enshittified paradise icon
S34NW Jan 21, 2024
de34567
Sirryan+Warrior reviews
S34NW Jan 21, 2024
a263ead
bloody define comments
S34NW Jan 21, 2024
c35c018
comment correction
S34NW Jan 21, 2024
e5c80c0
unprivate these
S34NW Jan 21, 2024
735e00f
errant . begone (how did this not cause a compiler error)
S34NW Jan 21, 2024
a1c8f3c
TGUIv4 - Adjustments, Fixes, and Tweaks v3 (#23807)
Burzah Jan 21, 2024
90718c6
TGUI Rebuild
AyIong Jan 21, 2024
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
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches:
- master
- translate

jobs:
run_linters:
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"eamodio.gitlens",
"usernamehw.errorlens",
"anturk.dmi-editor",
"esbenp.prettier-vscode"
"esbenp.prettier-vscode",
"arcanis.vscode-zipfs"
]
}
10 changes: 9 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@
],
// ESLint settings:
"eslint.workingDirectories": [
"tgui/"
"./tgui"
],
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"eslint.nodePath": "tgui/.yarn/sdks",
"prettier.prettierPath": "tgui/.yarn/sdks/prettier/index.cjs",
"typescript.tsdk": "tgui/.yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"eslint.rules.customizations": [
// We really want to fail the CI builds on styling errors,
// but it's better to show them as yellow squigglies in IDE
Expand Down
15 changes: 1 addition & 14 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "shell",
"command": "tgui/bin/tgui-build",
"windows": {
"command": ".\\tgui\\bin\\tgui-build.bat"
"command": ".\\tgui\\bin\\tgui.bat"
},
"problemMatcher": [
"$tsc",
Expand All @@ -37,18 +37,5 @@
"label": "tgui: run dev server"
}
,
{
"type": "shell",
"command": "tgui/bin/tgui-formatting",
"windows": {
"command": ".\\tgui\\bin\\tgui-formatting.bat"
},
"problemMatcher": [
"$tsc",
"$eslint-stylish"
],
"group": "build",
"label": "tgui: run prettier formatting"
}
]
}
2 changes: 1 addition & 1 deletion _build_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# For dreamchecker
export SPACEMANDMM_TAG=suite-1.7.1
# For TGUI
export NODE_VERSION=18
export NODE_VERSION=20
# Stable Byond Major
export STABLE_BYOND_MAJOR=515
# Stable Byond Minor
Expand Down
8 changes: 8 additions & 0 deletions code/__DEFINES/asset_defines.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/// Get html to load a url.
/// for use inside of browse() calls to html assets that might be loaded on a cdn.
#define URL2HTMLLOADER(url) {"<html><head><meta http-equiv="refresh" content="0;URL='[url]'"/></head><body onLoad="parent.location='[url]'"></body></html>"}

/// Generate a filename for this asset
/// The same asset will always lead to the same asset name
/// Generated names do not include file extension.
#define GENERATE_ASSET_NAME(file) "asset.[md5(fcopy_rsc(file))]"
25 changes: 25 additions & 0 deletions code/__DEFINES/chat.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (c) 2020 Aleksej Komarov
* SPDX-License-Identifier: MIT
*/

/// How many chat payloads to keep in history
#define CHAT_RELIABILITY_HISTORY_SIZE 5
/// How many resends to allow before giving up
#define CHAT_RELIABILITY_MAX_RESENDS 3

#define MESSAGE_TYPE_SYSTEM "system"
#define MESSAGE_TYPE_LOCALCHAT "localchat"
#define MESSAGE_TYPE_RADIO "radio"
#define MESSAGE_TYPE_INFO "info"
#define MESSAGE_TYPE_WARNING "warning"
#define MESSAGE_TYPE_DEADCHAT "deadchat"
#define MESSAGE_TYPE_OOC "ooc"
#define MESSAGE_TYPE_ADMINPM "adminpm"
#define MESSAGE_TYPE_COMBAT "combat"
#define MESSAGE_TYPE_ADMINCHAT "adminchat"
#define MESSAGE_TYPE_MENTORCHAT "mentorchat"
#define MESSAGE_TYPE_EVENTCHAT "eventchat"
#define MESSAGE_TYPE_ADMINLOG "adminlog"
#define MESSAGE_TYPE_ATTACKLOG "attacklog"
#define MESSAGE_TYPE_DEBUG "debug"
1 change: 1 addition & 0 deletions code/__DEFINES/chat_box_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define chat_box_examine(str) ("<div class='boxed_message left_align_text'>" + str + "</div>")
#define chat_box_red(str) ("<div class='boxed_message red_border'>" + str + "</div>")
#define chat_box_green(str) ("<div class='boxed_message green_border'>" + str + "</div>")
#define chat_box_purple(str) ("<div class='boxed_message purple_border'>" + str + "</div>")
#define chat_box_notice(str) ("<div class='boxed_message notice_border'>" + str + "</div>")
#define chat_box_healthscan(str) ("<div class='boxed_message notice_border left_align_text'>" + str + "</div>")
#define chat_box_notice_thick(str) ("<div class='boxed_message notice_border thick_border'>" + str + "</div>")
26 changes: 13 additions & 13 deletions code/__DEFINES/construction_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@
#define FULLTILE_WINDOW_DIR NORTHEAST

//Material defines, for determining how much of a given material an item contains
#define MAT_METAL "$metal"
#define MAT_GLASS "$glass"
#define MAT_SILVER "$silver"
#define MAT_GOLD "$gold"
#define MAT_DIAMOND "$diamond"
#define MAT_URANIUM "$uranium"
#define MAT_PLASMA "$plasma"
#define MAT_BLUESPACE "$bluespace"
#define MAT_BANANIUM "$bananium"
#define MAT_TRANQUILLITE "$tranquillite"
#define MAT_TITANIUM "$titanium"
#define MAT_BIOMASS "$biomass"
#define MAT_PLASTIC "$plastic"
#define MAT_METAL "metal"
#define MAT_GLASS "glass"
#define MAT_SILVER "silver"
#define MAT_GOLD "gold"
#define MAT_DIAMOND "diamond"
#define MAT_URANIUM "uranium"
#define MAT_PLASMA "plasma"
#define MAT_BLUESPACE "bluespace"
#define MAT_BANANIUM "bananium"
#define MAT_TRANQUILLITE "tranquillite"
#define MAT_TITANIUM "titanium"
#define MAT_BIOMASS "biomass"
#define MAT_PLASTIC "plastic"
//The amount of materials you get from a sheet of mineral like iron/diamond/glass etc
#define MINERAL_MATERIAL_AMOUNT 2000
//The maximum size of a stack object.
Expand Down
17 changes: 17 additions & 0 deletions code/__DEFINES/misc_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,23 @@
#define TRIGGER_GUARD_NONE 0
#define TRIGGER_GUARD_NORMAL 1

// These comments mirror the below define in the order of operations to help you understand what it is doing
// Check if datum I is a mob
// If I is a mob, return the client of mob I
// Else, check to see if I is a client
// If I is a client, return I
// Else, check to see if I is a mind
// If I is a mind, try and return the mind's current mob's client

/// Return a Client
#define CLIENT_FROM_VAR(I) (ismob(I) \
? I:client \
: istype(I, /client) \
? I \
: istype(I, /datum/mind \
? I:current?:client \
: null))

// Macro to get the current elapsed round time, rather than total world runtime
#define ROUND_TIME (SSticker.time_game_started ? (world.time - SSticker.time_game_started) : 0)

Expand Down
6 changes: 0 additions & 6 deletions code/__DEFINES/stat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
#define UNCONSCIOUS 1
#define DEAD 2

// TGUI flags
#define STATUS_INTERACTIVE 2 // GREEN Visability
#define STATUS_UPDATE 1 // ORANGE Visability
#define STATUS_DISABLED 0 // RED Visability
#define STATUS_CLOSE -1 // Close the interface

/*
Shuttles
*/
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@
#define INIT_ORDER_LATE_MAPPING -40
#define INIT_ORDER_PATH -50
#define INIT_ORDER_PERSISTENCE -95
#define INIT_ORDER_CHAT -100 // Should be last to ensure chat remains smooth during init.

// Subsystem fire priority, from lowest to highest priority
// If the subsystem isn't listed here it's either DEFAULT or PROCESS (if it's a processing subsystem child)

#define FIRE_PRIORITY_PING 10
#define FIRE_PRIORITY_NANOMOB 10
#define FIRE_PRIORITY_NIGHTSHIFT 10
#define FIRE_PRIORITY_IDLE_NPC 10
Expand All @@ -112,6 +114,7 @@
#define FIRE_PRIORITY_MOBS 100
#define FIRE_PRIORITY_TGUI 110
#define FIRE_PRIORITY_TICKER 200
#define FIRE_PRIORITY_CHAT 400
#define FIRE_PRIORITY_RUNECHAT 410 // I hate how high the fire priority on this is -aa
#define FIRE_PRIORITY_OVERLAYS 500
#define FIRE_PRIORITY_DELAYED_VERBS 950
Expand Down
40 changes: 39 additions & 1 deletion code/__DEFINES/tgui_defines.dm
Original file line number Diff line number Diff line change
@@ -1,8 +1,46 @@
// TGUI defines
// TGUI Modal defines
#define UI_MODAL_INPUT_MAX_LENGTH 1024
#define UI_MODAL_INPUT_MAX_LENGTH_NAME 64 // Names for generally anything don't go past 32, let alone 64.

#define UI_MODAL_OPEN 1
#define UI_MODAL_DELEGATE 2
#define UI_MODAL_ANSWER 3
#define UI_MODAL_CLOSE 4

/// Green eye; fully interactive
#define UI_INTERACTIVE 2
/// Orange eye; updates but is not interactive
#define UI_UPDATE 1
/// Red eye; disabled, does not update
#define UI_DISABLED 0
/// UI Should close
#define UI_CLOSE -1

/// Maximum number of windows that can be suspended/reused
#define TGUI_WINDOW_SOFT_LIMIT 5
/// Maximum number of open windows
#define TGUI_WINDOW_HARD_LIMIT 9

/// Maximum ping timeout allowed to detect zombie windows
#define TGUI_PING_TIMEOUT (4 SECONDS)
/// Used for rate-limiting to prevent DoS by excessively refreshing a TGUI window
#define TGUI_REFRESH_FULL_UPDATE_COOLDOWN (1 SECONDS)

/// Window does not exist
#define TGUI_WINDOW_CLOSED 0
/// Window was just opened, but is still not ready to be sent data
#define TGUI_WINDOW_LOADING 1
/// Window is free and ready to receive data
#define TGUI_WINDOW_READY 2

/// Get a window id based on the provided pool index
#define TGUI_WINDOW_ID(index) "tgui-window-[index]"
/// Get a pool index of the provided window id
#define TGUI_WINDOW_INDEX(window_id) text2num(copytext(window_id, 13))

/// Creates a message packet for sending via output()
#define TGUI_CREATE_MESSAGE(type, payload) ( \
url_encode(json_encode(list( \
"type" = type, \
"payload" = payload, \
))))
20 changes: 17 additions & 3 deletions code/__HELPERS/_logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ GLOBAL_PROTECT(log_end)

for(var/client/C in GLOB.admins)
if(check_rights(R_DEBUG | R_VIEWRUNTIMES, FALSE, C.mob) && (C.prefs.toggles & PREFTOGGLE_CHAT_DEBUGLOGS))
to_chat(C, "<span class='debug'>DEBUG: [text]</span>")
to_chat(C,
type = MESSAGE_TYPE_DEBUG,
html = "<span class='debug'>DEBUG: [text]</span>",
confidential = TRUE)

/proc/log_game(text)
if(GLOB.configuration.logging.game_logging)
Expand Down Expand Up @@ -149,8 +152,19 @@ GLOBAL_PROTECT(log_end)
/proc/log_runtime_summary(text)
rustg_log_write(GLOB.runtime_summary_log, "[text][GLOB.log_end]")

/proc/log_tgui(text)
rustg_log_write(GLOB.tgui_log, "[text][GLOB.log_end]")
/proc/log_tgui(user_or_client, text)
var/list/messages = list()
if(!user_or_client)
messages.Add("no user")
else if(ismob(user_or_client))
var/mob/user = user_or_client
messages.Add("[user.ckey] (as [user])")
else if(isclient(user_or_client))
var/client/client = user_or_client
messages.Add("[client.ckey]")
messages.Add(": [text]")
messages.Add("[GLOB.log_end]")
rustg_log_write(GLOB.tgui_log, messages.Join())

#ifdef REFERENCE_TRACKING
/proc/log_gc(text)
Expand Down
5 changes: 0 additions & 5 deletions code/__HELPERS/files.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@

return text

//Sends resource files to client cache
/client/proc/getFiles()
for(var/file in args)
src << browse_rsc(file)

/client/proc/browse_files(root="data/logs/", max_iterations=10, list/valid_extensions=list("txt", "log", "htm", "json"))
// wow why was this ever a parameter
root = "data/logs/"
Expand Down
41 changes: 41 additions & 0 deletions code/__HELPERS/iconprocs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,44 @@ world
M.Blend("#ffffff", ICON_SUBTRACT)
// apply mask
Blend(M, ICON_ADD)

// Converts an icon to base64. Operates by putting the icon in the iconCache savefile,
// exporting it as text, and then parsing the base64 from that.
// (This relies on byond automatically storing icons in savefiles as base64)
GLOBAL_DATUM_INIT(iconCache, /savefile, new /savefile("data/iconCache.sav"))

GLOBAL_LIST_EMPTY(bicon_cache)

/proc/icon2base64(icon/icon, iconKey = "misc")
if(!isicon(icon)) return 0

GLOB.iconCache[iconKey] << icon
var/iconData = GLOB.iconCache.ExportText(iconKey)
var/list/partial = splittext(iconData, "{")
return replacetext(copytext(partial[2], 3, -5), "\n", "")

/proc/bicon(obj, use_class = 1)
var/class = use_class ? "class='icon misc'" : null
if(!obj)
return

if(isicon(obj))
if(!GLOB.bicon_cache["\ref[obj]"]) // Doesn't exist yet, make it.
GLOB.bicon_cache["\ref[obj]"] = icon2base64(obj)

return "<img [class] src='data:image/png;base64,[GLOB.bicon_cache["\ref[obj]"]]'>"

// Either an atom or somebody fucked up and is gonna get a runtime, which I'm fine with.
var/atom/A = obj
var/key = "[istype(A.icon, /icon) ? "\ref[A.icon]" : A.icon]:[A.icon_state]"
if(!GLOB.bicon_cache[key]) // Doesn't exist, make it.
var/icon/I = icon(A.icon, A.icon_state, SOUTH, 1)
if(ishuman(obj)) // Shitty workaround for a BYOND issue.
var/icon/temp = I
I = icon()
I.Insert(temp, dir = SOUTH)
GLOB.bicon_cache[key] = icon2base64(I, key)
if(use_class)
class = "class='icon [A.icon_state]'"

return "<img [class] src='data:image/png;base64,[GLOB.bicon_cache[key]]'>"
7 changes: 0 additions & 7 deletions code/__HELPERS/lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,6 @@
var/middle = L.len / 2 + 1 // Copy is first,second-1
return mergeLists(sortList(L.Copy(0,middle)), sortList(L.Copy(middle))) //second parameter null = to end of list

//Mergsorge: uses sortAssoc() but uses the var's name specifically. This should probably be using mergeAtom() instead
/proc/sortNames(list/L)
var/list/Q = new()
for(var/atom/x in L)
Q[x.name] = x
return sortAssoc(Q)

/proc/mergeLists(list/L, list/R)
var/Li=1
var/Ri=1
Expand Down
Loading
Loading