java.js
// Updates all of the button displays
Updates all of the button displays
Updates all of the button displays
function updateAllDisplays() {
	function ifGreaterThanShow(showvar, elementToShow, elementToHide) {
		if (showvar >= 1) {
			document.getElementById(elementToShow).style.display = "inline";
			document.getElementById(elementToHide).style.display = "none";
		}
	}
	roundSizeDisp(spscost, 'n', 1);
	document.getElementById("keypresser").innerHTML = "Keypresser (" + newdisp + ", +1 byte per second)";
	ifGreaterThanShow(boughtpressers, "catbuy", "lockedcat");
	ifGreaterThanShow(boughtpressers, "fingerpurchase", "lockedfinger");
	roundSizeDisp(catcost, 'n', 1);
	document.getElementById("catbuy").innerHTML = "Cat (" + newdisp + ", +5 bytes per second)";
	ifGreaterThanShow(boughtcats, "holdbuy", "lockedhold");
	roundSizeDisp(holdcost, 'n', 1);
	document.getElementById("holdbuy").innerHTML = "Key Holder (" + newdisp + ", +30 bytes per second)";
	ifGreaterThanShow(boughtholders, "macrobuy", "lockedmacro");
	roundSizeDisp(macrocost, 'n', 1);
	document.getElementById("macrobuy").innerHTML = "Word Macro (" + newdisp +", +250 bytes per second)";
	ifGreaterThanShow(boughtmacros, "collabuy", "lockedmacro");
	roundSizeDisp(colabcost, 'n', 1);
	document.getElementById("collabuy").innerHTML = "Collab Document (" + newdisp + ", +5 KB per second)";
	roundSizeDisp(fingercost, 'n', 1);
	document.getElementById("fingerpurchase").innerHTML = "Extra Finger (" + newdisp + ", +1 byte per click)";
	ifGreaterThanShow(boughtfingers, "keyboardpurchase", "lockedkeyboard");
	roundSizeDisp(keycost, 'n', 1);
	document.getElementById("keyboardpurchase").innerHTML = `Extra Keyboard (${newdisp}, +40 bytes per click)`;
	ifGreaterThanShow(boughtkeys, "macrobutpurchase", "lockedmacrobut");
	roundSizeDisp(macrobuttoncost, 'n', 1);
	document.getElementById("macrobutpurchase").innerHTML = `Macro Button (${newdisp}, +500 bytes per click)`;
	ifGreaterThanShow(boughtmacrobuts, "copypastepurchase", "lockedcopypaste");
	roundSizeDisp(copypastecost, 'n', 1);
	document.getElementById("copypastepurchase").innerHTML = `Copy Paste (${newdisp}, +10 KB per click)`;
}
function updateAllDisplays ( ) { function ifGreaterThanShow ( showvar , elementToShow , elementToHide ) { if ( showvar >= 1 ) { document . getElementById ( elementToShow ) . style . display = "inline" ; document . getElementById ( elementToHide ) . style . display = "none" ; } } roundSizeDisp ( spscost , 'n' , 1 ) ; document . getElementById ( "keypresser" ) . innerHTML = "Keypresser (" + newdisp + ", +1 byte per second)" ; ifGreaterThanShow ( boughtpressers , "catbuy" , "lockedcat" ) ; ifGreaterThanShow ( boughtpressers , "fingerpurchase" , "lockedfinger" ) ; roundSizeDisp ( catcost , 'n' , 1 ) ; document . getElementById ( "catbuy" ) . innerHTML = "Cat (" + newdisp + ", +5 bytes per second)" ; ifGreaterThanShow ( boughtcats , "holdbuy" , "lockedhold" ) ; roundSizeDisp ( holdcost , 'n' , 1 ) ; document . getElementById ( "holdbuy" ) . innerHTML = "Key Holder (" + newdisp + ", +30 bytes per second)" ; ifGreaterThanShow ( boughtholders , "macrobuy" , "lockedmacro" ) ; roundSizeDisp ( macrocost , 'n' , 1 ) ; document . getElementById ( "macrobuy" ) . innerHTML = "Word Macro (" + newdisp + ", +250 bytes per second)" ; ifGreaterThanShow ( boughtmacros , "collabuy" , "lockedmacro" ) ; roundSizeDisp ( colabcost , 'n' , 1 ) ; document . getElementById ( "collabuy" ) . innerHTML = "Collab Document (" + newdisp + ", +5 KB per second)" ; roundSizeDisp ( fingercost , 'n' , 1 ) ; document . getElementById ( "fingerpurchase" ) . innerHTML = "Extra Finger (" + newdisp + ", +1 byte per click)" ; ifGreaterThanShow ( boughtfingers , "keyboardpurchase" , "lockedkeyboard" ) ; roundSizeDisp ( keycost , 'n' , 1 ) ; document . getElementById ( "keyboardpurchase" ) . innerHTML = ` ${ newdisp } ` ; ifGreaterThanShow ( boughtkeys , "macrobutpurchase" , "lockedmacrobut" ) ; roundSizeDisp ( macrobuttoncost , 'n' , 1 ) ; document . getElementById ( "macrobutpurchase" ) . innerHTML = ` ${ newdisp } ` ; ifGreaterThanShow ( boughtmacrobuts , "copypastepurchase" , "lockedcopypaste" ) ; roundSizeDisp ( copypastecost , 'n' , 1 ) ; document . getElementById ( "copypastepurchase" ) . innerHTML = ` ${ newdisp } ` ; }
Updates all of the button displays
Updates all of the button displays