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

Method drawSelectedItemStuff

code/main/SecondHouse.ts:126–140  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124 }
125
126 private drawSelectedItemStuff(): void{
127 var yPos: number; // Will contain the y position of the bottom of the speech
128
129 // Draw the speech
130 yPos = this.drawSpeech(this.items[this.selectedItemIndex].getMerchantSpeech());
131
132 // If we can buy this item
133 if(this.items[this.selectedItemIndex].canBeBought()){
134 // Add the buying button
135 this.renderArea.addAsciiRealButton(Database.getText(this.items[this.selectedItemIndex].getButtonText()), 45 - Math.floor(Database.getText(this.items[this.selectedItemIndex].getButtonText()).length/2), yPos + 2, this.items[this.selectedItemIndex].getButtonName() + "BuyingButton", Database.getTranslatedText(this.items[this.selectedItemIndex].getButtonText()), true);
136
137 // Add the link
138 this.renderArea.addLinkCall("." + this.items[this.selectedItemIndex].getButtonName() + "BuyingButton", new CallbackCollection(this.buySelectedItem.bind(this)));
139 }
140 }
141
142 private drawSpeech(speechName: string): number{
143 return this.renderArea.drawSpeech(Database.getText(speechName), 3, 30, 60, "secondHouseMerchantSpeech", Database.getTranslatedText(speechName));

Callers 1

updateMethod · 0.95

Calls 9

drawSpeechMethod · 0.95
getMerchantSpeechMethod · 0.80
canBeBoughtMethod · 0.80
addAsciiRealButtonMethod · 0.80
getButtonTextMethod · 0.80
getButtonNameMethod · 0.80
addLinkCallMethod · 0.80
bindMethod · 0.80
getTextMethod · 0.45

Tested by

no test coverage detected