Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reagents ru-name support #785

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modular_bandastation/translations/_translations.dme
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
#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/ru_names/ru_name_reagents.dm"

#include "code/~undefs.dm"
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/datum/reagent
/// List consists of ("name", "именительный", "родительный", "дательный", "винительный", "творительный", "предложный", "gender")
var/list/ru_names

/// Необходимо использовать ПЕРЕД изменением var/name, и использовать только этот прок для изменения в рантайме склонений
/datum/reagent/ru_names_rename(list/new_list)
if(!length(new_list))
return
ru_names = new_list

/datum/reagent/New()
. = ..()
ru_names_rename(ru_names_toml(LOWER_TEXT(name)))

/datum/reagent/declent_ru(case_id, list/ru_names_override)
var/list/list_to_use = ru_names_override || ru_names
if(length(list_to_use) && list_to_use["base"] == name && list_to_use[case_id])
return list_to_use[case_id]
if(case_id == "gender")
return
return name
Loading