()
| 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)); |
no test coverage detected