Skip to content

Commit 1e11fc7

Browse files
authored
IconForge: GAGS (3.1.2) (#13)
* Don't hash the same DMI 500 times * GAGS * Add async load * Set version to 3.1.2 * Format
1 parent d41380d commit 1e11fc7

File tree

4 files changed

+653
-50
lines changed

4 files changed

+653
-50
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rust-g"
33
edition = "2021"
4-
version = "3.1.1"
4+
version = "3.1.2"
55
authors = [
66
"Bjorn Neergaard <bjorn@neersighted.com>",
77
"Tad Hardesty <tad@platymuus.com>",

dmsrc/iconforge.dm

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@
5252
#define rustg_iconforge_cache_valid(input_hash, dmi_hashes, sprites) RUSTG_CALL(RUST_G, "iconforge_cache_valid")(input_hash, dmi_hashes, sprites)
5353
/// Returns a job_id for use with rustg_iconforge_check()
5454
#define rustg_iconforge_cache_valid_async(input_hash, dmi_hashes, sprites) RUSTG_CALL(RUST_G, "iconforge_cache_valid_async")(input_hash, dmi_hashes, sprites)
55+
/// Provided a /datum/greyscale_config typepath, JSON string containing the greyscale config, and path to a DMI file containing the base icons,
56+
/// Loads that config into memory for later use by rustg_iconforge_gags(). The config_path is the unique identifier used later.
57+
/// JSON Config schema: https://hackmd.io/@tgstation/GAGS-Layer-Types
58+
/// Unsupported features: color_matrix layer type, 'or' blend_mode. May not have BYOND parity with animated icons or varying dirs between layers.
59+
/// Returns "OK" if successful, otherwise, returns a string containing the error.
60+
#define rustg_iconforge_load_gags_config(config_path, config_json, config_icon_path) RUSTG_CALL(RUST_G, "iconforge_load_gags_config")("[config_path]", config_json, config_icon_path)
61+
/// Given a config_path (previously loaded by rustg_iconforge_load_gags_config), and a string of hex colors formatted as "#ff00ff#ffaa00"
62+
/// Outputs a DMI containing all of the states within the config JSON to output_dmi_path, creating any directories leading up to it if necessary.
63+
/// Returns "OK" if successful, otherwise, returns a string containing the error.
64+
#define rustg_iconforge_gags(config_path, colors, output_dmi_path) RUSTG_CALL(RUST_G, "iconforge_gags")("[config_path]", colors, output_dmi_path)
65+
/// Returns a job_id for use with rustg_iconforge_check()
66+
#define rustg_iconforge_load_gags_config_async(config_path, config_json, config_icon_path) RUSTG_CALL(RUST_G, "iconforge_load_gags_config_async")("[config_path]", config_json, config_icon_path)
67+
/// Returns a job_id for use with rustg_iconforge_check()
68+
#define rustg_iconforge_gags_async(config_path, colors, output_dmi_path) RUSTG_CALL(RUST_G, "iconforge_gags_async")("[config_path]", colors, output_dmi_path)
5569

5670
#define RUSTG_ICONFORGE_BLEND_COLOR "BlendColor"
5771
#define RUSTG_ICONFORGE_BLEND_ICON "BlendIcon"

0 commit comments

Comments
 (0)