Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
d06e227
Part 1: fix tgui
ShiftyRail Apr 20, 2025
dcf3f74
Fix overdark layering
ShiftyRail Apr 20, 2025
dbbe7ac
Vector code rework
ShiftyRail Apr 20, 2025
909c739
misc. tgui things
ShiftyRail Apr 20, 2025
5b07bcd
final DM side fixes
ShiftyRail Apr 20, 2025
7f2166e
TGUI try to fix #1
ShiftyRail Apr 20, 2025
5738c90
Nuclear option. Bring all TGUI files. Will begin UNTGification in lat…
ShiftyRail Apr 21, 2025
876b33c
Untgify: callback
ShiftyRail Apr 21, 2025
6de8e35
untgify : config flags & config datums
ShiftyRail Apr 21, 2025
ba693e7
Fixes GLOBAL_VAR_INIT
ShiftyRail Apr 21, 2025
b19c4f3
Purge HASTRAIT
ShiftyRail Apr 21, 2025
08ad4bd
.dme cleanup
ShiftyRail Apr 21, 2025
f2c6b39
file by file: status_alert.dm
ShiftyRail Apr 21, 2025
2c78dc5
file by file : preference datums + remove unused content
ShiftyRail Apr 21, 2025
fadc21e
file by file : tgui_input/text.dm
ShiftyRail Apr 21, 2025
8bbca54
file by file : fixes asset_cache_client.dm
ShiftyRail Apr 21, 2025
8ee5a00
file by file : tgui_panel / external.dm
ShiftyRail Apr 21, 2025
9ecd309
file by file : tgui / external.dm
ShiftyRail Apr 21, 2025
0947c37
file by file : tgui / states.dm
ShiftyRail Apr 21, 2025
c476030
file by file : subsystems/assets.dm [unused return type]
ShiftyRail Apr 21, 2025
e2e941d
file by file : subsystems/tgui.dm [tg-macro for process()]
ShiftyRail Apr 21, 2025
92910e5
file by file : asset_cache_item.dm [minor proc call fix]
ShiftyRail Apr 21, 2025
1c4f268
file by file : fixes a mistype for datum/asset_cache_item
ShiftyRail Apr 21, 2025
965b408
file by file : removes bugs and unimplemented features in asset_list.dm
ShiftyRail Apr 21, 2025
0d19474
multifile : some more work on asset manager
ShiftyRail Apr 21, 2025
94c2aea
File deleted : spirtesheet tg_assets. Don't need them
ShiftyRail Apr 21, 2025
12c8829
Remove unused TG content, fix asset_list.dm
ShiftyRail Apr 21, 2025
ebb8f44
Fixes a few issues with wrong type paths.
ShiftyRail Apr 21, 2025
9ad59bb
remove tgui_panel : this is for tgchat/stat2, which we don't use
ShiftyRail Apr 21, 2025
a2e028c
fix thing
ShiftyRail Apr 21, 2025
2e0f9c5
misc changes to tgui.dm. Defining QDELETED macro
ShiftyRail Apr 21, 2025
f7d7de1
final TGui fix
ShiftyRail Apr 21, 2025
fa48740
TGUI file convert : camera console and religion screen
ShiftyRail Apr 22, 2025
e93844e
Works
ShiftyRail Apr 22, 2025
6e6af71
GPS fixed + fontAwesome fixed
ShiftyRail Apr 24, 2025
7624083
Mecha console control
ShiftyRail Apr 24, 2025
af5c770
Fixes blurry icons
ShiftyRail Apr 25, 2025
7624c65
fixes iconbase64 regression
ShiftyRail Apr 25, 2025
ff4dea9
Misc bug/runtimes fixes
ShiftyRail Apr 25, 2025
71bfb0a
Fixes runtime funtime
ShiftyRail Apr 25, 2025
ed493c6
Add merch computer TGUI
ShiftyRail Apr 25, 2025
6470217
Fixes TGUI ticking interfaces + MSGS
ShiftyRail Apr 25, 2025
b2438c6
PCMC
ShiftyRail Apr 26, 2025
f6085f7
Power Monitor working
ShiftyRail Apr 27, 2025
961d6b8
Power monitor
ShiftyRail Apr 27, 2025
151bfcf
Bugfixes + robot console
ShiftyRail Apr 27, 2025
df22bcd
Fixes mecha messages
ShiftyRail Apr 27, 2025
1ac290e
Spess dot TV
ShiftyRail Apr 27, 2025
1d247c8
TEG
ShiftyRail Apr 27, 2025
b8e0beb
Syndicate Uplink
ShiftyRail Apr 27, 2025
62cf911
Bump defines and connection warning
ShiftyRail Apr 27, 2025
7771134
fix?
ShiftyRail Apr 27, 2025
7a485fb
Fucking highscores
ShiftyRail Apr 27, 2025
eb0ac94
Fixes mistakes
ShiftyRail May 1, 2025
4c90072
Merge branch 'Bleeding-Edge' into 516_but_it_will_work_this_time
west3436 May 6, 2025
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
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ on:
workflow_dispatch:

