mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-16 09:34:21 +01:00
Ports rust-g -> rustlibs: toast (#29379)
* moves rustg_toast to rustlibs_toast * Build Rust library * Build Rust library * Update rust/Cargo.toml Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Signed-off-by: chuga-git <98280110+chuga-git@users.noreply.github.com> * Build Rust library * throw out old binaries --------- Signed-off-by: chuga-git <98280110+chuga-git@users.noreply.github.com> Co-authored-by: paradisess13[bot] <165046124+paradisess13[bot]@users.noreply.github.com> Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
This commit is contained in:
@@ -189,6 +189,12 @@
|
||||
return RUSTLIB_CALL(redis_publish, channel, message)
|
||||
|
||||
|
||||
// MARK: Toast
|
||||
/// (Windows only) Triggers a desktop notification with the specified title and body
|
||||
/proc/rustlibs_create_toast(title, body)
|
||||
return RUSTLIB_CALL(create_toast, title, body)
|
||||
|
||||
|
||||
// MARK: HTTP
|
||||
#define RUSTLIBS_HTTP_METHOD_GET "get"
|
||||
#define RUSTLIBS_HTTP_METHOD_PUT "put"
|
||||
|
||||
@@ -82,7 +82,3 @@
|
||||
#define rustg_sql_connected(handle) RUSTG_CALL(RUST_G, "sql_connected")(handle)
|
||||
#define rustg_sql_disconnect_pool(handle) RUSTG_CALL(RUST_G, "sql_disconnect_pool")(handle)
|
||||
#define rustg_sql_check_query(job_id) RUSTG_CALL(RUST_G, "sql_check_query")("[job_id]")
|
||||
|
||||
// Toast Operations //
|
||||
|
||||
#define rustg_create_toast(title, body) RUSTG_CALL(RUST_G, "create_toast")(title, body)
|
||||
|
||||
@@ -255,7 +255,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new
|
||||
log_startup_progress("Initializations complete within [time] second[time == 1 ? "" : "s"]!")
|
||||
|
||||
if(GLOB.configuration.system.toast_on_init_complete)
|
||||
rustg_create_toast("Paradise SS13", "Server initialization complete")
|
||||
rustlibs_create_toast("Paradise SS13", "Server initialization complete")
|
||||
|
||||
if(GLOB.configuration.general.developer_express_start)
|
||||
SSticker.force_start = TRUE
|
||||
|
||||
@@ -436,7 +436,7 @@ SUBSYSTEM_DEF(garbage)
|
||||
|
||||
log_gc("Completed search for references to a [type].")
|
||||
#ifdef FIND_REF_NOTIFY_ON_COMPLETE
|
||||
rustg_create_toast("ParadiseSS13", "GC search complete for [type]")
|
||||
rustlibs_create_toast("ParadiseSS13", "GC search complete for [type]")
|
||||
#endif
|
||||
if(usr && usr.client)
|
||||
usr.client.running_find_references = null
|
||||
|
||||
Generated
+944
-83
File diff suppressed because it is too large
Load Diff
@@ -42,3 +42,4 @@ dbpnoise = "0.1.2"
|
||||
# redis - DO NOT CHANGE FROM 0.21.4 - also dont touch flume either please k thx. if you mess with these you make redis unstable
|
||||
redis = { version = "0.21.4" }
|
||||
flume = { version = "0.10" }
|
||||
notify-rust = "4.11.7"
|
||||
|
||||
@@ -9,4 +9,5 @@ mod rustlibs_json;
|
||||
mod rustlibs_logging;
|
||||
mod rustlibs_noisegen;
|
||||
mod rustlibs_redispubsub;
|
||||
mod rustlibs_toast;
|
||||
mod rustlibs_toml;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
use byondapi::value::ByondValue;
|
||||
#[cfg(target_os = "windows")]
|
||||
use notify_rust::Notification;
|
||||
|
||||
#[byondapi::bind]
|
||||
fn create_toast(_title: ByondValue, _text: ByondValue) -> eyre::Result<ByondValue> {
|
||||
#[cfg(target_os = "windows")]
|
||||
Notification::new()
|
||||
.summary(&_title.get_string()?)
|
||||
.body(&_text.get_string()?)
|
||||
.show()
|
||||
.ok();
|
||||
Ok(ByondValue::null())
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user