Skip to content

Commit

Permalink
feat: replace rust_g_ss220 to rust_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaxeer committed May 14, 2024
1 parent f154de7 commit 5b7c203
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 163 deletions.
Binary file added librust_utils.dll
Binary file not shown.
4 changes: 4 additions & 0 deletions modular_ss220/_rust_utils/_rust_utils.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/datum/modpack/rust_utils
name = "Rust Utils"
desc = "Набор утилит на rust"
author = "furior, gaxeer"
3 changes: 3 additions & 0 deletions modular_ss220/_rust_utils/_rust_utils.dme
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "_rust_utils.dm"

#include "code/rust_utils.dm"
28 changes: 28 additions & 0 deletions modular_ss220/_rust_utils/code/rust_utils.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#ifndef RUST_UTILS

/* This comment bypasses grep checks */ /var/__rust_utils

/proc/__detect_rust_utils()
if (world.system_type == UNIX)

Check failure on line 6 in modular_ss220/_rust_utils/code/rust_utils.dm

View workflow job for this annotation

GitHub Actions / Run Linters

Check Grep

modular_ss220/_rust_utils/code/rust_utils.dm:6: Found a conditional statement matching the format "if (thing)" (irregular spacing), please use "if(thing)" instead.
if (fexists("./librust_utils.so"))

Check failure on line 7 in modular_ss220/_rust_utils/code/rust_utils.dm

View workflow job for this annotation

GitHub Actions / Run Linters

Check Grep

modular_ss220/_rust_utils/code/rust_utils.dm:7: Found a conditional statement matching the format "if (thing)" (irregular spacing), please use "if(thing)" instead.
// No need for LD_LIBRARY_PATH badness.
return __rust_utils = "./librust_utils.so"
else
// It's not in the current directory, so try others
return __rust_utils = "librust_utils.so"
else
return __rust_utils = "librust_utils"

#define RUST_UTILS (__rust_utils || __detect_rust_utils())
#endif

/// Gets the version of rust_utils
/proc/rust_utils_get_version() return RUSTG_CALL(RUST_UTILS, "get_version")()

#define rustutils_file_write_b64decode(text, fname) RUSTG_CALL(RUST_UTILS, "file_write")(text, fname, "true")

#define rustutils_regex_replace(text, re, re_params, replacement) RUSTG_CALL(RUST_UTILS, "regex_replace")(text, re, re_params, replacement)

#define rustutils_cyrillic_to_latin(text) RUSTG_CALL(RUST_UTILS, "cyrillic_to_latin")("[text]")
#define rustutils_latin_to_cyrillic(text) RUSTG_CALL(RUST_UTILS, "latin_to_cyrillic")("[text]")

1 change: 1 addition & 0 deletions modular_ss220/modular_ss220.dme
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// #include "example/_example.dme"

// --- MAINTENANCE --- //
#include "_rust_utils/_rust_utils.dme"
#include "_components/_components.dme"
#include "_defines220/_defines220.dme"
#include "_signals220/_signals220.dme"
Expand Down
1 change: 0 additions & 1 deletion modular_ss220/speech_filter/_speech_filter.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

#include "code/configuration.dm"
#include "code/mob.dm"
#include "code/rust_utils.dm"
#include "code/speech_filter.dm"
44 changes: 0 additions & 44 deletions modular_ss220/speech_filter/code/rust_utils.dm

This file was deleted.

2 changes: 1 addition & 1 deletion modular_ss220/speech_filter/code/speech_filter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
if(!brainrot_regex)
return

message = rust_utils_regex_replace(message, brainrot_regex, "igu", "")
message = rustutils_regex_replace(message, brainrot_regex, "i", "")
if(original_message_length == length(message))
return

Expand Down
1 change: 0 additions & 1 deletion modular_ss220/text_to_speech/_tts.dme
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "code/hear.dm"
#include "code/numbers.dm"
#include "code/providers/silero.dm"
#include "code/rust_g_ss220.dm"
#include "code/seeds/base.dm"
#include "code/seeds/silero.dm"
#include "code/sound.dm"
Expand Down
48 changes: 0 additions & 48 deletions modular_ss220/text_to_speech/code/rust_g_ss220.dm

This file was deleted.

4 changes: 2 additions & 2 deletions modular_ss220/text_to_speech/code/tts_subsystem.dm
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ SUBSYSTEM_DEF(tts220)
if(!voice)
return

rustg_ss220_file_write_b64decode(voice, "[filename].ogg")
rustutils_file_write_b64decode(voice, "[filename].ogg")

if(!GLOB.configuration.tts.tts_cache_enabled)
addtimer(CALLBACK(src, PROC_REF(cleanup_tts_file), "[filename].ogg"), 30 SECONDS)
Expand Down Expand Up @@ -557,7 +557,7 @@ SUBSYSTEM_DEF(tts220)
. = replacetext_char(., acronyms, /proc/tts_acronym_replacer)
for(var/job in tts_job_replacements)
. = replacetext_char(., job, tts_job_replacements[job])
. = rustg_ss220_latin_to_cyrillic(.)
. = rustutils_latin_to_cyrillic(.)

var/static/regex/decimals = new(@"-?\d+\.\d+", "g")
. = replacetext_char(., decimals, /proc/dec_in_words)
Expand Down
6 changes: 0 additions & 6 deletions modular_ss220/text_to_speech/code/~undefs/~undefs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
#undef TTS_TRAIT_RATE_FASTER
#undef TTS_TRAIT_RATE_MEDIUM

#undef rustg_ss220_file_write_b64decode

// Text Operations //
#undef rustg_ss220_cyrillic_to_latin
#undef rustg_ss220_latin_to_cyrillic

#undef TTS_CATEGORY_OTHER
#undef TTS_CATEGORY_WARCRAFT3
#undef TTS_CATEGORY_HALFLIFE2
Expand Down
Binary file removed rust_g_ss220.dll
Binary file not shown.
Binary file removed rust_utils.dll
Binary file not shown.
7 changes: 3 additions & 4 deletions tools/tgs_scripts/PreCompile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ else
~/.cargo/bin/rustup target add i686-unknown-linux-gnu
fi

echo "Deploying rust-g ss220..."
echo "Deploying rustutils..."
RUSTFLAGS="-C target-cpu=native"
env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --features all --target=i686-unknown-linux-gnu
rm -f "$original_dir/../GameStaticFiles/librust_g_ss220.so"
mv target/i686-unknown-linux-gnu/release/librust_g.so "$original_dir/../GameStaticFiles/librust_g_ss220.so"
env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --all-features --target=i686-unknown-linux-gnu
mv target/i686-unknown-linux-gnu/release/librust_utils.so "$1/librust_utils.so"
cd ../../
56 changes: 0 additions & 56 deletions tools/tgs_scripts/PreCompileSS220.sh

This file was deleted.

0 comments on commit 5b7c203

Please sign in to comment.