mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-14 03:32:00 +00:00
## About The Pull Request This PR refactors mind language holders into non-existence As a result, `update_atom_languages` is no longer necessary Mind-bound languages are transferred via `/mind/proc/transfer_to` Species changing no longer deletes and re-creates the mob's language holder, allowing them to keep any languages they have. Species languages are sourced from `LANGUAGE_SPECIES` now, meaning they are removed when they change species. If the mob is not a human with a species datum, these are effectively just atom level languages. Makes a bunch of unit tests to ensure language transfer over certain events works as intended ## Why It's Good For The Game Mobs with minds having two independent language holders results in a good few bugs, and simply doesn't make sense when we have sources (`LANGUAGE_MIND`). Instead of tracking two language holders, we can simply use sources better and only track one. This means that the language holder you start with is your language holder, period. It doesn't get deleted or re-instantiated or whatever. ## Changelog 🆑 Melbert refactor: Refactored language holders, making species changes not delete all of your known languages /🆑
20 lines
518 B
Plaintext
20 lines
518 B
Plaintext
/*!
|
|
* Copyright (c) 2020 Aleksej Komarov
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
/**
|
|
* tgui state: language_menu_state
|
|
*/
|
|
|
|
GLOBAL_DATUM_INIT(language_menu_state, /datum/ui_state/language_menu, new)
|
|
|
|
/datum/ui_state/language_menu/can_use_topic(src_object, mob/user)
|
|
. = UI_CLOSE
|
|
if(check_rights_for(user.client, R_ADMIN))
|
|
. = UI_INTERACTIVE
|
|
else if(istype(src_object, /datum/language_menu))
|
|
var/datum/language_menu/my_languages = src_object
|
|
if(my_languages.language_holder.owner == user)
|
|
. = UI_INTERACTIVE
|