MCPcopy Create free account
hub / github.com/FSGModding/FSG_Mod_Assistant / #doPath

Method #doPath

renderer/renderJS/setup_ui.js:185–222  ·  view source on GitHub ↗
(version)

Source from the content-addressed store, hash-verified

183 }
184
185 #doPath(version) {
186 const iVer = parseInt(version)
187 const fullKey = `game_path_${version}`
188 const node = document.createElement('div')
189 node.innerHTML = [
190 '<i18n-text class="inset-block-header" data-key="user_pref_title_game_path"></i18n-text>',
191 '<i18n-text class="inset-block-blurb-option mb-3" data-key="user_pref_blurb_game_path"></i18n-text>',
192 '<div class="row inset-block-lined-row">',
193 '<div class="col"><i18n-text data-key="wizard_current"></i18n-text></div>',
194 '<div class="col-auto fst-italic small current_game_path"></div>',
195 '</div><div class="found_paths"></div>',
196 ].join('')
197
198 const buttons = node.querySelector('.found_paths')
199
200 const updater = () => {
201 window.settings.get(fullKey).then((value) => {
202 buttons.innerHTML = ''
203 node.querySelector('.current_game_path').textContent = value !== '' ? value : '--'
204
205 if ( this.wizard.games[iVer].length === 0 ) {
206 buttons.appendChild(I18N.__('wizard_step_4_fail_exe', ['text-center', 'd-block']))
207 } else {
208 for ( const gamePath of this.wizard.games[iVer] ) {
209 buttons.appendChild(this.#doButton(
210 fullKey,
211 gamePath[1],
212 value,
213 gamePath[0]
214 ))
215 }
216 }
217 })
218 }
219
220 this.update.push(updater)
221 return node
222 }
223
224 #doSettings(version) {
225 const iVer = parseInt(version)

Callers 1

initMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected