Skip to content

Commit

Permalink
Merge pull request #976 from SPLURT-Station/hate-upstream
Browse files Browse the repository at this point in the history
Moves flavor texts to the background tab
  • Loading branch information
MosleyTheMalO authored Oct 26, 2023
2 parents 7da7acb + ac236ec commit e9e9651
Show file tree
Hide file tree
Showing 28 changed files with 344 additions and 180 deletions.
5 changes: 5 additions & 0 deletions code/__DEFINES/DNA.dm
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,8 @@
#define G_FEMALE 2
#define G_PLURAL 3
#define G_NEUTER 4

#define PREVIEW_PREF_JOB "Job"
#define PREVIEW_PREF_LOADOUT "Loadout"
#define PREVIEW_PREF_NAKED "Naked"
#define PREVIEW_PREF_NAKED_AROUSED "Naked - Aroused"
1 change: 1 addition & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@
#define COMSIG_MOB_CLIENT_MOVE "mob_client_move" //sent when client/Move() finishes with no early returns: (client, direction, n, oldloc)
#define COMSIG_MOB_CLIENT_CHANGE_VIEW "mob_client_change_view" //from base of /client/change_view(): (client, old_view, view)
#define COMSIG_MOB_CLIENT_MOUSEMOVE "mob_client_mousemove" //from base of /client/MouseMove(): (object, location, control, params)
#define COMSIG_MOB_CLIENT_JOINED_FROM_LOBBY "mob_client_joined_from_lobby" //sent when a player joins/latejoins the game: (new_character, client, late_transfer)

///sent when a mob/login() finishes: (client)
#define COMSIG_MOB_CLIENT_LOGIN "comsig_mob_client_login"
Expand Down
24 changes: 16 additions & 8 deletions code/__DEFINES/loadout.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,23 @@
#define LOADOUT_CAN_DESCRIPTION (1<<1) //adding a custom description to items
#define LOADOUT_CAN_COLOR_POLYCHROMIC (1<<2)

/* the names of the customization tabs
//the names of the customization tabs
#define SETTINGS_TAB 0
#define GAME_PREFERENCES_TAB 1
#define APPEARANCE_TAB 2
#define SPEECH_TAB 3
#define LOADOUT_TAB 4
#define CONTENT_PREFERENCES_TAB 5
#define KEYBINDINGS_TAB 6
*/
#define PREFERENCES_TAB 1
#define KEYBINDINGS_TAB 2

//subtabs for the character settings tab
#define GENERAL_CHAR_TAB 0
#define BACKGROUND_CHAR_TAB 1
#define APPEARANCE_CHAR_TAB 2
#define MARKINGS_CHAR_TAB 3
#define SPEECH_CHAR_TAB 4
#define LOADOUT_CHAR_TAB 5

//subtabs for preferences tab
#define GAME_PREFS_TAB 0
#define OOC_PREFS_TAB 1
#define CONTENT_PREFS_TAB 2

//quirks
#define QUIRK_POSITIVE "Positive"
Expand Down
4 changes: 0 additions & 4 deletions code/__SANDCODE/DEFINES/DNA.dm

This file was deleted.

18 changes: 0 additions & 18 deletions code/__SANDCODE/DEFINES/loadout.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,3 @@
#define LOADOUT_CATEGORY_WRISTS "Wrists"
/// Subcategory for watches
#define LOADOUT_SUBCATEGORY_WATCHES "Watches"

//the names of the customization tabs
#define SETTINGS_TAB 0
#define PREFERENCES_TAB 1
#define KEYBINDINGS_TAB 2

//subtabs for the character settings tab
#define GENERAL_CHAR_TAB 0
#define APPEARANCE_CHAR_TAB 1
#define MARKINGS_CHAR_TAB 2
#define SPEECH_CHAR_TAB 3
#define BACKGROUND_CHAR_TAB 4
#define LOADOUT_CHAR_TAB 5

//subtabs for preferences tab
#define GAME_PREFS_TAB 0
#define OOC_PREFS_TAB 1
#define CONTENT_PREFS_TAB 2
16 changes: 16 additions & 0 deletions code/__SANDCODE/HELPERS/silicon.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/proc/setup_silicon_law_prefs(mob/living/silicon/Silicon, client/player_client)
if(!CONFIG_GET(flag/allow_silicon_choosing_laws))
return