env:
BYOND_MAJOR: 515
BYOND_MINOR: 1603
BYOND_MAJOR: 516
BYOND_MINOR: 1659

#This can be declared here because build.py will ignore it if DM_UNIT_TESTS is true.
ALL_MAPS: tgstation metaclub defficiency packedstation roidstation test_tiny test_vault snaxi tgstation-sec tgstation-snow LampreyStation xoq synergy bagelstation lowfatbagel Dorfstation waystation line horizon wheelstation
Expand Down
9 changes: 9 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@
],
"group": "build",
"label": "tgui: sonar"
},
{
"type": "npm",
"script": "install",
"path": "tgui",
"group": "clean",
"problemMatcher": [],
"label": "npm: install - tgui",
"detail": "install dependencies from package"
}
]
}
1 change: 1 addition & 0 deletions __DEFINES/_macros.dm
Original file line number Diff line number Diff line change
Expand Up @@ -439,3 +439,4 @@ var/global/list/visible_spaces = list(/turf/simulated/open, /turf/simulated/floo
#define OMNI_LINK(A,B) isliving(A) && A:omnitool_connect(B)

#define is_real_champion(A) ismob(A) && A.is_wearing_item(/obj/item/weapon/storage/belt/champion) && A.is_wearing_item(/obj/item/clothing/mask/luchador)

6 changes: 6 additions & 0 deletions __DEFINES/cooldowns.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//Returns true if the cooldown has run its course, false otherwise
#define COOLDOWN_FINISHED(cd_source, cd_index) (cd_source.cd_index <= world.time)

#define COOLDOWN_TIMELEFT(cd_source, cd_index) (max(0, cd_source.cd_index - world.time))

#define COOLDOWN_START(cd_source, cd_index, cd_time) (cd_source.cd_index = world.time + (cd_time))
2 changes: 1 addition & 1 deletion __DEFINES/planes+layers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ var/obj/abstract/screen/plane_master/overdark_planemaster/overdark_planemaster =
appearance_flags = 0
plane = BASE_PLANE
mouse_opacity = 0
screen_loc = "CENTER,CENTER"
screen_loc = "SOUTHWEST,SOUTHWEST"
render_source = "*overdark"

var/obj/abstract/screen/plane_master/overdark_planemaster_target/overdark_planemaster_target = new()
Expand Down
3 changes: 3 additions & 0 deletions __DEFINES/qdel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
#define QDEL_LIST_ASSOC_NULL(L) QDEL_LIST_ASSOC(L); L = null
#define QDEL_LIST_CUT(L) QDEL_LIST(L); L.Cut()
#define QDEL_LIST_ASSOC_CUT(L) QDEL_LIST_ASSOC(L); L.Cut()

// QDEL macros borrowed from TG
#define QDELETED(X) (!X || X.gcDestroyed)
2 changes: 1 addition & 1 deletion __DEFINES/setup.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
#if DM_VERSION < 513
#if DM_VERSION < 516
#error Your version of byond is too old, you need version 513 or higher

Check failure on line 3 in __DEFINES/setup.dm

View workflow job for this annotation

GitHub Actions / Run linters

#error Your version of byond is too old, you need version 513 or higher
#endif
#define RUNWARNING // disable if they re-enable run() in 507 or newer.
// They did, tested in 508.1296 - N3X
Expand Down
14 changes: 14 additions & 0 deletions __DEFINES/tgui.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,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
Expand All @@ -38,3 +41,14 @@
#define TGUI_CREATE_MESSAGE(type, payload) ( \
"%7b%22type%22%3a%22[type]%22%2c%22payload%22%3a[url_encode(json_encode(payload))]%7d" \
)

