MCPcopy Create free account
hub / github.com/FSGModding/FSG_Mod_Assistant / processData

Method processData

renderer/renderJS/savemanage_ui.js:46–87  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

44 }
45
46 async processData(data) {
47 await this.updateLang()
48
49 this.uuidMap = {}
50 const theseSaves = data.opts.saveInfo
51
52 const activeIDS = Object.keys(theseSaves).filter((x) => typeof theseSaves[x].active === 'object' && theseSaves[x].active?.errorList.length === 0)
53 const backIDS = Object.keys(theseSaves).filter((x) => Array.isArray(theseSaves[x].backups) && theseSaves[x].backups.length !== 0 )
54
55 const activeGameHTML = []
56 const backGameHTML = []
57 const compareHTML = []
58
59 for ( const collectKey of data.set_Collections ) {
60 if ( data.appSettings.game_version === data.collectionNotes[collectKey].notes_version ) {
61 compareHTML.push(DATA.optionFromArray([collectKey, data.collectionToFullName[collectKey]]))
62 }
63 }
64
65 for ( const thisID of activeIDS ) {
66 this.uuidMap[theseSaves[thisID].active.uuid] = {
67 path : theseSaves[thisID].active.fullPath,
68 name : theseSaves[thisID].active.fullName,
69 }
70 activeGameHTML.push(this.doTemplate(thisID, theseSaves[thisID].active))
71 }
72
73 for ( const thisID of backIDS ) {
74 theseSaves[thisID].backups.reverse()
75 for ( const thisRecord of theseSaves[thisID].backups ) {
76 this.uuidMap[thisRecord.uuid] = {
77 path : thisRecord.fullPath,
78 name : thisRecord.fullName,
79 }
80 backGameHTML.push(this.doTemplate(thisID, thisRecord, 'savegame_backup_buttons'))
81 }
82 }
83
84 MA.byIdHTML('save_collect_choice', compareHTML.join(''))
85 MA.byIdNodeArray('active_games', activeGameHTML)
86 MA.byIdNodeArray('backup_games', backGameHTML)
87 }
88
89 async updateLang() {
90 return window.i18n.lang().then((value) => {

Callers 1

constructorMethod · 0.95

Calls 3

updateLangMethod · 0.95
doTemplateMethod · 0.95
keysMethod · 0.80

Tested by

no test coverage detected