()
| 103 | } |
| 104 | |
| 105 | private drawItems(): void{ |
| 106 | for(var i = 0; i < this.items.length; i++){ |
| 107 | // If we can show this item |
| 108 | if(this.items[i].canBeShown()){ |
| 109 | // We draw the item at the correct position |
| 110 | this.renderArea.drawArray(Database.getAscii(this.items[i].getAsciiName()), this.items[i].getAsciiPosition().x, this.items[i].getAsciiPosition().y, new RenderTransparency(" ", "%")); |
| 111 | |
| 112 | // If it can be clicked |
| 113 | if(this.items[i].canBeClicked()){ |
| 114 | // We add the button and the link to be able to click it (we add it on each line of the ascii art) |
| 115 | for(var j = 0; j < Database.getAsciiHeight(this.items[i].getAsciiName()); j++){ |
| 116 | // Button |
| 117 | this.renderArea.addAsciiButton(this.items[i].getAsciiPosition().x, this.items[i].getAsciiPosition().x + Database.getAsciiWidth(this.items[i].getAsciiName()), this.items[i].getAsciiPosition().y + j, this.items[i].getButtonName() + "RealItem"); |
| 118 | // Link |
| 119 | this.renderArea.addLinkCall("." + this.items[i].getButtonName() + "RealItem", new CallbackCollection(this.clickedOnItem.bind(this, i))); |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | private drawSelectedItemStuff(): void{ |
| 127 | var yPos: number; // Will contain the y position of the bottom of the speech |
no test coverage detected