From c0167b6bdb2c57f87752bed3b5ead63b5ed6854f Mon Sep 17 00:00:00 2001 From: Ben <91219575+Ben10083@users.noreply.github.com> Date: Tue, 5 Nov 2024 13:28:39 -0500 Subject: [PATCH] Custom Stickersheets (#20076) Adds custom stickersheets (you pick 4 stickers in loadout, each selection adds 3 stickers) 'None' and "Random' are now at the top of TGUI lists for content gear tweaks for QoL ![image](https://github.com/user-attachments/assets/41340b7f-9f45-4657-adf0-f704c5c51b75) --------- Co-authored-by: Ben10083 --- code/game/objects/items/sticker.dm | 2 +- .../items/weapons/storage/stickersheets.dm | 12 ++-- .../preference_setup/loadout/gear_tweaks.dm | 2 +- .../preference_setup/loadout/items/toy.dm | 33 +++++++++++ html/changelogs/Ben10083 - Custom_SSheets.yml | 59 +++++++++++++++++++ 5 files changed, 100 insertions(+), 8 deletions(-) create mode 100644 html/changelogs/Ben10083 - Custom_SSheets.yml diff --git a/code/game/objects/items/sticker.dm b/code/game/objects/items/sticker.dm index 6bb5ec5727c..12fadcde205 100644 --- a/code/game/objects/items/sticker.dm +++ b/code/game/objects/items/sticker.dm @@ -352,7 +352,7 @@ icon_state = "scarabpole" /obj/item/sticker/flagpole/coalition/xanu - name = "all xanu repiblic flag sticker" + name = "all xanu republic flag sticker" desc = "The flag of the All Xanu-Republic on a flagpole." icon_state = "xanupole" diff --git a/code/game/objects/items/weapons/storage/stickersheets.dm b/code/game/objects/items/weapons/storage/stickersheets.dm index 239db756afc..407b8bf9524 100644 --- a/code/game/objects/items/weapons/storage/stickersheets.dm +++ b/code/game/objects/items/weapons/storage/stickersheets.dm @@ -28,6 +28,12 @@ /obj/item/sticker/generic/googly_eye = 12 ) +/obj/item/storage/stickersheet/domadice + name = "domadice sticker sheet" + starts_with = list( + /obj/item/sticker/generic/domadice = 12 + ) + /obj/item/storage/stickersheet/generic name = "generic sticker sheet" starts_with = list( @@ -52,12 +58,6 @@ /obj/item/sticker/religious/trinary = 2 ) -/obj/item/storage/stickersheet/domadice - name = "domadice sticker sheet" - starts_with = list( - /obj/item/sticker/generic/domadice = 12 - ) - /obj/item/storage/stickersheet/biesel name = "republic of biesel sticker sheet" starts_with = list( diff --git a/code/modules/client/preference_setup/loadout/gear_tweaks.dm b/code/modules/client/preference_setup/loadout/gear_tweaks.dm index 55e50b6a6d3..287919bb660 100644 --- a/code/modules/client/preference_setup/loadout/gear_tweaks.dm +++ b/code/modules/client/preference_setup/loadout/gear_tweaks.dm @@ -192,7 +192,7 @@ Content adjustment for(var/i = metadata.len to (valid_contents.len - 1)) metadata += "Random" for(var/i = 1 to valid_contents.len) - var/entry = tgui_input_list(user, "Choose an entry.", "Character Preference", (valid_contents[i] + list("Random", "None")), metadata[i]) + var/entry = tgui_input_list(user, "Choose an entry.", "Character Preference", (list("None", "Random") + valid_contents[i]), metadata[i]) if(entry) . += entry else diff --git a/code/modules/client/preference_setup/loadout/items/toy.dm b/code/modules/client/preference_setup/loadout/items/toy.dm index fa3b57695bc..1f008c06985 100644 --- a/code/modules/client/preference_setup/loadout/items/toy.dm +++ b/code/modules/client/preference_setup/loadout/items/toy.dm @@ -144,3 +144,36 @@ stickersheet["Uueoa-Esa sticker sheet"] = /obj/item/storage/stickersheet/hegemony stickersheet["Anti-Establishment sticker sheet"] = /obj/item/storage/stickersheet/resistance gear_tweaks += new /datum/gear_tweak/path(stickersheet) + +/datum/gear/toy/stickersheet_custom + display_name = "sticker sheet (custom)" + description = "A sticker sheet that can hold a variety of stickers." + cost = 1 + path = /obj/item/storage/stickersheet + +/datum/gear/toy/stickersheet_custom/New() + ..() + var/list/stickersheet = list() + + for(var/sticker as anything in subtypesof(/obj/item/sticker)) + var/obj/O = sticker + stickersheet[initial(O.name)] = sticker + gear_tweaks += new /datum/gear_tweak/contents/stickersheet(stickersheet,stickersheet,stickersheet,stickersheet) + +// Same as contents/tweak_item except it adds 3 of each item into the stickersheet (4 * 3 = 12) +/datum/gear_tweak/contents/stickersheet/tweak_item(var/obj/item/storage/stickersheet/sheet, var/list/metadata, var/mob/living/carbon/human/H) + if(length(metadata) != length(valid_contents)) + return + for(var/i = 1 to length(valid_contents)) + var/path + var/list/contents = valid_contents[i] + if(metadata[i] == "Random") + path = pick(contents) + path = contents[path] + else if(metadata[i] == "None") + continue + else + path = contents[metadata[i]] + if(path) // repeat 3 times for each item + for(i = 0, i < 3, ++i) + new path(sheet) diff --git a/html/changelogs/Ben10083 - Custom_SSheets.yml b/html/changelogs/Ben10083 - Custom_SSheets.yml new file mode 100644 index 00000000000..9baa5cee5a3 --- /dev/null +++ b/html/changelogs/Ben10083 - Custom_SSheets.yml @@ -0,0 +1,59 @@ +################################ +# 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 +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: Ben10083 + +# 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, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Custom stickersheets added to loadout. Select 4 stickers which is put into the sheet (each selection provides 3)." + - qol: "Random and None options now appear first in content lists (like lunchboxes)"