From 78538d68f5c36f5c89af717eb442bb45f21648ae Mon Sep 17 00:00:00 2001 From: Jan Laupetin Date: Thu, 16 Oct 2025 21:22:47 +0100 Subject: [PATCH 01/23] chore: use PrimeVue components --- .../build/HeaderTransformationPlugin.ts | 2 +- src/ModManUi/package-lock.json | 96 ++++++++++++++++ src/ModManUi/package.json | 3 + src/ModManUi/src/App.vue | 88 ++++++--------- src/ModManUi/src/PrimeVue.ts | 35 ++++++ src/ModManUi/src/components/ZoneSelector.vue | 54 +++++++++ src/ModManUi/src/main.scss | 104 ++---------------- src/ModManUi/src/main.ts | 3 + src/ModManUi/src/stores/ZoneStore.ts | 4 +- 9 files changed, 241 insertions(+), 148 deletions(-) create mode 100644 src/ModManUi/src/PrimeVue.ts create mode 100644 src/ModManUi/src/components/ZoneSelector.vue diff --git a/src/ModManUi/build/HeaderTransformationPlugin.ts b/src/ModManUi/build/HeaderTransformationPlugin.ts index 4d6fba3c..c2269f0a 100644 --- a/src/ModManUi/build/HeaderTransformationPlugin.ts +++ b/src/ModManUi/build/HeaderTransformationPlugin.ts @@ -8,7 +8,7 @@ type MinimalOutputChunk = Pick; type MinimalOutputBundle = Record; function createVarName(fileName: string) { - return fileName.replaceAll(".", "_").toUpperCase(); + return fileName.replaceAll(/[\.-]/g, "_").toUpperCase(); } function transformAsset(asset: MinimalOutputAsset) { diff --git a/src/ModManUi/package-lock.json b/src/ModManUi/package-lock.json index d64a29a2..40b2841d 100644 --- a/src/ModManUi/package-lock.json +++ b/src/ModManUi/package-lock.json @@ -8,7 +8,10 @@ "name": "openassettools", "version": "0.1.0", "dependencies": { + "@fontsource/inter": "^5.2.8", + "@primeuix/themes": "^1.2.5", "pinia": "3.0.3", + "primevue": "^4.4.1", "vue": "3.5.22" }, "devDependencies": { @@ -1324,6 +1327,15 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@fontsource/inter": { + "version": "5.2.8", + "resolved": "https://registry.npmjs.org/@fontsource/inter/-/inter-5.2.8.tgz", + "integrity": "sha512-P6r5WnJoKiNVV+zvW2xM13gNdFhAEpQ9dQJHt3naLvfg+LkF2ldgSLiF4T41lf1SQCM9QmkqPTn4TH568IRagg==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, "node_modules/@humanfs/core": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", @@ -1829,6 +1841,74 @@ "dev": true, "license": "MIT" }, + "node_modules/@primeuix/styled": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@primeuix/styled/-/styled-0.7.4.tgz", + "integrity": "sha512-QSO/NpOQg8e9BONWRBx9y8VGMCMYz0J/uKfNJEya/RGEu7ARx0oYW0ugI1N3/KB1AAvyGxzKBzGImbwg0KUiOQ==", + "license": "MIT", + "dependencies": { + "@primeuix/utils": "^0.6.1" + }, + "engines": { + "node": ">=12.11.0" + } + }, + "node_modules/@primeuix/styles": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@primeuix/styles/-/styles-1.2.5.tgz", + "integrity": "sha512-nypFRct/oaaBZqP4jinT0puW8ZIfs4u+l/vqUFmJEPU332fl5ePj6DoOpQgTLzo3OfmvSmz5a5/5b4OJJmmi7Q==", + "license": "MIT", + "dependencies": { + "@primeuix/styled": "^0.7.3" + } + }, + "node_modules/@primeuix/themes": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@primeuix/themes/-/themes-1.2.5.tgz", + "integrity": "sha512-n3YkwJrHQaEESc/D/A/iD815sxp8cKnmzscA6a8Tm8YvMtYU32eCahwLLe6h5rywghVwxASWuG36XBgISYOIjQ==", + "license": "MIT", + "dependencies": { + "@primeuix/styled": "^0.7.3" + } + }, + "node_modules/@primeuix/utils": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@primeuix/utils/-/utils-0.6.1.tgz", + "integrity": "sha512-tQL/ZOPgCdD+NTimlUmhyD0ey8J1XmpZE4hDHM+/fnuBicVVmlKOd5HpS748LcOVRUKbWjmEPdHX4hi5XZoC1Q==", + "license": "MIT", + "engines": { + "node": ">=12.11.0" + } + }, + "node_modules/@primevue/core": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@primevue/core/-/core-4.4.1.tgz", + "integrity": "sha512-RG56iDKIJT//EtntjQzOiWOHZZJczw/qWWtdL5vFvw8/QDS9DPKn8HLpXK7N5Le6KK1MLXUsxoiGTZK+poUFUg==", + "license": "MIT", + "dependencies": { + "@primeuix/styled": "^0.7.4", + "@primeuix/utils": "^0.6.1" + }, + "engines": { + "node": ">=12.11.0" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + }, + "node_modules/@primevue/icons": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@primevue/icons/-/icons-4.4.1.tgz", + "integrity": "sha512-UfDimrIjVdY6EziwieyV4zPKzW6mnKHKhy4Dgyjv2oI6pNeuim+onbJo1ce22PEGXW78vfblG/3/JIzVHFweqQ==", + "license": "MIT", + "dependencies": { + "@primeuix/utils": "^0.6.1", + "@primevue/core": "4.4.1" + }, + "engines": { + "node": ">=12.11.0" + } + }, "node_modules/@rolldown/pluginutils": { "version": "1.0.0-beta.29", "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.29.tgz", @@ -5369,6 +5449,22 @@ "node": ">=6.0.0" } }, + "node_modules/primevue": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/primevue/-/primevue-4.4.1.tgz", + "integrity": "sha512-JbHBa5k30pZ7mn/z4vYBOnyt5GrR15eM3X0wa3VanonxnFLYkTEx8OMh33aU6ndWeOfi7Ef57dOL3bTH+3f4hQ==", + "license": "MIT", + "dependencies": { + "@primeuix/styled": "^0.7.4", + "@primeuix/styles": "^1.2.5", + "@primeuix/utils": "^0.6.1", + "@primevue/core": "4.4.1", + "@primevue/icons": "4.4.1" + }, + "engines": { + "node": ">=12.11.0" + } + }, "node_modules/proto-list": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", diff --git a/src/ModManUi/package.json b/src/ModManUi/package.json index aaba126d..0eeaac30 100644 --- a/src/ModManUi/package.json +++ b/src/ModManUi/package.json @@ -13,7 +13,10 @@ "format": "prettier --write **/*.{js,ts,vue,html,json,yml,yaml,md}" }, "dependencies": { + "@fontsource/inter": "^5.2.8", + "@primeuix/themes": "^1.2.5", "pinia": "3.0.3", + "primevue": "^4.4.1", "vue": "3.5.22" }, "devDependencies": { diff --git a/src/ModManUi/src/App.vue b/src/ModManUi/src/App.vue index 73f92c86..d79530fc 100644 --- a/src/ModManUi/src/App.vue +++ b/src/ModManUi/src/App.vue @@ -1,16 +1,15 @@ @@ -90,33 +83,28 @@ webviewAddEventListener("zoneUnlinkProgress", (dto) => { Nothing to see here yet, this is mainly for testing
- - +
-
-

Loaded zones:

-
-
- {{ zone }} - -
-
-
+ -
-
-
+ @@ -127,10 +115,6 @@ webviewAddEventListener("zoneUnlinkProgress", (dto) => { column-gap: 0.5em; } -.loading { - margin-right: 0.2em; -} - .zone-list { display: flex; flex-direction: column; @@ -141,23 +125,21 @@ webviewAddEventListener("zoneUnlinkProgress", (dto) => { margin-left: 0.5em; } -.progressbar-wrapper { +@starting-style { + .progressbar { + opacity: 0; + } +} + +.progressbar { position: absolute; bottom: 0; left: 0; right: 0; - padding: 0.35rem 0.4rem; -} -.progressbar { - opacity: 0; height: 0.4rem; - border-radius: 2.5rem; - background-color: #b9772c; - transition: opacity 0.2s ease-in-out; - &.visible { - opacity: 1; - } + transition: opacity 0.2s ease-in-out; + opacity: 1; } diff --git a/src/ModManUi/src/PrimeVue.ts b/src/ModManUi/src/PrimeVue.ts new file mode 100644 index 00000000..9eb4aeb4 --- /dev/null +++ b/src/ModManUi/src/PrimeVue.ts @@ -0,0 +1,35 @@ +import type { App } from "vue"; +import PrimeVue from "primevue/config"; +import Aura from "@primeuix/themes/aura"; +import { definePreset } from "@primeuix/themes"; + +const ModManTheme = definePreset(Aura, { + semantic: { + primary: { + 50: "{orange.50}", + 100: "{orange.100}", + 200: "{orange.200}", + 300: "{orange.300}", + 400: "{orange.400}", + 500: "{orange.500}", + 600: "{orange.600}", + 700: "{orange.700}", + 800: "{orange.800}", + 900: "{orange.900}", + 950: "{orange.950}", + }, + }, +}); + +export function configurePrimeVue(app: App) { + app.use(PrimeVue, { + theme: { + preset: ModManTheme, + options: { + darkModeSelector: ".dark-mode", + }, + }, + }); + // Always make dark mode for now + document.documentElement.classList.add("dark-mode"); +} diff --git a/src/ModManUi/src/components/ZoneSelector.vue b/src/ModManUi/src/components/ZoneSelector.vue new file mode 100644 index 00000000..bc098574 --- /dev/null +++ b/src/ModManUi/src/components/ZoneSelector.vue @@ -0,0 +1,54 @@ + + + + + diff --git a/src/ModManUi/src/main.scss b/src/ModManUi/src/main.scss index bfd40850..e119d56c 100644 --- a/src/ModManUi/src/main.scss +++ b/src/ModManUi/src/main.scss @@ -1,11 +1,20 @@ -:root { +@import "@fontsource/inter/latin-300.css"; +@import "@fontsource/inter/latin-300-italic.css"; +@import "@fontsource/inter/latin-400.css"; +@import "@fontsource/inter/latin-400-italic.css"; +@import "@fontsource/inter/latin-600.css"; +@import "@fontsource/inter/latin-600-italic.css"; +@import "@fontsource/inter/latin-700.css"; +@import "@fontsource/inter/latin-700-italic.css"; + +:root { font-family: Inter, Avenir, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 24px; font-weight: 400; - color: #0f0f0f; - background-color: #f6f6f6; + color: var(--p-text-color); + background-color: var(--p-content-background); font-synthesis: none; text-rendering: optimizeLegibility; @@ -33,92 +42,3 @@ body { height: 100vh; } - -.logo { - height: 6em; - padding: 1.5em; - will-change: filter; - transition: 0.75s; -} - -.logo.tauri:hover { - filter: drop-shadow(0 0 2em #24c8db); -} - -.row { - display: flex; - justify-content: center; -} - -a { - font-weight: 500; - color: #646cff; - text-decoration: inherit; -} - -a:hover { - color: #535bf2; -} - -h1 { - text-align: center; -} - -input, -button { - border-radius: 8px; - border: 1px solid transparent; - padding: 0.6em 1.2em; - font-size: 1em; - font-weight: 500; - font-family: inherit; - color: #0f0f0f; - background-color: #ffffff; - transition: border-color 0.25s; - box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2); -} - -button { - cursor: pointer; -} - -button:not(:disabled):hover { - border-color: #396cd8; -} -button:not(:disabled):active { - border-color: #396cd8; - background-color: #e8e8e8; -} -button:disabled { - opacity: 0.6; - cursor: not-allowed; -} - -input, -button { - outline: none; -} - -#greet-input { - margin-right: 5px; -} - -@media (prefers-color-scheme: dark) { - :root { - color: #f6f6f6; - background-color: #2f2f2f; - } - - a:hover { - color: #24c8db; - } - - input, - button { - color: #ffffff; - background-color: #0f0f0f98; - } - button:not(:disabled):active { - background-color: #0f0f0f69; - } -} \ No newline at end of file diff --git a/src/ModManUi/src/main.ts b/src/ModManUi/src/main.ts index d1a7b243..1f9883ef 100644 --- a/src/ModManUi/src/main.ts +++ b/src/ModManUi/src/main.ts @@ -3,6 +3,7 @@ import "./main.scss"; import { createApp } from "vue"; import { createPinia } from "pinia"; +import { configurePrimeVue } from "./PrimeVue.ts"; import App from "./App.vue"; @@ -10,4 +11,6 @@ const app = createApp(App); app.use(createPinia()); +configurePrimeVue(app); + app.mount("#app"); diff --git a/src/ModManUi/src/stores/ZoneStore.ts b/src/ModManUi/src/stores/ZoneStore.ts index 3877ab87..1b2fe86e 100644 --- a/src/ModManUi/src/stores/ZoneStore.ts +++ b/src/ModManUi/src/stores/ZoneStore.ts @@ -1,4 +1,4 @@ -import { readonly, ref } from "vue"; +import { ref } from "vue"; import { defineStore } from "pinia"; import { webviewAddEventListener } from "@/native"; @@ -16,5 +16,5 @@ export const useZoneStore = defineStore("zone", () => { } }); - return { loadedZones: readonly(loadedZones) }; + return { loadedZones }; }); From 23f5ad67e99d9b6a6b11084145ac196ab04fceac Mon Sep 17 00:00:00 2001 From: Jan Laupetin Date: Thu, 16 Oct 2025 23:04:03 +0100 Subject: [PATCH 02/23] feat: combine loading bar and zone list --- src/ModMan/Context/FastFileContext.cpp | 45 ++++++---- src/ModMan/Context/FastFileContext.h | 15 +++- src/ModMan/Web/Binds/UnlinkingBinds.cpp | 14 ++-- src/ModMan/Web/Binds/ZoneBinds.cpp | 58 +++++++++++-- src/ModMan/Web/Binds/ZoneBinds.h | 3 +- src/ModManUi/src/App.vue | 88 ++------------------ src/ModManUi/src/components/ZoneSelector.vue | 72 ++++++++++++++-- src/ModManUi/src/native/UnlinkingBinds.ts | 3 + src/ModManUi/src/native/ZoneBinds.ts | 12 ++- src/ModManUi/src/stores/UnlinkingStore.ts | 31 +++++++ src/ModManUi/src/stores/ZoneStore.ts | 64 ++++++++++++-- 11 files changed, 276 insertions(+), 129 deletions(-) create mode 100644 src/ModManUi/src/stores/UnlinkingStore.ts diff --git a/src/ModMan/Context/FastFileContext.cpp b/src/ModMan/Context/FastFileContext.cpp index 2a5f8112..1027b488 100644 --- a/src/ModMan/Context/FastFileContext.cpp +++ b/src/ModMan/Context/FastFileContext.cpp @@ -10,7 +10,7 @@ namespace fs = std::filesystem; namespace { - constexpr double MIN_PROGRESS_TO_REPORT = 0.005; + constexpr double MIN_PROGRESS_TO_REPORT = 0.5; class LoadingEventProgressReporter : public ProgressCallback { @@ -23,7 +23,7 @@ namespace void OnProgress(const size_t current, const size_t total) override { - const double percentage = static_cast(current) / static_cast(total); + const double percentage = static_cast(current) / static_cast(total) * 100.0; if (percentage - m_last_progress >= MIN_PROGRESS_TO_REPORT) { @@ -38,38 +38,53 @@ namespace }; } // namespace +LoadedZone::LoadedZone(std::unique_ptr zone, std::string filePath) + : m_zone(std::move(zone)), + m_file_path(std::move(filePath)) +{ +} + void FastFileContext::Destroy() { // Unload all zones m_loaded_zones.clear(); } -result::Expected FastFileContext::LoadFastFile(const std::string& path) +result::Expected FastFileContext::LoadFastFile(const std::string& path) { auto zone = ZoneLoading::LoadZone(path, std::make_unique(fs::path(path).filename().replace_extension().string())); if (!zone) return result::Unexpected(std::move(zone.error())); - auto* result = m_loaded_zones.emplace_back(std::move(*zone)).get(); + auto loadedZone = std::make_unique(std::move(*zone), path); - ui::NotifyZoneLoaded(result->m_name, path); + LoadedZone* result; + { + std::lock_guard lock(m_zone_lock); + result = m_loaded_zones.emplace_back(std::move(loadedZone)).get(); + } + + ui::NotifyZoneLoaded(*result); return result; } result::Expected FastFileContext::UnloadZone(const std::string& zoneName) { - const auto existingZone = std::ranges::find_if(m_loaded_zones, - [&zoneName](const std::unique_ptr& zone) - { - return zone->m_name == zoneName; - }); - - if (existingZone != m_loaded_zones.end()) { - m_loaded_zones.erase(existingZone); - ui::NotifyZoneUnloaded(zoneName); - return NoResult(); + std::lock_guard lock(m_zone_lock); + const auto existingZone = std::ranges::find_if(m_loaded_zones, + [&zoneName](const std::unique_ptr& loadedZone) + { + return loadedZone->m_zone->m_name == zoneName; + }); + + if (existingZone != m_loaded_zones.end()) + { + m_loaded_zones.erase(existingZone); + ui::NotifyZoneUnloaded(zoneName); + return NoResult(); + } } return result::Unexpected(std::format("No zone with name {} loaded", zoneName)); diff --git a/src/ModMan/Context/FastFileContext.h b/src/ModMan/Context/FastFileContext.h index a3f87a42..e769e34f 100644 --- a/src/ModMan/Context/FastFileContext.h +++ b/src/ModMan/Context/FastFileContext.h @@ -4,15 +4,26 @@ #include "Zone/Zone.h" #include +#include #include +class LoadedZone +{ +public: + std::unique_ptr m_zone; + std::string m_file_path; + + LoadedZone(std::unique_ptr zone, std::string filePath); +}; + class FastFileContext { public: void Destroy(); - result::Expected LoadFastFile(const std::string& path); + result::Expected LoadFastFile(const std::string& path); result::Expected UnloadZone(const std::string& zoneName); - std::vector> m_loaded_zones; + std::vector> m_loaded_zones; + std::shared_mutex m_zone_lock; }; diff --git a/src/ModMan/Web/Binds/UnlinkingBinds.cpp b/src/ModMan/Web/Binds/UnlinkingBinds.cpp index 82d9d9b2..ba3f7a58 100644 --- a/src/ModMan/Web/Binds/UnlinkingBinds.cpp +++ b/src/ModMan/Web/Binds/UnlinkingBinds.cpp @@ -23,7 +23,7 @@ namespace NLOHMANN_DEFINE_TYPE_EXTENSION(ZoneUnlinkProgressDto, zoneName, percentage); - constexpr double MIN_PROGRESS_TO_REPORT = 0.005; + constexpr double MIN_PROGRESS_TO_REPORT = 0.5; class UnlinkingEventProgressReporter : public ProgressCallback { @@ -36,7 +36,7 @@ namespace void OnProgress(const size_t current, const size_t total) override { - const double percentage = static_cast(current) / static_cast(total); + const double percentage = static_cast(current) / static_cast(total) * 100.0; if (percentage - m_last_progress >= MIN_PROGRESS_TO_REPORT) { @@ -54,17 +54,17 @@ namespace { const auto& context = ModManContext::Get().m_fast_file; const auto existingZone = std::ranges::find_if(context.m_loaded_zones, - [&zoneName](const std::unique_ptr& zone) + [&zoneName](const std::unique_ptr& loadedZone) { - return zone->m_name == zoneName; + return loadedZone->m_zone->m_name == zoneName; }); if (existingZone == context.m_loaded_zones.end()) return result::Unexpected(std::format("No zone with name {} loaded", zoneName)); - const auto& zone = *existingZone->get(); + const auto& loadedZone = *existingZone->get(); - const auto* objWriter = IObjWriter::GetObjWriterForGame(zone.m_game_id); + const auto* objWriter = IObjWriter::GetObjWriterForGame(loadedZone.m_zone->m_game_id); const auto outputFolderPath = fs::path(utils::GetExecutablePath()).parent_path() / "zone_dump" / zoneName; const auto outputFolderPathStr = outputFolderPath.string(); @@ -72,7 +72,7 @@ namespace OutputPathFilesystem outputFolderOutputPath(outputFolderPath); SearchPaths searchPaths; AssetDumpingContext dumpingContext( - zone, outputFolderPathStr, outputFolderOutputPath, searchPaths, std::make_unique(zoneName)); + *loadedZone.m_zone, outputFolderPathStr, outputFolderOutputPath, searchPaths, std::make_unique(zoneName)); objWriter->DumpZone(dumpingContext); return NoResult(); diff --git a/src/ModMan/Web/Binds/ZoneBinds.cpp b/src/ModMan/Web/Binds/ZoneBinds.cpp index fd538376..01b2fd70 100644 --- a/src/ModMan/Web/Binds/ZoneBinds.cpp +++ b/src/ModMan/Web/Binds/ZoneBinds.cpp @@ -7,6 +7,15 @@ namespace { + class ZoneDto + { + public: + std::string name; + std::string filePath; + }; + + NLOHMANN_DEFINE_TYPE_EXTENSION(ZoneDto, name, filePath); + class ZoneLoadProgressDto { public: @@ -19,11 +28,10 @@ namespace class ZoneLoadedDto { public: - std::string zoneName; - std::string filePath; + ZoneDto zone; }; - NLOHMANN_DEFINE_TYPE_EXTENSION(ZoneLoadedDto, zoneName, filePath); + NLOHMANN_DEFINE_TYPE_EXTENSION(ZoneLoadedDto, zone); class ZoneUnloadedDto { @@ -33,6 +41,33 @@ namespace NLOHMANN_DEFINE_TYPE_EXTENSION(ZoneUnloadedDto, zoneName); + ZoneDto CreateZoneDto(const LoadedZone& loadedZone) + { + return ZoneDto{ + .name = loadedZone.m_zone->m_name, + .filePath = loadedZone.m_file_path, + }; + } + + std::vector GetLoadedZones() + { + auto& context = ModManContext::Get().m_fast_file; + + std::vector result; + + { + std::shared_lock lock(context.m_zone_lock); + result.reserve(context.m_loaded_zones.size()); + + for (const auto& loadedZone : context.m_loaded_zones) + { + result.emplace_back(CreateZoneDto(*loadedZone)); + } + } + + return result; + } + void LoadFastFile(webview::webview& wv, std::string id, std::string path) // NOLINT(performance-unnecessary-value-param) Copy is made for thread safety { ModManContext::Get().m_db_thread.Dispatch( @@ -45,10 +80,9 @@ namespace ui::PromiseResolve(wv, id, ZoneLoadedDto{ - .zoneName = maybeZone.value()->m_name, - .filePath = path, + .zone = CreateZoneDto(*maybeZone.value()), }); - con::debug("Loaded zone \"{}\"", maybeZone.value()->m_name); + con::debug("Loaded zone \"{}\"", maybeZone.value()->m_zone->m_name); } else { @@ -89,11 +123,10 @@ namespace ui Notify(*ModManContext::Get().m_main_webview, "zoneLoadProgress", dto); } - void NotifyZoneLoaded(std::string zoneName, std::string fastFilePath) + void NotifyZoneLoaded(const LoadedZone& loadedZone) { const ZoneLoadedDto dto{ - .zoneName = std::move(zoneName), - .filePath = std::move(fastFilePath), + .zone = CreateZoneDto(loadedZone), }; Notify(*ModManContext::Get().m_main_webview, "zoneLoaded", dto); } @@ -108,6 +141,13 @@ namespace ui void RegisterZoneBinds(webview::webview& wv) { + BindRetOnly>(wv, + "getZones", + [] + { + return GetLoadedZones(); + }); + BindAsync(wv, "loadFastFile", [&wv](const std::string& id, std::string path) diff --git a/src/ModMan/Web/Binds/ZoneBinds.h b/src/ModMan/Web/Binds/ZoneBinds.h index 142d5e5b..ee2efda8 100644 --- a/src/ModMan/Web/Binds/ZoneBinds.h +++ b/src/ModMan/Web/Binds/ZoneBinds.h @@ -1,11 +1,12 @@ #pragma once +#include "Context/FastFileContext.h" #include "Web/WebViewLib.h" namespace ui { void NotifyZoneLoadProgress(std::string zoneName, double percentage); - void NotifyZoneLoaded(std::string zoneName, std::string fastFilePath); + void NotifyZoneLoaded(const LoadedZone& loadedZone); void NotifyZoneUnloaded(std::string zoneName); void RegisterZoneBinds(webview::webview& wv); diff --git a/src/ModManUi/src/App.vue b/src/ModManUi/src/App.vue index d79530fc..8e4f6e0f 100644 --- a/src/ModManUi/src/App.vue +++ b/src/ModManUi/src/App.vue @@ -1,80 +1,21 @@ @@ -113,6 +36,7 @@ webviewAddEventListener("zoneUnlinkProgress", (dto) => { display: flex; justify-content: center; column-gap: 0.5em; + margin-top: 1em; } .zone-list { diff --git a/src/ModManUi/src/components/ZoneSelector.vue b/src/ModManUi/src/components/ZoneSelector.vue index bc098574..2e4ab4b0 100644 --- a/src/ModManUi/src/components/ZoneSelector.vue +++ b/src/ModManUi/src/components/ZoneSelector.vue @@ -1,17 +1,46 @@ diff --git a/src/ModManUi/src/components/unlinking/zone_selector/ZoneSelector.vue b/src/ModManUi/src/components/unlinking/zone_selector/ZoneSelector.vue new file mode 100644 index 00000000..02a85d85 --- /dev/null +++ b/src/ModManUi/src/components/unlinking/zone_selector/ZoneSelector.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/src/ModManUi/src/components/unlinking/zone_selector/ZoneSelectorDetails.vue b/src/ModManUi/src/components/unlinking/zone_selector/ZoneSelectorDetails.vue new file mode 100644 index 00000000..100f4a04 --- /dev/null +++ b/src/ModManUi/src/components/unlinking/zone_selector/ZoneSelectorDetails.vue @@ -0,0 +1,26 @@ + + + + + diff --git a/src/ModManUi/src/components/ZoneSelector.vue b/src/ModManUi/src/components/unlinking/zone_selector/ZoneSelectorZoneList.vue similarity index 51% rename from src/ModManUi/src/components/ZoneSelector.vue rename to src/ModManUi/src/components/unlinking/zone_selector/ZoneSelectorZoneList.vue index 2e4ab4b0..4a10814d 100644 --- a/src/ModManUi/src/components/ZoneSelector.vue +++ b/src/ModManUi/src/components/unlinking/zone_selector/ZoneSelectorZoneList.vue @@ -2,7 +2,7 @@ import Button from "primevue/button"; import ProgressBar from "primevue/progressbar"; import Listbox from "primevue/listbox"; -import { computed, ref, watch } from "vue"; +import { computed } from "vue"; import { useZoneStore } from "@/stores/ZoneStore"; import { webviewBinds } from "@/native"; @@ -12,7 +12,18 @@ interface SelectableZone { } const zoneStore = useZoneStore(); -const selectedZone = ref(null); +const selectedZone = defineModel("selectedZone"); + +async function openFastFileSelect() { + return await webviewBinds.openFileDialog({ filters: [{ name: "Fastfiles", filter: "*.ff" }] }); +} + +async function onOpenFastFileClick() { + const fastFilePath = await openFastFileSelect(); + if (!fastFilePath) return; + + zoneStore.loadFastFile(fastFilePath); +} const availableZones = computed(() => { const result = [ @@ -40,64 +51,48 @@ const availableZones = computed(() => { function onUnloadClicked() { if (!selectedZone.value) return; - webviewBinds.unloadZone(selectedZone.value.zoneName).catch((e: string) => { + webviewBinds.unloadZone(selectedZone.value).catch((e: string) => { console.error("Failed to unload zone:", e); }); } - -watch( - () => zoneStore.loadedZones, - (newValue) => { - // Reset selection if unloaded - if (!selectedZone.value) return; - if (newValue.findIndex((loadedZone) => loadedZone.name === selectedZone.value?.zoneName) >= 0) - return; - selectedZone.value = null; - }, - { deep: true }, -); diff --git a/src/ModManUi/src/native/AssetBinds.ts b/src/ModManUi/src/native/AssetBinds.ts index 4e98dfc2..ce8a2f6c 100644 --- a/src/ModManUi/src/native/AssetBinds.ts +++ b/src/ModManUi/src/native/AssetBinds.ts @@ -17,7 +17,7 @@ export enum CommonAssetType { LIGHT_DEF = "LIGHT_DEF", UI_MAP = "UI_MAP", FONT = "FONT", - MENULIST = "MENULIST", + MENU_LIST = "MENU_LIST", MENU = "MENU", LOCALIZE_ENTRY = "LOCALIZE_ENTRY", WEAPON = "WEAPON", diff --git a/src/ModManUi/src/native/ZoneBinds.ts b/src/ModManUi/src/native/ZoneBinds.ts index f5babce3..1be14aad 100644 --- a/src/ModManUi/src/native/ZoneBinds.ts +++ b/src/ModManUi/src/native/ZoneBinds.ts @@ -1,6 +1,22 @@ +export enum GameId { + IW3 = "IW3", + IW4 = "IW4", + IW5 = "IW5", + T5 = "T5", + T6 = "T6", +} + +export enum GamePlatform { + PC = "PC", + XBOX = "XBOX", + PS3 = "PS3", +} + export interface ZoneDto { name: string; filePath: string; + game: GameId; + platform: GamePlatform; } export interface ZoneLoadProgressDto { diff --git a/src/ModManUi/src/utils/AssetTypeName.ts b/src/ModManUi/src/utils/AssetTypeName.ts new file mode 100644 index 00000000..d4c3e8d7 --- /dev/null +++ b/src/ModManUi/src/utils/AssetTypeName.ts @@ -0,0 +1,85 @@ +import { CommonAssetType } from "@/native/AssetBinds"; + +const LOOKUP_CAPITALIZED: Record = { + [CommonAssetType.PHYS_PRESET]: "Phys preset", + [CommonAssetType.XANIM]: "XAnim", + [CommonAssetType.XMODEL]: "XModel", + [CommonAssetType.MATERIAL]: "Material", + [CommonAssetType.TECHNIQUE_SET]: "Technique set", + [CommonAssetType.IMAGE]: "Image", + [CommonAssetType.SOUND]: "Sound", + [CommonAssetType.SOUND_CURVE]: "Sound curve", + [CommonAssetType.LOADED_SOUND]: "Loaded sound", + [CommonAssetType.CLIP_MAP]: "Clip map", + [CommonAssetType.COM_WORLD]: "Com world", + [CommonAssetType.GAME_WORLD_SP]: "Game world SP", + [CommonAssetType.GAME_WORLD_MP]: "Game world MP", + [CommonAssetType.MAP_ENTS]: "Map ents", + [CommonAssetType.GFX_WORLD]: "Gfx world", + [CommonAssetType.LIGHT_DEF]: "Light def", + [CommonAssetType.UI_MAP]: "UI map", + [CommonAssetType.FONT]: "Font", + [CommonAssetType.MENU_LIST]: "Menu list", + [CommonAssetType.MENU]: "Menu", + [CommonAssetType.LOCALIZE_ENTRY]: "Localize entry", + [CommonAssetType.WEAPON]: "Weapon", + [CommonAssetType.SOUND_DRIVER_GLOBALS]: "Sound driver globals", + [CommonAssetType.FX]: "FX", + [CommonAssetType.IMPACT_FX]: "Impact FX", + [CommonAssetType.AI_TYPE]: "AI type", + [CommonAssetType.MP_TYPE]: "MP type", + [CommonAssetType.CHARACTER]: "Character", + [CommonAssetType.XMODEL_ALIAS]: "XModel alias", + [CommonAssetType.RAW_FILE]: "Raw file", + [CommonAssetType.STRING_TABLE]: "String table", + [CommonAssetType.XMODEL_PIECES]: "XModel pieces", + [CommonAssetType.PHYS_COLL_MAP]: "Phys coll map", + [CommonAssetType.XMODEL_SURFS]: "XModel surfs", + [CommonAssetType.PIXEL_SHADER]: "Pixel shader", + [CommonAssetType.VERTEX_SHADER]: "Vertex shader", + [CommonAssetType.VERTEX_DECL]: "Vertex decl", + [CommonAssetType.FX_WORLD]: "FX world", + [CommonAssetType.LEADERBOARD]: "Leaderboard", + [CommonAssetType.STRUCTURED_DATA_DEF]: "Structured data def", + [CommonAssetType.TRACER]: "Tracer", + [CommonAssetType.VEHICLE]: "Vehicle", + [CommonAssetType.ADDON_MAP_ENTS]: "Addon map ents", + [CommonAssetType.GLASS_WORLD]: "Glass world", + [CommonAssetType.PATH_DATA]: "Path data", + [CommonAssetType.VEHICLE_TRACK]: "Vehicle track", + [CommonAssetType.ATTACHMENT]: "Attachment", + [CommonAssetType.SURFACE_FX]: "Surface FX", + [CommonAssetType.SCRIPT]: "Script", + [CommonAssetType.PHYS_CONSTRAINTS]: "Phys constraints", + [CommonAssetType.DESTRUCTIBLE_DEF]: "Destructible def", + [CommonAssetType.SOUND_PATCH]: "Sound patch", + [CommonAssetType.WEAPON_DEF]: "Weapon def", + [CommonAssetType.WEAPON_VARIANT]: "Weapon variant", + [CommonAssetType.MP_BODY]: "MP body", + [CommonAssetType.MP_HEAD]: "MP head", + [CommonAssetType.PACK_INDEX]: "Pack index", + [CommonAssetType.XGLOBALS]: "XGlobals", + [CommonAssetType.DDL]: "DDL", + [CommonAssetType.GLASSES]: "Glasses", + [CommonAssetType.EMBLEM_SET]: "Emblem set", + [CommonAssetType.FONT_ICON]: "Font icon", + [CommonAssetType.WEAPON_FULL]: "Weapon full", + [CommonAssetType.ATTACHMENT_UNIQUE]: "Attachment unique", + [CommonAssetType.WEAPON_CAMO]: "Weapon camo", + [CommonAssetType.KEY_VALUE_PAIRS]: "Key value pairs", + [CommonAssetType.MEMORY_BLOCK]: "Memory block", + [CommonAssetType.SKINNED_VERTS]: "Skinned verts", + [CommonAssetType.QDB]: "Qdb", + [CommonAssetType.SLUG]: "Slug", + [CommonAssetType.FOOTSTEP_TABLE]: "Footstep table", + [CommonAssetType.FOOTSTEP_FX_TABLE]: "Footstep FX table", + [CommonAssetType.ZBARRIER]: "ZBarrier", +}; + +export function getAssetTypeNameCapitalized(assetType: CommonAssetType): string { + return LOOKUP_CAPITALIZED[assetType]; +} + +export function getAssetTypeNameLower(assetType: CommonAssetType): string { + return getAssetTypeNameCapitalized(assetType).toLocaleLowerCase(); +} diff --git a/src/ZoneCommon/Zone/Zone.cpp b/src/ZoneCommon/Zone/Zone.cpp index 8c160d89..4f0fe2b5 100644 --- a/src/ZoneCommon/Zone/Zone.cpp +++ b/src/ZoneCommon/Zone/Zone.cpp @@ -2,11 +2,12 @@ #include "ZoneRegistry.h" -Zone::Zone(std::string name, const zone_priority_t priority, GameId gameId) +Zone::Zone(std::string name, const zone_priority_t priority, const GameId gameId, const GamePlatform platform) : m_name(std::move(name)), m_priority(priority), m_language(GameLanguage::LANGUAGE_NONE), m_game_id(gameId), + m_platform(platform), m_pools(ZoneAssetPools::CreateForGame(gameId, this, priority)), m_memory(std::make_unique()), m_registered(false) diff --git a/src/ZoneCommon/Zone/Zone.h b/src/ZoneCommon/Zone/Zone.h index 658bb412..a4f57018 100644 --- a/src/ZoneCommon/Zone/Zone.h +++ b/src/ZoneCommon/Zone/Zone.h @@ -15,7 +15,7 @@ class ZoneAssetPools; class Zone { public: - Zone(std::string name, zone_priority_t priority, GameId gameId); + Zone(std::string name, zone_priority_t priority, GameId gameId, GamePlatform platform); ~Zone(); Zone(const Zone& other) = delete; Zone(Zone&& other) noexcept = default; @@ -30,6 +30,7 @@ public: zone_priority_t m_priority; GameLanguage m_language; GameId m_game_id; + GamePlatform m_platform; ZoneScriptStrings m_script_strings; std::unique_ptr m_pools; diff --git a/src/ZoneLoading/Game/IW3/ZoneLoaderFactoryIW3.cpp b/src/ZoneLoading/Game/IW3/ZoneLoaderFactoryIW3.cpp index ae0708d5..0a81643c 100644 --- a/src/ZoneLoading/Game/IW3/ZoneLoaderFactoryIW3.cpp +++ b/src/ZoneLoading/Game/IW3/ZoneLoaderFactoryIW3.cpp @@ -69,7 +69,7 @@ std::unique_ptr ZoneLoaderFactory::CreateLoaderForHeader(const ZoneH return nullptr; // Create new zone - auto zone = std::make_unique(fileName, 0, GameId::IW3); + auto zone = std::make_unique(fileName, 0, GameId::IW3, inspectResult->m_platform); auto* zonePtr = zone.get(); zone->m_pools = std::make_unique(zonePtr, 0); zone->m_language = GameLanguage::LANGUAGE_NONE; diff --git a/src/ZoneLoading/Game/IW4/ZoneLoaderFactoryIW4.cpp b/src/ZoneLoading/Game/IW4/ZoneLoaderFactoryIW4.cpp index 3a23cbc9..78116b19 100644 --- a/src/ZoneLoading/Game/IW4/ZoneLoaderFactoryIW4.cpp +++ b/src/ZoneLoading/Game/IW4/ZoneLoaderFactoryIW4.cpp @@ -211,7 +211,7 @@ std::unique_ptr ZoneLoaderFactory::CreateLoaderForHeader(const ZoneH return nullptr; // Create new zone - auto zone = std::make_unique(fileName, 0, GameId::IW4); + auto zone = std::make_unique(fileName, 0, GameId::IW4, inspectResult->m_generic_result.m_platform); auto* zonePtr = zone.get(); zone->m_pools = std::make_unique(zonePtr, 0); zone->m_language = GameLanguage::LANGUAGE_NONE; diff --git a/src/ZoneLoading/Game/IW5/ZoneLoaderFactoryIW5.cpp b/src/ZoneLoading/Game/IW5/ZoneLoaderFactoryIW5.cpp index d3d3cbb7..557d5537 100644 --- a/src/ZoneLoading/Game/IW5/ZoneLoaderFactoryIW5.cpp +++ b/src/ZoneLoading/Game/IW5/ZoneLoaderFactoryIW5.cpp @@ -165,7 +165,7 @@ std::unique_ptr ZoneLoaderFactory::CreateLoaderForHeader(const ZoneH return nullptr; // Create new zone - auto zone = std::make_unique(fileName, 0, GameId::IW5); + auto zone = std::make_unique(fileName, 0, GameId::IW5, inspectResult->m_platform); auto* zonePtr = zone.get(); zone->m_pools = std::make_unique(zonePtr, 0); zone->m_language = GameLanguage::LANGUAGE_NONE; diff --git a/src/ZoneLoading/Game/T5/ZoneLoaderFactoryT5.cpp b/src/ZoneLoading/Game/T5/ZoneLoaderFactoryT5.cpp index 861a0d4d..7d93b5d2 100644 --- a/src/ZoneLoading/Game/T5/ZoneLoaderFactoryT5.cpp +++ b/src/ZoneLoading/Game/T5/ZoneLoaderFactoryT5.cpp @@ -68,7 +68,7 @@ std::unique_ptr ZoneLoaderFactory::CreateLoaderForHeader(const ZoneH return nullptr; // Create new zone - auto zone = std::make_unique(fileName, 0, GameId::T5); + auto zone = std::make_unique(fileName, 0, GameId::T5, inspectResult->m_platform); auto* zonePtr = zone.get(); zone->m_pools = std::make_unique(zonePtr, 0); zone->m_language = GameLanguage::LANGUAGE_NONE; diff --git a/src/ZoneLoading/Game/T6/ZoneLoaderFactoryT6.cpp b/src/ZoneLoading/Game/T6/ZoneLoaderFactoryT6.cpp index b4023dc0..f4a40755 100644 --- a/src/ZoneLoading/Game/T6/ZoneLoaderFactoryT6.cpp +++ b/src/ZoneLoading/Game/T6/ZoneLoaderFactoryT6.cpp @@ -284,7 +284,7 @@ std::unique_ptr ZoneLoaderFactory::CreateLoaderForHeader(const ZoneH return nullptr; // Create new zone - auto zone = std::make_unique(fileName, 0, GameId::T6); + auto zone = std::make_unique(fileName, 0, GameId::T6, inspectResult->m_generic_result.m_platform); auto* zonePtr = zone.get(); zone->m_pools = std::make_unique(zonePtr, 0); zone->m_language = GetZoneLanguage(fileName); From 94cc12f4af08226a0d707520ac2741267c760ec7 Mon Sep 17 00:00:00 2001 From: Jan Laupetin Date: Tue, 21 Oct 2025 23:45:19 +0100 Subject: [PATCH 06/23] fix: add platform to test code --- .../Game/T6/KeyValuePairs/KeyValuePairsCompilerT6Test.cpp | 2 +- test/ObjCompilingTests/Image/IPak/IPakCreatorTest.cpp | 2 +- test/ObjCompilingTests/Image/ImageIPakPostProcessorTest.cpp | 2 +- test/ObjCompilingTests/Image/ImageIwdPostProcessorTest.cpp | 2 +- test/ObjCompilingTests/Iwd/IwdCreatorTest.cpp | 2 +- .../ObjLoadingTests/Game/IW3/Material/LoaderMaterialIW3Test.cpp | 2 +- .../Game/IW3/StringTable/AssetLoaderStringTableIW3Test.cpp | 2 +- .../Game/IW4/AssetLoaders/LoaderStringTableIW4Test.cpp | 2 +- .../ObjLoadingTests/Game/IW4/Material/LoaderMaterialIW4Test.cpp | 2 +- test/ObjLoadingTests/Game/IW4/Menu/LoaderMenuListIW4Test.cpp | 2 +- .../Game/IW5/AssetLoaders/LoaderStringTableIW5Test.cpp | 2 +- .../ObjLoadingTests/Game/IW5/Material/LoaderMaterialIW5Test.cpp | 2 +- .../Game/T5/AssetLoaders/LoaderStringTableT5Test.cpp | 2 +- test/ObjLoadingTests/Game/T5/Material/LoaderMaterialT5Test.cpp | 2 +- .../Game/T6/AssetLoaders/LoaderStringTableT6Test.cpp | 2 +- .../Game/T6/FontIcon/JsonLoaderFontIconT6Test.cpp | 2 +- test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp | 2 +- .../Game/IW3/Material/MaterialJsonDumperIW3Test.cpp | 2 +- .../Game/IW4/Material/MaterialJsonDumperIW4Test.cpp | 2 +- .../Game/IW5/Material/MaterialJsonDumperIW5Test.cpp | 2 +- .../Game/T5/Material/MaterialJsonDumperT5Test.cpp | 2 +- .../Game/T6/FontIcon/FontIconJsonDumperT6Test.cpp | 2 +- .../Game/T6/Material/MaterialJsonDumperT6Test.cpp | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/test/ObjCompilingTests/Game/T6/KeyValuePairs/KeyValuePairsCompilerT6Test.cpp b/test/ObjCompilingTests/Game/T6/KeyValuePairs/KeyValuePairsCompilerT6Test.cpp index 4d5ab4fa..7e81cf1b 100644 --- a/test/ObjCompilingTests/Game/T6/KeyValuePairs/KeyValuePairsCompilerT6Test.cpp +++ b/test/ObjCompilingTests/Game/T6/KeyValuePairs/KeyValuePairsCompilerT6Test.cpp @@ -20,7 +20,7 @@ namespace public: TestContext() : m_memory(), - m_zone("test", 0, GameId::T6), + m_zone("test", 0, GameId::T6, GamePlatform::PC), m_zone_definition(), m_zone_states(m_zone), m_creators(m_zone), diff --git a/test/ObjCompilingTests/Image/IPak/IPakCreatorTest.cpp b/test/ObjCompilingTests/Image/IPak/IPakCreatorTest.cpp index fc423589..1f2d74df 100644 --- a/test/ObjCompilingTests/Image/IPak/IPakCreatorTest.cpp +++ b/test/ObjCompilingTests/Image/IPak/IPakCreatorTest.cpp @@ -20,7 +20,7 @@ namespace { public: TestContext() - : m_zone("test", 0, GameId::T6), + : m_zone("test", 0, GameId::T6, GamePlatform::PC), m_zone_states(m_zone), m_out_dir() { diff --git a/test/ObjCompilingTests/Image/ImageIPakPostProcessorTest.cpp b/test/ObjCompilingTests/Image/ImageIPakPostProcessorTest.cpp index c9c6b82c..d92899bf 100644 --- a/test/ObjCompilingTests/Image/ImageIPakPostProcessorTest.cpp +++ b/test/ObjCompilingTests/Image/ImageIPakPostProcessorTest.cpp @@ -20,7 +20,7 @@ namespace { public: TestContext() - : m_zone("test", 0, GameId::T6), + : m_zone("test", 0, GameId::T6, GamePlatform::PC), m_zone_definition(), m_zone_definition_context(m_zone_definition), m_zone_states(m_zone), diff --git a/test/ObjCompilingTests/Image/ImageIwdPostProcessorTest.cpp b/test/ObjCompilingTests/Image/ImageIwdPostProcessorTest.cpp index adfef729..c9b1ddc4 100644 --- a/test/ObjCompilingTests/Image/ImageIwdPostProcessorTest.cpp +++ b/test/ObjCompilingTests/Image/ImageIwdPostProcessorTest.cpp @@ -19,7 +19,7 @@ namespace { public: TestContext() - : m_zone("test", 0, GameId::T6), + : m_zone("test", 0, GameId::T6, GamePlatform::PC), m_zone_definition(), m_zone_definition_context(m_zone_definition), m_zone_states(m_zone), diff --git a/test/ObjCompilingTests/Iwd/IwdCreatorTest.cpp b/test/ObjCompilingTests/Iwd/IwdCreatorTest.cpp index 33421760..a15cc0c4 100644 --- a/test/ObjCompilingTests/Iwd/IwdCreatorTest.cpp +++ b/test/ObjCompilingTests/Iwd/IwdCreatorTest.cpp @@ -23,7 +23,7 @@ namespace { public: TestContext() - : m_zone("test", 0, GameId::T6), + : m_zone("test", 0, GameId::T6, GamePlatform::PC), m_zone_states(m_zone), m_out_dir() { diff --git a/test/ObjLoadingTests/Game/IW3/Material/LoaderMaterialIW3Test.cpp b/test/ObjLoadingTests/Game/IW3/Material/LoaderMaterialIW3Test.cpp index 4c88b469..28806ca1 100644 --- a/test/ObjLoadingTests/Game/IW3/Material/LoaderMaterialIW3Test.cpp +++ b/test/ObjLoadingTests/Game/IW3/Material/LoaderMaterialIW3Test.cpp @@ -274,7 +274,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::IW3); + Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/IW3/StringTable/AssetLoaderStringTableIW3Test.cpp b/test/ObjLoadingTests/Game/IW3/StringTable/AssetLoaderStringTableIW3Test.cpp index 4bfd7172..c98e09be 100644 --- a/test/ObjLoadingTests/Game/IW3/StringTable/AssetLoaderStringTableIW3Test.cpp +++ b/test/ObjLoadingTests/Game/IW3/StringTable/AssetLoaderStringTableIW3Test.cpp @@ -20,7 +20,7 @@ namespace "test,data,lol\n" "lorem,ipsum"); - Zone zone("MockZone", 0, GameId::IW3); + Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/IW4/AssetLoaders/LoaderStringTableIW4Test.cpp b/test/ObjLoadingTests/Game/IW4/AssetLoaders/LoaderStringTableIW4Test.cpp index e6fdf9db..1585b4ea 100644 --- a/test/ObjLoadingTests/Game/IW4/AssetLoaders/LoaderStringTableIW4Test.cpp +++ b/test/ObjLoadingTests/Game/IW4/AssetLoaders/LoaderStringTableIW4Test.cpp @@ -20,7 +20,7 @@ namespace "test,data,lol\n" "lorem,ipsum"); - Zone zone("MockZone", 0, GameId::IW4); + Zone zone("MockZone", 0, GameId::IW4, GamePlatform::PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/IW4/Material/LoaderMaterialIW4Test.cpp b/test/ObjLoadingTests/Game/IW4/Material/LoaderMaterialIW4Test.cpp index 39fd6075..fcb765de 100644 --- a/test/ObjLoadingTests/Game/IW4/Material/LoaderMaterialIW4Test.cpp +++ b/test/ObjLoadingTests/Game/IW4/Material/LoaderMaterialIW4Test.cpp @@ -277,7 +277,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::IW4); + Zone zone("MockZone", 0, GameId::IW4, GamePlatform::PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/IW4/Menu/LoaderMenuListIW4Test.cpp b/test/ObjLoadingTests/Game/IW4/Menu/LoaderMenuListIW4Test.cpp index dcd495f1..ec4cc5bb 100644 --- a/test/ObjLoadingTests/Game/IW4/Menu/LoaderMenuListIW4Test.cpp +++ b/test/ObjLoadingTests/Game/IW4/Menu/LoaderMenuListIW4Test.cpp @@ -30,7 +30,7 @@ namespace test::game::iw4::menu::parsing::it public: MenuParsingItHelper() - : m_zone("MockZone", 0, GameId::IW4), + : m_zone("MockZone", 0, GameId::IW4, GamePlatform::PC), m_creator_collection(m_zone), m_ignored_asset_lookup(), m_context(m_zone, &m_creator_collection, &m_ignored_asset_lookup) diff --git a/test/ObjLoadingTests/Game/IW5/AssetLoaders/LoaderStringTableIW5Test.cpp b/test/ObjLoadingTests/Game/IW5/AssetLoaders/LoaderStringTableIW5Test.cpp index 6aadc816..7b94170c 100644 --- a/test/ObjLoadingTests/Game/IW5/AssetLoaders/LoaderStringTableIW5Test.cpp +++ b/test/ObjLoadingTests/Game/IW5/AssetLoaders/LoaderStringTableIW5Test.cpp @@ -19,7 +19,7 @@ namespace "test,data,lol\n" "lorem,ipsum"); - Zone zone("MockZone", 0, GameId::IW5); + Zone zone("MockZone", 0, GameId::IW5, GamePlatform::PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/IW5/Material/LoaderMaterialIW5Test.cpp b/test/ObjLoadingTests/Game/IW5/Material/LoaderMaterialIW5Test.cpp index 8105f4ee..67a12e83 100644 --- a/test/ObjLoadingTests/Game/IW5/Material/LoaderMaterialIW5Test.cpp +++ b/test/ObjLoadingTests/Game/IW5/Material/LoaderMaterialIW5Test.cpp @@ -301,7 +301,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::IW5); + Zone zone("MockZone", 0, GameId::IW5, GamePlatform::PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/T5/AssetLoaders/LoaderStringTableT5Test.cpp b/test/ObjLoadingTests/Game/T5/AssetLoaders/LoaderStringTableT5Test.cpp index 7db27a83..86ce69ad 100644 --- a/test/ObjLoadingTests/Game/T5/AssetLoaders/LoaderStringTableT5Test.cpp +++ b/test/ObjLoadingTests/Game/T5/AssetLoaders/LoaderStringTableT5Test.cpp @@ -19,7 +19,7 @@ namespace "test,data,lol\n" "lorem,ipsum"); - Zone zone("MockZone", 0, GameId::T5); + Zone zone("MockZone", 0, GameId::T5, GamePlatform::PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/T5/Material/LoaderMaterialT5Test.cpp b/test/ObjLoadingTests/Game/T5/Material/LoaderMaterialT5Test.cpp index 4847e225..ce0d8fa5 100644 --- a/test/ObjLoadingTests/Game/T5/Material/LoaderMaterialT5Test.cpp +++ b/test/ObjLoadingTests/Game/T5/Material/LoaderMaterialT5Test.cpp @@ -358,7 +358,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::T5); + Zone zone("MockZone", 0, GameId::T5, GamePlatform::PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/T6/AssetLoaders/LoaderStringTableT6Test.cpp b/test/ObjLoadingTests/Game/T6/AssetLoaders/LoaderStringTableT6Test.cpp index e26e8b74..ec8c0500 100644 --- a/test/ObjLoadingTests/Game/T6/AssetLoaders/LoaderStringTableT6Test.cpp +++ b/test/ObjLoadingTests/Game/T6/AssetLoaders/LoaderStringTableT6Test.cpp @@ -19,7 +19,7 @@ namespace "test,data,lol\n" "lorem,ipsum"); - Zone zone("MockZone", 0, GameId::T6); + Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/T6/FontIcon/JsonLoaderFontIconT6Test.cpp b/test/ObjLoadingTests/Game/T6/FontIcon/JsonLoaderFontIconT6Test.cpp index 24311566..a75adfe2 100644 --- a/test/ObjLoadingTests/Game/T6/FontIcon/JsonLoaderFontIconT6Test.cpp +++ b/test/ObjLoadingTests/Game/T6/FontIcon/JsonLoaderFontIconT6Test.cpp @@ -79,7 +79,7 @@ namespace ] })FONT_ICON"); - Zone zone("MockZone", 0, GameId::T6); + Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp b/test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp index 95b3bfa1..24340f67 100644 --- a/test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp +++ b/test/ObjLoadingTests/Game/T6/Material/LoaderMaterialT6Test.cpp @@ -241,7 +241,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::T6); + Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); MemoryManager memory; AssetCreatorCollection creatorCollection(zone); diff --git a/test/ObjWritingTests/Game/IW3/Material/MaterialJsonDumperIW3Test.cpp b/test/ObjWritingTests/Game/IW3/Material/MaterialJsonDumperIW3Test.cpp index fda33fe2..0a1ad83c 100644 --- a/test/ObjWritingTests/Game/IW3/Material/MaterialJsonDumperIW3Test.cpp +++ b/test/ObjWritingTests/Game/IW3/Material/MaterialJsonDumperIW3Test.cpp @@ -551,7 +551,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::IW3); + Zone zone("MockZone", 0, GameId::IW3, GamePlatform::PC); MemoryManager memory; MockSearchPath mockObjPath; diff --git a/test/ObjWritingTests/Game/IW4/Material/MaterialJsonDumperIW4Test.cpp b/test/ObjWritingTests/Game/IW4/Material/MaterialJsonDumperIW4Test.cpp index adbbc517..f5397cd0 100644 --- a/test/ObjWritingTests/Game/IW4/Material/MaterialJsonDumperIW4Test.cpp +++ b/test/ObjWritingTests/Game/IW4/Material/MaterialJsonDumperIW4Test.cpp @@ -532,7 +532,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::IW4); + Zone zone("MockZone", 0, GameId::IW4, GamePlatform::PC); MemoryManager memory; MockSearchPath mockObjPath; diff --git a/test/ObjWritingTests/Game/IW5/Material/MaterialJsonDumperIW5Test.cpp b/test/ObjWritingTests/Game/IW5/Material/MaterialJsonDumperIW5Test.cpp index 9c003335..3196f28a 100644 --- a/test/ObjWritingTests/Game/IW5/Material/MaterialJsonDumperIW5Test.cpp +++ b/test/ObjWritingTests/Game/IW5/Material/MaterialJsonDumperIW5Test.cpp @@ -585,7 +585,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::IW5); + Zone zone("MockZone", 0, GameId::IW5, GamePlatform::PC); MemoryManager memory; MockSearchPath mockObjPath; diff --git a/test/ObjWritingTests/Game/T5/Material/MaterialJsonDumperT5Test.cpp b/test/ObjWritingTests/Game/T5/Material/MaterialJsonDumperT5Test.cpp index 0036b78e..d2664be6 100644 --- a/test/ObjWritingTests/Game/T5/Material/MaterialJsonDumperT5Test.cpp +++ b/test/ObjWritingTests/Game/T5/Material/MaterialJsonDumperT5Test.cpp @@ -614,7 +614,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::T5); + Zone zone("MockZone", 0, GameId::T5, GamePlatform::PC); MemoryManager memory; MockSearchPath mockObjPath; diff --git a/test/ObjWritingTests/Game/T6/FontIcon/FontIconJsonDumperT6Test.cpp b/test/ObjWritingTests/Game/T6/FontIcon/FontIconJsonDumperT6Test.cpp index 91b6b1f3..db107bca 100644 --- a/test/ObjWritingTests/Game/T6/FontIcon/FontIconJsonDumperT6Test.cpp +++ b/test/ObjWritingTests/Game/T6/FontIcon/FontIconJsonDumperT6Test.cpp @@ -141,7 +141,7 @@ namespace ] })FONT_ICON"); - Zone zone("MockZone", 0, GameId::T6); + Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); MemoryManager memory; MockSearchPath mockObjPath; diff --git a/test/ObjWritingTests/Game/T6/Material/MaterialJsonDumperT6Test.cpp b/test/ObjWritingTests/Game/T6/Material/MaterialJsonDumperT6Test.cpp index bfefddb1..49b4a59b 100644 --- a/test/ObjWritingTests/Game/T6/Material/MaterialJsonDumperT6Test.cpp +++ b/test/ObjWritingTests/Game/T6/Material/MaterialJsonDumperT6Test.cpp @@ -462,7 +462,7 @@ namespace ] })MATERIAL"); - Zone zone("MockZone", 0, GameId::T6); + Zone zone("MockZone", 0, GameId::T6, GamePlatform::PC); MemoryManager memory; MockSearchPath mockObjPath; From 61ab196c5aeb947128c50cf1f628324eabe550c8 Mon Sep 17 00:00:00 2001 From: Jan Laupetin Date: Wed, 22 Oct 2025 17:49:31 +0100 Subject: [PATCH 07/23] chore: reduce size of asset MeterGroup --- .../unlinking/zone_selector/ZoneSelectorDetails.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ModManUi/src/components/unlinking/zone_selector/ZoneSelectorDetails.vue b/src/ModManUi/src/components/unlinking/zone_selector/ZoneSelectorDetails.vue index 64646e4c..c1cf6a9b 100644 --- a/src/ModManUi/src/components/unlinking/zone_selector/ZoneSelectorDetails.vue +++ b/src/ModManUi/src/components/unlinking/zone_selector/ZoneSelectorDetails.vue @@ -131,6 +131,10 @@ watch( .asset-meter { padding-top: 0.5em; + font-size: 0.8em; + line-height: 1.25; + --p-metergroup-gap: 1em; + --p-metergroup-label-list-horizontal-gap: 0.8em; } .count-skeleton { From 6b3fdbfb752eaeeed983f91d00a760d614dce936 Mon Sep 17 00:00:00 2001 From: Jan Laupetin Date: Wed, 22 Oct 2025 23:37:52 +0100 Subject: [PATCH 08/23] chore: add modman navigation --- src/ModManUi/package-lock.json | 24 +- src/ModManUi/package.json | 3 +- src/ModManUi/src/App.vue | 18 +- src/ModManUi/src/components/ModManHeader.vue | 60 ++++ .../src/components/icons/IconArrowLeft.vue | 9 + .../src/components/icons/IconGear.vue | 9 + src/ModManUi/src/main.ts | 4 +- src/ModManUi/src/router/Page.ts | 5 + src/ModManUi/src/router/Router.ts | 18 + src/ModManUi/src/style/_colors.scss | 311 ++++++++++++++++++ src/ModManUi/src/style/_variables.scss | 1 + src/ModManUi/src/{ => style}/main.scss | 15 +- src/ModManUi/src/style/utils.scss | 3 + .../inspect/ZoneInspector.vue} | 13 +- .../inspect/ZoneInspectorDetails.vue} | 0 .../inspect/ZoneInspectorZoneList.vue} | 0 src/ModManUi/tsconfig.app.json | 3 +- src/ModManUi/vite.config.ts | 1 + 18 files changed, 466 insertions(+), 31 deletions(-) create mode 100644 src/ModManUi/src/components/ModManHeader.vue create mode 100644 src/ModManUi/src/components/icons/IconArrowLeft.vue create mode 100644 src/ModManUi/src/components/icons/IconGear.vue create mode 100644 src/ModManUi/src/router/Page.ts create mode 100644 src/ModManUi/src/router/Router.ts create mode 100644 src/ModManUi/src/style/_colors.scss create mode 100644 src/ModManUi/src/style/_variables.scss rename src/ModManUi/src/{ => style}/main.scss (79%) create mode 100644 src/ModManUi/src/style/utils.scss rename src/ModManUi/src/{components/unlinking/zone_selector/ZoneSelector.vue => view/inspect/ZoneInspector.vue} (68%) rename src/ModManUi/src/{components/unlinking/zone_selector/ZoneSelectorDetails.vue => view/inspect/ZoneInspectorDetails.vue} (100%) rename src/ModManUi/src/{components/unlinking/zone_selector/ZoneSelectorZoneList.vue => view/inspect/ZoneInspectorZoneList.vue} (100%) diff --git a/src/ModManUi/package-lock.json b/src/ModManUi/package-lock.json index 40b2841d..14a58f0d 100644 --- a/src/ModManUi/package-lock.json +++ b/src/ModManUi/package-lock.json @@ -12,7 +12,8 @@ "@primeuix/themes": "^1.2.5", "pinia": "3.0.3", "primevue": "^4.4.1", - "vue": "3.5.22" + "vue": "3.5.22", + "vue-router": "4.6.3" }, "devDependencies": { "@tsconfig/node22": "^22.0.2", @@ -6649,6 +6650,27 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/vue-router": { + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.6.3.tgz", + "integrity": "sha512-ARBedLm9YlbvQomnmq91Os7ck6efydTSpRP3nuOKCvgJOHNrhRoJDSKtee8kcL1Vf7nz6U+PMBL+hTvR3bTVQg==", + "license": "MIT", + "dependencies": { + "@vue/devtools-api": "^6.6.4" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + }, + "node_modules/vue-router/node_modules/@vue/devtools-api": { + "version": "6.6.4", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.6.4.tgz", + "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==", + "license": "MIT" + }, "node_modules/vue-tsc": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-3.1.2.tgz", diff --git a/src/ModManUi/package.json b/src/ModManUi/package.json index 0eeaac30..78ef8bad 100644 --- a/src/ModManUi/package.json +++ b/src/ModManUi/package.json @@ -17,7 +17,8 @@ "@primeuix/themes": "^1.2.5", "pinia": "3.0.3", "primevue": "^4.4.1", - "vue": "3.5.22" + "vue": "3.5.22", + "vue-router": "4.6.3" }, "devDependencies": { "@tsconfig/node22": "^22.0.2", diff --git a/src/ModManUi/src/App.vue b/src/ModManUi/src/App.vue index 308f9eba..08fc7fde 100644 --- a/src/ModManUi/src/App.vue +++ b/src/ModManUi/src/App.vue @@ -1,20 +1,22 @@ diff --git a/src/ModManUi/src/components/ModManHeader.vue b/src/ModManUi/src/components/ModManHeader.vue new file mode 100644 index 00000000..eb0d48d2 --- /dev/null +++ b/src/ModManUi/src/components/ModManHeader.vue @@ -0,0 +1,60 @@ + + + + + diff --git a/src/ModManUi/src/components/icons/IconArrowLeft.vue b/src/ModManUi/src/components/icons/IconArrowLeft.vue new file mode 100644 index 00000000..3e37cfb5 --- /dev/null +++ b/src/ModManUi/src/components/icons/IconArrowLeft.vue @@ -0,0 +1,9 @@ + diff --git a/src/ModManUi/src/components/icons/IconGear.vue b/src/ModManUi/src/components/icons/IconGear.vue new file mode 100644 index 00000000..6ba8ca16 --- /dev/null +++ b/src/ModManUi/src/components/icons/IconGear.vue @@ -0,0 +1,9 @@ + diff --git a/src/ModManUi/src/main.ts b/src/ModManUi/src/main.ts index 1f9883ef..dc4dcad6 100644 --- a/src/ModManUi/src/main.ts +++ b/src/ModManUi/src/main.ts @@ -1,15 +1,17 @@ import "../public/favicon.ico"; -import "./main.scss"; +import "@style/main.scss"; import { createApp } from "vue"; import { createPinia } from "pinia"; import { configurePrimeVue } from "./PrimeVue.ts"; import App from "./App.vue"; +import { createModManRouter } from "./router/Router.ts"; const app = createApp(App); app.use(createPinia()); +app.use(createModManRouter()); configurePrimeVue(app); diff --git a/src/ModManUi/src/router/Page.ts b/src/ModManUi/src/router/Page.ts new file mode 100644 index 00000000..1a8c8744 --- /dev/null +++ b/src/ModManUi/src/router/Page.ts @@ -0,0 +1,5 @@ +export const PAGE = { + HOME: "Home", + INSPECT_ZONE: "Inspect zone", + OPTIONS: "Options", +}; diff --git a/src/ModManUi/src/router/Router.ts b/src/ModManUi/src/router/Router.ts new file mode 100644 index 00000000..48a3e294 --- /dev/null +++ b/src/ModManUi/src/router/Router.ts @@ -0,0 +1,18 @@ +import { createRouter, createWebHashHistory, type RouteRecordRaw } from "vue-router"; +import { PAGE } from "./Page"; +import ZoneInspector from "@/view/inspect/ZoneInspector.vue"; + +const ROUTES: RouteRecordRaw[] = [ + { + path: "/", + name: PAGE.INSPECT_ZONE, + component: ZoneInspector, + }, +]; + +export function createModManRouter() { + return createRouter({ + history: createWebHashHistory(), + routes: ROUTES, + }); +} diff --git a/src/ModManUi/src/style/_colors.scss b/src/ModManUi/src/style/_colors.scss new file mode 100644 index 00000000..687d2dd2 --- /dev/null +++ b/src/ModManUi/src/style/_colors.scss @@ -0,0 +1,311 @@ +// Primitive colors +$EMERALD-50: var(--p-emerald-50); +$EMERALD-100: var(--p-emerald-100); +$EMERALD-200: var(--p-emerald-200); +$EMERALD-300: var(--p-emerald-300); +$EMERALD-400: var(--p-emerald-400); +$EMERALD-500: var(--p-emerald-500); +$EMERALD-600: var(--p-emerald-600); +$EMERALD-700: var(--p-emerald-700); +$EMERALD-800: var(--p-emerald-800); +$EMERALD-900: var(--p-emerald-900); +$EMERALD-950: var(--p-emerald-950); + +$GREEN-50: var(--p-green-50); +$GREEN-100: var(--p-green-100); +$GREEN-200: var(--p-green-200); +$GREEN-300: var(--p-green-300); +$GREEN-400: var(--p-green-400); +$GREEN-500: var(--p-green-500); +$GREEN-600: var(--p-green-600); +$GREEN-700: var(--p-green-700); +$GREEN-800: var(--p-green-800); +$GREEN-900: var(--p-green-900); +$GREEN-950: var(--p-green-950); + +$LIME-50: var(--p-lime-50); +$LIME-100: var(--p-lime-100); +$LIME-200: var(--p-lime-200); +$LIME-300: var(--p-lime-300); +$LIME-400: var(--p-lime-400); +$LIME-500: var(--p-lime-500); +$LIME-600: var(--p-lime-600); +$LIME-700: var(--p-lime-700); +$LIME-800: var(--p-lime-800); +$LIME-900: var(--p-lime-900); +$LIME-950: var(--p-lime-950); + +$RED-50: var(--p-red-50); +$RED-100: var(--p-red-100); +$RED-200: var(--p-red-200); +$RED-300: var(--p-red-300); +$RED-400: var(--p-red-400); +$RED-500: var(--p-red-500); +$RED-600: var(--p-red-600); +$RED-700: var(--p-red-700); +$RED-800: var(--p-red-800); +$RED-900: var(--p-red-900); +$RED-950: var(--p-red-950); + +$ORANGE-50: var(--p-orange-50); +$ORANGE-100: var(--p-orange-100); +$ORANGE-200: var(--p-orange-200); +$ORANGE-300: var(--p-orange-300); +$ORANGE-400: var(--p-orange-400); +$ORANGE-500: var(--p-orange-500); +$ORANGE-600: var(--p-orange-600); +$ORANGE-700: var(--p-orange-700); +$ORANGE-800: var(--p-orange-800); +$ORANGE-900: var(--p-orange-900); +$ORANGE-950: var(--p-orange-950); + +$AMBER-50: var(--p-amber-50); +$AMBER-100: var(--p-amber-100); +$AMBER-200: var(--p-amber-200); +$AMBER-300: var(--p-amber-300); +$AMBER-400: var(--p-amber-400); +$AMBER-500: var(--p-amber-500); +$AMBER-600: var(--p-amber-600); +$AMBER-700: var(--p-amber-700); +$AMBER-800: var(--p-amber-800); +$AMBER-900: var(--p-amber-900); +$AMBER-950: var(--p-amber-950); + +$YELLOW-50: var(--p-yellow-50); +$YELLOW-100: var(--p-yellow-100); +$YELLOW-200: var(--p-yellow-200); +$YELLOW-300: var(--p-yellow-300); +$YELLOW-400: var(--p-yellow-400); +$YELLOW-500: var(--p-yellow-500); +$YELLOW-600: var(--p-yellow-600); +$YELLOW-700: var(--p-yellow-700); +$YELLOW-800: var(--p-yellow-800); +$YELLOW-900: var(--p-yellow-900); +$YELLOW-950: var(--p-yellow-950); + +$TEAL-50: var(--p-teal-50); +$TEAL-100: var(--p-teal-100); +$TEAL-200: var(--p-teal-200); +$TEAL-300: var(--p-teal-300); +$TEAL-400: var(--p-teal-400); +$TEAL-500: var(--p-teal-500); +$TEAL-600: var(--p-teal-600); +$TEAL-700: var(--p-teal-700); +$TEAL-800: var(--p-teal-800); +$TEAL-900: var(--p-teal-900); +$TEAL-950: var(--p-teal-950); + +$CYAN-50: var(--p-cyan-50); +$CYAN-100: var(--p-cyan-100); +$CYAN-200: var(--p-cyan-200); +$CYAN-300: var(--p-cyan-300); +$CYAN-400: var(--p-cyan-400); +$CYAN-500: var(--p-cyan-500); +$CYAN-600: var(--p-cyan-600); +$CYAN-700: var(--p-cyan-700); +$CYAN-800: var(--p-cyan-800); +$CYAN-900: var(--p-cyan-900); +$CYAN-950: var(--p-cyan-950); + +$SKY-50: var(--p-sky-50); +$SKY-100: var(--p-sky-100); +$SKY-200: var(--p-sky-200); +$SKY-300: var(--p-sky-300); +$SKY-400: var(--p-sky-400); +$SKY-500: var(--p-sky-500); +$SKY-600: var(--p-sky-600); +$SKY-700: var(--p-sky-700); +$SKY-800: var(--p-sky-800); +$SKY-900: var(--p-sky-900); +$SKY-950: var(--p-sky-950); + +$BLUE-50: var(--p-blue-50); +$BLUE-100: var(--p-blue-100); +$BLUE-200: var(--p-blue-200); +$BLUE-300: var(--p-blue-300); +$BLUE-400: var(--p-blue-400); +$BLUE-500: var(--p-blue-500); +$BLUE-600: var(--p-blue-600); +$BLUE-700: var(--p-blue-700); +$BLUE-800: var(--p-blue-800); +$BLUE-900: var(--p-blue-900); +$BLUE-950: var(--p-blue-950); + +$INDIGO-50: var(--p-indigo-50); +$INDIGO-100: var(--p-indigo-100); +$INDIGO-200: var(--p-indigo-200); +$INDIGO-300: var(--p-indigo-300); +$INDIGO-400: var(--p-indigo-400); +$INDIGO-500: var(--p-indigo-500); +$INDIGO-600: var(--p-indigo-600); +$INDIGO-700: var(--p-indigo-700); +$INDIGO-800: var(--p-indigo-800); +$INDIGO-900: var(--p-indigo-900); +$INDIGO-950: var(--p-indigo-950); + +$VIOLET-50: var(--p-violet-50); +$VIOLET-100: var(--p-violet-100); +$VIOLET-200: var(--p-violet-200); +$VIOLET-300: var(--p-violet-300); +$VIOLET-400: var(--p-violet-400); +$VIOLET-500: var(--p-violet-500); +$VIOLET-600: var(--p-violet-600); +$VIOLET-700: var(--p-violet-700); +$VIOLET-800: var(--p-violet-800); +$VIOLET-900: var(--p-violet-900); +$VIOLET-950: var(--p-violet-950); + +$PURPLE-50: var(--p-purple-50); +$PURPLE-100: var(--p-purple-100); +$PURPLE-200: var(--p-purple-200); +$PURPLE-300: var(--p-purple-300); +$PURPLE-400: var(--p-purple-400); +$PURPLE-500: var(--p-purple-500); +$PURPLE-600: var(--p-purple-600); +$PURPLE-700: var(--p-purple-700); +$PURPLE-800: var(--p-purple-800); +$PURPLE-900: var(--p-purple-900); +$PURPLE-950: var(--p-purple-950); + +$FUCHSIA-50: var(--p-fuchsia-50); +$FUCHSIA-100: var(--p-fuchsia-100); +$FUCHSIA-200: var(--p-fuchsia-200); +$FUCHSIA-300: var(--p-fuchsia-300); +$FUCHSIA-400: var(--p-fuchsia-400); +$FUCHSIA-500: var(--p-fuchsia-500); +$FUCHSIA-600: var(--p-fuchsia-600); +$FUCHSIA-700: var(--p-fuchsia-700); +$FUCHSIA-800: var(--p-fuchsia-800); +$FUCHSIA-900: var(--p-fuchsia-900); +$FUCHSIA-950: var(--p-fuchsia-950); + +$PINK-50: var(--p-pink-50); +$PINK-100: var(--p-pink-100); +$PINK-200: var(--p-pink-200); +$PINK-300: var(--p-pink-300); +$PINK-400: var(--p-pink-400); +$PINK-500: var(--p-pink-500); +$PINK-600: var(--p-pink-600); +$PINK-700: var(--p-pink-700); +$PINK-800: var(--p-pink-800); +$PINK-900: var(--p-pink-900); +$PINK-950: var(--p-pink-950); + +$ROSE-50: var(--p-rose-50); +$ROSE-100: var(--p-rose-100); +$ROSE-200: var(--p-rose-200); +$ROSE-300: var(--p-rose-300); +$ROSE-400: var(--p-rose-400); +$ROSE-500: var(--p-rose-500); +$ROSE-600: var(--p-rose-600); +$ROSE-700: var(--p-rose-700); +$ROSE-800: var(--p-rose-800); +$ROSE-900: var(--p-rose-900); +$ROSE-950: var(--p-rose-950); + +$SLATE-50: var(--p-slate-50); +$SLATE-100: var(--p-slate-100); +$SLATE-200: var(--p-slate-200); +$SLATE-300: var(--p-slate-300); +$SLATE-400: var(--p-slate-400); +$SLATE-500: var(--p-slate-500); +$SLATE-600: var(--p-slate-600); +$SLATE-700: var(--p-slate-700); +$SLATE-800: var(--p-slate-800); +$SLATE-900: var(--p-slate-900); +$SLATE-950: var(--p-slate-950); + +$GRAY-50: var(--p-gray-50); +$GRAY-100: var(--p-gray-100); +$GRAY-200: var(--p-gray-200); +$GRAY-300: var(--p-gray-300); +$GRAY-400: var(--p-gray-400); +$GRAY-500: var(--p-gray-500); +$GRAY-600: var(--p-gray-600); +$GRAY-700: var(--p-gray-700); +$GRAY-800: var(--p-gray-800); +$GRAY-900: var(--p-gray-900); +$GRAY-950: var(--p-gray-950); + +$ZINC-50: var(--p-zinc-50); +$ZINC-100: var(--p-zinc-100); +$ZINC-200: var(--p-zinc-200); +$ZINC-300: var(--p-zinc-300); +$ZINC-400: var(--p-zinc-400); +$ZINC-500: var(--p-zinc-500); +$ZINC-600: var(--p-zinc-600); +$ZINC-700: var(--p-zinc-700); +$ZINC-800: var(--p-zinc-800); +$ZINC-900: var(--p-zinc-900); +$ZINC-950: var(--p-zinc-950); + +$NEUTRAL-50: var(--p-neutral-50); +$NEUTRAL-100: var(--p-neutral-100); +$NEUTRAL-200: var(--p-neutral-200); +$NEUTRAL-300: var(--p-neutral-300); +$NEUTRAL-400: var(--p-neutral-400); +$NEUTRAL-500: var(--p-neutral-500); +$NEUTRAL-600: var(--p-neutral-600); +$NEUTRAL-700: var(--p-neutral-700); +$NEUTRAL-800: var(--p-neutral-800); +$NEUTRAL-900: var(--p-neutral-900); +$NEUTRAL-950: var(--p-neutral-950); + +$STONE-50: var(--p-stone-50); +$STONE-100: var(--p-stone-100); +$STONE-200: var(--p-stone-200); +$STONE-300: var(--p-stone-300); +$STONE-400: var(--p-stone-400); +$STONE-500: var(--p-stone-500); +$STONE-600: var(--p-stone-600); +$STONE-700: var(--p-stone-700); +$STONE-800: var(--p-stone-800); +$STONE-900: var(--p-stone-900); +$STONE-950: var(--p-stone-950); + +// Semantic colors + +$PRIMARY-50: var(--p-primary-50); +$PRIMARY-100: var(--p-primary-100); +$PRIMARY-200: var(--p-primary-200); +$PRIMARY-300: var(--p-primary-300); +$PRIMARY-400: var(--p-primary-400); +$PRIMARY-500: var(--p-primary-500); +$PRIMARY-600: var(--p-primary-600); +$PRIMARY-700: var(--p-primary-700); +$PRIMARY-800: var(--p-primary-800); +$PRIMARY-900: var(--p-primary-900); +$PRIMARY-950: var(--p-primary-950); + +$SURFACE-50: var(--p-surface-50); +$SURFACE-100: var(--p-surface-100); +$SURFACE-200: var(--p-surface-200); +$SURFACE-300: var(--p-surface-300); +$SURFACE-400: var(--p-surface-400); +$SURFACE-500: var(--p-surface-500); +$SURFACE-600: var(--p-surface-600); +$SURFACE-700: var(--p-surface-700); +$SURFACE-800: var(--p-surface-800); +$SURFACE-900: var(--p-surface-900); +$SURFACE-950: var(--p-surface-950); + +$PRIMARY-COLOR: var(--p-primary-color); +$PRIMARY-CONTRAST-COLOR: var(--p-primary-contrast-color); +$PRIMARY-HOVER-COLOR: var(--p-primary-hover-color); +$PRIMARY-ACTIVE-COLOR: var(--p-primary-active-color); + +$CONTENT-BACKGROUND: var(--p-content-background); +$CONTENT-HOVER-BACKGROUND: var(--p-content-hover-background); +$CONTENT-BORDER-COLOR: var(--p-content-border-color); +$CONTENT-COLOR: var(--p-content-color); +$CONTENT-HOVER-COLOR: var(--p-content-hover-color); + +$HIGHLIGHT-BACKGROUND: var(--p-highlight-background); +$HIGHLIGHT-FOCUS-BACKGROUND: var(--p-highlight-focus-background); +$HIGHLIGHT-COLOR: var(--p-highlight-color); +$HIGHLIGHT-FOCUS-COLOR: var(--p-highlight-focus-color); + +$TEXT-COLOR: var(--p-text-color); +$TEXT-HOVER-COLOR: var(--p-text-hover-color); +$TEXT-MUTED-COLOR: var(--p-text-muted-color); +$TEXT-HOVER-MUTED-COLOR: var(--p-text-hover-muted-color); diff --git a/src/ModManUi/src/style/_variables.scss b/src/ModManUi/src/style/_variables.scss new file mode 100644 index 00000000..70c003a2 --- /dev/null +++ b/src/ModManUi/src/style/_variables.scss @@ -0,0 +1 @@ +$TRANSITION_DURATION: var(--p-transition-duration); diff --git a/src/ModManUi/src/main.scss b/src/ModManUi/src/style/main.scss similarity index 79% rename from src/ModManUi/src/main.scss rename to src/ModManUi/src/style/main.scss index a1906699..05162d79 100644 --- a/src/ModManUi/src/main.scss +++ b/src/ModManUi/src/style/main.scss @@ -1,4 +1,6 @@ -@import "@fontsource/inter/latin-300.css"; +@use "utils.scss"; + +@import "@fontsource/inter/latin-300.css"; @import "@fontsource/inter/latin-300-italic.css"; @import "@fontsource/inter/latin-400.css"; @import "@fontsource/inter/latin-400-italic.css"; @@ -30,14 +32,3 @@ body { margin: 0; } - -.container { - margin: 0; - padding-top: 10vh; - display: flex; - position: relative; - flex-direction: column; - justify-content: start; - - height: 100vh; -} diff --git a/src/ModManUi/src/style/utils.scss b/src/ModManUi/src/style/utils.scss new file mode 100644 index 00000000..7de368ca --- /dev/null +++ b/src/ModManUi/src/style/utils.scss @@ -0,0 +1,3 @@ +.icon { + height: 1lh; +} \ No newline at end of file diff --git a/src/ModManUi/src/components/unlinking/zone_selector/ZoneSelector.vue b/src/ModManUi/src/view/inspect/ZoneInspector.vue similarity index 68% rename from src/ModManUi/src/components/unlinking/zone_selector/ZoneSelector.vue rename to src/ModManUi/src/view/inspect/ZoneInspector.vue index 02a85d85..67c6ca45 100644 --- a/src/ModManUi/src/components/unlinking/zone_selector/ZoneSelector.vue +++ b/src/ModManUi/src/view/inspect/ZoneInspector.vue @@ -1,8 +1,8 @@ From 27ecb4cc57f1e268325bed9e319e047254726f37 Mon Sep 17 00:00:00 2001 From: Jan Laupetin Date: Mon, 27 Oct 2025 22:02:20 +0100 Subject: [PATCH 14/23] chore: only show specific back buttons in modman --- src/ModManUi/src/components/ModManHeader.vue | 23 ++++++++++++-------- src/ModManUi/src/router/RouteMeta.ts | 19 +++++++++++----- src/ModManUi/src/router/Router.ts | 1 + 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/ModManUi/src/components/ModManHeader.vue b/src/ModManUi/src/components/ModManHeader.vue index aaca28cd..e5419f5d 100644 --- a/src/ModManUi/src/components/ModManHeader.vue +++ b/src/ModManUi/src/components/ModManHeader.vue @@ -1,31 +1,36 @@