From 9968109439052097753d51e413a42e606a0eaf46 Mon Sep 17 00:00:00 2001 From: larentoun <31931237+larentoun@users.noreply.github.com> Date: Wed, 20 Nov 2024 20:38:01 +0300 Subject: [PATCH] declent orderable items (#775) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## About The Pull Request ру неймы --- .../translations/_translations.dme | 1 + .../code/ru_names/ru_name_materials.dm | 2 +- .../code/ru_names/ru_name_orderables.dm | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 modular_bandastation/translations/code/ru_names/ru_name_orderables.dm diff --git a/modular_bandastation/translations/_translations.dme b/modular_bandastation/translations/_translations.dme index b5d918cee4f6d..ee887950be7b9 100644 --- a/modular_bandastation/translations/_translations.dme +++ b/modular_bandastation/translations/_translations.dme @@ -14,5 +14,6 @@ #include "code/translate_verbs.dm" #include "code/ru_names/ru_name_base.dm" #include "code/ru_names/ru_name_materials.dm" +#include "code/ru_names/ru_name_orderables.dm" #include "code/~undefs.dm" diff --git a/modular_bandastation/translations/code/ru_names/ru_name_materials.dm b/modular_bandastation/translations/code/ru_names/ru_name_materials.dm index 155657730e7b3..526737ffe36d0 100644 --- a/modular_bandastation/translations/code/ru_names/ru_name_materials.dm +++ b/modular_bandastation/translations/code/ru_names/ru_name_materials.dm @@ -3,7 +3,7 @@ if(!ispath(sheet_type)) CRASH("Sheet type couldn't be declented because it's not a path!") var/atom/sheet = sheet_type - var/list/list_to_use = ru_names_override || ru_names_toml(name) || ru_names_toml(sheet:name) + var/list/list_to_use = ru_names_override || ru_names_toml(name) || ru_names_toml(sheet::name) if(length(list_to_use) && list_to_use["base"] == name && list_to_use[case_id]) return list_to_use[case_id] return name diff --git a/modular_bandastation/translations/code/ru_names/ru_name_orderables.dm b/modular_bandastation/translations/code/ru_names/ru_name_orderables.dm new file mode 100644 index 0000000000000..7ec24c1b3a789 --- /dev/null +++ b/modular_bandastation/translations/code/ru_names/ru_name_orderables.dm @@ -0,0 +1,17 @@ +/datum/orderable_item + var/use_translate = TRUE + +/datum/orderable_item/New() + . = ..() + if(!use_translate) + return + name = capitalize(declent_ru(NOMINATIVE)) + +/datum/orderable_item/declent_ru(case_id, list/ru_names_override) + . = name + if(!ispath(purchase_path)) + CRASH("Purchase type couldn't be declented because it's not a path!") + var/list/list_to_use = ru_names_override || ru_names_toml(purchase_path::name) + if(length(list_to_use) && list_to_use["base"] == name && list_to_use[case_id]) + return list_to_use[case_id] + return name