(data)
| 39 | } |
| 40 | |
| 41 | async updateFromData(data) { |
| 42 | this.track.lastPayload = data |
| 43 | this.flag.activeCollect = data.opts.activeCollection |
| 44 | this.flag.currentVersion = data.appSettings.game_version |
| 45 | this.flag.gameRunning = data.opts.gameRunning |
| 46 | this.flag.launchEnable = data.opts.gameRunningEnable |
| 47 | this.flag.pinMini = data.opts.pinMini |
| 48 | |
| 49 | this.mapCollectionDropdown = new Map() |
| 50 | this.mapCollectionDropdown.set(0, `--${data.opts.l10n.disable}--`) |
| 51 | |
| 52 | for ( const [_, CKey] of Object.entries([...data.set_Collections]) ) { |
| 53 | if ( data.collectionNotes[CKey].notes_version !== this.flag.currentVersion ) { continue } |
| 54 | this.mapCollectionDropdown.set(CKey, data.modList[CKey].fullName) |
| 55 | } |
| 56 | this.mapCollectionDropdown.set(999, `--${data.opts.l10n.unknown}--`) |
| 57 | |
| 58 | const optList = [] |
| 59 | for (const [value, text] of this.mapCollectionDropdown) { |
| 60 | optList.push(DATA.optionFromArray([value, text], this.flag.activeCollect)) |
| 61 | } |
| 62 | MA.byIdHTML('collectionSelect', optList.join('')) |
| 63 | this.displayState() |
| 64 | } |
| 65 | |
| 66 | displayState() { |
| 67 | MA.byId('window-pin-pinned').clsShow(this.flag.pinMini) |
no test coverage detected