From 3b164cd8aa5be642129b094ec801cb8e643a678e Mon Sep 17 00:00:00 2001 From: Krausus Date: Sun, 3 Jul 2016 00:24:40 -0400 Subject: [PATCH] Loadout fixes and loadout points config option - Adds a configuration option for loadout points. - Fixes the blue plaid skirt lacking its own unique type, causing runtimes due to the mismatch between its display_name and initial(display_name). - Fixes the gear selection table using a fixed width. - Fixes the restrictions column not consistently being added. - Fixes the header and footer lacking the proper column span to account for the restrictions column. --- code/controllers/configuration.dm | 5 ++++ .../preference/loadout/loadout_uniform.dm | 4 ++-- code/modules/client/preference/preferences.dm | 24 +++++++++---------- config/example/config.txt | 5 +++- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index f4e795f6c77..b0e3059ee6d 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -177,6 +177,8 @@ var/disable_lobby_music = 0 // Disables the lobby music var/disable_cid_warn_popup = 0 //disables the annoying "You have already logged in this round, disconnect or be banned" popup, because it annoys the shit out of me when testing. + var/max_loadout_points = 5 // How many points can be spent on extra items in character setup + /datum/configuration/New() var/list/L = subtypesof(/datum/game_mode) for (var/T in L) @@ -552,6 +554,9 @@ if("disable_cid_warn_popup") config.disable_cid_warn_popup = 1 + if("max_loadout_points") + config.max_loadout_points = text2num(value) + else diary << "Unknown setting in configuration: '[name]'" diff --git a/code/modules/client/preference/loadout/loadout_uniform.dm b/code/modules/client/preference/loadout/loadout_uniform.dm index d5916b8530c..826cc7d5838 100644 --- a/code/modules/client/preference/loadout/loadout_uniform.dm +++ b/code/modules/client/preference/loadout/loadout_uniform.dm @@ -5,9 +5,9 @@ sort_category = "Uniforms and Casual Dress" /datum/gear/uniform/skirt - display_name = "skirt" + subtype_path = /datum/gear/uniform/skirt -/datum/gear/uniform/skirt +/datum/gear/uniform/skirt/blue display_name = "plaid skirt, blue" path = /obj/item/clothing/under/dress/plaid_blue diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index a8ab1a2beaa..899f29ed2b5 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -63,7 +63,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts #define MAX_SAVE_SLOTS 20 // Save slots for regular players #define MAX_SAVE_SLOTS_MEMBER 20 // Save slots for BYOND members -#define MAX_GEAR_COST 5 +#define MAX_GEAR_COST config.max_loadout_points #define TAB_CHAR 0 #define TAB_GAME 1 @@ -435,9 +435,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts var/fcolor = "#3366CC" if(total_cost < MAX_GEAR_COST) fcolor = "#E67300" - dat += "" - dat += "" - dat += "
[total_cost]/[MAX_GEAR_COST] loadout points spent. \[Clear Loadout\]
" + dat += "" + dat += "" + dat += "" var/datum/loadout_category/LC = loadout_categories[gear_tab] - dat += "" - dat += "" - dat += "" + dat += "" + dat += "" + dat += "" for(var/gear_name in LC.gear) var/datum/gear/G = LC.gear[gear_name] var/ticked = (G.display_name in gear) dat += "" - dat += "" + dat += "" - dat += "" + dat += "" + dat += "" if(ticked) - . += "" diff --git a/config/example/config.txt b/config/example/config.txt index 1ed02a543d1..ca829933479 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -317,4 +317,7 @@ PLAYER_REROUTE_CAP 0 #DISABLE_LOBBY_MUSIC ## Uncomment this if you want to disable the popup alert for people on the same CID -#DISABLE_CID_WARN_POPUP \ No newline at end of file +#DISABLE_CID_WARN_POPUP + +## How many loadout points players may spend in character setup +#MAX_LOADOUT_POINTS 5 \ No newline at end of file
[total_cost]/[MAX_GEAR_COST] loadout points spent. \[Clear Loadout\]
" var/firstcat = 1 for(var/category in loadout_categories) @@ -452,22 +452,22 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts dat += "

[LC.category]


[LC.category]

[G.display_name][G.cost][G.cost]" if(G.allowed_roles) - dat += "Restrictions: " + dat += "Restrictions: " for(var/role in G.allowed_roles) dat += role + " " - dat += "[G.description]
[G.description]
" + . += "
" for(var/datum/gear_tweak/tweak in G.gear_tweaks) . += " [tweak.get_contents(get_tweak_metadata(G, tweak))]" . += "