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

Method addList

code/main/RenderArea.ts:156–169  ·  view source on GitHub ↗
(x1: number, x2: number, y: number, id: string, callbackCollection: CallbackCollection, optionsArray: string[] = [])

Source from the content-addressed store, hash-verified

154 }
155
156 public addList(x1: number, x2: number, y: number, id: string, callbackCollection: CallbackCollection, optionsArray: string[] = []): void{
157 var options: string = "";
158
159 // Add all the options tag & text to the options string
160 for(var i = 0; i < optionsArray.length/2; i++){
161 options += "<option id=\"" + optionsArray[i*2] + "\" class=\"asciiSelectOption\">" + optionsArray[i*2+1] + "</option>";
162 }
163
164 // Add the list itself as a tag
165 this.addTag(new RenderTag(x1, "<span class=\"aroundSelect\"><select id=\"" + id + "\" class=\"asciiSelect\" style=\"width:" + (x2 - x1).toString() + "ex\">" + options + "</select></span>"), y);
166
167 // Add the render link used to control the list
168 this.addLinkChange("#" + id, callbackCollection);
169 }
170
171 public addMultipleAsciiButtons(otherClass: string, ...coordinates: number[]): boolean{
172 // If the length of the coordinates array isn't multiple of 3, we return false

Callers 6

drawEquipmentMethod · 0.80
updateMethod · 0.80
drawLocalSaveMethod · 0.80
drawCfgLanguageMethod · 0.80

Calls 2

addTagMethod · 0.95
addLinkChangeMethod · 0.95

Tested by

no test coverage detected