| 200 | } |
| 201 | |
| 202 | public setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void { |
| 203 | super.setup_beforeAdd(buffer, beginPos); |
| 204 | |
| 205 | buffer.seek(beginPos, 4); |
| 206 | |
| 207 | let str = buffer.readS(); |
| 208 | if (str) { |
| 209 | this.promptText = str; |
| 210 | } |
| 211 | |
| 212 | str = buffer.readS(); |
| 213 | if (str) { |
| 214 | this.restrict = str; |
| 215 | } |
| 216 | |
| 217 | const iv = buffer.getInt32(); |
| 218 | if (iv !== 0) { |
| 219 | this.maxLength = iv; |
| 220 | } |
| 221 | |
| 222 | const keyboardTypeValue = buffer.getInt32(); |
| 223 | if (keyboardTypeValue !== 0) { |
| 224 | if (keyboardTypeValue === 4) { |
| 225 | this.keyboardType = EKeyboardType.Number; |
| 226 | } else if (keyboardTypeValue === 3) { |
| 227 | this.keyboardType = EKeyboardType.Url; |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | if (buffer.readBool()) { |
| 232 | this.password = true; |
| 233 | } |
| 234 | } |
| 235 | } |