update webui messaging around syncing when game ws is available
This commit is contained in:
		
							parent
							
								
									d52cbb9ac4
								
							
						
					
					
						commit
						22a9cd2436
					
				@ -93,7 +93,7 @@
 | 
			
		||||
                </form>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div data-route="/webui/inventory" data-title="Inventory | OpenWF WebUI">
 | 
			
		||||
                <p class="mb-3" data-loc="general_inventoryUpdateNote"></p>
 | 
			
		||||
                <p class="mb-3 inventory-update-note"></p>
 | 
			
		||||
                <div class="card mb-3">
 | 
			
		||||
                    <div class="card-header">
 | 
			
		||||
                        <ul class="nav nav-tabs card-header-tabs">
 | 
			
		||||
@ -715,7 +715,7 @@
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div data-route="/webui/mods" data-title="Mods | OpenWF WebUI">
 | 
			
		||||
                <p class="mb-3" data-loc="general_inventoryUpdateNote"></p>
 | 
			
		||||
                <p class="mb-3 inventory-update-note"></p>
 | 
			
		||||
                <div class="row g-3">
 | 
			
		||||
                    <div class="col-xxl-6">
 | 
			
		||||
                        <div class="card mb-3">
 | 
			
		||||
@ -771,7 +771,7 @@
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div data-route="/webui/quests" data-title="Quests | OpenWF WebUI">
 | 
			
		||||
                <p class="mb-3" data-loc="general_inventoryUpdateNote"></p>
 | 
			
		||||
                <p class="mb-3 inventory-update-note"></p>
 | 
			
		||||
                <div class="row g-3">
 | 
			
		||||
                    <div class="col-md-6">
 | 
			
		||||
                        <div class="card">
 | 
			
		||||
 | 
			
		||||
