diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 76c3a68d5a2..a5a59b3fc63 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -80,6 +80,7 @@ var/list/gamemode_cache = list() var/cult_ghostwriter_req_cultists = 10 //...so long as this many cultists are active. var/character_slots = 10 // The number of available character slots + var/loadout_slots = 3 // The number of loadout slots per character var/max_maint_drones = 5 //This many drones can spawn, var/allow_drone_spawn = 1 //assuming the admin allow them to. @@ -724,6 +725,9 @@ var/list/gamemode_cache = list() if("character_slots") config.character_slots = text2num(value) + if("loadout_slots") + config.loadout_slots = text2num(value) + if("allow_drone_spawn") config.allow_drone_spawn = text2num(value) diff --git a/code/modules/client/preference_setup/loadout/loadout.dm b/code/modules/client/preference_setup/loadout/loadout.dm index 2b39286a3a3..ad47420537b 100644 --- a/code/modules/client/preference_setup/loadout/loadout.dm +++ b/code/modules/client/preference_setup/loadout/loadout.dm @@ -247,11 +247,15 @@ var/list/gear_datums = list() //If we're moving up a slot.. if(href_list["next_slot"]) //change the current slot number - pref.gear_slot = ((pref.gear_slot+1) % 3) + 1 + pref.gear_slot = pref.gear_slot+1 + if(pref.gear_slot > config.loadout_slots) + pref.gear_slot = 1 //If we're moving down a slot.. else if(href_list["prev_slot"]) //change current slot one down - pref.gear_slot = ((pref.gear_slot-1) % 3) + 1 + pref.gear_slot = pref.gear_slot-1 + if(pref.gear_slot < 1) + pref.gear_slot = config.loadout_slots // Set the currently selected gear to whatever's in the new slot if(pref.gear_list["[pref.gear_slot]"]) pref.gear = pref.gear_list["[pref.gear_slot]"] diff --git a/config/example/config.txt b/config/example/config.txt index bd3f8787e10..244931672fb 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -341,6 +341,8 @@ REQ_CULT_GHOSTWRITER 6 ## Sets the number of available character slots CHARACTER_SLOTS 10 +## Sets the number of available loadout slots +LOADOUT_SLOTS 3 ## Expected round length in minutes EXPECTED_ROUND_LENGTH 180 diff --git a/html/changelogs/wezzy_loadoutbutton_fixes.yml b/html/changelogs/wezzy_loadoutbutton_fixes.yml new file mode 100644 index 00000000000..2a99ffb4eed --- /dev/null +++ b/html/changelogs/wezzy_loadoutbutton_fixes.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: Wowzewow (Wezzy) + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Fixes loadout slot buttons not working properly."