diff --git a/src/uncategorized/buildingWidgets.tw b/src/uncategorized/buildingWidgets.tw index 142a33cbb30bc0b3591489d720193051ce0a8106..947f3c0e2e4bfb66ed13a481c1b8551c73a97510 100644 --- a/src/uncategorized/buildingWidgets.tw +++ b/src/uncategorized/buildingWidgets.tw @@ -19,87 +19,112 @@ Yes, I am aware this is horrible. If anyone can figure out how to get widgets to empty-cells: hide; width: 70%; } - th, td { - border: 0px; + + table.arcology td { + margin: 1px; + } + + table.arcology col { width: 8%; } - td#Empty { - border: 5px solid LightGray; - } - td#Private { - border: 5px solid Red; - } - td#Shops { - border: 5px solid Thistle; - } - td#FSShops { - border: 5px solid MediumPurple; - } - td#Brothel { - border: 5px solid Violet; - } - td#Club { - border: 5px solid Orchid; - } - td#Apartments { - border: 5px solid LimeGreen; - } - td#DenseApartments { - border: 5px solid SeaGreen; - } - td#LuxuryApartments { - border: 5px solid PaleGreen; - } - td#Markets { - border: 5px solid MediumOrchid; - } - td#CorporateMarket { - border: 5px solid Purple; - } - td#Arcade { - border: 5px solid DeepPink; - } - td#Pens { - border: 5px solid GoldenRod; - } - td#Pit { - border: 5px solid OrangeRed; - } - td#Manufacturing { - border: 5px solid SlateGray; - } - td#Sweatshops { - border: 5px solid Gray; - } - td#Barracks { - border: 5px solid OliveDrab; - } - td#Penthouse { - border: 5px solid Teal; - } - td#Dairy { - border: 5px solid White; - } + + table.arcology td { + border: 5px solid transparent; + } + + td#Empty { border-color: lightgray; } + td#Private { border-color: red; } + td#Shops { border-color: thistle; } + td#FSShops { border-color: mediumpurple; } + td#Brothel { border-color: violet; } + td#Club { border-color: orchid; } + td#Apartments { border-color: limegreen; } + td#DenseApartments { border-color: seagreen; } + td#LuxuryApartments { border-color: palegreen; } + td#Markets { border-color: mediumorchid; } + td#CorporateMarket { border-color: purple; } + td#Arcade { border-color: deeppink; } + td#Pens { border-color: goldenrod; } + td#Pit { border-color: orangered; } + td#Manufacturing { border-color: slategray; } + td#Sweatshops { border-color: gray; } + td#Barracks { border-color: olivedrab; } + td#Penthouse { border-color: teal; } + td#Dairy { border-color: white; } </style> +<<script>> +/* This code only runs once per page load */ +if(!Macro.has('sectorblock')) { + /* Usage: <<sectorblock sector index "other text (optional)">> */ + Macro.add('sectorblock', { + /* + * Add sector metadata here + * + * base: Which passage the sector link goes to if owned. Defaults to the sector type. Unowned go to "Private" + * name: The sector name. Defaults to the sector type, with spaces inserted in case of WordsLikeThis + * cls: The CSS id to use for styling if owned; else uses "Private" + * extra: Some (SugarCube-style) extra text to add after the link + */ + sectors: { + LuxuryApartments: { base: 'Apartments' }, + DenseApartments: { base: 'Apartments' }, + Club: { extra: ' ($clubSlaves/<<print $club>><<if $DJ>>, L<</if>>)' }, + Brothel: { extra: ' ($brothelSlaves/<<print $brothel>><<if $Madam>>,L<</if>>)' }, + CorporateMarket: { base: 'Corporate Market' }, + Pit: { extra: ' ($fighterIDs.length)'}, + Arcade: { extra: ' ($arcadeSlaves/<<print $arcade>>)'}, + Dairy: { extra: '<<set _SCapT9 = $bioreactorsXY+$bioreactorsXX+$bioreactorsHerm+$bioreactorsBarren>> ($dairySlaves<<if _SCapT9>>+_SCapT9<</if>>/<<print $dairy>><<if $Milkmaid>>,L<</if>>)' }, + /* speciality shop types */ + Subjugationist: { base: 'Shops', name: 'Subjugationist Shops', cls: 'FSShops' }, + Supremacist: { base: 'Shops', name: 'Supremacist Shops', cls: 'FSShops' }, + 'Gender Radicalist': { base: 'Shops', name: 'Gender Radicalist Shops', cls: 'FSShops' }, + 'Gender Fundamentalist': { base: 'Shops', name: 'Gender Fundamentalist Shops', cls: 'FSShops' }, + Paternalist: { base: 'Shops', name: 'Paternalist Shops', cls: 'FSShops' }, + Degradationist: { base: 'Shops', name: 'Degradationist Shops', cls: 'FSShops' }, + 'Body Purist': { base: 'Shops', name: 'Body Purist Shops', cls: 'FSShops' }, + 'Transformation Fetishist': { base: 'Shops', name: 'Transformation Fetishist Shops', cls: 'FSShops' }, + 'Youth Preferentialist': { base: 'Shops', name: 'Youth Preferentialist Shops', cls: 'FSShops' }, + 'Maturity Preferentialist': { base: 'Shops', name: 'Maturity Preferentialist Shops', cls: 'FSShops' }, + 'Slimness Enthusiast': { base: 'Shops', name: 'Slimness Enthusiast Shops', cls: 'FSShops' }, + 'Asset Expansionist': { base: 'Shops', name: 'Asset Expansionist Shops', cls: 'FSShops' }, + 'Pastoralist': { base: 'Shops', name: 'Pastoralist Shops', cls: 'FSShops' }, + 'Physical Idealist': { base: 'Shops', name: 'Physical Idealist Shops', cls: 'FSShops' }, + 'Chattel Religionist': { base: 'Shops', name: 'Chattel Religionist Shops', cls: 'FSShops' }, + 'Roman Revivalist': { base: 'Shops', name: 'Roman Revivalist Shops', cls: 'FSShops' }, + 'Aztec Revivalist': { base: 'Shops', name: 'Aztec Revivalist Shops', cls: 'FSShops' }, + 'Egyptian Revivalist': { base: 'Shops', name: 'Egyptian Revivalist Shops', cls: 'FSShops' }, + 'Edo Revivalist': { base: 'Shops', name: 'Edo Revivalist Shops', cls: 'FSShops' }, + 'Arabian Revivalist': { base: 'Shops', name: 'Arabian Revivalist Shops', cls: 'FSShops' }, + 'Chinese Revivalist': { base: 'Shops', name: 'Chinese Revivalist Shops', cls: 'FSShops' }, + 'Repopulationist': { base: 'Shops', name: 'Repopulationist Shops', cls: 'FSShops' }, + 'Eugenics': { base: 'Shops', name: 'Eugenics Shops', cls: 'FSShops' }, + 'Hedonism': { base: 'Shops', name: 'Hedonistic Shops', cls: 'FSShops' }, + }, + + handler() { + let sec = this.args[0]; + if(!sec || !sec.type) { + return; + } + let meta = this.self.sectors[sec.type] || {}; + let type = sec.ownership === 1 ? (meta.cls || sec.type) : 'Private'; + let basetype = sec.ownership === 1 ? (meta.base || sec.type) : 'Private'; + let name = meta.name || sec.type.replace(/([a-z])([A-Z])/g, '$1 $2'); + let text = + '<td colspan="2" id="' + type + '">' + + '[[' + name + '|' + basetype + '][$AS=' + this.args[1] + ']]' + + (meta.extra || '') + (this.args[2] || '') + + '</td>'; + new Wikifier(this.output, text); + }, + }); +} +<</script>> <center> -<table class="arcology" border="1"> - <tr> - <th></th> - <th></th> - <th></th> - <th></th> - <th></th> - <th></th> - <th></th> - <th></th> - <th></th> - <th></th> - </tr> +<table class="arcology"> <tr> /* Level 9, penthouse, sector 0 */ - <td></td> - <td></td> - <td></td> + <td colspan="3"></td> <td id="Penthouse" colspan="4"> <<link "Penthouse">><<set $nextButton = "Back", $nextLink = _Pass>><<goto "Manage Penthouse">><</link>> <<if $masterSuite||$servantsQuarters||$spa||$clinic||$schoolroom||$cellblock||$incubator||$HGSuite||$researchLab.built=="true">> @@ -115,265 +140,45 @@ Yes, I am aware this is horrible. If anyone can figure out how to get widgets to <<if $researchLab.built == "true">>[[Research Lab][$temp = 0]]<</if>> <</if>> </td> - <td></td> - <td></td> - <td></td> + <td colspan="3"></td> </tr> <<if $arcologyUpgrade.spire == 1>> <tr> /* Level 8, spire, sectors 1-2 */ - <td></td> - <td></td> - <td></td> - <<for _i = 1; _i <= 2; _i++>> - <<switch $sectors[_i].type>> - <<case "Apartments">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="Apartments"><<print "[[Apartments][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Apartments|Private][$AS="+_i+"]]">></td> - <</if>> - <<case "DenseApartments">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="DenseApartments"><<print "[[Dense Apartments|Apartments][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Dense Apartments|Private][$AS="+_i+"]]">></td> - <</if>> - <<case "LuxuryApartments">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="LuxuryApartments"><<print "[[Luxury Apartments|Apartments][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Luxury Apartments|Private][$AS="+_i+"]]">></td> - <</if>> - <<default>> - <<set $sectors[_i].type = "LuxuryApartments", $sectors[_i].ownership = 0>> - <td colspan="2" id="Private"><<print "[[Luxury Apartments|Private][$AS="+_i+"]]">></td> - <</switch>> - <</for>> + <td colspan="3"></td> + <<for _i = 1; _i <= 2; _i++>><<sectorblock $sectors[_i] _i>><</for>> + <td colspan="3"></td> </tr> <tr> /* Level 7, spire, sectors 3-4 */ - <td></td> - <td></td> - <td></td> - <<for _i = 3; _i <= 4; _i++>> - <<switch $sectors[_i].type>> - <<case "Apartments">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="Apartments"><<print "[[Apartments][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Apartments|Private][$AS="+_i+"]]">></td> - <</if>> - <<case "DenseApartments">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="DenseApartments"><<print "[[Dense Apartments|Apartments][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Dense Apartments|Private][$AS="+_i+"]]">></td> - <</if>> - <<case "LuxuryApartments">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="LuxuryApartments"><<print "[[Luxury Apartments|Apartments][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Luxury Apartments|Private][$AS="+_i+"]]">></td> - <</if>> - <<default>> - <<set $sectors[_i].type = "LuxuryApartments", $sectors[_i].ownership = 0>> - <td colspan="2" id="Private"><<print "[[Luxury Apartments|Private][$AS="+_i+"]]">></td> - <</switch>> - <</for>> + <td colspan="3"></td> + <<for _i = 3; _i <= 4; _i++>><<sectorblock $sectors[_i] _i>><</for>> + <td colspan="3"></td> </tr> <</if>> <tr> /* Level 6, promenade, sectors 5-7 */ - <td></td> - <td></td> - <<for _i = 5; _i <= 7; _i++>> - <<switch $sectors[_i].type>> - <<case "Club">> - <td colspan="2" id="Club"><<print "[[Club][$AS="+_i+"]]">> ($clubSlaves/<<print $club>><<if $DJ>>, L<</if>>)</td> - <<case "Brothel">> - <td colspan="2" id="Brothel"><<print "[[Brothel][$AS="+_i+"]]">> ($brothelSlaves/<<print $brothel>><<if $Madam>>,L<</if>>)</td> - <<case "Shops">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="Shops"><<print "[[Shops][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Shops|Private][$AS="+_i+"]]">></td> - <</if>> - <<case "Subjugationist">> - <td colspan="2" id="FSShops"><<print "[[Subjugationist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Supremacist">> - <td colspan="2" id="FSShops"><<print "[[Supremacist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Gender Radicalist">> - <td colspan="2" id="FSShops"><<print "[[Gender Radicalist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Gender Fundamentalist">> - <td colspan="2" id="FSShops"><<print "[[Gender Fundamentalist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Paternalist">> - <td colspan="2" id="FSShops"><<print "[[Paternalist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Degradationist">> - <td colspan="2" id="FSShops"><<print "[[Degradationist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Body Purist">> - <td colspan="2" id="FSShops"><<print "[[Body Purist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Transformation Fetishist">> - <td colspan="2" id="FSShops"><<print "[[Transformation Fetishist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Youth Preferentialist">> - <td colspan="2" id="FSShops"><<print "[[Youth Preferentialist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Maturity Preferentialist">> - <td colspan="2" id="FSShops"><<print "[[Maturity Preferentialist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Slimness Enthusiast">> - <td colspan="2" id="FSShops"><<print "[[Slimness Enthusiast Shops|Shops][$AS="+_i+"]]">></td> - <<case "Asset Expansionist">> - <td colspan="2" id="FSShops"><<print "[[Asset Expansionist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Pastoralist">> - <td colspan="2" id="FSShops"><<print "[[Pastoralist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Physical Idealist">> - <td colspan="2" id="FSShops"><<print "[[Physical Idealist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Chattel Religionist">> - <td colspan="2" id="FSShops"><<print "[[Chattel Religionist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Roman Revivalist">> - <td colspan="2" id="FSShops"><<print "[[Roman Revivalist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Aztec Revivalist">> - <td colspan="2" id="FSShops"><<print "[[Aztec Revivalist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Egyptian Revivalist">> - <td colspan="2" id="FSShops"><<print "[[Egyptian Revivalist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Edo Revivalist">> - <td colspan="2" id="FSShops"><<print "[[Edo Revivalist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Arabian Revivalist">> - <td colspan="2" id="FSShops"><<print "[[Arabian Revivalist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Chinese Revivalist">> - <td colspan="2" id="FSShops"><<print "[[Chinese Revivalist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Repopulationist">> - <td colspan="2" id="FSShops"><<print "[[Repopulationist Shops|Shops][$AS="+_i+"]]">></td> - <<case "Eugenics">> - <td colspan="2" id="FSShops"><<print "[[Eugenics Shops|Shops][$AS="+_i+"]]">></td> - <<case "Hedonism">> - <td colspan="2" id="FSShops"><<print "[[Hedonistic Shops|Shops][$AS="+_i+"]]">></td> - <<default>><td></td> - <</switch>> - <</for>> + <td colspan="2"></td> + <<for _i = 5; _i <= 7; _i++>><<sectorblock $sectors[_i] _i>><</for>> + <td colspan="2"></td> </tr> <tr> /* Level 5, apartments, sectors 8-11 */ <td></td> - <<for _i = 8; _i <= 11; _i++>> - <<switch $sectors[_i].type>> - <<case "Apartments">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="Apartments"><<print "[[Apartments][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Apartments|Private][$AS="+_i+"]]">></td> - <</if>> - <<case "DenseApartments">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="DenseApartments"><<print "[[Dense Apartments|Apartments][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Dense Apartments|Private][$AS="+_i+"]]">></td> - <</if>> - <<case "LuxuryApartments">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="LuxuryApartments"><<print "[[Luxury Apartments|Apartments][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Luxury Apartments|Private][$AS="+_i+"]]">></td> - <</if>> - <<default>><td></td> - <</switch>> - <</for>> + <<for _i = 8; _i <= 11; _i++>><<sectorblock $sectors[_i] _i>><</for>> + <td></td> </tr> <tr> /* Level 4, apartments, sectors 12-15 */ <td></td> - <<for _i = 12; _i <= 15; _i++>> - <<switch $sectors[_i].type>> - <<case "Apartments">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="Apartments"><<print "[[Apartments][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Apartments|Private][$AS="+_i+"]]">></td> - <</if>> - <<case "DenseApartments">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="DenseApartments"><<print "[[Dense Apartments|Apartments][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Dense Apartments|Private][$AS="+_i+"]]">></td> - <</if>> - <<case "LuxuryApartments">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="LuxuryApartments"><<print "[[Luxury Apartments|Apartments][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Luxury Apartments|Private][$AS="+_i+"]]">></td> - <</if>> - <<default>><td></td> - <</switch>> - <</for>> + <<for _i = 12; _i <= 15; _i++>><<sectorblock $sectors[_i] _i>><</for>> + <td></td> </tr> <tr> /* Level 3, apartments, sectors 16-19 */ <td></td> - <<for _i = 16; _i <= 19; _i++>> - <<switch $sectors[_i].type>> - <<case "Apartments">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="Apartments"><<print "[[Apartments][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Apartments|Private][$AS="+_i+"]]">></td> - <</if>> - <<case "DenseApartments">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="DenseApartments"><<print "[[Dense Apartments|Apartments][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Dense Apartments|Private][$AS="+_i+"]]">></td> - <</if>> - <<case "LuxuryApartments">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="LuxuryApartments"><<print "[[Luxury Apartments|Apartments][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Luxury Apartments|Private][$AS="+_i+"]]">></td> - <</if>> - <<default>><td></td> - <</switch>> - <</for>> + <<for _i = 16; _i <= 19; _i++>><<sectorblock $sectors[_i] _i>><</for>> + <td></td> </tr> <tr> /* Level 2, concourse, sectors 20-24 */ - <<for _i = 20; _i <= 24; _i++>> - <<switch $sectors[_i].type>> - <<case "Markets">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="Markets"><<print "[[Markets][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Markets|Private][$AS="+_i+"]]">></td> - <</if>> - <<case "CorporateMarket">> - <td colspan="2" id="CorporateMarket"><<print "[[Corporate Market][$AS="+_i+"]]">></td> - <<case "Pit">> - <td colspan="2" id="Pit"><<print "[[Pit][$AS="+_i+"]]">> ($fighterIDs.length)</td> - <<case "Arcade">> - <td colspan="2" id="Arcade"><<print "[[Arcade][$AS="+_i+"]]">> ($arcadeSlaves/<<print $arcade>>)</td> - <<default>><td></td> - <</switch>> - <</for>> + <<for _i = 20; _i <= 24; _i++>><<sectorblock $sectors[_i] _i>><</for>> </tr> <tr> /* Level 1, service area, sectors 25-29 */ - <<for _i = 25; _i <= 29; _i++>> - <<switch $sectors[_i].type>> - <<case "Manufacturing">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="Manufacturing"><<print "[[Manufacturing][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Manufacturing|Private][$AS="+_i+"]]">></td> - <</if>> - <<case "Sweatshops">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="Sweatshops"><<print "[[Sweatshops|Manufacturing][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Sweatshops|Private][$AS="+_i+"]]">></td> - <</if>> - <<case "Pens">> - <<if $sectors[_i].ownership == 1>> - <td colspan="2" id="Pens"><<print "[[Pens][$AS="+_i+"]]">></td> - <<else>> - <td colspan="2" id="Private"><<print "[[Pens|Private][$AS="+_i+"]]">></td> - <</if>> - <<case "Barracks">> - <td colspan="2" id="Barracks"><<print "[[Barracks][$AS="+_i+"]]">></td> - <<case "Dairy">> - <<set _SCapT9 = $bioreactorsXY+$bioreactorsXX+$bioreactorsHerm+$bioreactorsBarren>> - <td colspan="2" id="Dairy"><<print "[[Dairy][$AS="+_i+"]]">> ($dairySlaves<<if _SCapT9>>+_SCapT9<</if>>/<<print $dairy>><<if $Milkmaid>>,L<</if>>)</td> - <<default>><td></td> - <</switch>> - <</for>> + <<for _i = 25; _i <= 29; _i++>><<sectorblock $sectors[_i] _i>><</for>> </tr> </table> </center>