// -- TG Style nameof() --
#define PROC_REF(X) (nameof(.proc/##X))
/**
* NAMEOF: Compile time checked variable name to string conversion
* evaluates to a string equal to "X", but compile errors if X isn't a var on datum.
**/
#define NAMEOF(datum, X) (#X || ##datum.##X)

/// Call by name proc reference, checks if the proc exists on either the given type or as a global proc
#define TYPE_PROC_REF(TYPE, X) (nameof(##TYPE.proc/##X))
6 changes: 4 additions & 2 deletions code/ATMOSPHERICS/components/binary_devices/MSGS.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
var/internal_volume = 10000
var/max_pressure = 10000

var/target_pressure = 4500 //Output pressure.
var/target_pressure = 2500 //Output pressure.

var/datum/gas_mixture/air //Internal tank.

Expand Down Expand Up @@ -102,17 +102,19 @@
))
return data

/obj/machinery/atmospherics/binary/msgs/ui_act(action, list/params)
/obj/machinery/atmospherics/binary/msgs/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
return
switch(action)
if("toggle_power")
on = !on
update_icon()
SStgui.try_update_ui(ui.user, src, ui)
return TRUE
if("set_pressure")
target_pressure = round(clamp(text2num(params["new_pressure"]), 0, 4500))
SStgui.try_update_ui(ui.user, src, ui)
update_icon()
return TRUE

Expand Down
3 changes: 3 additions & 0 deletions code/__HELPERS/cmp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ var/cmp_field = "name"
/proc/cmp_records_dsc(datum/data/record/a, datum/data/record/b)
return sorttext(a.fields[cmp_field], b.fields[cmp_field])

/proc/cmp_records_numerically(datum/data/record/a, datum/data/record/b)
return b.fields[cmp_field] - a.fields[cmp_field]

/proc/cmp_ckey_asc(client/a, client/b)
return sorttext(b.ckey, a.ckey)

Expand Down
1 change: 1 addition & 0 deletions code/__HELPERS/datum.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/datum
var/list/datum_components
var/list/active_timers
var/list/open_uis

/datum/proc/initialize()
return TRUE
Expand Down
20 changes: 20 additions & 0 deletions code/__HELPERS/files.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,23 @@
fileaccess_timer = world.time + FTPDELAY
return 0
#undef FTPDELAY

// Similar to clamp but the bottom rolls around to the top and vice versa. min is inclusive, max is exclusive
#define WRAP(val, min, max) clamp(( min == max ? min : (val) - (round(((val) - (min))/((max) - (min))) * ((max) - (min))) ),min,max)


/// Save file as an external file then md5 it.
/// Used because md5ing files stored in the rsc sometimes gives incorrect md5 results.
/// https://www.byond.com/forum/post/2611357
/proc/md5asfile(file)
var/static/notch = 0
// its importaint this code can handle md5filepath sleeping instead of hard blocking, if it's converted to use rust_g.
var/filename = "tmp/md5asfile.[world.realtime].[world.timeofday].[world.time].[world.tick_usage].[notch]"
notch = WRAP(notch+1, 0, 2**15)
fcopy(file, filename)
. = md5filepath(filename)
fdel(filename)

/// Returns the md5 of a file at a given path.
/proc/md5filepath(path)
. = md5(file(path))
61 changes: 61 additions & 0 deletions code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,64 @@
return HSVtoRGB(hsv(hsv_list[1], hsv_list[2], hsv_list[3], hsv_list[4]))
return HSVtoRGB(hsv(hsv_list[1], hsv_list[2], hsv_list[3]))

/// given an icon object, dmi file path, or atom/image/mutable_appearance, attempts to find and return an associated dmi file path.
/// a weird quirk about dm is that /icon objects represent both compile-time or dynamic icons in the rsc,
/// but stringifying rsc references returns a dmi file path
/// ONLY if that icon represents a completely unchanged dmi file from when the game was compiled.
/// so if the given object is associated with an icon that was in the rsc when the game was compiled, this returns a path. otherwise it returns ""
/proc/get_icon_dmi_path(icon/icon)
/// the dmi file path we attempt to return if the given object argument is associated with a stringifiable icon
/// if successful, this looks like "icons/path/to/dmi_file.dmi"
var/icon_path = ""