if(!player_client.prefs.silicon_lawset)
return

var/list/config_laws = CONFIG_GET(keyed_list/choosable_laws)
var/player_lawset = config_laws[player_client.prefs.silicon_lawset]
if(player_lawset)
Silicon.laws = new player_lawset
var/admin_warning = "[player_client] / [Silicon] ([initial(Silicon.name)]) has joined with the [player_client.prefs.silicon_lawset] ([player_lawset]) lawset.<br>"
admin_warning += "Laws:<br>"
admin_warning += english_list(Silicon.laws.get_law_list(TRUE), "No laws", "<br>", "<br>")
Silicon.laws.show_laws(player_client)
message_admins(examine_block(admin_warning))
2 changes: 1 addition & 1 deletion code/_globalvars/lists/loadout_categories.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
GLOBAL_LIST_INIT(loadout_categories, list(
LOADOUT_CATEGORY_ACCESSORY = LOADOUT_SUBCATEGORIES_NONE,
LOADOUT_CATEGORY_BACKPACK = list(LOADOUT_SUBCATEGORY_BACKPACK_GENERAL, LOADOUT_SUBCATEGORY_BACKPACK_TOYS),
LOADOUT_CATEGORY_NECK = list(LOADOUT_SUBCATEGORY_NECK_GENERAL, LOADOUT_SUBCATEGORY_NECK_TIE, LOADOUT_SUBCATEGORY_NECK_SCARVES),
LOADOUT_CATEGORY_MASK = LOADOUT_SUBCATEGORIES_NONE,
LOADOUT_CATEGORY_HANDS = LOADOUT_SUBCATEGORIES_NONE,
LOADOUT_CATEGORY_UNIFORM = list(LOADOUT_SUBCATEGORY_UNIFORM_GENERAL, LOADOUT_SUBCATEGORY_UNIFORM_JOBS, LOADOUT_SUBCATEGORY_UNIFORM_SUITS, LOADOUT_SUBCATEGORY_UNIFORM_SKIRTS, LOADOUT_SUBCATEGORY_UNIFORM_DRESSES, LOADOUT_SUBCATEGORY_UNIFORM_SWEATERS, LOADOUT_SUBCATEGORY_UNIFORM_PANTS, LOADOUT_SUBCATEGORY_UNIFORM_SHORTS),
LOADOUT_CATEGORY_ACCESSORY = LOADOUT_SUBCATEGORIES_NONE,
LOADOUT_CATEGORY_SUIT = list(LOADOUT_SUBCATEGORY_SUIT_GENERAL, LOADOUT_SUBCATEGORY_SUIT_COATS, LOADOUT_SUBCATEGORY_SUIT_JACKETS, LOADOUT_SUBCATEGORY_SUIT_JOBS),
LOADOUT_CATEGORY_HEAD = list(LOADOUT_SUBCATEGORY_HEAD_GENERAL, LOADOUT_SUBCATEGORY_HEAD_JOBS),
LOADOUT_CATEGORY_SHOES = LOADOUT_SUBCATEGORIES_NONE,
Expand Down
8 changes: 7 additions & 1 deletion code/controllers/configuration/config_entry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define VALUE_MODE_TEXT 1
#define VALUE_MODE_FLAG 2
#define VALUE_MODE_NUM_LIST 3
#define VALUE_MODE_TYPE 4

#define KEY_MODE_TEXT 0
#define KEY_MODE_TYPE 1
Expand Down Expand Up @@ -214,7 +215,7 @@
if(lowercase_key)
key_name = lowertext(key_name)
if(key_pos)
key_value = copytext(str_val, key_pos + length(str_val[key_pos]))
key_value = copytext(str_val, key_pos + length(splitter))
var/new_key
var/new_value
var/continue_check_value
Expand Down Expand Up @@ -250,6 +251,11 @@
new_list += temp
new_value = new_list
continue_check_value = new_list.len
if(VALUE_MODE_TYPE)
new_value = key_value
if(!ispath(new_value))
new_value = text2path(new_value)
continue_check_value = ispath(new_value)
if(continue_check_value && continue_check_key && ValidateListEntry(new_key, new_value))
new_key = preprocess_key(new_key)
new_value = preprocess_value(new_value)
Expand Down
6 changes: 3 additions & 3 deletions code/controllers/subsystem/language.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SUBSYSTEM_DEF(language)
name = "Language"
init_order = INIT_ORDER_LANGUAGE
flags = SS_NO_FIRE
var/list/languages_by_name = list() //SKYRAT CHANGE - language bullshit
var/list/languages_by_name = list() //Sandstorm CHANGE - language bullshit

/datum/controller/subsystem/language/Initialize(timeofday)
for(var/L in subtypesof(/datum/language))
Expand All @@ -15,8 +15,8 @@ SUBSYSTEM_DEF(language)
var/datum/language/instance = new language

GLOB.language_datum_instances[language] = instance
//skyrat change
languages_by_name[initial(language.name)] = new language
//Sandstorm change
languages_by_name[initial(language.name)] = instance
//

return ..()
2 changes: 1 addition & 1 deletion code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ SUBSYSTEM_DEF(ticker)
SSjob.EquipRank(N, player.mind.assigned_role, 0)
if(CONFIG_GET(flag/roundstart_traits) && ishuman(N.new_character))
SSquirks.AssignQuirks(N.new_character, N.client, TRUE, TRUE, SSjob.GetJob(player.mind.assigned_role), FALSE, N)
//skyrat change
//sandstorm change
if(ishuman(N.new_character))
SSlanguage.AssignLanguage(N.new_character, N.client)
//
Expand Down
5 changes: 2 additions & 3 deletions code/datums/ai_laws.dm
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,9 @@
/datum/ai_laws/proc/clear_hacked_laws()
hacked = list()

/datum/ai_laws/proc/show_laws(who)
/datum/ai_laws/proc/show_laws(who, title = "<b>Obey these laws:</b>")
var/list/printable_laws = get_law_list(include_zeroth = TRUE)
for(var/law in printable_laws)
to_chat(who,law)
to_chat(who, examine_block("<center>[title]</center><br>[english_list(printable_laws, "No laws", "<br>", "<br>")]"))

/datum/ai_laws/proc/clear_zeroth_law(force) //only removes zeroth from antag ai if force is 1
if(force)
Expand Down
23 changes: 21 additions & 2 deletions code/datums/elements/flavor_text.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,17 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code
LAZYOR(GLOB.mobs_with_editable_flavor_text[M], src)
add_verb(M, /mob/proc/manage_flavor_tests)

if(save_key && ishuman(target))
if(!save_key)
return
if(ishuman(target))
RegisterSignal(target, COMSIG_HUMAN_PREFS_COPIED_TO, .proc/update_prefs_flavor_text)
else if(iscyborg(target))
RegisterSignal(target, COMSIG_MOB_ON_NEW_MIND, .proc/borged_update_flavor_text)
RegisterSignal(target, COMSIG_MOB_CLIENT_JOINED_FROM_LOBBY, .proc/borged_update_flavor_text)

/datum/element/flavor_text/Detach(atom/A)
. = ..()
UnregisterSignal(A, list(COMSIG_PARENT_EXAMINE, COMSIG_HUMAN_PREFS_COPIED_TO))
UnregisterSignal(A, list(COMSIG_PARENT_EXAMINE, COMSIG_HUMAN_PREFS_COPIED_TO, COMSIG_MOB_ON_NEW_MIND, COMSIG_MOB_CLIENT_JOINED_FROM_LOBBY))
texts_by_atom -= A
if(can_edit && ismob(A))
var/mob/M = A
Expand Down Expand Up @@ -183,6 +188,20 @@ GLOBAL_LIST_EMPTY(mobs_with_editable_flavor_text) //et tu, hacky code
if(P.features.Find(save_key))
texts_by_atom[H] = P.features[save_key]

/datum/element/flavor_text/proc/borged_update_flavor_text(mob/new_character, client/C)
C = C || GET_CLIENT(new_character)
if(!C)
LAZYREMOVE(texts_by_atom, new_character)
return
var/datum/preferences/P = C.prefs
if(!P)
LAZYREMOVE(texts_by_atom, new_character)
return
if(P.custom_names["cyborg"] == new_character.real_name)
LAZYSET(texts_by_atom, new_character, P.features[save_key])
else
LAZYREMOVE(texts_by_atom, new_character)

//subtypes with additional hooks for DNA and preferences.
/datum/element/flavor_text/carbon
//list of antagonists etcetera that should have nothing to do with people's snowflakes.
Expand Down
Loading

0 comments on commit e9e9651

Please sign in to comment.