<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.hoodedhorse.com/Against_the_Storm/index.php?action=history&amp;feed=atom&amp;title=Module%3ACampbox</id>
	<title>Module:Campbox - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.hoodedhorse.com/Against_the_Storm/index.php?action=history&amp;feed=atom&amp;title=Module%3ACampbox"/>
	<link rel="alternate" type="text/html" href="https://wiki.hoodedhorse.com/Against_the_Storm/index.php?title=Module:Campbox&amp;action=history"/>
	<updated>2026-10-18T12:15:41Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.5</generator>
	<entry>
		<id>https://wiki.hoodedhorse.com/Against_the_Storm/index.php?title=Module:Campbox&amp;diff=3701&amp;oldid=prev</id>
		<title>76561197969631737: Adding quotes around the ID</title>
		<link rel="alternate" type="text/html" href="https://wiki.hoodedhorse.com/Against_the_Storm/index.php?title=Module:Campbox&amp;diff=3701&amp;oldid=prev"/>
		<updated>2023-11-28T02:10:15Z</updated>

		<summary type="html">&lt;p&gt;Adding quotes around the ID&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:10, 28 November 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l133&quot;&gt;Line 133:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 133:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		innerTable:tag(&amp;quot;tr&amp;quot;):css(Infobox.CSS_TR_BORDER_TOP):css(Infobox.CSS_TR_BORDER_BOT)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		innerTable:tag(&amp;quot;tr&amp;quot;):css(Infobox.CSS_TR_BORDER_TOP):css(Infobox.CSS_TR_BORDER_BOT)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;				  :tag(&amp;quot;th&amp;quot;):wikitext(Infobox.TITLE_ID):done()&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;				  :tag(&amp;quot;th&amp;quot;):wikitext(Infobox.TITLE_ID):done()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;				  :tag(&quot;td&quot;):wikitext(campID):done()&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;				  :tag(&quot;td&quot;):wikitext(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;\&#039;&quot; .. &lt;/ins&gt;campID &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.. &quot;\&#039;&quot;&lt;/ins&gt;):done()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;				  :done():newline()&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;				  :done():newline()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key ATS_:diff:1.41:old-3697:rev-3701:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>76561197969631737</name></author>
	</entry>
	<entry>
		<id>https://wiki.hoodedhorse.com/Against_the_Storm/index.php?title=Module:Campbox&amp;diff=3697&amp;oldid=prev</id>
		<title>76561197969631737: Created to display infoboxes on camp buildings&#039; pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.hoodedhorse.com/Against_the_Storm/index.php?title=Module:Campbox&amp;diff=3697&amp;oldid=prev"/>
		<updated>2023-11-28T02:04:17Z</updated>

		<summary type="html">&lt;p&gt;Created to display infoboxes on camp buildings&amp;#039; pages&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;---&lt;br /&gt;
--- Module to create an infobox for displaying on a camp&amp;#039;s wiki page.&lt;br /&gt;
---&lt;br /&gt;
--- Shows the facts from the data about the specified building in an easy-to-&lt;br /&gt;
--- read table, with a large icon, information, categories, and the flavor&lt;br /&gt;
--- text.&lt;br /&gt;
---&lt;br /&gt;
--- This should be invoked from Template:Campbox with the parameter of the&lt;br /&gt;
--- building whose infobox should be shown. See the template documentation for&lt;br /&gt;
--- more information about parameters and errors and to see examples.&lt;br /&gt;
---&lt;br /&gt;
--- @module Campbox&lt;br /&gt;
local Campbox = {}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local Infobox = require(&amp;quot;Module:Infobox&amp;quot;)&lt;br /&gt;
local CampsData = require(&amp;quot;Module:CampsData&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--region Private constants&lt;br /&gt;
&lt;br /&gt;
local ARG_NAME = &amp;quot;name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
-- Subheading for all the buildings from this template.&lt;br /&gt;
local BUILDING_CATEGORY = &amp;quot;Gathering Camp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
local NBSP = &amp;quot;&amp;amp;nbsp;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
--endregion&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--region Private methods&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
--- Builds using the provided wikiInfobox a subtable to lay out headers and&lt;br /&gt;
--- fields.&lt;br /&gt;
---&lt;br /&gt;
---@param wikiInfobox table mw.html object into which we&amp;#039;re building this&lt;br /&gt;
---@param campName string the name of the camp the infobox is about&lt;br /&gt;
---@return table the Mediawiki html object into which we&amp;#039;ve been adding things&lt;br /&gt;
local function makeInnerTable(wikiInfobox, campName)&lt;br /&gt;
&lt;br /&gt;
	-- Grab the data we&amp;#039;ll use to populate this.&lt;br /&gt;
	local campID = CampsData.getCampID(campName)&lt;br /&gt;
	local campCategory = CampsData.getCampCategory(campName)&lt;br /&gt;
	local campSizeX, campSizeY = CampsData.getCampSize(campName)&lt;br /&gt;
	local campIsMovable = CampsData.isCampMovable(campName)&lt;br /&gt;
	local campIsEssential = CampsData.isCampInitiallyEssential(campName)&lt;br /&gt;
	local campStorageCap = CampsData.getCampStorage(campName)&lt;br /&gt;
	local campArea = CampsData.getCampArea(campName)&lt;br /&gt;
	local campConstructionTime = CampsData.getCampConstructionTime(campName)&lt;br /&gt;
	local campWorkplaces = CampsData.getCampNumberOfWorkplaces(campName)&lt;br /&gt;
	local campRequiredGoods = CampsData.getAllCampRequiredGoods(campName)&lt;br /&gt;
	local campRecipesTable = CampsData.getAllCampRecipes(campName)&lt;br /&gt;
&lt;br /&gt;
	-- Start the inner table&lt;br /&gt;
	local innerTable = wikiInfobox:tag(&amp;quot;tr&amp;quot;):tag(&amp;quot;td&amp;quot;):newline():tag(&amp;quot;table&amp;quot;):css(Infobox.CSS_INNER_TABLE)&lt;br /&gt;
	innerTable:newline()&lt;br /&gt;
&lt;br /&gt;
	-- Additional parameters would go here.&lt;br /&gt;
&lt;br /&gt;
	-- Construction toolbar category.&lt;br /&gt;
	if campCategory then&lt;br /&gt;
&lt;br /&gt;
		local categoryIconFilename = Infobox.ICON_FILENAMES_CATEGORIES[campCategory]&lt;br /&gt;
		if categoryIconFilename ~= nil then&lt;br /&gt;
			local categoryIconPart = &amp;quot;[[File:&amp;quot; .. categoryIconFilename .. &amp;quot;|&amp;quot; .. Infobox.ICONSIZE_MED .. &amp;quot;|alt=&amp;quot; .. campCategory .. &amp;quot;]]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
			Infobox.buildStandardRow(innerTable, Infobox.CSS_TR_BORDER_TOP,&lt;br /&gt;
					Infobox.TITLE_CATEGORY, categoryIconPart .. NBSP .. campCategory)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Expand recipes into a small table&lt;br /&gt;
	if campRecipesTable and #campRecipesTable &amp;gt; 0 then&lt;br /&gt;
&lt;br /&gt;
		local recipesRows = mw.getCurrentFrame():expandTemplate{ title=&amp;quot;Recipe&amp;quot;, args={&lt;br /&gt;
			building= campName, display=&amp;quot;list&amp;quot;	} }&lt;br /&gt;
&lt;br /&gt;
		Infobox.buildStandardRow(innerTable, Infobox.CSS_TR_BORDER_BOT,&lt;br /&gt;
				Infobox.TITLE_RECIPES, recipesRows)&lt;br /&gt;
	end&lt;br /&gt;
	-- Since false is a valid value, have to directly check if it&amp;#039;s nil.&lt;br /&gt;
	if campIsMovable ~= nil then&lt;br /&gt;
&lt;br /&gt;
		Infobox.buildStandardRow(innerTable, Infobox.CSS_TR_BORDER_TOP,&lt;br /&gt;
				Infobox.TITLE_MOVABLE, campIsMovable and &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
	if campIsEssential ~= nil then&lt;br /&gt;
&lt;br /&gt;
		Infobox.buildStandardRow(innerTable, Infobox.CSS_TR_BORDER_BOT,&lt;br /&gt;
				Infobox.TITLE_ESSENTIAL, campIsEssential and &amp;quot;Yes&amp;quot; or &amp;quot;No&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
	-- Combine sizes into one line&lt;br /&gt;
	if campSizeX ~= nil and campSizeY ~= nil then&lt;br /&gt;
&lt;br /&gt;
		Infobox.buildStandardRow(innerTable, Infobox.CSS_TR_BORDER_TOP,&lt;br /&gt;
				Infobox.TITLE_SIZE, campSizeX .. &amp;quot; × &amp;quot; .. campSizeY)&lt;br /&gt;
	end&lt;br /&gt;
	if campArea then&lt;br /&gt;
&lt;br /&gt;
		Infobox.buildStandardRow(innerTable, &amp;quot;&amp;quot;,&lt;br /&gt;
				Infobox.TITLE_GATHERING_AREA, campArea)&lt;br /&gt;
	end&lt;br /&gt;
	if campStorageCap then&lt;br /&gt;
&lt;br /&gt;
		Infobox.buildStandardRow(innerTable, &amp;quot;&amp;quot;,&lt;br /&gt;
				Infobox.TITLE_STORAGE_CAPACITY, campStorageCap)&lt;br /&gt;
	end&lt;br /&gt;
	if campWorkplaces then&lt;br /&gt;
&lt;br /&gt;
		Infobox.buildStandardRow(innerTable, Infobox.CSS_TR_BORDER_BOT,&lt;br /&gt;
				Infobox.TITLE_WORKPLACES, campWorkplaces)&lt;br /&gt;
	end&lt;br /&gt;
	if campConstructionTime then&lt;br /&gt;
&lt;br /&gt;
		Infobox.buildStandardRow(innerTable, Infobox.CSS_TR_BORDER_TOP,&lt;br /&gt;
				Infobox.TITLE_CONSTRUCTION_TIME, campConstructionTime)&lt;br /&gt;
	end&lt;br /&gt;
	-- Need to build a separate table to display building materials&lt;br /&gt;
	if campRequiredGoods then&lt;br /&gt;
&lt;br /&gt;
		local requiredGoodsRows = tostring( Infobox.writeRequiredGoodsRows(campRequiredGoods) )&lt;br /&gt;
&lt;br /&gt;
		Infobox.buildStandardRow(innerTable, Infobox.CSS_TR_BORDER_BOT,&lt;br /&gt;
				Infobox.TITLE_CONSTRUCTION_COST, requiredGoodsRows)&lt;br /&gt;
&lt;br /&gt;
		innerTable:tag(&amp;quot;tr&amp;quot;):css(Infobox.CSS_TR_BORDER_BOT)&lt;br /&gt;
	end&lt;br /&gt;
	if campID then&lt;br /&gt;
		innerTable:tag(&amp;quot;tr&amp;quot;):css(Infobox.CSS_TR_BORDER_TOP):css(Infobox.CSS_TR_BORDER_BOT)&lt;br /&gt;
				  :tag(&amp;quot;th&amp;quot;):wikitext(Infobox.TITLE_ID):done()&lt;br /&gt;
				  :tag(&amp;quot;td&amp;quot;):wikitext(campID):done()&lt;br /&gt;
				  :done():newline()&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Close the table.&lt;br /&gt;
	innerTable:done():newline()&lt;br /&gt;
	-- Close the table cell and row the inner table is in.&lt;br /&gt;
	wikiInfobox:done():done():newline()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--endregion&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--region Public methods&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
-- Creates an html table to display the data in a floating box.&lt;br /&gt;
--&lt;br /&gt;
-- @param frame the template&amp;#039;s calling context&lt;br /&gt;
-- @return wiki markup for the box&lt;br /&gt;
function Campbox.renderCampbox(frame)&lt;br /&gt;
	&lt;br /&gt;
	-- Every camp must have a name.&lt;br /&gt;
	local campName = frame.args[ARG_NAME]&lt;br /&gt;
	if not campName or campName == &amp;quot;&amp;quot; then&lt;br /&gt;
		return &amp;quot;You must specify the name of the camp. See [[Template:Campbox]] for examples.&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Use this method here to check to see whether the provided name is valid.&lt;br /&gt;
	if not CampsData.getAllDataForCamp(campName) then&lt;br /&gt;
		return &amp;quot;Campbox can&amp;#039;t find the specified camp: &amp;quot; .. campName .. &amp;quot;.&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Additional template parameters would go here.&lt;br /&gt;
&lt;br /&gt;
	-- Get the data to display.&lt;br /&gt;
	local campDescription = CampsData.getCampDescription(campName)&lt;br /&gt;
	local campIconFilename = CampsData.getCampIcon(campName)&lt;br /&gt;
&lt;br /&gt;
	-- Make the top of the infobox that every one has...&lt;br /&gt;
	local wikiInfobox = mw.html.create(&amp;quot;table&amp;quot;):css(Infobox.CSS_MAIN):newline()&lt;br /&gt;
	-- with a title...&lt;br /&gt;
	wikiInfobox:tag(&amp;quot;tr&amp;quot;)&lt;br /&gt;
			   :tag(&amp;quot;th&amp;quot;):wikitext(campName):done()&lt;br /&gt;
			   :done():newline()&lt;br /&gt;
	-- and a subtitle, showing the functional category...&lt;br /&gt;
	wikiInfobox:tag(&amp;quot;tr&amp;quot;)&lt;br /&gt;
			:tag(&amp;quot;td&amp;quot;):wikitext(BUILDING_CATEGORY):done()&lt;br /&gt;
		:done():newline()&lt;br /&gt;
	-- and a large icon.&lt;br /&gt;
	if campIconFilename then&lt;br /&gt;
		wikiInfobox:tag(&amp;quot;tr&amp;quot;)&lt;br /&gt;
				   :tag(&amp;quot;td&amp;quot;):wikitext(&amp;quot;[[File:&amp;quot; .. campIconFilename .. &amp;quot;]]&amp;quot;):done()&lt;br /&gt;
				   :done():newline()&lt;br /&gt;
		wikiInfobox:tag(&amp;quot;tr&amp;quot;):css(Infobox.CSS_TR_BORDER_BOT)&lt;br /&gt;
				   :tag(&amp;quot;td&amp;quot;):wikitext(campName .. &amp;quot;, as seen in-game&amp;quot;):done()&lt;br /&gt;
				   :done():newline()&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	makeInnerTable(wikiInfobox, campName)&lt;br /&gt;
&lt;br /&gt;
	-- Finish with the flavor text.&lt;br /&gt;
	if campDescription then&lt;br /&gt;
		wikiInfobox:tag(&amp;quot;tr&amp;quot;):css(Infobox.CSS_TR_BORDER_TOP)&lt;br /&gt;
				   :tag(&amp;quot;td&amp;quot;):wikitext(campDescription):done()&lt;br /&gt;
				   :done():newline()&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return wikiInfobox&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--endregion&lt;br /&gt;
&lt;br /&gt;
return Campbox&lt;/div&gt;</summary>
		<author><name>76561197969631737</name></author>
	</entry>
</feed>