if(isatom(icon) || istype(icon, /image) || istype(icon, /mutable_appearance))
var/atom/atom_icon = icon
icon = atom_icon.icon
//atom icons compiled in from 'icons/path/to/dmi_file.dmi' are weird and not really icon objects that you generate with icon().
//if they're unchanged dmi's then they're stringifiable to "icons/path/to/dmi_file.dmi"

if(isicon(icon) && isfile(icon))
//icons compiled in from 'icons/path/to/dmi_file.dmi' at compile time are weird and aren't really /icon objects,
///but they pass both isicon() and isfile() checks. they're the easiest case since stringifying them gives us the path we want
var/icon_ref = ref(icon)
var/locate_icon_string = "[locate(icon_ref)]"

icon_path = locate_icon_string

else if(isicon(icon) && "[icon]" == "/icon")
// icon objects generated from icon() at runtime are icons, but they AREN'T files themselves, they represent icon files.
// if the files they represent are compile time dmi files in the rsc, then
// the rsc reference returned by fcopy_rsc() will be stringifiable to "icons/path/to/dmi_file.dmi"
var/rsc_ref = fcopy_rsc(icon)

var/icon_ref = ref(rsc_ref)

var/icon_path_string = "[locate(icon_ref)]"

icon_path = icon_path_string

else if(istext(icon))
var/rsc_ref = fcopy_rsc(icon)
//if its the text path of an existing dmi file, the rsc reference returned by fcopy_rsc() will be stringifiable to a dmi path

var/rsc_ref_ref = ref(rsc_ref)
var/rsc_ref_string = "[locate(rsc_ref_ref)]"

icon_path = rsc_ref_string

if(is_valid_dmi_file(icon_path))
return icon_path

return FALSE

///given a text string, returns whether it is a valid dmi icons folder path
/proc/is_valid_dmi_file(icon_path)
if(!istext(icon_path) || !length(icon_path))
return FALSE

var/is_in_icon_folder = findtextEx(icon_path, "icons/")
var/is_dmi_file = findtextEx(icon_path, ".dmi")

if(is_in_icon_folder && is_dmi_file)
return TRUE
return FALSE
38 changes: 19 additions & 19 deletions code/__HELPERS/math/ray/ray.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

/ray
var/z //the z-level we are casting our ray in
var/vector/origin //the origin of the ray
var/vector/origin_floored //the floored origin vector
var/vector/direction //direction of the ray
var/_vector/origin //the origin of the ray
var/_vector/origin_floored //the floored origin vector
var/_vector/direction //direction of the ray
var/original_damage //original damage of the ray when applicable
var/turf/final_turf
var/turf/previous_turf
Expand All @@ -29,7 +29,7 @@
return "\[Ray\](\n- origin = " + origin.toString() + "\n- origin_floored = "+ origin_floored.toString() + "\n- direction = " + direction.toString() + "\n- z-level = " + num2text(z) + "\n)"

//use atom2vector for the origin, atoms2vector for the direction
/ray/New(var/vector/p_origin, var/vector/p_direction, var/z)
/ray/New(var/_vector/p_origin, var/_vector/p_direction, var/z)
origin = p_origin
origin_floored = origin.floored() //to save us from calculating it all over again
direction = p_direction.chebyshev_normalized()
Expand All @@ -53,7 +53,7 @@
return hitsPoint(other_ray.origin)

//returns true if point is on our ray (can be called with a max distance)
/ray/proc/hitsPoint(var/vector/point, var/max_distance = 0)
/ray/proc/hitsPoint(var/_vector/point, var/max_distance = 0)
if(origin.equals(point)) //the easy way out
return TRUE

Expand All @@ -73,23 +73,23 @@
// wrong?
/ray/proc/getReboundOnAtom(var/rayCastHit/hit)
//calc where we hit the atom
var/vector/hit_point = hit.point_raw
var/_vector/hit_point = hit.point_raw
var/atom/movable/resolved_hit_atom = hit.hit_atom?.get()
var/vector/hit_atom_loc = atom2vector(resolved_hit_atom) + new /vector(0.5, 0.5)
var/_vector/hit_atom_loc = atom2vector(resolved_hit_atom) + new /_vector(0.5, 0.5)

var/vector/hit_vector = hit_point - hit_atom_loc
var/_vector/hit_vector = hit_point - hit_atom_loc

