Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Stickersheets #20076

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/game/objects/items/sticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
28 changes: 22 additions & 6 deletions code/game/objects/items/weapons/storage/stickersheets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@
/obj/item/sticker
)

// List/Procs to list all stickers for custom stickersheet(similar to lunchbox code)
var/list/stickersheet_stickers_ = typesof(/obj/item/sticker)

/proc/stickersheet_stickers()
if(!(stickersheet_stickers_[stickersheet_stickers_[1]]))
stickersheet_stickers_ = init_sticketsheet_stickers(stickersheet_stickers_)
return stickersheet_stickers_

/proc/init_sticketsheet_stickers(var/list/stickers)
. = list()
for(var/sticker in stickers)
var/obj/O = sticker
.[initial(O.name)] = sticker

sortTim(., GLOBAL_PROC_REF(cmp_text_asc))

/obj/item/storage/stickersheet/goldstar
name = "gold star sticker sheet"
starts_with = list(
Expand All @@ -28,6 +44,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(
Expand All @@ -52,12 +74,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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 29 additions & 0 deletions code/modules/client/preference_setup/loadout/items/toy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,32 @@
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()
..()
gear_tweaks += new /datum/gear_tweak/contents/stickersheet(stickersheet_stickers(),stickersheet_stickers(),stickersheet_stickers(),stickersheet_stickers())

/// 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(metadata.len != valid_contents.len)
return
for(var/i = 1 to valid_contents.len)
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
new path(sheet)
new path(sheet)
new path(sheet)
59 changes: 59 additions & 0 deletions html/changelogs/Ben10083 - Custom_SSheets.yml
Original file line number Diff line number Diff line change
@@ -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)"
Loading