diff --git a/gaseous-server/Classes/MetadataManagement.cs b/gaseous-server/Classes/MetadataManagement.cs index 6557fdc5..3630dae6 100644 --- a/gaseous-server/Classes/MetadataManagement.cs +++ b/gaseous-server/Classes/MetadataManagement.cs @@ -370,7 +370,23 @@ public void RefreshMetadata(bool forceRefresh = false) try { Logging.Log(Logging.LogType.Information, "Metadata Refresh", "(" + StatusCounter + "/" + dt.Rows.Count + "): Refreshing metadata for platform " + dr["name"] + " (" + dr["id"] + ")"); - Metadata.Platforms.GetPlatform((long)dr["id"], MetadataSources.None); + + HasheousClient.Models.MetadataSources metadataSource = HasheousClient.Models.MetadataSources.None; + + // fetch the platform metadata + Platform platform = Metadata.Platforms.GetPlatform((long)dr["id"], metadataSource); + + // fetch the platform metadata from Hasheous + if (Config.MetadataConfiguration.SignatureSource == HasheousClient.Models.MetadataModel.SignatureSources.Hasheous) + { + Communications.PopulateHasheousPlatformData((long)dr["id"]); + } + + // force platformLogo refresh + if (platform.PlatformLogo != null) + { + Metadata.PlatformLogos.GetPlatformLogo(platform.PlatformLogo, metadataSource); + } } catch (Exception ex) { diff --git a/gaseous-server/Controllers/V1.1/GamesController.cs b/gaseous-server/Controllers/V1.1/GamesController.cs index aa9241c3..8f19d4f7 100644 --- a/gaseous-server/Controllers/V1.1/GamesController.cs +++ b/gaseous-server/Controllers/V1.1/GamesController.cs @@ -43,7 +43,7 @@ public GamesController( [MapToApiVersion("1.1")] [HttpPost] [ProducesResponseType(typeof(GameReturnPackage), StatusCodes.Status200OK)] - public async Task Game_v1_1(GameSearchModel model, int pageNumber = 0, int pageSize = 0) + public async Task Game_v1_1(GameSearchModel model, int pageNumber = 0, int pageSize = 0, bool returnSummary = true, bool returnGames = true) { var user = await _userManager.GetUserAsync(User); @@ -88,7 +88,7 @@ public async Task Game_v1_1(GameSearchModel model, int pageNumber model.GameAgeRating.IncludeUnrated = false; } - return Ok(GetGames(model, user.Id, pageNumber, pageSize)); + return Ok(GetGames(model, user.Id, pageNumber, pageSize, returnSummary, returnGames)); } else { @@ -190,7 +190,7 @@ public enum SortField } } - public static GameReturnPackage GetGames(GameSearchModel model, string userid, int pageNumber = 0, int pageSize = 0) + public static GameReturnPackage GetGames(GameSearchModel model, string userid, int pageNumber = 0, int pageSize = 0, bool returnSummary = true, bool returnGames = true) { string whereClause = ""; string havingClause = ""; @@ -551,89 +551,100 @@ LEFT JOIN Relation_Game_Themes ON Game.Id = Relation_Game_Themes.GameId LEFT JOIN Favourites ON Game.MetadataMapId = Favourites.GameId AND Favourites.UserId = @userid " + whereClause + " " + havingClause + " " + orderByClause; - List RetVal = new List(); + + // if (returnGames == true) + // { + // sql += " LIMIT @pageOffset, @pageSize"; + // whereParams.Add("pageOffset", pageSize * (pageNumber - 1)); + // whereParams.Add("pageSize", pageSize); + // } DataTable dbResponse = db.ExecuteCMD(sql, whereParams, new Database.DatabaseMemoryCacheOptions(CacheEnabled: true, ExpirationSeconds: 60)); // get count - int RecordCount = dbResponse.Rows.Count; + int? RecordCount = null; + if (returnSummary == true) + { + RecordCount = dbResponse.Rows.Count; + } // compile data for return - int pageOffset = pageSize * (pageNumber - 1); - for (int i = pageOffset; i < dbResponse.Rows.Count; i++) + List? RetVal = null; + if (returnGames == true) { - if (pageNumber != 0 && pageSize != 0) + RetVal = new List(); + foreach (int i in Enumerable.Range(0, dbResponse.Rows.Count)) { - if (i >= (pageOffset + pageSize)) + Models.Game retGame = Storage.BuildCacheObject(new Models.Game(), dbResponse.Rows[i]); + retGame.MetadataMapId = (long)dbResponse.Rows[i]["MetadataMapId"]; + retGame.MetadataSource = (HasheousClient.Models.MetadataSources)dbResponse.Rows[i]["GameIdType"]; + + Games.MinimalGameItem retMinGame = new Games.MinimalGameItem(retGame); + retMinGame.Index = i; + if (dbResponse.Rows[i]["RomSaveCount"] != DBNull.Value || dbResponse.Rows[i]["MediaGroupSaveCount"] != DBNull.Value) { - break; + retMinGame.HasSavedGame = true; + } + else + { + retMinGame.HasSavedGame = false; + } + if ((int)dbResponse.Rows[i]["Favourite"] == 0) + { + retMinGame.IsFavourite = false; + } + else + { + retMinGame.IsFavourite = true; } - } - - Models.Game retGame = Storage.BuildCacheObject(new Models.Game(), dbResponse.Rows[i]); - retGame.MetadataMapId = (long)dbResponse.Rows[i]["MetadataMapId"]; - retGame.MetadataSource = (HasheousClient.Models.MetadataSources)dbResponse.Rows[i]["GameIdType"]; - Games.MinimalGameItem retMinGame = new Games.MinimalGameItem(retGame); - retMinGame.Index = i; - if (dbResponse.Rows[i]["RomSaveCount"] != DBNull.Value || dbResponse.Rows[i]["MediaGroupSaveCount"] != DBNull.Value) - { - retMinGame.HasSavedGame = true; + RetVal.Add(retMinGame); } - else - { - retMinGame.HasSavedGame = false; - } - if ((int)dbResponse.Rows[i]["Favourite"] == 0) - { - retMinGame.IsFavourite = false; - } - else - { - retMinGame.IsFavourite = true; - } - - RetVal.Add(retMinGame); } - // build alpha list - Dictionary AlphaList = new Dictionary(); - if (orderByField == "NameThe" || orderByField == "Name") + Dictionary? AlphaList = null; + if (returnSummary == true) { - int CurrentPage = 1; - int NextPageIndex = pageSize; + AlphaList = new Dictionary(); - string alphaSearchField; - if (orderByField == "NameThe") + // build alpha list + if (orderByField == "NameThe" || orderByField == "Name") { - alphaSearchField = "NameThe"; - } - else - { - alphaSearchField = "Name"; - } + int CurrentPage = 1; + int NextPageIndex = pageSize; - for (int i = 0; i < dbResponse.Rows.Count; i++) - { - if (NextPageIndex == i + 1) + string alphaSearchField; + if (orderByField == "NameThe") { - NextPageIndex += pageSize; - CurrentPage += 1; + alphaSearchField = "NameThe"; + } + else + { + alphaSearchField = "Name"; } - string firstChar = dbResponse.Rows[i][alphaSearchField].ToString().Substring(0, 1).ToUpperInvariant(); - if ("ABCDEFGHIJKLMNOPQRSTUVWXYZ".Contains(firstChar)) + for (int i = 0; i < dbResponse.Rows.Count; i++) { - if (!AlphaList.ContainsKey(firstChar)) + if (NextPageIndex == i + 1) { - AlphaList.Add(firstChar, CurrentPage); + NextPageIndex += pageSize; + CurrentPage += 1; } - } - else - { - if (!AlphaList.ContainsKey("#")) + + string firstChar = dbResponse.Rows[i][alphaSearchField].ToString().Substring(0, 1).ToUpperInvariant(); + if ("ABCDEFGHIJKLMNOPQRSTUVWXYZ".Contains(firstChar)) + { + if (!AlphaList.ContainsKey(firstChar)) + { + AlphaList.Add(firstChar, CurrentPage); + } + } + else { - AlphaList.Add("#", 1); + if (!AlphaList.ContainsKey("#")) + { + AlphaList.Add("#", 1); + } } } } @@ -669,9 +680,9 @@ public GameReturnPackage(int Count, List Games) this.Games = minimalGames; } - public int Count { get; set; } - public List Games { get; set; } = new List(); - public Dictionary AlphaList { get; set; } + public int? Count { get; set; } + public List? Games { get; set; } = new List(); + public Dictionary? AlphaList { get; set; } } } } \ No newline at end of file diff --git a/gaseous-server/Models/PlatformMapping.cs b/gaseous-server/Models/PlatformMapping.cs index c6c9ed54..29e3a3af 100644 --- a/gaseous-server/Models/PlatformMapping.cs +++ b/gaseous-server/Models/PlatformMapping.cs @@ -107,11 +107,6 @@ private static Platform CreateDummyPlatform(PlatformMapItem mapItem) Storage.NewCacheValue(HasheousClient.Models.MetadataSources.None, platform); } - if (Config.MetadataConfiguration.SignatureSource == HasheousClient.Models.MetadataModel.SignatureSources.Hasheous) - { - Communications.PopulateHasheousPlatformData(mapItem.IGDBId); - } - if (Storage.GetCacheStatus(HasheousClient.Models.MetadataSources.IGDB, "Platform", mapItem.IGDBId) == Storage.CacheStatus.NotPresent) { Storage.NewCacheValue(HasheousClient.Models.MetadataSources.IGDB, platform); diff --git a/gaseous-server/wwwroot/pages/game.js b/gaseous-server/wwwroot/pages/game.js index 03f7ceb4..7d26849e 100644 --- a/gaseous-server/wwwroot/pages/game.js +++ b/gaseous-server/wwwroot/pages/game.js @@ -613,221 +613,225 @@ class RomManagement { this.#SetupFixPlatformDropDown(); // add buttons - let platformMappingButton = new ModalButton('Metadata Mapping', 0, this, async function (callingObject) { - let metadataModal = await new Modal('messagebox'); - await metadataModal.BuildModal(); + if (userProfile.roles.includes("Admin")) { + let platformMappingButton = new ModalButton('Metadata Mapping', 0, this, async function (callingObject) { + let metadataModal = await new Modal('messagebox'); + await metadataModal.BuildModal(); - // override the dialog size - metadataModal.modalElement.style = 'width: 600px; height: 400px; min-width: unset; min-height: 400px; max-width: unset; max-height: 400px;'; + // override the dialog size + metadataModal.modalElement.style = 'width: 600px; height: 400px; min-width: unset; min-height: 400px; max-width: unset; max-height: 400px;'; - // set the title - metadataModal.modalElement.querySelector('#modal-header-text').innerHTML = callingObject.Platform.name + ' Metadata Mapping'; + // set the title + metadataModal.modalElement.querySelector('#modal-header-text').innerHTML = callingObject.Platform.name + ' Metadata Mapping'; - // set the content - let metadataContent = metadataModal.modalElement.querySelector('#modal-body'); + // set the content + let metadataContent = metadataModal.modalElement.querySelector('#modal-body'); - // fetch the metadata map - let metadataMap = await fetch('/api/v1.1/Games/' + callingObject.Platform.metadataMapId + '/metadata', { - method: 'GET', - headers: { - 'Content-Type': 'application/json' - } - }).then(response => response.json()); - console.log(metadataMap); - - metadataMap.metadataMapItems.forEach(element => { - let itemSection = document.createElement('div'); - itemSection.className = 'section'; - - // header - let itemSectionHeader = document.createElement('div'); - itemSectionHeader.className = 'section-header'; - - let itemSectionHeaderRadio = document.createElement('input'); - itemSectionHeaderRadio.id = 'platformMappingSource_' + element.sourceType; - itemSectionHeaderRadio.type = 'radio'; - itemSectionHeaderRadio.name = 'platformMappingSource'; - itemSectionHeaderRadio.value = element.sourceType; - itemSectionHeaderRadio.style.margin = '0px'; - itemSectionHeaderRadio.style.height = 'unset'; - itemSectionHeaderRadio.addEventListener('change', () => { - metadataMap.metadataMapItems.forEach(element => { - element.preferred = false; + // fetch the metadata map + let metadataMap = await fetch('/api/v1.1/Games/' + callingObject.Platform.metadataMapId + '/metadata', { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => response.json()); + console.log(metadataMap); + + metadataMap.metadataMapItems.forEach(element => { + let itemSection = document.createElement('div'); + itemSection.className = 'section'; + + // header + let itemSectionHeader = document.createElement('div'); + itemSectionHeader.className = 'section-header'; + + let itemSectionHeaderRadio = document.createElement('input'); + itemSectionHeaderRadio.id = 'platformMappingSource_' + element.sourceType; + itemSectionHeaderRadio.type = 'radio'; + itemSectionHeaderRadio.name = 'platformMappingSource'; + itemSectionHeaderRadio.value = element.sourceType; + itemSectionHeaderRadio.style.margin = '0px'; + itemSectionHeaderRadio.style.height = 'unset'; + itemSectionHeaderRadio.addEventListener('change', () => { + metadataMap.metadataMapItems.forEach(element => { + element.preferred = false; + }); + + element.preferred = true; + console.log('Selected: ' + element.sourceType); + console.log(metadataMap); }); + if (element.preferred == true) { + itemSectionHeaderRadio.checked = true; + } + itemSectionHeader.appendChild(itemSectionHeaderRadio); - element.preferred = true; - console.log('Selected: ' + element.sourceType); - console.log(metadataMap); - }); - if (element.preferred == true) { - itemSectionHeaderRadio.checked = true; - } - itemSectionHeader.appendChild(itemSectionHeaderRadio); - - let itemSectionHeaderLabel = document.createElement('label'); - itemSectionHeaderLabel.htmlFor = 'platformMappingSource_' + element.sourceType; - itemSectionHeaderLabel.style.marginLeft = '10px'; - itemSectionHeaderLabel.innerHTML = element.sourceType; - itemSectionHeader.appendChild(itemSectionHeaderLabel); - - itemSection.appendChild(itemSectionHeader); - - // content - let itemSectionContent = document.createElement('div'); - itemSectionContent.className = 'section-body'; - switch (element.sourceType) { - case 'None': - let noneContent = document.createElement('div'); - noneContent.className = 'section-body-content'; - - let noneContentLabel = document.createElement('label'); - noneContentLabel.innerHTML = 'No Metadata Source'; - noneContent.appendChild(noneContentLabel); - - itemSectionContent.appendChild(noneContent); - break; - - default: - let contentLabel2 = document.createElement('div'); - contentLabel2.innerHTML = 'ID: ' + element.sourceId; - itemSectionContent.appendChild(contentLabel2); - - let contentLabel3 = document.createElement('div'); - contentLabel3.innerHTML = 'Slug: ' + element.sourceSlug; - itemSectionContent.appendChild(contentLabel3); - - if (element.link) { - if (element.link.length > 0) { - let contentLabel4 = document.createElement('div'); - contentLabel4.innerHTML = 'Link: ' + element.link + ''; - itemSectionContent.appendChild(contentLabel4); + let itemSectionHeaderLabel = document.createElement('label'); + itemSectionHeaderLabel.htmlFor = 'platformMappingSource_' + element.sourceType; + itemSectionHeaderLabel.style.marginLeft = '10px'; + itemSectionHeaderLabel.innerHTML = element.sourceType; + itemSectionHeader.appendChild(itemSectionHeaderLabel); + + itemSection.appendChild(itemSectionHeader); + + // content + let itemSectionContent = document.createElement('div'); + itemSectionContent.className = 'section-body'; + switch (element.sourceType) { + case 'None': + let noneContent = document.createElement('div'); + noneContent.className = 'section-body-content'; + + let noneContentLabel = document.createElement('label'); + noneContentLabel.innerHTML = 'No Metadata Source'; + noneContent.appendChild(noneContentLabel); + + itemSectionContent.appendChild(noneContent); + break; + + default: + let contentLabel2 = document.createElement('div'); + contentLabel2.innerHTML = 'ID: ' + element.sourceId; + itemSectionContent.appendChild(contentLabel2); + + let contentLabel3 = document.createElement('div'); + contentLabel3.innerHTML = 'Slug: ' + element.sourceSlug; + itemSectionContent.appendChild(contentLabel3); + + if (element.link) { + if (element.link.length > 0) { + let contentLabel4 = document.createElement('div'); + contentLabel4.innerHTML = 'Link: ' + element.link + ''; + itemSectionContent.appendChild(contentLabel4); + } } - } - break; + break; - } - itemSection.appendChild(itemSectionContent); + } + itemSection.appendChild(itemSectionContent); - metadataContent.appendChild(itemSection); - }); + metadataContent.appendChild(itemSection); + }); - // setup the buttons - let okButton = new ModalButton('OK', 1, callingObject, async function (callingObject) { - let model = metadataMap.metadataMapItems; + // setup the buttons + let okButton = new ModalButton('OK', 1, callingObject, async function (callingObject) { + let model = metadataMap.metadataMapItems; - await fetch('/api/v1.1/Games/' + callingObject.Platform.metadataMapId + '/metadata', { - method: 'PUT', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(model) - }).then(response => response.json()).then(result => { - location.reload(true); + await fetch('/api/v1.1/Games/' + callingObject.Platform.metadataMapId + '/metadata', { + method: 'PUT', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(model) + }).then(response => response.json()).then(result => { + location.reload(true); + }); }); - }); - metadataModal.addButton(okButton); + metadataModal.addButton(okButton); + + let cancelButton = new ModalButton('Cancel', 0, metadataModal, async function (callingObject) { + metadataModal.close(); + }); + metadataModal.addButton(cancelButton); - let cancelButton = new ModalButton('Cancel', 0, metadataModal, async function (callingObject) { - metadataModal.close(); + // show the dialog + await metadataModal.open(); }); - metadataModal.addButton(cancelButton); + this.romsModal.addButton(platformMappingButton); + } - // show the dialog - await metadataModal.open(); - }); - this.romsModal.addButton(platformMappingButton); + if (this.Platform.id != 0) { + let platformEditButton = new ModalButton('Configure Emulator', 0, this, async function (callingObject) { + let mappingModal = await new Modal('messagebox'); + await mappingModal.BuildModal(); - let platformEditButton = new ModalButton('Configure Emulator', 0, this, async function (callingObject) { - let mappingModal = await new Modal('messagebox'); - await mappingModal.BuildModal(); + // override the dialog size + mappingModal.modalElement.style = 'width: 600px; height: 80%; min-width: unset; min-height: 400px; max-width: unset; max-height: 80%;'; - // override the dialog size - mappingModal.modalElement.style = 'width: 600px; height: 80%; min-width: unset; min-height: 400px; max-width: unset; max-height: 80%;'; + // get the platform map + let platformMap = await fetch('/api/v1.1/PlatformMaps/' + callingObject.Platform.id, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => response.json()); + let defaultPlatformMap = platformMap; - // get the platform map - let platformMap = await fetch('/api/v1.1/PlatformMaps/' + callingObject.Platform.id, { - method: 'GET', - headers: { - 'Content-Type': 'application/json' - } - }).then(response => response.json()); - let defaultPlatformMap = platformMap; - - // get the user emulation configuration - let userEmuConfig = await fetch('/api/v1.1/Games/' + callingObject.Platform.metadataMapId + '/emulatorconfiguration/' + callingObject.Platform.id, { - method: 'GET', - headers: { - 'Content-Type': 'application/json' - } - }).then(response => response.json()); - if (userEmuConfig) { - if (userEmuConfig.emulatorType || userEmuConfig.core) { - platformMap.webEmulator.type = userEmuConfig.emulatorType; - platformMap.webEmulator.core = userEmuConfig.core; - } - if (userEmuConfig.enableBIOSFiles) { - platformMap.enabledBIOSHashes = userEmuConfig.enableBIOSFiles; + // get the user emulation configuration + let userEmuConfig = await fetch('/api/v1.1/Games/' + callingObject.Platform.metadataMapId + '/emulatorconfiguration/' + callingObject.Platform.id, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => response.json()); + if (userEmuConfig) { + if (userEmuConfig.emulatorType || userEmuConfig.core) { + platformMap.webEmulator.type = userEmuConfig.emulatorType; + platformMap.webEmulator.core = userEmuConfig.core; + } + if (userEmuConfig.enableBIOSFiles) { + platformMap.enabledBIOSHashes = userEmuConfig.enableBIOSFiles; + } } - } - // set the title - mappingModal.modalElement.querySelector('#modal-header-text').innerHTML = callingObject.Platform.name + ' Emulation Settings'; + // set the title + mappingModal.modalElement.querySelector('#modal-header-text').innerHTML = callingObject.Platform.name + ' Emulation Settings'; - // set the content - let mappingContent = mappingModal.modalElement.querySelector('#modal-body'); - mappingContent.innerHTML = ''; - let emuConfig = await new WebEmulatorConfiguration(platformMap) - emuConfig.open(); - mappingContent.appendChild(emuConfig.panel); + // set the content + let mappingContent = mappingModal.modalElement.querySelector('#modal-body'); + mappingContent.innerHTML = ''; + let emuConfig = await new WebEmulatorConfiguration(platformMap) + emuConfig.open(); + mappingContent.appendChild(emuConfig.panel); - // setup the buttons - let resetButton = new ModalButton('Reset to Default', 0, callingObject, async function (callingObject) { - await fetch('/api/v1.1/Games/' + callingObject.Platform.metadataMapId + '/emulatorconfiguration/' + callingObject.Platform.id, { - method: 'DELETE' + // setup the buttons + let resetButton = new ModalButton('Reset to Default', 0, callingObject, async function (callingObject) { + await fetch('/api/v1.1/Games/' + callingObject.Platform.metadataMapId + '/emulatorconfiguration/' + callingObject.Platform.id, { + method: 'DELETE' + }); + callingObject.Platform.emulatorConfiguration.emulatorType = defaultPlatformMap.webEmulator.type; + callingObject.Platform.emulatorConfiguration.core = defaultPlatformMap.webEmulator.core; + callingObject.Platform.emulatorConfiguration.enabledBIOSHashes = defaultPlatformMap.enabledBIOSHashes; + callingObject.#loadRoms(); + callingObject.OkCallback(); + mappingModal.close(); }); - callingObject.Platform.emulatorConfiguration.emulatorType = defaultPlatformMap.webEmulator.type; - callingObject.Platform.emulatorConfiguration.core = defaultPlatformMap.webEmulator.core; - callingObject.Platform.emulatorConfiguration.enabledBIOSHashes = defaultPlatformMap.enabledBIOSHashes; - callingObject.#loadRoms(); - callingObject.OkCallback(); - mappingModal.close(); - }); - mappingModal.addButton(resetButton); + mappingModal.addButton(resetButton); - let okButton = new ModalButton('OK', 1, callingObject, async function (callingObject) { - let model = { - EmulatorType: emuConfig.PlatformMap.webEmulator.type, - Core: emuConfig.PlatformMap.webEmulator.core, - EnableBIOSFiles: emuConfig.PlatformMap.enabledBIOSHashes - } + let okButton = new ModalButton('OK', 1, callingObject, async function (callingObject) { + let model = { + EmulatorType: emuConfig.PlatformMap.webEmulator.type, + Core: emuConfig.PlatformMap.webEmulator.core, + EnableBIOSFiles: emuConfig.PlatformMap.enabledBIOSHashes + } - await fetch('/api/v1.1/Games/' + callingObject.Platform.metadataMapId + '/emulatorconfiguration/' + callingObject.Platform.id, { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify(model) + await fetch('/api/v1.1/Games/' + callingObject.Platform.metadataMapId + '/emulatorconfiguration/' + callingObject.Platform.id, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(model) + }); + callingObject.Platform.emulatorConfiguration.emulatorType = emuConfig.PlatformMap.webEmulator.type; + callingObject.Platform.emulatorConfiguration.core = emuConfig.PlatformMap.webEmulator.core; + callingObject.Platform.emulatorConfiguration.enabledBIOSHashes = emuConfig.PlatformMap.enabledBIOSHashes; + + callingObject.#loadRoms(); + callingObject.OkCallback(); + mappingModal.close(); }); - callingObject.Platform.emulatorConfiguration.emulatorType = emuConfig.PlatformMap.webEmulator.type; - callingObject.Platform.emulatorConfiguration.core = emuConfig.PlatformMap.webEmulator.core; - callingObject.Platform.emulatorConfiguration.enabledBIOSHashes = emuConfig.PlatformMap.enabledBIOSHashes; + mappingModal.addButton(okButton); - callingObject.#loadRoms(); - callingObject.OkCallback(); - mappingModal.close(); - }); - mappingModal.addButton(okButton); + let cancelButton = new ModalButton('Cancel', 0, mappingModal, async function (callingObject) { + mappingModal.close(); + }); + mappingModal.addButton(cancelButton); - let cancelButton = new ModalButton('Cancel', 0, mappingModal, async function (callingObject) { - mappingModal.close(); + // show the dialog + await mappingModal.open(); }); - mappingModal.addButton(cancelButton); - - // show the dialog - await mappingModal.open(); - }); - this.romsModal.addButton(platformEditButton); + this.romsModal.addButton(platformEditButton); + } let closeButton = new ModalButton('Close', 0, this, function (callingObject) { callingObject.romsModal.close();