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

Method update

code/main/LonelyHouse.ts:78–165  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76 }
77
78 private update(): void{
79 // Erase everything
80 this.renderArea.resetAllButSize();
81
82 // Back to the map button
83 this.addBackToMainMapButton(this.renderArea, "lonelyHouseBackToTheMapButton");
84
85 // Draw the house
86 this.renderArea.drawArray(Database.getAscii("places/lonelyHouse"), 0, 3);
87
88 // Draw the box
89 if(Saving.loadBool("lonelyHouseTakeTheBoxDone") == false){
90 this.renderArea.drawArray(Database.getAscii("general/box"), 54, 9);
91 }
92
93 // Add the buttons or texts
94 if(Saving.loadBool("lonelyHouseOpenBoxDone") == false){
95 this.getRenderArea().addAsciiRealButton(Database.getText("lonelyHouseOpenBox"), 4, 4, "lonelyHouseOpenBoxButton", Database.getTranslatedText("lonelyHouseOpenBox"), true, -1, null, false);
96 this.getRenderArea().addLinkCall(".lonelyHouseOpenBoxButton", new CallbackCollection(this.openBox.bind(this)));
97 }
98 else{
99 this.getRenderArea().drawString(Database.getText("lonelyHouseOpenBoxResult"), 4, 4);
100 this.getRenderArea().drawString(Database.getTranslatedText("lonelyHouseOpenBoxResult"), 4, 5, true);
101 }
102
103 if(Saving.loadBool("lonelyHouseShakeBoxDone") == false){
104 this.getRenderArea().addAsciiRealButton(Database.getText("lonelyHouseShakeBox"), 4, 8, "lonelyHouseShakeBoxButton", Database.getTranslatedText("lonelyHouseShakeBox"), true, -1, null, false);
105 this.getRenderArea().addLinkCall(".lonelyHouseShakeBoxButton", new CallbackCollection(this.shakeBox.bind(this)));
106 }
107 else{
108 this.getRenderArea().drawString(Database.getText("lonelyHouseShakeBoxResult"), 4, 8);
109 this.getRenderArea().drawString(Database.getTranslatedText("lonelyHouseShakeBoxResult"), 4, 9, true);
110 }
111
112 if(Saving.loadBool("lonelyHouseBreakLockDone") == false){
113 this.getRenderArea().addAsciiRealButton(Database.getText("lonelyHouseBreakLock"), 4, 12, "lonelyHouseBreakLockButton", Database.getTranslatedText("lonelyHouseBreakLock"), true, -1, null, false);
114 this.getRenderArea().addLinkCall(".lonelyHouseBreakLockButton", new CallbackCollection(this.breakLock.bind(this)));
115 }
116 else{
117 this.getRenderArea().drawString(Database.getText("lonelyHouseBreakLockResult"), 4, 12);
118 this.getRenderArea().drawString(Database.getTranslatedText("lonelyHouseBreakLockResult"), 4, 13, true);
119 }
120
121 if(Saving.loadBool("lonelyHouseKickBoxDone") == false){
122 this.getRenderArea().addAsciiRealButton(Database.getText("lonelyHouseKickBox"), 4, 16, "lonelyHouseKickBoxButton", Database.getTranslatedText("lonelyHouseKickBox"), true, -1, null, false);
123 this.getRenderArea().addLinkCall(".lonelyHouseKickBoxButton", new CallbackCollection(this.kickBox.bind(this)));
124 }
125 else{
126 this.getRenderArea().drawString(Database.getText("lonelyHouseKickBoxResult"), 4, 16);
127 this.getRenderArea().drawString(Database.getTranslatedText("lonelyHouseKickBoxResult"), 4, 17, true);
128 }
129
130 if(Saving.loadBool("lonelyHouseAskTheBoxToOpenItselfDone") == false){
131 this.getRenderArea().addAsciiRealButton(Database.getText("lonelyHouseAskTheBoxToOpenItself"), 4, 20, "lonelyHouseAskTheBoxToOpenItselfButton", Database.getTranslatedText("lonelyHouseAskTheBoxToOpenItself"), true, -1, null, false);
132 this.getRenderArea().addLinkCall(".lonelyHouseAskTheBoxToOpenItselfButton", new CallbackCollection(this.askTheBoxToOpenItself.bind(this)));
133 }
134 else{
135 this.getRenderArea().drawString(Database.getText("lonelyHouseAskTheBoxToOpenItselfResult"), 4, 20);

Callers 8

constructorMethod · 0.95
askTheBoxToOpenItselfMethod · 0.95
breakLockMethod · 0.95
kickBoxMethod · 0.95
lureTheBoxWithACandyMethod · 0.95
openBoxMethod · 0.95
shakeBoxMethod · 0.95
takeTheBoxMethod · 0.95

Calls 10

getRenderAreaMethod · 0.95
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