diff --git a/client/src/services/GameDataManager.js b/client/src/services/GameDataManager.js index 333743a..e83e565 100644 --- a/client/src/services/GameDataManager.js +++ b/client/src/services/GameDataManager.js @@ -9,7 +9,7 @@ class GameDataManager { this.enemies = new Map(); this.translations = {}; this.manifest = {}; - this.currentLang = "en_US"; + this.currentLang = localStorage.getItem("selected_lang") || "en_us"; this.isLoaded = false; } diff --git a/client/src/views/GameInterface/components/GameHeader.jsx b/client/src/views/GameInterface/components/GameHeader.jsx index f449385..a4dcb9e 100644 --- a/client/src/views/GameInterface/components/GameHeader.jsx +++ b/client/src/views/GameInterface/components/GameHeader.jsx @@ -1,51 +1,59 @@ -import React from "react"; +import React, { useState } from "react"; import { useSocket } from "../../../hooks/useSocket"; +import SettingsModal from "./SettingsModal"; import "./GameHeader.css"; const GameHeader = ({ onReturn }) => { const { disconnectFromServer } = useSocket(); + const [isSettingsOpen, setIsSettingsOpen] = useState(false); const handleHomeClick = () => { localStorage.removeItem("activeServer"); - disconnectFromServer(); - if (onReturn) { onReturn(); } }; return ( -
-
-

GSO

-
- - Commander - - - Lv. 1 - -
-
-
-
-
- - 100/100 + <> +
+
+

GSO

+
+ Commander + Lv. 1
-
-
- -
-
+ +
+
+
+ + 100/100 +
+
+
+ +
+ + + +
+ + + {isSettingsOpen && ( + setIsSettingsOpen(false)} /> + )} + ); }; diff --git a/client/src/views/GameInterface/components/Navigation.jsx b/client/src/views/GameInterface/components/Navigation.jsx index 0d26490..e319d13 100644 --- a/client/src/views/GameInterface/components/Navigation.jsx +++ b/client/src/views/GameInterface/components/Navigation.jsx @@ -1,17 +1,23 @@ import React from "react"; +import GameDataManager from "../../../services/GameDataManager.js"; import "./Navigation.css"; const Navigation = ({ activeTab, onTabChange }) => { const tabs = [ - { id: "dashboard", icon: "fa-tachometer-alt", label: "Dashboard" }, - { id: "dungeons", icon: "fa-dungeon", label: "Dungeons" }, - { id: "skills", icon: "fa-graduation-cap", label: "Skills" }, - { id: "inventory", icon: "fa-archive", label: "Inventory" }, - { id: "shop", icon: "fa-store", label: "Shop" }, - { id: "crafting", icon: "fa-hammer", label: "Crafting" }, - { id: "itemlist", iocon: "fa-store", label: "Item List" }, + { id: "dashboard", icon: "fa-tachometer-alt" }, + { id: "dungeons", icon: "fa-dungeon" }, + { id: "skills", icon: "fa-graduation-cap" }, + { id: "inventory", icon: "fa-archive" }, + { id: "shop", icon: "fa-store" }, + { id: "crafting", icon: "fa-hammer" }, + { id: "itemlist", icon: "fa-list-ul" }, ]; + const getLabel = (id) => { + if (id === "itemlist") return "ITEM_LIST"; + return GameDataManager.t(`category.tabs.original.${id}`); + }; + return (