//we assume every atom is a octogonal, hence we use all_vectors
//here we calculate the "face" of the octagonal atom we want to rebound on
var/entry_byond_dir = vector2ClosestDir(hit_vector)
var/vector/entry_dir = dir2vector(entry_byond_dir)
var/_vector/entry_dir = dir2vector(entry_byond_dir)

return src.direction.mirrorWithNormal(entry_dir)


//gets a point along the ray
/ray/proc/getPoint(var/distance)
var/vector/path = direction * distance
var/_vector/path = direction * distance
return origin + path

//inherit and override this for costum logic
Expand All @@ -101,15 +101,15 @@
//returns list of raycasthits
/ray/proc/cast(var/max_distance = RAY_CAST_DEFAULT_MAX_DISTANCE, var/max_hits = RAY_CAST_UNLIMITED_HITS, var/ignore_origin = TRUE)
//calculating a step and its distance to use in the loop
var/vector/a_step = direction * RAY_CAST_STEP
var/_vector/a_step = direction * RAY_CAST_STEP
var/step_distance = a_step.chebyshev_norm()

//setting up our pointer and distance to track where we are
var/vector/pointer = new /vector(0,0)
var/_vector/pointer = new /_vector(0,0)
var/distance = 0

//positions list to easier check if we already found this position (since we are moving in tiny steps, not full numbers)
var/list/vector/positions = list()
var/list/_vector/positions = list()

//our result
var/list/rayCastHit/hits = list()
Expand All @@ -124,12 +124,12 @@
distance += step_distance

//calculating our current position in world space (its two lines cause byond)
var/vector/new_position_unfloored = origin + pointer
var/vector/new_position = new_position_unfloored.floored()
var/_vector/new_position_unfloored = origin + pointer
var/_vector/new_position = new_position_unfloored.floored()

//check if we already checked this (floored) vector
var/exists = FALSE
for(var/vector/V in positions)
for(var/_vector/V in positions)
if(V.equals(new_position))
exists = TRUE
if(exists)
Expand Down Expand Up @@ -191,14 +191,14 @@ var/list/ray_draw_icon_cache = list()
var/angle = direction.toAngle()
var/max_distance = draw_distance - distance_from_endpoint
while(distance_pointer < max_distance)
var/vector/point
var/_vector/point
if(distance_pointer > max_distance - step_size) //last loop
point = getPoint(max_distance - step_size)
else
point = getPoint(distance_pointer)
var/vector/point_floored = point.floored()
var/_vector/point_floored = point.floored()

var/vector/pixels = (point - point_floored - new /vector(0.5, 0.5)) * WORLD_ICON_SIZE
var/_vector/pixels = (point - point_floored - new /_vector(0.5, 0.5)) * WORLD_ICON_SIZE

var/turf/T = locate(point_floored.x, point_floored.y, z)

Expand Down
4 changes: 2 additions & 2 deletions code/__HELPERS/math/ray/rayCastHit.dm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/rayCastHit
var/ray/used_ray
var/datum/weakref/hit_atom
var/vector/point
var/vector/point_raw
var/_vector/point
var/_vector/point_raw
var/distance
var/hit_type // see defines in ray.dm

Expand Down
6 changes: 3 additions & 3 deletions code/__HELPERS/math/ray/rayCastHitInfo.dm
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/rayCastHitInfo
var/ray/used_ray
var/datum/weakref/hit_atom
var/vector/point
var/vector/point_raw
var/_vector/point
var/_vector/point_raw
var/distance

/rayCastHitInfo/New(var/ray/used_ray, var/datum/weakref/hit_atom, var/vector/point, var/vector/point_raw, var/distance)
/rayCastHitInfo/New(var/ray/used_ray, var/datum/weakref/hit_atom, var/_vector/point, var/_vector/point_raw, var/distance)
src.used_ray = used_ray
src.hit_atom = hit_atom
src.point = point
Expand Down
4 changes: 2 additions & 2 deletions code/__HELPERS/math/ray/ray_test_procs.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

/proc/raycast_test(var/x = 1, var/y = 1, var/dist)
var/vector/origin = new /vector(usr.x, usr.y)
var/vector/direction = new /vector(x, y)
var/_vector/origin = new /_vector(usr.x, usr.y)
var/_vector/direction = new /_vector(x, y)

var/ray/our_ray = new /ray(origin, direction, usr.z)
var/list/res = our_ray.cast(dist)
Expand Down
Loading
Loading