diff --git a/code/modules/client/preference_setup/loadout/items/factions.dm b/code/modules/client/preference_setup/loadout/items/factions.dm index 6ec19c86979..fc2985c9431 100644 --- a/code/modules/client/preference_setup/loadout/items/factions.dm +++ b/code/modules/client/preference_setup/loadout/items/factions.dm @@ -919,7 +919,7 @@ GLOBAL_DATUM_INIT(gear_tweak_modsuit_configuration, /datum/gear_tweak/modsuit_co /datum/gear/faction/scc_notepad display_name = "SCC notepad" description = "A notepad for jotting down notes in corporate meetings. This one is navy blue with a gold SCC logo on the front." - path = /obj/item/journal/notepad/scc + path = /obj/item/journal/notepad/scc/filled sort_category = "Factions" cost = 1 faction = null diff --git a/code/modules/client/preference_setup/loadout/items/utility.dm b/code/modules/client/preference_setup/loadout/items/utility.dm index 8990974003d..1c9916398d7 100644 --- a/code/modules/client/preference_setup/loadout/items/utility.dm +++ b/code/modules/client/preference_setup/loadout/items/utility.dm @@ -46,13 +46,13 @@ /datum/gear/utility/journal display_name = "journal" description = "A journal, kind of like a folder, but bigger! And personal." - path = /obj/item/journal + path = /obj/item/journal/filled flags = GEAR_HAS_NAME_SELECTION | GEAR_HAS_DESC_SELECTION | GEAR_HAS_COLOR_SELECTION /datum/gear/utility/notepad display_name = "notepad" description = "A notepad for jotting down notes in meetings or interrogations." - path = /obj/item/journal/notepad + path = /obj/item/journal/notepad/filled flags = GEAR_HAS_NAME_SELECTION | GEAR_HAS_DESC_SELECTION | GEAR_HAS_COLOR_SELECTION /datum/gear/utility/fountainpen diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm index 2a9f8d2b2a7..b0cee1ab7e7 100644 --- a/code/modules/customitems/item_defines.dm +++ b/code/modules/customitems/item_defines.dm @@ -2051,6 +2051,13 @@ All custom items with worn sprites must follow the contained sprite system: http item_state = "kath_journal" color = null +/obj/item/journal/fluff/kathira/Initialize() + . = ..() + var/obj/item/folder/embedded/E = generate_index("Journal") + for(var/i = 1 to 5) + new /obj/item/paper(E) + update_icon() + /obj/item/organ/internal/augment/fluff/kath_legbrace // Leg Support Augment - Kathira El-Hashem - thegreywolf name = "leg support augment" desc = "A leg augment to aid in the mobility of an otherwise disabled leg." diff --git a/code/modules/paperwork/folders.dm b/code/modules/paperwork/folders.dm index 87e1d0c8716..54dd9472a6a 100644 --- a/code/modules/paperwork/folders.dm +++ b/code/modules/paperwork/folders.dm @@ -153,6 +153,11 @@ if(!length(contents)) qdel(src) +/obj/item/folder/embedded/Destroy() + for(var/x in src) + qdel(x) + . = ..() + /obj/item/folder/envelope name = "envelope" desc = "A thick envelope. You can't see what's inside." diff --git a/code/modules/paperwork/journal.dm b/code/modules/paperwork/journal.dm index c6d7d7307ef..58eb33949ef 100644 --- a/code/modules/paperwork/journal.dm +++ b/code/modules/paperwork/journal.dm @@ -25,8 +25,10 @@ . += "While the journal is open, use it in hand or use a pen on it to access the contents." /obj/item/journal/Destroy() - for(var/obj/item/folder/embedded/E as anything in indices) - qdel(E) + if (indices) + for(var/E in indices) + qdel(indices[E]) + LAZYCLEARLIST(indices) return ..() /obj/item/journal/update_icon() @@ -70,20 +72,7 @@ if(!open) to_chat(user, SPAN_WARNING("You can't put anything into \the [src] while it's closed.")) return - var/obj/item/folder/embedded/E - var/list/options = LAZYLEN(indices) ? indices + "New Index" : list("New Index") - var/selected_folder = tgui_input_list(user, "Select an index to insert this into.", "Index Selection", options) - if(isnull(selected_folder)) - return - if(selected_folder == "New Index") - E = generate_index(user) - else - E = indices[selected_folder] - if(!E) - return - user.drop_from_inventory(attacking_item, E) - to_chat(user, SPAN_NOTICE("You put \the [attacking_item] into \the [E] index in \the [src].")) - update_icon() + insert_item(attacking_item, user) return if(attacking_item.ispen()) if(!open) @@ -93,9 +82,27 @@ return attack_self(user) -/obj/item/journal/proc/generate_index(var/mob/user) +/obj/item/journal/proc/insert_item(obj/item/attacking_item, mob/user, var/selected_folder) + var/obj/item/folder/embedded/E + if(isnull(selected_folder)) + var/list/options = LAZYLEN(indices) ? indices + "New Index" : list("New Index") + selected_folder = tgui_input_list(user, "Select an index to insert this into.", "Index Selection", options) + if(isnull(selected_folder)) + return + if(selected_folder == "New Index") + var/index_name = sanitize(input(user, "Enter the index' name.", "Index Name") as text|null) + E = generate_index(index_name) + else + E = indices[selected_folder] + if(!E) + return + + user.drop_from_inventory(attacking_item, E) + to_chat(user, SPAN_NOTICE("You put \the [attacking_item] into \the [E] index in \the [src].")) + update_icon() + +/obj/item/journal/proc/generate_index(var/index_name) var/obj/item/folder/embedded/E = new /obj/item/folder/embedded(src) - var/index_name = sanitize(input(user, "Enter the index' name.", "Index Name") as text|null) if(!index_name) qdel(E) return null @@ -110,6 +117,15 @@ LAZYREMOVE(indices, E.name) update_icon() +/obj/item/journal/filled + +/obj/item/journal/filled/Initialize() + . = ..() + var/obj/item/folder/embedded/E = generate_index("Journal") + for(var/i = 1 to 5) + new /obj/item/paper(E) + update_icon() + /obj/item/journal/notepad name = "notepad" desc = "A notepad for jotting down notes in meetings or interrogations." @@ -141,9 +157,27 @@ if(closed_desc) desc = open ? initial(desc) + closed_desc : initial(desc) +/obj/item/journal/notepad/filled + +/obj/item/journal/notepad/filled/Initialize() + . = ..() + var/obj/item/folder/embedded/E = generate_index("Notepad") + for(var/i = 1 to 5) + new /obj/item/paper(E) + update_icon() + /obj/item/journal/notepad/scc name = "scc notepad" desc = "A notepad for jotting down notes in corporate meetings. This one is navy blue with a gold SCC logo on the front." icon_state = "notepad_scc" item_state = "notepad_scc" color = COLOR_WHITE + +/obj/item/journal/notepad/scc/filled + +/obj/item/journal/notepad/scc/filled/Initialize() + . = ..() + var/obj/item/folder/embedded/E = generate_index("Notepad") + for(var/i = 1 to 5) + new /obj/item/paper(E) + update_icon() diff --git a/html/changelogs/JournalPaper.yml b/html/changelogs/JournalPaper.yml new file mode 100644 index 00000000000..f424aa67227 --- /dev/null +++ b/html/changelogs/JournalPaper.yml @@ -0,0 +1,6 @@ +author: TheGreyWolf + +delete-after: True + +changes: + - rscadd: "Journals and notepads in the loadout now spawns with 5 blank pieces of paper."