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

Method update

code/main/Treasure.ts:33–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31 }
32
33 private update(): void{
34 // Erase everything
35 this.renderArea.resetAllButSize();
36
37 // Back to the map button
38 this.addBackToMainMapButton(this.renderArea, "treasureBackToTheMapButton");
39
40 // Draw the ascii
41 this.renderArea.drawArray(Database.getAscii("places/treasure"), 28, 3);
42
43 // If we didn't find the treasure yet
44 if(Saving.loadBool("TheCavePattern_TreasureMapFoundTreasure") == false){
45 // Add the button to get the treasure
46 this.renderArea.addAsciiRealButton(Database.getText("treasureButtonDig"), 49, 14, "treasureButton", Database.getTranslatedText("treasureButtonDig"), true, -1, null, false);
47 this.renderArea.addLinkCall(".treasureButton", new CallbackCollection(this.dig.bind(this)));
48 }
49 // Else, we found the treasure
50 else{
51 // Add the text
52 this.renderArea.drawString(Database.getText("treasureButtonYouFound"), 49, 14);
53 this.renderArea.drawString(Database.getTranslatedText("treasureButtonYouFound"), 49, 15, true);
54 }
55 }
56}

Callers 2

constructorMethod · 0.95
digMethod · 0.95

Calls 9

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

Tested by

no test coverage detected