@ -90,6 +90,12 @@ function openWebSocket() {
 | 
			
		||||
        if ("logged_out" in msg) {
 | 
			
		||||
            logout();
 | 
			
		||||
        }
 | 
			
		||||
        if ("have_game_ws" in msg) {
 | 
			
		||||
            window.have_game_ws = msg.have_game_ws;
 | 
			
		||||
            if (window.dict) {
 | 
			
		||||
                $(".inventory-update-note").text(loc(msg.have_game_ws ? "general_inventoryUpdateNoteGameWs" : "general_inventoryUpdateNote"));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
    window.ws.onclose = function () {
 | 
			
		||||
        ws_is_open = false;
 | 
			
		||||
@ -223,6 +229,7 @@ function updateLocElements() {
 | 
			
		||||
    document.querySelectorAll("[data-loc-replace]").forEach(elm => {
 | 
			
		||||
        elm.innerHTML = elm.innerHTML.replace("|VAL|", elm.getAttribute("data-loc-replace"));
 | 
			
		||||
    });
 | 
			
		||||
    $(".inventory-update-note").text(loc(window.have_game_ws ? "general_inventoryUpdateNoteGameWs" : "general_inventoryUpdateNote"));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function setActiveLanguage(lang) {
 | 
			
		||||
@ -3468,13 +3475,13 @@ async function doUnlockAllScans() {
 | 
			
		||||
async function doUnlockAllShipFeatures() {
 | 
			
		||||
    await revalidateAuthz();
 | 
			
		||||
    await fetch("/custom/unlockAllShipFeatures?" + window.authz);
 | 
			
		||||
    toast(loc("cheats_unlockSuccInventory"));
 | 
			
		||||
    toast(loc(window.have_game_ws ? "code_succAdded" : "cheats_unlockSuccInventory"));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
async function doUnlockAllCapturaScenes() {
 | 
			
		||||
    await revalidateAuthz();
 | 
			
		||||
    await fetch("/custom/unlockAllCapturaScenes?" + window.authz);
 | 
			
		||||
    toast(loc("cheats_unlockSuccInventory"));
 | 
			
		||||
    toast(loc(window.have_game_ws ? "code_succAdded" : "cheats_unlockSuccInventory"));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
async function unlockAllMissions() {
 | 
			
		||||
@ -3486,13 +3493,13 @@ async function unlockAllMissions() {
 | 
			
		||||
async function unlockAllProfitTakerStages() {
 | 
			
		||||
    await revalidateAuthz();
 | 
			
		||||
    await fetch("/custom/unlockAllProfitTakerStages?" + window.authz);
 | 
			
		||||
    toast(loc("cheats_unlockSuccInventory"));
 | 
			
		||||
    toast(loc(window.have_game_ws ? "code_succAdded" : "cheats_unlockSuccInventory"));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
async function unlockAllSimarisResearchEntries() {
 | 
			
		||||
    await revalidateAuthz();
 | 
			
		||||
    await fetch("/custom/unlockAllSimarisResearchEntries?" + window.authz);
 | 
			
		||||
    toast(loc("cheats_unlockSuccInventory"));
 | 
			
		||||
    toast(loc(window.have_game_ws ? "code_succAdded" : "cheats_unlockSuccInventory"));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const importSamples = {
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,7 @@
 | 
			
		||||
// German translation by Animan8000
 | 
			
		||||
dict = {
 | 
			
		||||
    general_inventoryUpdateNote: `Hinweis: Um Änderungen im Spiel zu sehen, musst du dein Inventar neu synchronisieren, z. B. mit dem /sync Befehl des Bootstrappers, durch Besuch eines Dojo/Relais oder durch erneutes Einloggen.`,
 | 
			
		||||
    general_inventoryUpdateNoteGameWs: `[UNTRANSLATED] Note: You may need to reopen any menu you are on for changes to be reflected.`,
 | 
			
		||||
    general_addButton: `Hinzufügen`,
 | 
			
		||||
    general_setButton: `Festlegen`,
 | 
			
		||||
    general_none: `Keines`,
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,6 @@
 | 
			
		||||
dict = {
 | 
			
		||||
    general_inventoryUpdateNote: `Note: To see changes in-game, you need to resync your inventory, e.g. using the bootstrapper's /sync command, visiting a dojo/relay, or relogging.`,
 | 
			
		||||
    general_inventoryUpdateNoteGameWs: `Note: You may need to reopen any menu you are on for changes to be reflected.`,
 | 
			
		||||
    general_addButton: `Add`,
 | 
			
		||||
    general_setButton: `Set`,
 | 
			
		||||
    general_none: `None`,
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,7 @@
 | 
			
		||||
// Spanish translation by hxedcl
 | 
			
		||||
dict = {
 | 
			
		||||
    general_inventoryUpdateNote: `Para ver los cambios en el juego, necesitas volver a sincronizar tu inventario, por ejemplo, usando el comando /sync del bootstrapper, visitando un dojo o repetidor, o volviendo a iniciar sesión.`,
 | 
			
		||||
    general_inventoryUpdateNoteGameWs: `[UNTRANSLATED] Note: You may need to reopen any menu you are on for changes to be reflected.`,
 | 
			
		||||
    general_addButton: `Agregar`,
 | 
			
		||||
    general_setButton: `Establecer`,
 | 
			
		||||
    general_none: `Ninguno`,
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,7 @@
 | 
			
		||||
// French translation by Vitruvio
 | 
			
		||||
dict = {
 | 
			
		||||
    general_inventoryUpdateNote: `Note : Pour voir les changements en jeu, l'inventaire doit être actualisé. Cela se fait en tapant /sync dans le tchat, en visitant un dojo/relais ou en se reconnectant.`,
 | 
			
		||||
    general_inventoryUpdateNoteGameWs: `[UNTRANSLATED] Note: You may need to reopen any menu you are on for changes to be reflected.`,
 | 
			
		||||
    general_addButton: `Ajouter`,
 | 
			
		||||
    general_setButton: `Définir`,
 | 
			
		||||
    general_none: `Aucun`,
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,7 @@
 | 
			
		||||
// Russian translation by AMelonInsideLemon, LoseFace
 | 
			
		||||
dict = {
 | 
			
		||||
    general_inventoryUpdateNote: `Примечание: Чтобы увидеть изменения в игре, вам нужно повторно синхронизировать свой инвентарь, например, используя команду /sync загрузчика, посетив Додзё/Реле или перезагрузив игру.`,
 | 
			
		||||
    general_inventoryUpdateNoteGameWs: `[UNTRANSLATED] Note: You may need to reopen any menu you are on for changes to be reflected.`,
 | 
			
		||||
    general_addButton: `Добавить`,
 | 
			
		||||
    general_setButton: `Установить`,
 | 
			
		||||
    general_none: `Отсутствует`,
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,7 @@
 | 
			
		||||
// Ukrainian translation by LoseFace
 | 
			
		||||
dict = {
 | 
			
		||||
    general_inventoryUpdateNote: `Пам'ятка: Щоб побачити зміни в грі, вам потрібно повторно синхронізувати своє спорядження, наприклад, використовуючи команду /sync завантажувача, відвідавши Доджьо/Реле або перезавантаживши гру.`,
 | 
			
		||||
    general_inventoryUpdateNoteGameWs: `[UNTRANSLATED] Note: You may need to reopen any menu you are on for changes to be reflected.`,
 | 
			
		||||
    general_addButton: `Добавити`,
 | 
			
		||||
    general_setButton: `Встановити`,
 | 
			
		||||
    general_none: `Відсутній`,
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,7 @@
 | 
			
		||||
// Chinese translation by meb154, bishan178, nyaoouo, qianlishun, CrazyZhang, Corvus, & qingchun
 | 
			
		||||
dict = {
 | 
			
		||||
    general_inventoryUpdateNote: `注意: 要在游戏中查看更改,您需要重新同步库存,例如使用客户端的 /sync 命令,访问道场/中继站或重新登录.`,
 | 
			
		||||
    general_inventoryUpdateNoteGameWs: `[UNTRANSLATED] Note: You may need to reopen any menu you are on for changes to be reflected.`,
 | 
			
		||||
    general_addButton: `添加`,
 | 
			
		||||
    general_setButton: `设置`,
 | 
			
		||||
    general_none: `无`,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user