MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / drawMillStuff

Method drawMillStuff

code/main/LollipopFarm.ts:218–240  ·  view source on GitHub ↗
(x: number, y: number)

Source from the content-addressed store, hash-verified

216 }
217
218 private drawMillStuff(x: number, y: number): void{
219 // Button to construct the mill (show if the button is unlocked and the mill isn't constructed yet)
220 if(Saving.loadBool("lollipopFarmConstructMillButtonUnlocked") == true && Saving.loadBool("lollipopFarmMillConstructed") == false){
221 this.renderArea.addAsciiRealButton(Database.getText("lollipopFarmConstructMill"), x+30, y+2, "lollipopFarmConstructMillButton", Database.getTranslatedText("lollipopFarmConstructMill"), true, -1, null, false);
222 this.renderArea.addLinkCall(".lollipopFarmConstructMillButton", new CallbackCollection(this.constructMill.bind(this)));
223 }
224
225 // If the mill is constructed
226 if(Saving.loadBool("lollipopFarmMillConstructed") == true){
227 // Draw the mill ascii art
228 this.renderArea.drawArray(Database.getAscii("places/lollipopFarm/mill"), x, y);
229
230 // Draw the button to feed the mill
231 this.renderArea.addAsciiRealButton(Database.getText("lollipopFarmFeedMill") + " (" + Algo.numberToStringButNicely(this.getNumberOfLollipopsToFeedTheMill()) + " lollipops)", x+30, y, "lollipopFarmFeedMillButton", Database.getTranslatedText("lollipopFarmFeedMill"), true, -1, null, false);
232 this.renderArea.addLinkCall(".lollipopFarmFeedMillButton", new CallbackCollection(this.feedMill.bind(this)));
233
234 // Draw the current candies production if it's different from one
235 if(Saving.loadNumber("lollipopFarmCurrentCandiesProduction") != 1){
236 this.renderArea.drawString(Database.getText("lollipopFarmCurrentCandiesProduction") + " : " + Saving.loadNumber("lollipopFarmCurrentCandiesProduction").toString() + " each second", x+30, y+3);
237 this.renderArea.drawString(Database.getTranslatedText("lollipopFarmCurrentCandiesProduction"), x+30, y+4, true);
238 }
239 }
240 }
241
242 private drawPondStuff(x: number, y: number): void{
243 // Y position used because some things need to be moved when the player uses a non-english language

Callers 1

updateMethod · 0.95

Calls 8

addAsciiRealButtonMethod · 0.80
addLinkCallMethod · 0.80
bindMethod · 0.80
drawArrayMethod · 0.80
getAsciiMethod · 0.80
drawStringMethod · 0.80
getTextMethod · 0.45

Tested by

no test coverage detected