-
Notifications
You must be signed in to change notification settings - Fork 581
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# About the pull request Adds autowiki for requisition crates # Explain why it's good for the game Less need for manual additions to the wiki. # Testing Photographs and Procedure Not Applicable # Changelog :cl: qol: Added auto wiki for requisitions. /:cl: --------- Co-authored-by: harryob <[email protected]> Co-authored-by: harryob <[email protected]>
- Loading branch information
1 parent
a04b081
commit 12bc03d
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/datum/autowiki/supply_packs | ||
generate_multiple = TRUE | ||
page = "Template:Autowiki/Content/SupplyPacks" | ||
|
||
|
||
/datum/autowiki/supply_packs/generate_multiple() | ||
|
||
var/output = list() | ||
|
||
//Gets the subtypes of all supply_packs | ||
for(var/typepath in subtypesof(/datum/supply_packs)) | ||
var/datum/supply_packs/my_pack = GLOB.supply_packs_datums[typepath] | ||
|
||
|
||
var/list/contents = list() | ||
for(var/obj/contents_type in my_pack.contains) | ||
//So long as there is something in the contaienr it will add it to the list | ||
if(!length(my_pack.contains)) | ||
return | ||
contents += contents_type::name | ||
|
||
var/obj/structure/closet/crate/container_typepath = my_pack.containertype | ||
var/container_filename = container_typepath ? SANITIZE_FILENAME(escape_value(format_text("[container_typepath::icon]-[container_typepath::icon_state]"))) : null | ||
if(container_filename && !fexists("data/autowiki_files/[container_filename].png")) | ||
var/obj/structure/closet/crate/generating_crate = new my_pack.containertype | ||
upload_icon(getFlatIcon(generating_crate, no_anim = TRUE), container_filename) | ||
|
||
var/page_name = SANITIZE_FILENAME(replacetext(strip_improper(my_pack.name), " ", "_")) | ||
var/to_add = list(title = "Template:Autowiki/Content/SupplyPack/[page_name]", text = include_template("Autowiki/SupplyPack",list( | ||
"icon" = container_filename, | ||
"name" = my_pack.name, | ||
"cost" = my_pack.cost, | ||
"contents" = contents.Join(", ") | ||
) | ||
)) | ||
output += list(to_add) | ||
|
||
return output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters