Skip to content
Snippets Groups Projects
Commit d3a7de24 authored by x's avatar x
Browse files

code moving

parent 0cc04a7b
No related branches found
No related tags found
No related merge requests found
:: PenthouseNaming [script]
window.MS = function() {
const V = State.variables;
var name = "";
if (V.masterSuiteNameCaps === "The Master Suite")
name = "Master Suite"
else
name = V.masterSuiteNameCaps;
return `<<link "${name}""Master Suite">><</link>> `}
window.HS = function() {
const V = State.variables;
var name = "";
if (V.HGSuiteNameCaps === "The Head Girl Suite")
name = "Head Girl Suite"
else
name = V.HGSuiteNameCaps;
return `<<link "${name}""Head Girl Suite">><</link>> `}
window.SQ = function() {
const V = State.variables;
var name = "";
if (V.servantsQuartersNameCaps === "The Servants' Quarters")
name = "Servants' Quarters"
else
name = V.servantsQuartersNameCaps;
return `<<link "${name}""Servants' Quarters">><</link>> `}
window.S = function() {
const V = State.variables;
var name = "";
if (V.spaNameCaps === "The Spa")
name = "Spa"
else
name = V.spaNameCaps;
return `<<link "${name}""Spa">><</link>> `}
window.CI = function() {
const V = State.variables;
var name = "";
if (V.clinicNameCaps === "The Clinic")
name = "Clinic"
else
name = V.clinicNameCaps;
return `<<link "${name}""Clinic">><</link>> `}
window.SC = function() {
const V = State.variables;
var name = "";
if (V.schoolroomNameCaps === "The Schoolroom")
name = "Schoolroom"
else
name = V.schoolroomNameCaps;
return `<<link "${name}""Schoolroom">><</link>> `}
window.CB = function() {
const V = State.variables;
var name = "";
if (V.cellblockNameCaps === "The Cellblock")
name = "Cellblock"
else
name = V.cellblockNameCaps;
return `<<link "${name}""Cellblock">><</link>> `}
window.I = function() {
const V = State.variables;
var name = "";
if (V.incubatorNameCaps === "The Incubator")
name = "Incubator"
else
name = V.incubatorNameCaps;
return `<<link "${name}""Incubator">><</link>> `}
...@@ -2,69 +2,3 @@ ...@@ -2,69 +2,3 @@
/*! <<checkvars>> macro for SugarCube 2.x */ /*! <<checkvars>> macro for SugarCube 2.x */
!function(){"use strict";if("undefined"==typeof version||"undefined"==typeof version.title||"SugarCube"!==version.title||"undefined"==typeof version.major||version.major<2)throw new Error("<<checkvars>> macro requires SugarCube 2.0 or greater, aborting load");Macro.add("checkvars",{handler:function(){function toString(value,indent){var baseType=typeof value;switch(baseType){case"number":return isNaN(value)?"NaN":isFinite(value)?String(value):"Infinity";case"string":return JSON.stringify(value);case"function":return"(function)";default:if("object"!==baseType||null==value)return String(value);var objType=Object.prototype.toString.call(value);if("[object Date]"===objType)return'(object: Date, value: "'+value.toISOString()+'")';if("[object RegExp]"===objType)return"(object: RegExp, value: "+value.toString()+")";var opener,closer,result=[],indentText=" ";return indent||(indent=""),("[object Set]"===objType||value instanceof Set)&&(value=Array.from(value)),Array.isArray(value)?(opener="[\n",closer="\n"+indent+"]",value.forEach(function(p,i){result.push(indent+indentText+i+" ⇒ "+toString(value[i],indent+indentText))}),Object.keys(value).forEach(function(p){/^\d+$/.test(p)||result.push(indent+indentText+toString(p)+" ⇒ "+toString(value[p],indent+indentText))})):"[object Map]"===objType||value instanceof Map?(opener="{\n",closer="\n"+indent+"}",Array.from(value).map(function(kv){result.push(indent+indentText+toString(kv[0],indent+indentText)+" ⇒ "+toString(kv[1],indent+indentText))})):(opener="{\n",closer="\n"+indent+"}",Object.keys(value).forEach(function(p){result.push(indent+indentText+toString(p)+" ⇒ "+toString(value[p],indent+indentText))})),opener+result.join(",\n")+closer}}var dialog,sv=State.variables,names=Object.keys(sv);if(dialog=UI.setup("Story $variables","checkvars"),0===names.length)return dialog.innerHTML="<h1>Story $variables (<code>State.variables</code>):</h1><p><em>No $variables currently set…</em></p>",void UI.open();dialog.innerHTML="<h1>Story $variables (<code>State.variables</code>):</h1><table><thead><tr><th>Name</th><th>Value</th></tr></thead><tbody></tbody></table>"+(/applewebkit|chrome/.test(Browser.userAgent)?"":'<div class="scroll-pad">&nbsp;</div>');var tbody=dialog.querySelector("tbody");names.sort(function(a,b){return Util.isNumeric(a)&&Util.isNumeric(b)?Number(a)-Number(b):a.localeCompare(b)});for(var i=0;i<names.length;i++){var tr=document.createElement("tr"),tdName=document.createElement("td"),tdValue=document.createElement("td");tdName.textContent="$"+names[i],tdValue.textContent = toString(sv[names[i]]),tr.appendChild(tdName),tr.appendChild(tdValue),tbody.appendChild(tr)}UI.open()}})}(); !function(){"use strict";if("undefined"==typeof version||"undefined"==typeof version.title||"SugarCube"!==version.title||"undefined"==typeof version.major||version.major<2)throw new Error("<<checkvars>> macro requires SugarCube 2.0 or greater, aborting load");Macro.add("checkvars",{handler:function(){function toString(value,indent){var baseType=typeof value;switch(baseType){case"number":return isNaN(value)?"NaN":isFinite(value)?String(value):"Infinity";case"string":return JSON.stringify(value);case"function":return"(function)";default:if("object"!==baseType||null==value)return String(value);var objType=Object.prototype.toString.call(value);if("[object Date]"===objType)return'(object: Date, value: "'+value.toISOString()+'")';if("[object RegExp]"===objType)return"(object: RegExp, value: "+value.toString()+")";var opener,closer,result=[],indentText=" ";return indent||(indent=""),("[object Set]"===objType||value instanceof Set)&&(value=Array.from(value)),Array.isArray(value)?(opener="[\n",closer="\n"+indent+"]",value.forEach(function(p,i){result.push(indent+indentText+i+" ⇒ "+toString(value[i],indent+indentText))}),Object.keys(value).forEach(function(p){/^\d+$/.test(p)||result.push(indent+indentText+toString(p)+" ⇒ "+toString(value[p],indent+indentText))})):"[object Map]"===objType||value instanceof Map?(opener="{\n",closer="\n"+indent+"}",Array.from(value).map(function(kv){result.push(indent+indentText+toString(kv[0],indent+indentText)+" ⇒ "+toString(kv[1],indent+indentText))})):(opener="{\n",closer="\n"+indent+"}",Object.keys(value).forEach(function(p){result.push(indent+indentText+toString(p)+" ⇒ "+toString(value[p],indent+indentText))})),opener+result.join(",\n")+closer}}var dialog,sv=State.variables,names=Object.keys(sv);if(dialog=UI.setup("Story $variables","checkvars"),0===names.length)return dialog.innerHTML="<h1>Story $variables (<code>State.variables</code>):</h1><p><em>No $variables currently set…</em></p>",void UI.open();dialog.innerHTML="<h1>Story $variables (<code>State.variables</code>):</h1><table><thead><tr><th>Name</th><th>Value</th></tr></thead><tbody></tbody></table>"+(/applewebkit|chrome/.test(Browser.userAgent)?"":'<div class="scroll-pad">&nbsp;</div>');var tbody=dialog.querySelector("tbody");names.sort(function(a,b){return Util.isNumeric(a)&&Util.isNumeric(b)?Number(a)-Number(b):a.localeCompare(b)});for(var i=0;i<names.length;i++){var tr=document.createElement("tr"),tdName=document.createElement("td"),tdValue=document.createElement("td");tdName.textContent="$"+names[i],tdValue.textContent = toString(sv[names[i]]),tr.appendChild(tdName),tr.appendChild(tdValue),tbody.appendChild(tr)}UI.open()}})}();
window.MS = function() {
const V = State.variables;
var name = "";
if (V.masterSuiteNameCaps === "The Master Suite")
name = "Master Suite"
else
name = V.masterSuiteNameCaps;
return `<<link "${name}""Master Suite">><</link>> `}
window.HS = function() {
const V = State.variables;
var name = "";
if (V.HGSuiteNameCaps === "The Head Girl Suite")
name = "Head Girl Suite"
else
name = V.HGSuiteNameCaps;
return `<<link "${name}""Head Girl Suite">><</link>> `}
window.SQ = function() {
const V = State.variables;
var name = "";
if (V.servantsQuartersNameCaps === "The Servants' Quarters")
name = "Servants' Quarters"
else
name = V.servantsQuartersNameCaps;
return `<<link "${name}""Servants' Quarters">><</link>> `}
window.S = function() {
const V = State.variables;
var name = "";
if (V.spaNameCaps === "The Spa")
name = "Spa"
else
name = V.spaNameCaps;
return `<<link "${name}""Spa">><</link>> `}
window.CI = function() {
const V = State.variables;
var name = "";
if (V.clinicNameCaps === "The Clinic")
name = "Clinic"
else
name = V.clinicNameCaps;
return `<<link "${name}""Clinic">><</link>> `}
window.SC = function() {
const V = State.variables;
var name = "";
if (V.schoolroomNameCaps === "The Schoolroom")
name = "Schoolroom"
else
name = V.schoolroomNameCaps;
return `<<link "${name}""Schoolroom">><</link>> `}
window.CB = function() {
const V = State.variables;
var name = "";
if (V.cellblockNameCaps === "The Cellblock")
name = "Cellblock"
else
name = V.cellblockNameCaps;
return `<<link "${name}""Cellblock">><</link>> `}
window.I = function() {
const V = State.variables;
var name = "";
if (V.incubatorNameCaps === "The Incubator")
name = "Incubator"
else
name = V.incubatorNameCaps;
return `<<link "${name}""Incubator">><</link>> `}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment