mirror of
https://github.com/ScreamAngel/gow3_launcher.git
synced 2026-11-08 17:48:49 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08da3bec2c | ||
|
|
04f61833ea | ||
|
|
a60dc8bace | ||
|
|
7b8d9155fd | ||
|
|
ec0a5893c7 | ||
|
|
6bb6349c41 | ||
|
|
8ba512f45e | ||
|
|
0136d4a426 | ||
|
|
71b9cd8596 | ||
|
|
b6409869aa | ||
|
|
ff7c026bba | ||
|
|
f119d84439 | ||
|
|
4b5ec4f7f5 | ||
|
|
5ddf4eab9d | ||
|
|
839dabca0d | ||
|
|
319a4c56e8 | ||
|
|
0c9f36c292 | ||
|
|
bdb896b279 | ||
|
|
b435c8344b | ||
|
|
12dea62e3b | ||
|
|
192f9164d1 | ||
|
|
9fdbeb5650 | ||
|
|
95db57f9a1 | ||
|
|
ba4c08dcea | ||
|
|
e9f6c33021 | ||
|
|
234dae1972 | ||
|
|
ea0f8b7658 | ||
|
|
418e035def | ||
|
|
0079e3b5a6 | ||
|
|
ccc9765bf5 | ||
|
|
aff5ec53c8 | ||
|
|
7f7a00755c | ||
|
|
243dbf7c67 | ||
|
|
2a9a6480b5 | ||
|
|
ee36d5fb36 | ||
|
|
acf9d08527 | ||
|
|
4980c43d53 | ||
|
|
f36b0f3287 | ||
|
|
94e71041e4 | ||
|
|
3f269176da | ||
|
|
3786b49355 | ||
|
|
5bdc44159c | ||
|
|
0730f2da7d | ||
|
|
a9592e555b | ||
|
|
feea7e7975 | ||
|
|
f6df71dfb7 | ||
|
|
2e40762963 | ||
|
|
27e27eea3b | ||
|
|
008aa107a2 | ||
|
|
9d0691d5de | ||
|
|
28d5506758 | ||
|
|
97bed359e8 | ||
|
|
f4dd0eb1b5 | ||
|
|
f5fb6a70df | ||
|
|
1d357ca52a |
No files matched your search
@@ -10,6 +10,7 @@ user/
|
||||
out/
|
||||
GLCache/
|
||||
.runtime/
|
||||
mod-game-*/
|
||||
vkd3d-proton.cache
|
||||
fsr4_shaders/
|
||||
.local/
|
||||
@@ -18,6 +19,7 @@ __pycache__/
|
||||
# Logs & Configs generated during play
|
||||
*.log
|
||||
gow3_log.txt
|
||||
launcher_log.txt
|
||||
last_run.log
|
||||
gow3.ini
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
# God of War III PC Launcher — Proje Hafızası ve Mimari Özeti
|
||||
|
||||
> **Versiyon:** v2.1
|
||||
> **Depo:** [github.com/ScreamAngel/gow3_launcher](https://github.com/ScreamAngel/gow3_launcher) (`main` dalı)
|
||||
> **Platform Desteği:** Linux (x86_64, Wayland/Hyprland & X11) ve Windows (x86_64 MSVC)
|
||||
> **Tarih:** 07 Kasım 2026
|
||||
|
||||
---
|
||||
|
||||
## 1. Proje Mimarisi ve Çekirdek Dosyalar
|
||||
|
||||
* **Launcher Kaynak Kodu (`launcher/src/`):**
|
||||
* `main.rs`: CLI başlatma argümanları (`--play`, `-p`), pencere ikonu yükleme ve eframe/egui giriş noktası.
|
||||
* `app.rs`: Launcher ana GUI arayüzü, 6 sekme (Oyun, Grafik, Yapılandırma, Kontroller, Modlar, Sistem), shader derleme ekranı ve oyun süreci izleyicisi.
|
||||
* `discord_rpc.rs`: Sıfır ek yükümlü, yerel Discord IPC istemcisi (Linux Unix Domain Socket & Windows Named Pipe), gerçek zamanlı bölüm & boss savaşı dedektörü, çoklu dil desteği (`RpcLanguage`).
|
||||
* `win_input.rs`: Windows düşük seviye fare kancası (`WH_MOUSE_LL`), 1ms `timeBeginPeriod` zamanlayıcı çözünürlüğü ve oyun penceresini öne getirme (`SetForegroundWindow`).
|
||||
* `runner.rs`: Mod bindirme (overlay) yöneticisi, Python/Rust mod montajı, oyun süreci (`gow3-probe`) çalıştırma ve log yönlendirme.
|
||||
* `config.rs`: `launcher_config.json` yönetimi, donanım optimizasyonları ve otomatik sistem dili algılama (`default_language()`).
|
||||
* `i18n.rs`: 4 dilli arayüz yerelleştirmesi (Türkçe, English, Deutsch, Español).
|
||||
* `crash_analyzer.rs`: Oyun çöktüğünde `gow3_log.txt` çıktısını analiz edip kullanıcıya çözüm sunan hata teşhis motoru.
|
||||
* **Dağıtılan İkili Dosyalar (Binaries):**
|
||||
* Linux: `gow3-launcher`
|
||||
* Windows: `gow3-launcher-win.exe`
|
||||
* Alt dizin kopyaları: `gow3-linux/gow3-launcher`, `gow3-linux/gow3-launcher-win.exe`
|
||||
|
||||
---
|
||||
|
||||
## 2. Discord Rich Presence (RPC) Entegrasyonu
|
||||
|
||||
* **Resmi App ID:** `1440140183675867156` (*God of War III: Remastered*)
|
||||
* **Resmi Varlıklar (Assets):**
|
||||
* Kapak İkonu (Large Image): `https://cdn.discordapp.com/app-icons/1440140183675867156/2cbf4c7faf6444d474ff7b32b2025ec2.png`
|
||||
* Rozet İkonu (Small Image): `https://raw.githubusercontent.com/ScreamAngel/gow3_launcher/main/gow3.png`
|
||||
* **İletişim Kanalları:**
|
||||
* **Linux:** `$XDG_RUNTIME_DIR/discord-ipc-0`..`9`, `/tmp/discord-ipc-0`..`9`, Flatpak, Snap ve Vesktop (`vesktop-ipc`).
|
||||
* **Windows:** `\\.\pipe\discord-ipc-0`..`9` (Named Pipes). Olası donmaları engellemek için `PeekNamedPipe` ile asenkron kontrol mekanizması eklendi.
|
||||
* **Gerçek Zamanlı Durum Tespiti:**
|
||||
* `gow3_log.txt` dosyasından gerçek çalışma zamanı WAD yüklemeleri (`WAD_STATS: WAD <NAME>` ve `/WAD/PS4_LE/<NAME>.WAD`) taranır. Statik motor sözlüğü (`LoadWadSizeData`) **yoksayılır**.
|
||||
* `user/savedata/*/CUSA01715/*.sce_sys/param.bin` SFO dosyasından anlık kayıt checkpoint'i ve zorluk derecesi çekilir.
|
||||
* Ters kronolojik (newest-first) algoritma ile oyuncunun bulunduğu son bölge veya boss savaşı anlık belirlenir.
|
||||
* **Otomatik Dil Desteği (tr, en, de, es):**
|
||||
* İşletim sistemi dili (Linux'ta `$LANG`, Windows'ta `GetUserDefaultUILanguage`) veya launcher arayüz dili baz alınarak durum otomatik yerelleştirilir.
|
||||
* **Bölüm & Boss Karşılıkları:**
|
||||
* Poseidon Boss Savaşı: `Olympus Dağı (Poseidon Boss Fight)` / `Mount Olympus (Poseidon Boss Fight)`
|
||||
* Hades Boss Savaşı: `Yeraltı Dünyası (Hades Boss Fight)` / `The Underworld (Hades Boss Fight)`
|
||||
* Helios Boss Savaşı: `Olimpiya Şehri (Helios Boss Fight)` / `City of Olympia (Helios Boss Fight)`
|
||||
* Hermes Kovalamacası: `Olimpiya Şehri (Hermes Kovalamacası)` / `City of Olympia (Hermes Chase)`
|
||||
* Herkül Boss Savaşı: `Olympus Forumu (Hercules Boss Fight)` / `Forum of Olympus (Hercules Boss Fight)`
|
||||
* Kronos Boss Savaşı: `Tartarus Çukuru (Cronos Boss Fight)` / `Pit of Tartarus (Cronos Boss Fight)`
|
||||
* Hephaistos Boss Savaşı: `Demirhane (Hephaestus Boss Fight)` / `The Forge (Hephaestus Boss Fight)`
|
||||
* Skorpius Boss Savaşı: `Olimpos Mağaraları (Skorpius Boss Fight)` / `Caverns of Olympus (Skorpius Boss Fight)`
|
||||
* Zeus Boss Savaşı: `Olympus Tepesi (Zeus Boss Fight)` / `Summit of Olympus (Zeus Boss Fight)`
|
||||
* Mücadeleler: `Olympus Mücadelesi 1-7` / `Challenge of Olympus 1-7`
|
||||
* Savaş Arenası: `Savaş Arenası (Combat Arena)` / `Combat Arena`
|
||||
* Menü: `Ana Menüde` / `In Main Menu`
|
||||
* Shader Derleme: `Shader'lar Derleniyor (%X)` / `Compiling Shaders (X%)`
|
||||
|
||||
---
|
||||
|
||||
## 3. Çözülen Kritik Hatalar ve Teknik Notlar
|
||||
|
||||
1. **Windows Fare Tıklama Algılama Hatası:**
|
||||
* Sorun: Windows'ta sol ve sağ tık çalışmıyordu.
|
||||
* Çözüm: `win_input.rs` içindeki `WH_MOUSE_LL` kancasında PS4 SDL2 girdi haritasının beklediği F13/F14 sanal tarama kodları (`0x64` = Kare/Hafif Vuruş, `0x65` = Üçgen/Ağır Vuruş) düzeltildi.
|
||||
2. **Windows Siyah Ekran / Mod Açılış Hatası:**
|
||||
* Sorun: NTFS junction oluşturma yetki hatası yüzünden Windows'ta oyun siyah ekranda takılıyordu.
|
||||
* Çözüm: `runner.rs` içinde Rust tabanlı doğrudan dosya kopyalama bindirmesi (`out/mod-game-rust-overlay`) uygulandı, yol formatı ve dosya doğrulaması eklendi.
|
||||
3. **Shader Ekranı Küçülme / Kapanma / Arka Plana Düşme:**
|
||||
* Sorun: Shader derleme ekranı açıldığında oyun arka plana düşüyor veya görev çubuğuna küçülüyordu.
|
||||
* Çözüm: Oyun penceresi açıldığında shader ekranı 10 saniye boyunca arka planda tam ekran açık kalır, oyun penceresi öne getirilir (`bring_game_window_to_front`) ve süre bitiminde launcher normal moduna döner (asla küçülmez).
|
||||
4. **Linux Hyprland / Wayland Tam Ekran Hatası:**
|
||||
* Sorun: Windows için eklenen pencere boyutu komutları Linux Wayland'de oyunun kenarlıksız pencere moduna geçmesini bozuyordu.
|
||||
* Çözüm: `Maximized(true)` ve ilgili `ViewportCommand` çağrıları `#[cfg(target_os = "windows")]` ile izole edildi, Linux'ta yerel `hyprctl` ve saf Wayland geometri protokolü korundu.
|
||||
5. **Discord RPC'nin Sadece "Ana Menüde" Kalması:**
|
||||
* Sorun: Motorun statik `LoadWadSizeData: WAD_Shell` satırı yüzünden log döngüsü erken çıkış veriyor ve boss/bölüm adımlarını atlıyordu.
|
||||
* Çözüm: Statik sözlük filtrelendi, gerçek WAD yüklemeleri ters sırada önceliklendirildi.
|
||||
|
||||
---
|
||||
|
||||
## 4. Derleme ve Test Komutları
|
||||
|
||||
* **Birim Testleri (30 Test):**
|
||||
```bash
|
||||
cargo test --manifest-path launcher/Cargo.toml
|
||||
```
|
||||
* **Linux Release Derlemesi:**
|
||||
```bash
|
||||
cargo build --release --manifest-path launcher/Cargo.toml
|
||||
cp -f launcher/target/release/launcher gow3-launcher
|
||||
cp -f launcher/target/release/launcher gow3-linux/gow3-launcher
|
||||
```
|
||||
* **Windows Release Derlemesi (Cross-Compile):**
|
||||
```bash
|
||||
cargo xwin build --release --manifest-path launcher/Cargo.toml --target x86_64-pc-windows-msvc
|
||||
cp -f launcher/target/x86_64-pc-windows-msvc/release/launcher.exe gow3-launcher-win.exe
|
||||
cp -f launcher/target/x86_64-pc-windows-msvc/release/launcher.exe gow3-linux/gow3-launcher-win.exe
|
||||
```
|
||||
@@ -1,6 +1,10 @@
|
||||
# gow3_launcher
|
||||
Launcher for God Of War 3 PC on Linux and Windows
|
||||
|
||||
**To ensure mod support works, install the launcher using a clean installation**
|
||||
|
||||
**Mod desteğinin düzgün çalışmasını sağlamak için, başlatıcıyı temiz bir kurulum yaparak yükleyin**
|
||||
|
||||
# ⚡ God of War® III Remastered - Linux-Windows Port & Native Launcher
|
||||
|
||||
An optimized Linux-Windows port and native graphical launcher for **God of War® III Remastered** (*CUSA01623 / CUSA01715*), featuring hardware auto-tuning, 144Hz Delta-Time synchronization, crash diagnostics, and upstream GitHub integration.
|
||||
@@ -16,7 +20,7 @@ Launcher for God Of War 3 PC on Linux and Windows
|
||||
## 🌟 Key Features
|
||||
|
||||
- 🦀 **Native Rust GUI Launcher (`gow3-launcher`):** Built with `eframe`/`egui`. Ultra-fast, lightweight, with a sleek game-art interface and no heavy dependencies.
|
||||
- 🖥️ **Hardware Auto-Detection:** Automatically inspects GPU model, dedicated VRAM, system RAM, and display refresh rate (Hz) on launch.
|
||||
- 🖥️ **Hardware Auto-Detection:** Automatically inspects GPU model, CPU model, dedicated VRAM, system RAM, and display refresh rate (Hz) on launch.
|
||||
- ⏱️ **144Hz / High-Hz Delta-Time Sync:** Eliminates the infamous 2x speed bug on 144Hz+ gaming displays by syncing engine delta-time with target framerates.
|
||||
- 🎨 **Texture Glitch Fix (Instant Readbacks):** Prevents snowy, bright, or reflection textures from corrupting into golden-yellow artifacts.
|
||||
- 🎮 **Feral GameMode Integration:** Built-in toggle for `gamemoderun` to maximize CPU governor and GPU clocks during gameplay.
|
||||
@@ -71,14 +75,28 @@ Launcher for God Of War 3 PC on Linux and Windows
|
||||
### Sections of the launcher
|
||||
|
||||
**Home Screen**
|
||||
<img width="2384" height="1301" alt="image" src="https://github.com/user-attachments/assets/1e285415-92ce-48c4-a1b1-b8bcebde2cc5" />
|
||||
<img width="1901" height="1025" alt="image" src="https://github.com/user-attachments/assets/31385740-38a4-4ddd-bf5b-3d795930c51f" />
|
||||
|
||||
|
||||
|
||||
**Graphics Settings**
|
||||
<img width="2284" height="1241" alt="image" src="https://github.com/user-attachments/assets/b69c4452-9e0b-4b9a-ac3e-e387d947bda4" />
|
||||
|
||||
**Keyboard Configuration**
|
||||
<img width="3183" height="1742" alt="image" src="https://github.com/user-attachments/assets/6785f030-0bbb-4d56-a541-e8d2bdbe4684" />
|
||||
|
||||
**Mods Settings**
|
||||
<img width="1901" height="1024" alt="image" src="https://github.com/user-attachments/assets/7a73fbbd-eb58-49a4-a052-b397da7bcb0a" />
|
||||
|
||||
**System Specifications**
|
||||
<img width="1898" height="1024" alt="image" src="https://github.com/user-attachments/assets/2643f04c-02af-44e5-a2d0-c8f764688759" />
|
||||
|
||||
**Game Location**
|
||||
<img width="1898" height="1025" alt="image" src="https://github.com/user-attachments/assets/aff6bba2-489c-47cf-8db4-5812dc705371" />
|
||||
|
||||
**Keyboard Configuration**
|
||||
<img width="1901" height="1030" alt="image" src="https://github.com/user-attachments/assets/e245193f-3863-4a23-93ee-d4253a0a0d28" />
|
||||
|
||||
**Shader Settings**
|
||||
<img width="1900" height="1029" alt="image" src="https://github.com/user-attachments/assets/6db7a6d5-4474-411d-aa81-defdfb65da6b" />
|
||||
|
||||
|
||||
|
||||
@@ -133,7 +151,7 @@ Launcher for God Of War 3 PC on Linux and Windows
|
||||
|
||||
### Özellikler:
|
||||
1. **Tek ve Sade Rust Launcher:** Karmaşık `.sh` scriptleri kaldırılmış, tüm pipeline doğrudan `gow3-launcher` içine gömülmüştür.
|
||||
2. **Otomatik Donanım Algılama:** GPU, VRAM, RAM ve monitör yenileme hızınızı (Hz) anında tespit eder.
|
||||
2. **Otomatik Donanım Algılama:** GPU, CPU, VRAM, RAM ve monitör yenileme hızınızı (Hz) anında tespit eder.
|
||||
3. **144 Hz Düzeltmesi:** Yüksek yenileme hızlı monitörlerde oyunun hızlı akmasını (2x speed) engelleyen Delta-Time yaması.
|
||||
4. **Doku Bozulması Koruması:** Karlı sahnelerdeki sararma hatasını çözen Instant Readbacks yaması.
|
||||
5. **Feral GameMode:** Tek tıkla `gamemoderun` performans modu desteği.
|
||||
|
||||
Executable
BIN
Binary file not shown.
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -0,0 +1,417 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// God of War III Remastered - Linux & Windows Input Bridge & Mouse Injector
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#define _GNU_SOURCE
|
||||
#include <dlfcn.h>
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
// Scancodes used for mouse buttons (F13 - F19)
|
||||
#define SCANCODE_MOUSE_LEFT 104 // F13
|
||||
#define SCANCODE_MOUSE_RIGHT 105 // F14
|
||||
#define SCANCODE_MOUSE_MIDDLE 106 // F15
|
||||
#define SCANCODE_MOUSE_SIDE1 107 // F16
|
||||
#define SCANCODE_MOUSE_SIDE2 108 // F17
|
||||
#define SCANCODE_MOUSE_WHEELUP 109 // F18
|
||||
#define SCANCODE_MOUSE_WHEELDN 110 // F19
|
||||
|
||||
typedef const bool* (*RealSDL_GetKeyboardState)(int *numkeys);
|
||||
typedef SDL_MouseButtonFlags (*RealSDL_GetMouseState)(float *x, float *y);
|
||||
typedef SDL_MouseButtonFlags (*RealSDL_GetGlobalMouseState)(float *x, float *y);
|
||||
typedef SDL_Window* (*RealSDL_GetKeyboardFocus)(void);
|
||||
typedef SDL_Window* (*RealSDL_GetMouseFocus)(void);
|
||||
typedef bool (*RealSDL_CursorVisible)(void);
|
||||
typedef bool (*RealSDL_HideCursor)(void);
|
||||
typedef bool (*RealSDL_ShowCursor)(void);
|
||||
typedef bool (*RealSDL_PollEvent)(SDL_Event *event);
|
||||
typedef SDL_Scancode (*RealSDL_GetScancodeFromName)(const char *name);
|
||||
typedef SDL_Surface* (*RealSDL_CreateSurface)(int width, int height, SDL_PixelFormat format);
|
||||
typedef void (*RealSDL_DestroySurface)(SDL_Surface *surface);
|
||||
typedef SDL_Cursor* (*RealSDL_CreateColorCursor)(SDL_Surface *surface, int hot_x, int hot_y);
|
||||
typedef bool (*RealSDL_SetCursor)(SDL_Cursor *cursor);
|
||||
typedef SDL_Window* (*RealSDL_CreateWindowWithProperties)(SDL_PropertiesID props);
|
||||
typedef SDL_Window* (*RealSDL_CreateWindow)(const char *title, int w, int h, SDL_WindowFlags flags);
|
||||
typedef bool (*RealSDL_ShowWindow)(SDL_Window *window);
|
||||
typedef bool (*RealSDL_HideWindow)(SDL_Window *window);
|
||||
typedef bool (*RealSDL_RaiseWindow)(SDL_Window *window);
|
||||
|
||||
static RealSDL_GetKeyboardState real_GetKeyboardState = NULL;
|
||||
static RealSDL_GetMouseState real_GetMouseState = NULL;
|
||||
static RealSDL_GetGlobalMouseState real_GetGlobalMouseState = NULL;
|
||||
static RealSDL_GetKeyboardFocus real_GetKeyboardFocus = NULL;
|
||||
static RealSDL_GetMouseFocus real_GetMouseFocus = NULL;
|
||||
static RealSDL_CursorVisible real_CursorVisible = NULL;
|
||||
static RealSDL_HideCursor real_HideCursor = NULL;
|
||||
static RealSDL_ShowCursor real_ShowCursor = NULL;
|
||||
static RealSDL_PollEvent real_PollEvent = NULL;
|
||||
static RealSDL_GetScancodeFromName real_GetScancodeFromName = NULL;
|
||||
static RealSDL_CreateSurface real_CreateSurface = NULL;
|
||||
static RealSDL_DestroySurface real_DestroySurface = NULL;
|
||||
static RealSDL_CreateColorCursor real_CreateColorCursor = NULL;
|
||||
static RealSDL_SetCursor real_SetCursor = NULL;
|
||||
static RealSDL_CreateWindowWithProperties real_CreateWindowWithProperties = NULL;
|
||||
static RealSDL_CreateWindow real_CreateWindow = NULL;
|
||||
static RealSDL_ShowWindow real_ShowWindow = NULL;
|
||||
static RealSDL_HideWindow real_HideWindow = NULL;
|
||||
static RealSDL_RaiseWindow real_RaiseWindow = NULL;
|
||||
|
||||
static int hide_cursor_enabled = -1;
|
||||
static int wait_warmup_enabled = -1;
|
||||
static volatile bool warmup_done = false;
|
||||
static SDL_Window* tracked_game_window = NULL;
|
||||
static volatile uint32_t tracked_mouse_buttons = 0;
|
||||
static volatile uint32_t latched_mouse_buttons = 0;
|
||||
static volatile int is_window_focused = 1;
|
||||
static volatile int wheel_up_ticks = 0;
|
||||
static volatile int wheel_dn_ticks = 0;
|
||||
static SDL_Cursor* transparent_cursor = NULL;
|
||||
static volatile bool cursor_is_hidden = false;
|
||||
|
||||
static void apply_cursor_hidden(void) {
|
||||
if (!hide_cursor_enabled) return;
|
||||
|
||||
if (!transparent_cursor && real_CreateSurface && real_CreateColorCursor && real_DestroySurface) {
|
||||
SDL_Surface* s = real_CreateSurface(1, 1, SDL_PIXELFORMAT_RGBA32);
|
||||
if (s) {
|
||||
uint32_t* pix = (uint32_t*)s->pixels;
|
||||
if (pix) *pix = 0; // 100% transparent pixel
|
||||
transparent_cursor = real_CreateColorCursor(s, 0, 0);
|
||||
real_DestroySurface(s);
|
||||
}
|
||||
}
|
||||
|
||||
if (transparent_cursor && real_SetCursor) {
|
||||
real_SetCursor(transparent_cursor);
|
||||
}
|
||||
if (real_HideCursor) {
|
||||
real_HideCursor();
|
||||
}
|
||||
cursor_is_hidden = true;
|
||||
}
|
||||
|
||||
static void init_symbols(void) {
|
||||
if (!real_GetKeyboardState) {
|
||||
#ifdef _WIN32
|
||||
HMODULE h = GetModuleHandleA("SDL3.dll");
|
||||
if (!h) h = LoadLibraryA("SDL3.dll");
|
||||
if (h) {
|
||||
real_GetKeyboardState = (RealSDL_GetKeyboardState)GetProcAddress(h, "SDL_GetKeyboardState");
|
||||
real_GetMouseState = (RealSDL_GetMouseState)GetProcAddress(h, "SDL_GetMouseState");
|
||||
real_GetGlobalMouseState = (RealSDL_GetGlobalMouseState)GetProcAddress(h, "SDL_GetGlobalMouseState");
|
||||
real_GetKeyboardFocus = (RealSDL_GetKeyboardFocus)GetProcAddress(h, "SDL_GetKeyboardFocus");
|
||||
real_GetMouseFocus = (RealSDL_GetMouseFocus)GetProcAddress(h, "SDL_GetMouseFocus");
|
||||
real_CursorVisible = (RealSDL_CursorVisible)GetProcAddress(h, "SDL_CursorVisible");
|
||||
real_HideCursor = (RealSDL_HideCursor)GetProcAddress(h, "SDL_HideCursor");
|
||||
real_ShowCursor = (RealSDL_ShowCursor)GetProcAddress(h, "SDL_ShowCursor");
|
||||
real_PollEvent = (RealSDL_PollEvent)GetProcAddress(h, "SDL_PollEvent");
|
||||
real_GetScancodeFromName = (RealSDL_GetScancodeFromName)GetProcAddress(h, "SDL_GetScancodeFromName");
|
||||
real_CreateSurface = (RealSDL_CreateSurface)GetProcAddress(h, "SDL_CreateSurface");
|
||||
real_DestroySurface = (RealSDL_DestroySurface)GetProcAddress(h, "SDL_DestroySurface");
|
||||
real_CreateColorCursor = (RealSDL_CreateColorCursor)GetProcAddress(h, "SDL_CreateColorCursor");
|
||||
real_SetCursor = (RealSDL_SetCursor)GetProcAddress(h, "SDL_SetCursor");
|
||||
real_CreateWindowWithProperties = (RealSDL_CreateWindowWithProperties)GetProcAddress(h, "SDL_CreateWindowWithProperties");
|
||||
real_CreateWindow = (RealSDL_CreateWindow)GetProcAddress(h, "SDL_CreateWindow");
|
||||
real_ShowWindow = (RealSDL_ShowWindow)GetProcAddress(h, "SDL_ShowWindow");
|
||||
real_HideWindow = (RealSDL_HideWindow)GetProcAddress(h, "SDL_HideWindow");
|
||||
real_RaiseWindow = (RealSDL_RaiseWindow)GetProcAddress(h, "SDL_RaiseWindow");
|
||||
}
|
||||
#else
|
||||
real_GetKeyboardState = (RealSDL_GetKeyboardState)dlsym(RTLD_NEXT, "SDL_GetKeyboardState");
|
||||
if (!real_GetKeyboardState) {
|
||||
void* h = dlopen("libSDL3.so.0", RTLD_NOW | RTLD_GLOBAL);
|
||||
if (!h) h = dlopen("libSDL3.so", RTLD_NOW | RTLD_GLOBAL);
|
||||
if (h) {
|
||||
real_GetKeyboardState = (RealSDL_GetKeyboardState)dlsym(h, "SDL_GetKeyboardState");
|
||||
real_GetMouseState = (RealSDL_GetMouseState)dlsym(h, "SDL_GetMouseState");
|
||||
real_GetGlobalMouseState = (RealSDL_GetGlobalMouseState)dlsym(h, "SDL_GetGlobalMouseState");
|
||||
real_GetKeyboardFocus = (RealSDL_GetKeyboardFocus)dlsym(h, "SDL_GetKeyboardFocus");
|
||||
real_GetMouseFocus = (RealSDL_GetMouseFocus)dlsym(h, "SDL_GetMouseFocus");
|
||||
real_CursorVisible = (RealSDL_CursorVisible)dlsym(h, "SDL_CursorVisible");
|
||||
real_HideCursor = (RealSDL_HideCursor)dlsym(h, "SDL_HideCursor");
|
||||
real_ShowCursor = (RealSDL_ShowCursor)dlsym(h, "SDL_ShowCursor");
|
||||
real_PollEvent = (RealSDL_PollEvent)dlsym(h, "SDL_PollEvent");
|
||||
real_GetScancodeFromName = (RealSDL_GetScancodeFromName)dlsym(h, "SDL_GetScancodeFromName");
|
||||
real_CreateSurface = (RealSDL_CreateSurface)dlsym(h, "SDL_CreateSurface");
|
||||
real_DestroySurface = (RealSDL_DestroySurface)dlsym(h, "SDL_DestroySurface");
|
||||
real_CreateColorCursor = (RealSDL_CreateColorCursor)dlsym(h, "SDL_CreateColorCursor");
|
||||
real_SetCursor = (RealSDL_SetCursor)dlsym(h, "SDL_SetCursor");
|
||||
real_CreateWindowWithProperties = (RealSDL_CreateWindowWithProperties)dlsym(h, "SDL_CreateWindowWithProperties");
|
||||
real_CreateWindow = (RealSDL_CreateWindow)dlsym(h, "SDL_CreateWindow");
|
||||
real_ShowWindow = (RealSDL_ShowWindow)dlsym(h, "SDL_ShowWindow");
|
||||
real_HideWindow = (RealSDL_HideWindow)dlsym(h, "SDL_HideWindow");
|
||||
real_RaiseWindow = (RealSDL_RaiseWindow)dlsym(h, "SDL_RaiseWindow");
|
||||
}
|
||||
} else {
|
||||
real_GetMouseState = (RealSDL_GetMouseState)dlsym(RTLD_NEXT, "SDL_GetMouseState");
|
||||
real_GetGlobalMouseState = (RealSDL_GetGlobalMouseState)dlsym(RTLD_NEXT, "SDL_GetGlobalMouseState");
|
||||
real_GetKeyboardFocus = (RealSDL_GetKeyboardFocus)dlsym(RTLD_NEXT, "SDL_GetKeyboardFocus");
|
||||
real_GetMouseFocus = (RealSDL_GetMouseFocus)dlsym(RTLD_NEXT, "SDL_GetMouseFocus");
|
||||
real_CursorVisible = (RealSDL_CursorVisible)dlsym(RTLD_NEXT, "SDL_CursorVisible");
|
||||
real_HideCursor = (RealSDL_HideCursor)dlsym(RTLD_NEXT, "SDL_HideCursor");
|
||||
real_ShowCursor = (RealSDL_ShowCursor)dlsym(RTLD_NEXT, "SDL_ShowCursor");
|
||||
real_PollEvent = (RealSDL_PollEvent)dlsym(RTLD_NEXT, "SDL_PollEvent");
|
||||
real_GetScancodeFromName = (RealSDL_GetScancodeFromName)dlsym(RTLD_NEXT, "SDL_GetScancodeFromName");
|
||||
real_CreateSurface = (RealSDL_CreateSurface)dlsym(RTLD_NEXT, "SDL_CreateSurface");
|
||||
real_DestroySurface = (RealSDL_DestroySurface)dlsym(RTLD_NEXT, "SDL_DestroySurface");
|
||||
real_CreateColorCursor = (RealSDL_CreateColorCursor)dlsym(RTLD_NEXT, "SDL_CreateColorCursor");
|
||||
real_SetCursor = (RealSDL_SetCursor)dlsym(RTLD_NEXT, "SDL_SetCursor");
|
||||
real_CreateWindowWithProperties = (RealSDL_CreateWindowWithProperties)dlsym(RTLD_NEXT, "SDL_CreateWindowWithProperties");
|
||||
real_CreateWindow = (RealSDL_CreateWindow)dlsym(RTLD_NEXT, "SDL_CreateWindow");
|
||||
real_ShowWindow = (RealSDL_ShowWindow)dlsym(RTLD_NEXT, "SDL_ShowWindow");
|
||||
real_HideWindow = (RealSDL_HideWindow)dlsym(RTLD_NEXT, "SDL_HideWindow");
|
||||
real_RaiseWindow = (RealSDL_RaiseWindow)dlsym(RTLD_NEXT, "SDL_RaiseWindow");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (hide_cursor_enabled == -1) {
|
||||
const char *env = getenv("GOW3_HIDE_CURSOR");
|
||||
hide_cursor_enabled = (env && (env[0] == '1' || env[0] == 't' || env[0] == 'T')) ? 1 : 0;
|
||||
}
|
||||
|
||||
if (wait_warmup_enabled == -1) {
|
||||
const char *w_env = getenv("GOW3_WAIT_WARMUP");
|
||||
wait_warmup_enabled = (w_env && (w_env[0] == '1' || w_env[0] == 't' || w_env[0] == 'T')) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
SDL_Window* SDL_CreateWindowWithProperties(SDL_PropertiesID props) {
|
||||
init_symbols();
|
||||
SDL_Window* win = NULL;
|
||||
if (real_CreateWindowWithProperties) {
|
||||
win = real_CreateWindowWithProperties(props);
|
||||
}
|
||||
if (win) {
|
||||
tracked_game_window = win;
|
||||
apply_cursor_hidden();
|
||||
if (wait_warmup_enabled && !warmup_done) {
|
||||
if (real_HideWindow) {
|
||||
real_HideWindow(win);
|
||||
}
|
||||
}
|
||||
}
|
||||
return win;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
SDL_Window* SDL_CreateWindow(const char *title, int w, int h, SDL_WindowFlags flags) {
|
||||
init_symbols();
|
||||
SDL_Window* win = NULL;
|
||||
if (real_CreateWindow) {
|
||||
win = real_CreateWindow(title, w, h, flags);
|
||||
}
|
||||
if (win) {
|
||||
tracked_game_window = win;
|
||||
apply_cursor_hidden();
|
||||
if (wait_warmup_enabled && !warmup_done) {
|
||||
if (real_HideWindow) {
|
||||
real_HideWindow(win);
|
||||
}
|
||||
}
|
||||
}
|
||||
return win;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
bool SDL_ShowWindow(SDL_Window *window) {
|
||||
init_symbols();
|
||||
if (window) {
|
||||
tracked_game_window = window;
|
||||
}
|
||||
if (wait_warmup_enabled && !warmup_done) {
|
||||
// Keep window hidden until shader warmup is 100% complete
|
||||
if (real_HideWindow && window) {
|
||||
real_HideWindow(window);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (real_ShowWindow && window) {
|
||||
return real_ShowWindow(window);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
SDL_Scancode SDL_GetScancodeFromName(const char *name) {
|
||||
init_symbols();
|
||||
if (!name) return SDL_SCANCODE_UNKNOWN;
|
||||
|
||||
// Direct mapping for custom mouse buttons
|
||||
#ifdef _WIN32
|
||||
#define MATCH(s) (_stricmp(name, s) == 0)
|
||||
#else
|
||||
#define MATCH(s) (strcasecmp(name, s) == 0)
|
||||
#endif
|
||||
|
||||
if (MATCH("LeftButton") || MATCH("Mouse1") || MATCH("LeftClick")) {
|
||||
return (SDL_Scancode)SCANCODE_MOUSE_LEFT; // 104 (F13)
|
||||
}
|
||||
if (MATCH("RightButton") || MATCH("Mouse2") || MATCH("RightClick")) {
|
||||
return (SDL_Scancode)SCANCODE_MOUSE_RIGHT; // 105 (F14)
|
||||
}
|
||||
if (MATCH("MiddleButton") || MATCH("Mouse3") || MATCH("MiddleClick")) {
|
||||
return (SDL_Scancode)SCANCODE_MOUSE_MIDDLE; // 106 (F15)
|
||||
}
|
||||
if (MATCH("SideButtonBack") || MATCH("Mouse4") || MATCH("Side1")) {
|
||||
return (SDL_Scancode)SCANCODE_MOUSE_SIDE1; // 107 (F16)
|
||||
}
|
||||
if (MATCH("SideButtonForward") || MATCH("Mouse5") || MATCH("Side2")) {
|
||||
return (SDL_Scancode)SCANCODE_MOUSE_SIDE2; // 108 (F17)
|
||||
}
|
||||
if (MATCH("MouseWheelUp") || MATCH("WheelUp")) {
|
||||
return (SDL_Scancode)SCANCODE_MOUSE_WHEELUP; // 109 (F18)
|
||||
}
|
||||
if (MATCH("MouseWheelDown") || MATCH("WheelDown")) {
|
||||
return (SDL_Scancode)SCANCODE_MOUSE_WHEELDN; // 110 (F19)
|
||||
}
|
||||
|
||||
#undef MATCH
|
||||
|
||||
if (real_GetScancodeFromName) {
|
||||
return real_GetScancodeFromName(name);
|
||||
}
|
||||
return SDL_SCANCODE_UNKNOWN;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
const bool* SDL_GetKeyboardState(int *numkeys) {
|
||||
init_symbols();
|
||||
if (!real_GetKeyboardState) return NULL;
|
||||
|
||||
const bool* orig_state = real_GetKeyboardState(numkeys);
|
||||
if (!orig_state) return NULL;
|
||||
|
||||
bool* state = (bool*)orig_state;
|
||||
|
||||
// Query mouse buttons & inject into keyboard scancode array
|
||||
// tracked_mouse_buttons: continuously held buttons
|
||||
// latched_mouse_buttons: quick clicks between poll frames, guaranteed not to be lost
|
||||
uint32_t buttons = tracked_mouse_buttons | latched_mouse_buttons;
|
||||
latched_mouse_buttons = 0; // consumed by this frame
|
||||
|
||||
if (real_GetMouseState) {
|
||||
float mx = 0.0f, my = 0.0f;
|
||||
buttons |= real_GetMouseState(&mx, &my);
|
||||
}
|
||||
if (!buttons && real_GetGlobalMouseState && is_window_focused) {
|
||||
float mx = 0.0f, my = 0.0f;
|
||||
buttons |= real_GetGlobalMouseState(&mx, &my);
|
||||
}
|
||||
|
||||
state[SCANCODE_MOUSE_LEFT] = (buttons & SDL_BUTTON_LMASK) != 0;
|
||||
state[SCANCODE_MOUSE_RIGHT] = (buttons & SDL_BUTTON_RMASK) != 0;
|
||||
state[SCANCODE_MOUSE_MIDDLE] = (buttons & SDL_BUTTON_MMASK) != 0;
|
||||
state[SCANCODE_MOUSE_SIDE1] = (buttons & SDL_BUTTON_X1MASK) != 0;
|
||||
state[SCANCODE_MOUSE_SIDE2] = (buttons & SDL_BUTTON_X2MASK) != 0;
|
||||
|
||||
if (wheel_up_ticks > 0) {
|
||||
state[SCANCODE_MOUSE_WHEELUP] = true;
|
||||
wheel_up_ticks--;
|
||||
}
|
||||
if (wheel_dn_ticks > 0) {
|
||||
state[SCANCODE_MOUSE_WHEELDN] = true;
|
||||
wheel_dn_ticks--;
|
||||
}
|
||||
|
||||
return orig_state;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
bool SDL_PollEvent(SDL_Event *event) {
|
||||
init_symbols();
|
||||
if (!cursor_is_hidden) {
|
||||
apply_cursor_hidden();
|
||||
}
|
||||
if (!real_PollEvent) return false;
|
||||
|
||||
bool result = real_PollEvent(event);
|
||||
if (result && event) {
|
||||
uint32_t event_type = event->type;
|
||||
|
||||
// Window focus gained / shown
|
||||
if (event_type == SDL_EVENT_WINDOW_FOCUS_GAINED || event_type == 514 /* SDL_EVENT_WINDOW_SHOWN */) {
|
||||
is_window_focused = 1;
|
||||
apply_cursor_hidden();
|
||||
} else if (event_type == SDL_EVENT_WINDOW_FOCUS_LOST) {
|
||||
is_window_focused = 0;
|
||||
tracked_mouse_buttons = 0;
|
||||
latched_mouse_buttons = 0;
|
||||
}
|
||||
// Mouse button press / release
|
||||
else if (event_type == SDL_EVENT_MOUSE_BUTTON_DOWN) {
|
||||
is_window_focused = 1;
|
||||
uint8_t btn = event->button.button;
|
||||
if (btn >= 1 && btn <= 5) {
|
||||
uint32_t mask = (1u << (btn - 1));
|
||||
tracked_mouse_buttons |= mask;
|
||||
latched_mouse_buttons |= mask;
|
||||
}
|
||||
} else if (event_type == SDL_EVENT_MOUSE_BUTTON_UP) {
|
||||
uint8_t btn = event->button.button;
|
||||
if (btn >= 1 && btn <= 5) {
|
||||
tracked_mouse_buttons &= ~(1u << (btn - 1));
|
||||
}
|
||||
} else if (event_type == SDL_EVENT_MOUSE_WHEEL) {
|
||||
if (event->wheel.y > 0.0f) {
|
||||
wheel_up_ticks = 2;
|
||||
} else if (event->wheel.y < 0.0f) {
|
||||
wheel_dn_ticks = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// Override Gow3Overlay::SetLoading and ImGui::ProgressBar to completely eliminate
|
||||
// the engine's plain generic loading bar in fullscreen mode, and reveal the window
|
||||
// once shader warmup is 100% complete.
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
void _ZN11Gow3Overlay10SetLoadingEbjj(bool is_loading, unsigned int current, unsigned int total) {
|
||||
init_symbols();
|
||||
if (!is_loading || (total > 0 && current >= total)) {
|
||||
warmup_done = true;
|
||||
if (wait_warmup_enabled && tracked_game_window) {
|
||||
if (real_ShowWindow) {
|
||||
real_ShowWindow(tracked_game_window);
|
||||
}
|
||||
if (real_RaiseWindow) {
|
||||
real_RaiseWindow(tracked_game_window);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
void _ZN5ImGui11ProgressBarEfRK6ImVec2PKc(float fraction, const void* size_arg, const char* overlay) {
|
||||
(void)fraction;
|
||||
(void)size_arg;
|
||||
(void)overlay;
|
||||
}
|
||||
|
||||
Executable
BIN
Binary file not shown.
+1
-1
@@ -15,4 +15,4 @@ vsync=1
|
||||
deferred_readback=1
|
||||
stale_readback=1
|
||||
async_shaders=1
|
||||
frames_queued=1
|
||||
frames_queued=2
|
||||
Binary file not shown.
Binary file not shown.
Generated
+4
-332
@@ -417,18 +417,6 @@ version = "1.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
version = "0.22.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
version = "0.23.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5"
|
||||
|
||||
[[package]]
|
||||
name = "bit-set"
|
||||
version = "0.10.0"
|
||||
@@ -637,12 +625,6 @@ dependencies = [
|
||||
"bytemuck",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "color_quant"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
|
||||
|
||||
[[package]]
|
||||
name = "combine"
|
||||
version = "4.6.8"
|
||||
@@ -729,12 +711,6 @@ version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f"
|
||||
|
||||
[[package]]
|
||||
name = "data-url"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376"
|
||||
|
||||
[[package]]
|
||||
name = "dispatch"
|
||||
version = "0.2.0"
|
||||
@@ -909,14 +885,12 @@ checksum = "05cbdc785020861553f230f23d330ba1fb72613b9d8e0e457f3bdc8ba6db6dcf"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"egui",
|
||||
"ehttp",
|
||||
"enum-map",
|
||||
"image",
|
||||
"itertools",
|
||||
"log",
|
||||
"mime_guess2",
|
||||
"profiling",
|
||||
"resvg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -933,20 +907,6 @@ dependencies = [
|
||||
"winit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ehttp"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b2f1b93eb2e039aaff63ce07cca59bd1dca02f2ce30075a17b619d2c42f56efc"
|
||||
dependencies = [
|
||||
"document-features",
|
||||
"js-sys",
|
||||
"ureq",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "either"
|
||||
version = "1.19.0"
|
||||
@@ -1135,12 +1095,6 @@ dependencies = [
|
||||
"zlib-rs",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "float-cmp"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4"
|
||||
|
||||
[[package]]
|
||||
name = "foldhash"
|
||||
version = "0.2.0"
|
||||
@@ -1257,17 +1211,6 @@ dependencies = [
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "getrandom"
|
||||
version = "0.2.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"wasi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "getrandom"
|
||||
version = "0.3.4"
|
||||
@@ -1291,16 +1234,6 @@ dependencies = [
|
||||
"r-efi 6.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gif"
|
||||
version = "0.14.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ee8cfcc411d9adbbaba82fb72661cc1bcca13e8bba98b364e62b2dba8f960159"
|
||||
dependencies = [
|
||||
"color_quant",
|
||||
"weezl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gl_generator"
|
||||
version = "0.14.0"
|
||||
@@ -1485,22 +1418,6 @@ version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
||||
|
||||
[[package]]
|
||||
name = "http"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"itoa",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "httparse"
|
||||
version = "1.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
|
||||
|
||||
[[package]]
|
||||
name = "icu_collections"
|
||||
version = "2.3.0"
|
||||
@@ -1613,31 +1530,12 @@ checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"byteorder-lite",
|
||||
"color_quant",
|
||||
"gif",
|
||||
"image-webp",
|
||||
"moxcms",
|
||||
"num-traits",
|
||||
"png 0.18.1",
|
||||
"png",
|
||||
"tiff",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "image-webp"
|
||||
version = "0.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3"
|
||||
dependencies = [
|
||||
"byteorder-lite",
|
||||
"quick-error",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "imagesize"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "edcd27d72f2f071c64249075f42e205ff93c9a4c5f6c6da53e79ed9f9832c285"
|
||||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "2.14.2"
|
||||
@@ -1759,17 +1657,6 @@ version = "3.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
|
||||
|
||||
[[package]]
|
||||
name = "kurbo"
|
||||
version = "0.11.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c62026ae44756f8a599ba21140f350303d4f08dcdcc71b5ad9c9bb8128c13c62"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"euclid",
|
||||
"smallvec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kurbo"
|
||||
version = "0.13.1"
|
||||
@@ -1784,11 +1671,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "launcher"
|
||||
version = "1.7.0"
|
||||
version = "2.1.0"
|
||||
dependencies = [
|
||||
"eframe",
|
||||
"egui_extras",
|
||||
"image",
|
||||
"libc",
|
||||
"rfd",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -2444,7 +2332,7 @@ checksum = "839c8299360d2e998bdb106dc0a6cd71dcc5f4df51df1b620361bf50e283cca6"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"color",
|
||||
"kurbo 0.13.1",
|
||||
"kurbo",
|
||||
"linebender_resource_handle",
|
||||
"smallvec",
|
||||
]
|
||||
@@ -2542,12 +2430,6 @@ dependencies = [
|
||||
"siphasher",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pico-args"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315"
|
||||
|
||||
[[package]]
|
||||
name = "pin-project"
|
||||
version = "1.1.13"
|
||||
@@ -2597,19 +2479,6 @@ version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
|
||||
|
||||
[[package]]
|
||||
name = "png"
|
||||
version = "0.17.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"crc32fast",
|
||||
"fdeflate",
|
||||
"flate2",
|
||||
"miniz_oxide 0.8.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "png"
|
||||
version = "0.18.1"
|
||||
@@ -2837,20 +2706,6 @@ version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832"
|
||||
|
||||
[[package]]
|
||||
name = "resvg"
|
||||
version = "0.45.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a8928798c0a55e03c9ca6c4c6846f76377427d2c1e1f7e6de3c06ae57942df43"
|
||||
dependencies = [
|
||||
"log",
|
||||
"pico-args",
|
||||
"rgb",
|
||||
"svgtypes",
|
||||
"tiny-skia",
|
||||
"usvg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rfd"
|
||||
version = "0.17.2"
|
||||
@@ -2878,35 +2733,6 @@ dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rgb"
|
||||
version = "0.8.53"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "47b34b781b31e5d73e9fbc8689c70551fd1ade9a19e3e28cfec8580a79290cc4"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ring"
|
||||
version = "0.17.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"cfg-if",
|
||||
"getrandom 0.2.17",
|
||||
"libc",
|
||||
"untrusted",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "roxmltree"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97"
|
||||
|
||||
[[package]]
|
||||
name = "rustc-hash"
|
||||
version = "1.1.0"
|
||||
@@ -2954,41 +2780,6 @@ dependencies = [
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.23.46"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "48e13bd8c0e9365c43cfa5c9e8f9ad49d3c8444926c9aac819e0e4dc503c8fdf"
|
||||
dependencies = [
|
||||
"log",
|
||||
"once_cell",
|
||||
"ring",
|
||||
"rustls-pki-types",
|
||||
"rustls-webpki",
|
||||
"subtle",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-pki-types"
|
||||
version = "1.15.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96"
|
||||
dependencies = [
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-webpki"
|
||||
version = "0.103.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f3c3cf1d8b1e7d4927e2d154c3fcb02979afb9939629c62cd9048d4f07b60ac2"
|
||||
dependencies = [
|
||||
"ring",
|
||||
"rustls-pki-types",
|
||||
"untrusted",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustversion"
|
||||
version = "1.0.23"
|
||||
@@ -3133,15 +2924,6 @@ version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e"
|
||||
|
||||
[[package]]
|
||||
name = "simplecss"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7a9c6883ca9c3c7c90e888de77b7a5c849c779d25d74a1269b0218b14e8b136c"
|
||||
dependencies = [
|
||||
"log",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "siphasher"
|
||||
version = "1.0.4"
|
||||
@@ -3277,25 +3059,6 @@ name = "strict-num"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731"
|
||||
dependencies = [
|
||||
"float-cmp",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "subtle"
|
||||
version = "2.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
||||
|
||||
[[package]]
|
||||
name = "svgtypes"
|
||||
version = "0.15.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "68c7541fff44b35860c1a7a47a7cadf3e4a304c457b58f9870d9706ece028afc"
|
||||
dependencies = [
|
||||
"kurbo 0.11.3",
|
||||
"siphasher",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
@@ -3417,7 +3180,6 @@ dependencies = [
|
||||
"bytemuck",
|
||||
"cfg-if",
|
||||
"log",
|
||||
"png 0.17.16",
|
||||
"tiny-skia-path",
|
||||
]
|
||||
|
||||
@@ -3578,41 +3340,6 @@ version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"
|
||||
|
||||
[[package]]
|
||||
name = "untrusted"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
|
||||
|
||||
[[package]]
|
||||
name = "ureq"
|
||||
version = "3.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9a7ac20be9b7726e0bbdbf974c059676d9acb1cd414961f570a4e8231cacd7fc"
|
||||
dependencies = [
|
||||
"base64 0.23.1",
|
||||
"flate2",
|
||||
"log",
|
||||
"percent-encoding",
|
||||
"rustls",
|
||||
"rustls-pki-types",
|
||||
"ureq-proto",
|
||||
"utf8-zero",
|
||||
"webpki-roots",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ureq-proto"
|
||||
version = "0.6.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f86fd172ccca569e458f61b6bdd6220965a9ef36e672a6852953b51a0e1583be"
|
||||
dependencies = [
|
||||
"base64 0.23.1",
|
||||
"http",
|
||||
"httparse",
|
||||
"log",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "url"
|
||||
version = "2.5.8"
|
||||
@@ -3625,34 +3352,6 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "usvg"
|
||||
version = "0.45.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "80be9b06fbae3b8b303400ab20778c80bbaf338f563afe567cf3c9eea17b47ef"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"data-url",
|
||||
"flate2",
|
||||
"imagesize",
|
||||
"kurbo 0.11.3",
|
||||
"log",
|
||||
"pico-args",
|
||||
"roxmltree",
|
||||
"simplecss",
|
||||
"siphasher",
|
||||
"strict-num",
|
||||
"svgtypes",
|
||||
"tiny-skia-path",
|
||||
"xmlwriter",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "utf8-zero"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b8c0a043c9540bae7c578c88f91dda8bd82e59ae27c21baca69c8b191aaf5a6e"
|
||||
|
||||
[[package]]
|
||||
name = "utf8_iter"
|
||||
version = "1.0.4"
|
||||
@@ -3713,12 +3412,6 @@ dependencies = [
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasi"
|
||||
version = "0.11.1+wasi-snapshot-preview1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
|
||||
|
||||
[[package]]
|
||||
name = "wasip2"
|
||||
version = "1.0.4+wasi-0.2.12"
|
||||
@@ -3955,15 +3648,6 @@ dependencies = [
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "webpki-roots"
|
||||
version = "1.0.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a"
|
||||
dependencies = [
|
||||
"rustls-pki-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "weezl"
|
||||
version = "0.1.12"
|
||||
@@ -4508,12 +4192,6 @@ version = "0.8.29"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e450f9b2ed1dff33c94c12589a87338689467b9c4f5d8a5710bd09a847d2c8a7"
|
||||
|
||||
[[package]]
|
||||
name = "xmlwriter"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9"
|
||||
|
||||
[[package]]
|
||||
name = "yoke"
|
||||
version = "0.8.3"
|
||||
@@ -4684,12 +4362,6 @@ dependencies = [
|
||||
"synstructure",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zeroize"
|
||||
version = "1.9.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e13084392c5e4bc371903e2935a5eaeed24905a7511356b883835e18a78f6879"
|
||||
|
||||
[[package]]
|
||||
name = "zerotrie"
|
||||
version = "0.2.5"
|
||||
|
||||
+7
-4
@@ -1,17 +1,20 @@
|
||||
[package]
|
||||
name = "launcher"
|
||||
version = "1.7.0"
|
||||
version = "2.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
eframe = "0.36.2"
|
||||
egui_extras = { version = "0.36.2", features = ["all_loaders"] }
|
||||
image = { version = "0.25.10", default-features = false, features = ["png"] }
|
||||
egui_extras = { version = "0.36.2", features = ["image"] }
|
||||
image = { version = "0.25.10", default-features = false, features = ["png", "bmp"] }
|
||||
rfd = "0.17.2"
|
||||
serde = { version = "1.0.229", features = ["derive"] }
|
||||
serde_json = "1.0.154"
|
||||
|
||||
[target.'cfg(windows)'.build-dependencies]
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
libc = "0.2"
|
||||
|
||||
[build-dependencies]
|
||||
winres = "0.1"
|
||||
|
||||
[profile.release]
|
||||
|
||||
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 55 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 55 KiB |
+4
-2
@@ -1,11 +1,13 @@
|
||||
fn main() {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
|
||||
if target_os == "windows" {
|
||||
let mut res = winres::WindowsResource::new();
|
||||
res.set_icon("gow3.ico");
|
||||
res.set("ProductName", "God of War III Remastered Launcher");
|
||||
res.set("FileDescription", "God of War III Remastered PC Launcher");
|
||||
res.set("LegalCopyright", "God of War III Remastered");
|
||||
res.set("ProductVersion", "2.1.0.0");
|
||||
res.set("FileVersion", "2.1.0.0");
|
||||
if let Err(e) = res.compile() {
|
||||
eprintln!("Warning: failed to compile Windows icon resource: {}", e);
|
||||
}
|
||||
|
||||
+4122
-1500
File diff suppressed because it is too large.
Load diff
+299
-39
@@ -94,25 +94,36 @@ pub struct KeyboardBindings {
|
||||
|
||||
impl Default for KeyboardBindings {
|
||||
fn default() -> Self {
|
||||
Self::wasd_cvbn()
|
||||
Self::recommended()
|
||||
}
|
||||
}
|
||||
|
||||
impl KeyboardBindings {
|
||||
pub fn wasd_cvbn() -> Self {
|
||||
/// 1. Önerilen Preset (Klavye):
|
||||
/// - Üçgen: U
|
||||
/// - Kare: T
|
||||
/// - Yuvarlak: J
|
||||
/// - X: G
|
||||
/// - Sol Stick: W, A, S, D
|
||||
/// - Sağ Stick: Numpad 8 (Yukarı), Numpad 2 (Aşağı), Numpad 4 (Sol), Numpad 6 (Sağ)
|
||||
/// - Options: Enter
|
||||
/// - Share veya Select: Backspace
|
||||
/// - DPAD: Ok Tuşları (Yukarı, Aşağı, Sol, Sağ)
|
||||
/// - L1/R1/L2/R2/L3/R3: Q, E, Z, X, C, V
|
||||
pub fn recommended() -> Self {
|
||||
Self {
|
||||
triangle: "c".to_string(),
|
||||
circle: "b".to_string(),
|
||||
cross: "n".to_string(),
|
||||
square: "v".to_string(),
|
||||
triangle: "u".to_string(),
|
||||
circle: "j".to_string(),
|
||||
cross: "g".to_string(),
|
||||
square: "t".to_string(),
|
||||
l1: "q".to_string(),
|
||||
r1: "u".to_string(),
|
||||
l2: "e".to_string(),
|
||||
r2: "o".to_string(),
|
||||
l3: "x".to_string(),
|
||||
r3: "m".to_string(),
|
||||
r1: "e".to_string(),
|
||||
l2: "z".to_string(),
|
||||
r2: "x".to_string(),
|
||||
l3: "c".to_string(),
|
||||
r3: "v".to_string(),
|
||||
options: "enter".to_string(),
|
||||
touchpad_center: "space".to_string(),
|
||||
touchpad_center: "backspace".to_string(),
|
||||
pad_up: "up".to_string(),
|
||||
pad_down: "down".to_string(),
|
||||
pad_left: "left".to_string(),
|
||||
@@ -121,27 +132,38 @@ impl KeyboardBindings {
|
||||
axis_left_x_plus: "d".to_string(),
|
||||
axis_left_y_minus: "w".to_string(),
|
||||
axis_left_y_plus: "s".to_string(),
|
||||
axis_right_x_minus: "j".to_string(),
|
||||
axis_right_x_plus: "l".to_string(),
|
||||
axis_right_y_minus: "i".to_string(),
|
||||
axis_right_y_plus: "k".to_string(),
|
||||
axis_right_x_minus: "kp4".to_string(),
|
||||
axis_right_x_plus: "kp6".to_string(),
|
||||
axis_right_y_minus: "kp8".to_string(),
|
||||
axis_right_y_plus: "kp2".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn wasd_numpad() -> Self {
|
||||
/// 2. İkinci Preset (Fare + Klavye):
|
||||
/// - Üçgen: Fare Sağ Tık (rightbutton)
|
||||
/// - Kare: Fare Sol Tık (leftbutton)
|
||||
/// - Yuvarlak: F
|
||||
/// - X: Space
|
||||
/// - Sol Stick: W, A, S, D
|
||||
/// - Sağ Stick: Numpad 8 (Yukarı), Numpad 2 (Aşağı), Numpad 4 (Sol), Numpad 6 (Sağ)
|
||||
/// - Options: Enter
|
||||
/// - Share veya Select: Backspace
|
||||
/// - DPAD: Ok Tuşları (Yukarı, Aşağı, Sol, Sağ)
|
||||
/// - L1/R1/L2/R2/L3/R3: Q, E, Z, X, C, V
|
||||
pub fn mouse_keyboard() -> Self {
|
||||
Self {
|
||||
triangle: "kp8".to_string(),
|
||||
circle: "kp6".to_string(),
|
||||
cross: "kp2".to_string(),
|
||||
square: "kp4".to_string(),
|
||||
triangle: "rightbutton".to_string(),
|
||||
circle: "f".to_string(),
|
||||
cross: "space".to_string(),
|
||||
square: "leftbutton".to_string(),
|
||||
l1: "q".to_string(),
|
||||
r1: "u".to_string(),
|
||||
l2: "e".to_string(),
|
||||
r2: "o".to_string(),
|
||||
l3: "x".to_string(),
|
||||
r3: "m".to_string(),
|
||||
r1: "e".to_string(),
|
||||
l2: "z".to_string(),
|
||||
r2: "x".to_string(),
|
||||
l3: "c".to_string(),
|
||||
r3: "v".to_string(),
|
||||
options: "enter".to_string(),
|
||||
touchpad_center: "space".to_string(),
|
||||
touchpad_center: "backspace".to_string(),
|
||||
pad_up: "up".to_string(),
|
||||
pad_down: "down".to_string(),
|
||||
pad_left: "left".to_string(),
|
||||
@@ -150,12 +172,14 @@ impl KeyboardBindings {
|
||||
axis_left_x_plus: "d".to_string(),
|
||||
axis_left_y_minus: "w".to_string(),
|
||||
axis_left_y_plus: "s".to_string(),
|
||||
axis_right_x_minus: "j".to_string(),
|
||||
axis_right_x_plus: "l".to_string(),
|
||||
axis_right_y_minus: "i".to_string(),
|
||||
axis_right_y_plus: "k".to_string(),
|
||||
axis_right_x_minus: "kp4".to_string(),
|
||||
axis_right_x_plus: "kp6".to_string(),
|
||||
axis_right_y_minus: "kp8".to_string(),
|
||||
axis_right_y_plus: "kp2".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
@@ -214,6 +238,10 @@ pub struct LauncherConfig {
|
||||
pub patch_readbacks: bool,
|
||||
#[serde(default = "default_true")]
|
||||
pub async_readbacks: bool,
|
||||
#[serde(default)]
|
||||
pub launch_while_compiling_shaders: bool,
|
||||
#[serde(default = "default_true")]
|
||||
pub show_shader_compile_rage_meter: bool,
|
||||
#[serde(default = "default_true")]
|
||||
pub skip_cinematics: bool,
|
||||
#[serde(default = "default_true")]
|
||||
@@ -229,6 +257,10 @@ pub struct LauncherConfig {
|
||||
#[serde(default = "default_launcher_version")]
|
||||
pub launcher_version: String,
|
||||
|
||||
// Mods Management
|
||||
#[serde(default)]
|
||||
pub disabled_mods: Vec<String>,
|
||||
|
||||
// Graphics Settings
|
||||
#[serde(default = "default_render_resolution")]
|
||||
pub render_resolution: String,
|
||||
@@ -251,6 +283,8 @@ pub struct LauncherConfig {
|
||||
#[serde(default)]
|
||||
pub background_controller_input: bool,
|
||||
#[serde(default = "default_true")]
|
||||
pub hide_mouse_cursor: bool,
|
||||
#[serde(default = "default_true")]
|
||||
pub is_motion_controls_enabled: bool,
|
||||
#[serde(default = "default_deadzone")]
|
||||
pub deadzone_left: u32,
|
||||
@@ -260,10 +294,20 @@ pub struct LauncherConfig {
|
||||
// Keyboard bindings
|
||||
#[serde(default)]
|
||||
pub keyboard_bindings: KeyboardBindings,
|
||||
|
||||
// Discord Rich Presence
|
||||
#[serde(default = "default_true")]
|
||||
pub discord_rpc_enabled: bool,
|
||||
#[serde(default = "default_discord_client_id")]
|
||||
pub discord_client_id: String,
|
||||
}
|
||||
|
||||
fn default_discord_client_id() -> String {
|
||||
crate::discord_rpc::DISCORD_GOW3_APP_ID.to_string()
|
||||
}
|
||||
|
||||
fn default_language() -> String {
|
||||
"tr".to_string()
|
||||
crate::discord_rpc::detect_system_language().to_string()
|
||||
}
|
||||
fn default_target_fps() -> u32 {
|
||||
60
|
||||
@@ -271,6 +315,10 @@ fn default_target_fps() -> u32 {
|
||||
fn default_true() -> bool {
|
||||
true
|
||||
}
|
||||
#[allow(dead_code)]
|
||||
fn default_false() -> bool {
|
||||
false
|
||||
}
|
||||
fn default_deadzone() -> u32 {
|
||||
2
|
||||
}
|
||||
@@ -284,7 +332,7 @@ fn default_last_commit() -> String {
|
||||
"c5638d9956002b8a9f09a240028f6793ddf7b2f8".to_string()
|
||||
}
|
||||
fn default_launcher_version() -> String {
|
||||
"v1.7".to_string()
|
||||
"v2.1".to_string()
|
||||
}
|
||||
fn default_render_resolution() -> String {
|
||||
"native".to_string()
|
||||
@@ -301,12 +349,15 @@ impl Default for LauncherConfig {
|
||||
patch_delta_time: true,
|
||||
patch_readbacks: true,
|
||||
async_readbacks: true,
|
||||
launch_while_compiling_shaders: false,
|
||||
show_shader_compile_rage_meter: true,
|
||||
skip_cinematics: true,
|
||||
use_gamemode: true,
|
||||
vram_gc_budget_mb: default_vram_budget(),
|
||||
dmem_mb: default_dmem(),
|
||||
cached_hardware: CachedHardware::default(),
|
||||
last_git_commit: default_last_commit(),
|
||||
disabled_mods: Vec::new(),
|
||||
render_resolution: default_render_resolution(),
|
||||
fsr_enabled: false,
|
||||
disable_motion_blur: false,
|
||||
@@ -315,10 +366,13 @@ impl Default for LauncherConfig {
|
||||
display_mode: DisplayMode::default(),
|
||||
vsync: true,
|
||||
background_controller_input: false,
|
||||
hide_mouse_cursor: true,
|
||||
is_motion_controls_enabled: true,
|
||||
deadzone_left: default_deadzone(),
|
||||
deadzone_right: default_deadzone(),
|
||||
keyboard_bindings: KeyboardBindings::default(),
|
||||
discord_rpc_enabled: true,
|
||||
discord_client_id: default_discord_client_id(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -414,8 +468,9 @@ impl LauncherConfig {
|
||||
let vram = self.cached_hardware.vram_mb;
|
||||
if vram > 0 {
|
||||
// Guard against PCIe memory thrashing / swapping to system RAM over slow bus:
|
||||
// Desktop environment, window compositor and GPU drivers consume ~350-512MB of VRAM.
|
||||
// Texture GC budget must stay within available physical VRAM.
|
||||
// Desktop environment, window compositor (Wayland/X11) and GPU drivers consume ~600-1200MB of VRAM.
|
||||
// Game framebuffers, guest DMA buffers, swapchains and staging memory consume another ~1-1.5GB.
|
||||
// Texture GC budget must leave sufficient headroom while preventing premature texture purging (matches v1.8.2).
|
||||
let safe_ceiling = if vram <= 2048 {
|
||||
1280
|
||||
} else if vram <= 3072 {
|
||||
@@ -426,6 +481,8 @@ impl LauncherConfig {
|
||||
4608
|
||||
} else if vram <= 8192 {
|
||||
6144
|
||||
} else if vram <= 12288 {
|
||||
8192
|
||||
} else {
|
||||
vram.saturating_sub(1024)
|
||||
};
|
||||
@@ -434,6 +491,41 @@ impl LauncherConfig {
|
||||
self.vram_gc_budget_mb
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_mouse_button_bound(&self) -> bool {
|
||||
let is_mouse = |s: &str| {
|
||||
let s_low = s.trim().to_lowercase();
|
||||
matches!(
|
||||
s_low.as_str(),
|
||||
"leftbutton" | "rightbutton" | "middlebutton" | "sidebuttonback" | "sidebuttonforward" | "mouse1" | "mouse2" | "mouse3" | "mouse4" | "mouse5" | "mousewheelup" | "mousewheeldown"
|
||||
)
|
||||
};
|
||||
let b = &self.keyboard_bindings;
|
||||
is_mouse(&b.triangle)
|
||||
|| is_mouse(&b.circle)
|
||||
|| is_mouse(&b.cross)
|
||||
|| is_mouse(&b.square)
|
||||
|| is_mouse(&b.l1)
|
||||
|| is_mouse(&b.r1)
|
||||
|| is_mouse(&b.l2)
|
||||
|| is_mouse(&b.r2)
|
||||
|| is_mouse(&b.l3)
|
||||
|| is_mouse(&b.r3)
|
||||
|| is_mouse(&b.options)
|
||||
|| is_mouse(&b.touchpad_center)
|
||||
|| is_mouse(&b.pad_up)
|
||||
|| is_mouse(&b.pad_down)
|
||||
|| is_mouse(&b.pad_left)
|
||||
|| is_mouse(&b.pad_right)
|
||||
|| is_mouse(&b.axis_left_x_minus)
|
||||
|| is_mouse(&b.axis_left_x_plus)
|
||||
|| is_mouse(&b.axis_left_y_minus)
|
||||
|| is_mouse(&b.axis_left_y_plus)
|
||||
|| is_mouse(&b.axis_right_x_minus)
|
||||
|| is_mouse(&b.axis_right_x_plus)
|
||||
|| is_mouse(&b.axis_right_y_minus)
|
||||
|| is_mouse(&b.axis_right_y_plus)
|
||||
}
|
||||
pub fn config_path(base_dir: &Path) -> PathBuf {
|
||||
base_dir.join("launcher_config.json")
|
||||
}
|
||||
@@ -442,7 +534,31 @@ impl LauncherConfig {
|
||||
let path = Self::config_path(base_dir);
|
||||
if path.exists() {
|
||||
if let Ok(content) = fs::read_to_string(&path) {
|
||||
if let Ok(cfg) = serde_json::from_str::<LauncherConfig>(&content) {
|
||||
if let Ok(mut cfg) = serde_json::from_str::<LauncherConfig>(&content) {
|
||||
let mut changed = false;
|
||||
// Migrate from older versions: ensure v2.0 version string and enable recommended async_readbacks
|
||||
if cfg.launcher_version != "v2.0" {
|
||||
cfg.launcher_version = "v2.0".to_string();
|
||||
cfg.async_readbacks = true;
|
||||
changed = true;
|
||||
}
|
||||
// If the user's config still has old default bindings,
|
||||
// automatically update to the new recommended preset.
|
||||
if (cfg.keyboard_bindings.triangle == "c" && cfg.keyboard_bindings.square == "v")
|
||||
|| (cfg.keyboard_bindings.triangle == "kp8" && cfg.keyboard_bindings.square == "kp4" && cfg.keyboard_bindings.cross == "kp2")
|
||||
|| (cfg.keyboard_bindings.triangle == "u" && cfg.keyboard_bindings.r1 == "i")
|
||||
|| (cfg.keyboard_bindings.triangle == "rightbutton" && cfg.keyboard_bindings.r1 == "r")
|
||||
{
|
||||
cfg.keyboard_bindings = KeyboardBindings::recommended();
|
||||
changed = true;
|
||||
}
|
||||
if cfg.discord_client_id != crate::discord_rpc::DISCORD_GOW3_APP_ID {
|
||||
cfg.discord_client_id = crate::discord_rpc::DISCORD_GOW3_APP_ID.to_string();
|
||||
changed = true;
|
||||
}
|
||||
if changed {
|
||||
let _ = cfg.save(base_dir);
|
||||
}
|
||||
return cfg;
|
||||
}
|
||||
}
|
||||
@@ -452,10 +568,23 @@ impl LauncherConfig {
|
||||
default_cfg
|
||||
}
|
||||
|
||||
pub fn save_mods_config(&self, base_dir: &Path) {
|
||||
let mods_config_path = base_dir.join("mods_config.json");
|
||||
let json = serde_json::json!({
|
||||
"disabled": self.disabled_mods,
|
||||
"order": []
|
||||
});
|
||||
if let Ok(content) = serde_json::to_string_pretty(&json) {
|
||||
let _ = fs::write(&mods_config_path, content);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn save(&self, base_dir: &Path) -> std::io::Result<()> {
|
||||
let path = Self::config_path(base_dir);
|
||||
let content = serde_json::to_string_pretty(self)?;
|
||||
fs::write(path, content)
|
||||
let res = fs::write(path, content);
|
||||
self.save_mods_config(base_dir);
|
||||
res
|
||||
}
|
||||
|
||||
pub fn build_gow3_key_map(&self) -> String {
|
||||
@@ -475,6 +604,19 @@ impl LauncherConfig {
|
||||
s if s.starts_with("kp") && s.len() == 3 && s[2..].chars().all(|c| c.is_ascii_digit()) => {
|
||||
format!("Keypad {}", &s[2..])
|
||||
}
|
||||
"kp_plus" | "kpplus" => "Keypad +".to_string(),
|
||||
"kp_minus" | "kpminus" => "Keypad -".to_string(),
|
||||
"kp_multiply" | "kpasterisk" => "Keypad *".to_string(),
|
||||
"kp_divide" | "kpslash" => "Keypad /".to_string(),
|
||||
"kp_enter" | "kpenter" => "Keypad Enter".to_string(),
|
||||
"kp_period" | "kpperiod" => "Keypad .".to_string(),
|
||||
"leftbutton" | "mouse1" | "leftclick" => "F13".to_string(),
|
||||
"rightbutton" | "mouse2" | "rightclick" => "F14".to_string(),
|
||||
"middlebutton" | "mouse3" | "middleclick" => "F15".to_string(),
|
||||
"sidebuttonback" | "mouse4" | "side1" => "F16".to_string(),
|
||||
"sidebuttonforward" | "mouse5" | "side2" => "F17".to_string(),
|
||||
"mousewheelup" | "wheelup" => "F18".to_string(),
|
||||
"mousewheeldown" | "wheeldown" => "F19".to_string(),
|
||||
"shift" | "lshift" => "Left Shift".to_string(),
|
||||
"rshift" => "Right Shift".to_string(),
|
||||
"ctrl" | "lctrl" => "Left Ctrl".to_string(),
|
||||
@@ -591,8 +733,8 @@ pub fn key_to_sdl_scancode(key: &str) -> Option<u8> {
|
||||
"up" => Some(82),
|
||||
|
||||
// Numpad (SDL_SCANCODE_KP_1 = 89 .. SDL_SCANCODE_KP_0 = 98)
|
||||
"kp_divide" | "kpdivide" | "numdivide" => Some(84),
|
||||
"kp_multiply" | "kpmultiply" | "nummultiply" => Some(85),
|
||||
"kp_divide" | "kpdivide" | "numdivide" | "kpslash" => Some(84),
|
||||
"kp_multiply" | "kpmultiply" | "nummultiply" | "kpasterisk" => Some(85),
|
||||
"kp_minus" | "kpminus" | "numminus" => Some(86),
|
||||
"kp_plus" | "kpplus" | "numplus" => Some(87),
|
||||
"kp_enter" | "kpenter" | "numenter" => Some(88),
|
||||
@@ -616,6 +758,124 @@ pub fn key_to_sdl_scancode(key: &str) -> Option<u8> {
|
||||
"rshift" => Some(229),
|
||||
"ralt" => Some(230),
|
||||
|
||||
// Mouse buttons (F13..F19)
|
||||
"leftbutton" | "mouse1" | "leftclick" => Some(104),
|
||||
"rightbutton" | "mouse2" | "rightclick" => Some(105),
|
||||
"middlebutton" | "mouse3" | "middleclick" => Some(106),
|
||||
"sidebuttonback" | "mouse4" | "side1" => Some(107),
|
||||
"sidebuttonforward" | "mouse5" | "side2" => Some(108),
|
||||
"mousewheelup" | "wheelup" => Some(109),
|
||||
"mousewheeldown" | "wheeldown" => Some(110),
|
||||
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_numpad_scancodes() {
|
||||
assert_eq!(key_to_sdl_scancode("kp0"), Some(98));
|
||||
assert_eq!(key_to_sdl_scancode("kp1"), Some(89));
|
||||
assert_eq!(key_to_sdl_scancode("kp2"), Some(90));
|
||||
assert_eq!(key_to_sdl_scancode("kp3"), Some(91));
|
||||
assert_eq!(key_to_sdl_scancode("kp4"), Some(92));
|
||||
assert_eq!(key_to_sdl_scancode("kp5"), Some(93));
|
||||
assert_eq!(key_to_sdl_scancode("kp6"), Some(94));
|
||||
assert_eq!(key_to_sdl_scancode("kp7"), Some(95));
|
||||
assert_eq!(key_to_sdl_scancode("kp8"), Some(96));
|
||||
assert_eq!(key_to_sdl_scancode("kp9"), Some(97));
|
||||
assert_eq!(key_to_sdl_scancode("kpplus"), Some(87));
|
||||
assert_eq!(key_to_sdl_scancode("kpminus"), Some(86));
|
||||
assert_eq!(key_to_sdl_scancode("kpasterisk"), Some(85));
|
||||
assert_eq!(key_to_sdl_scancode("kpslash"), Some(84));
|
||||
assert_eq!(key_to_sdl_scancode("kpenter"), Some(88));
|
||||
assert_eq!(key_to_sdl_scancode("kpperiod"), Some(99));
|
||||
assert_eq!(key_to_sdl_scancode("leftbutton"), Some(104));
|
||||
assert_eq!(key_to_sdl_scancode("rightbutton"), Some(105));
|
||||
assert_eq!(key_to_sdl_scancode("middlebutton"), Some(106));
|
||||
assert_eq!(key_to_sdl_scancode("sidebuttonback"), Some(107));
|
||||
assert_eq!(key_to_sdl_scancode("sidebuttonforward"), Some(108));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_launcher_version_is_v20() {
|
||||
assert_eq!(default_launcher_version(), "v2.1");
|
||||
let def = LauncherConfig::default();
|
||||
assert!(def.async_readbacks);
|
||||
assert!(def.patch_readbacks);
|
||||
assert!(def.discord_rpc_enabled);
|
||||
assert_eq!(def.discord_client_id, crate::discord_rpc::DISCORD_GOW3_APP_ID);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_keyboard_presets() {
|
||||
let p1 = KeyboardBindings::recommended();
|
||||
assert_eq!(p1.triangle, "u");
|
||||
assert_eq!(p1.square, "t");
|
||||
assert_eq!(p1.circle, "j");
|
||||
assert_eq!(p1.cross, "g");
|
||||
assert_eq!(p1.axis_left_y_minus, "w");
|
||||
assert_eq!(p1.axis_left_x_minus, "a");
|
||||
assert_eq!(p1.axis_left_y_plus, "s");
|
||||
assert_eq!(p1.axis_left_x_plus, "d");
|
||||
assert_eq!(p1.axis_right_y_minus, "kp8");
|
||||
assert_eq!(p1.axis_right_y_plus, "kp2");
|
||||
assert_eq!(p1.axis_right_x_minus, "kp4");
|
||||
assert_eq!(p1.axis_right_x_plus, "kp6");
|
||||
assert_eq!(p1.l1, "q");
|
||||
assert_eq!(p1.r1, "e");
|
||||
assert_eq!(p1.l2, "z");
|
||||
assert_eq!(p1.r2, "x");
|
||||
assert_eq!(p1.l3, "c");
|
||||
assert_eq!(p1.r3, "v");
|
||||
assert_eq!(p1.options, "enter");
|
||||
assert_eq!(p1.touchpad_center, "backspace");
|
||||
assert_eq!(p1.pad_up, "up");
|
||||
assert_eq!(p1.pad_down, "down");
|
||||
assert_eq!(p1.pad_left, "left");
|
||||
assert_eq!(p1.pad_right, "right");
|
||||
|
||||
let p2 = KeyboardBindings::mouse_keyboard();
|
||||
assert_eq!(p2.triangle, "rightbutton");
|
||||
assert_eq!(p2.square, "leftbutton");
|
||||
assert_eq!(p2.circle, "f");
|
||||
assert_eq!(p2.cross, "space");
|
||||
assert_eq!(p2.l1, "q");
|
||||
assert_eq!(p2.r1, "e");
|
||||
assert_eq!(p2.l2, "z");
|
||||
assert_eq!(p2.r2, "x");
|
||||
assert_eq!(p2.l3, "c");
|
||||
assert_eq!(p2.r3, "v");
|
||||
assert_eq!(p2.axis_left_y_minus, "w");
|
||||
assert_eq!(p2.axis_left_x_minus, "a");
|
||||
assert_eq!(p2.axis_left_y_plus, "s");
|
||||
assert_eq!(p2.axis_left_x_plus, "d");
|
||||
assert_eq!(p2.axis_right_y_minus, "kp8");
|
||||
assert_eq!(p2.axis_right_y_plus, "kp2");
|
||||
assert_eq!(p2.axis_right_x_minus, "kp4");
|
||||
assert_eq!(p2.axis_right_x_plus, "kp6");
|
||||
assert_eq!(p2.options, "enter");
|
||||
assert_eq!(p2.touchpad_center, "backspace");
|
||||
assert_eq!(p2.pad_up, "up");
|
||||
assert_eq!(p2.pad_down, "down");
|
||||
assert_eq!(p2.pad_left, "left");
|
||||
assert_eq!(p2.pad_right, "right");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_shader_rage_meter_config() {
|
||||
let default_cfg = LauncherConfig::default();
|
||||
assert!(default_cfg.show_shader_compile_rage_meter);
|
||||
|
||||
let json = r#"{"show_shader_compile_rage_meter": false}"#;
|
||||
let deserialized: LauncherConfig = serde_json::from_str(json).unwrap();
|
||||
assert!(!deserialized.show_shader_compile_rage_meter);
|
||||
|
||||
let empty_json = r#"{}"#;
|
||||
let deserialized_empty: LauncherConfig = serde_json::from_str(empty_json).unwrap();
|
||||
assert!(deserialized_empty.show_shader_compile_rage_meter);
|
||||
}
|
||||
}
|
||||
@@ -111,16 +111,51 @@ pub fn analyze_post_game(base_dir: &Path, exit_code: Option<i32>) -> Option<Cras
|
||||
});
|
||||
}
|
||||
|
||||
// Check for GPU PM4 / Liverpool Packet Overrun or Assertion
|
||||
if tail_str.contains("packet length exceeds remaining submission size")
|
||||
|| tail_str.contains("Unimplemented PM4")
|
||||
|| (tail_str.contains("liverpool.cpp") && tail_str.contains("Unreachable code"))
|
||||
{
|
||||
return Some(CrashDiagnosis {
|
||||
title: "💥 GPU Komut Akışı (PM4 / Liverpool) Aşım Hatası".to_string(),
|
||||
description: "GPU komut işlemcisine (Liverpool) iletilen PM4 paket uzunluğu tahsis edilen teslimat boyutunu aştı. Ara bellek kopyalaması (GOW3_COPY_GPU_BUFFERS) paket sınırlarında uyuşmazlığa yol açtı.".to_string(),
|
||||
recommendation: "Ara GPU bellek kopyalaması güvenli şekilde kapatılmıştır. Oyunu tekrar başlatabilirsiniz.".to_string(),
|
||||
log_snippet: extract_relevant_snippet(&tail_str, "liverpool.cpp"),
|
||||
});
|
||||
}
|
||||
|
||||
// 3. Check for Texture Readback Glitch
|
||||
if tail_str.contains("Readback failed") || tail_str.contains("stale_readback") || tail_str.contains("readbackLinearImages failed") {
|
||||
return Some(CrashDiagnosis {
|
||||
title: "⚠️ Doku (Texture) Okuma Hatası Algılandı".to_string(),
|
||||
description: "GPU'dan sistem belleğine doku transferi sırasında gecikme veya veri bozulması yaşandı (Altın sarısı doku hatası belirtisi).".to_string(),
|
||||
recommendation: "Launcher üzerinde 'Sarı Doku Hatası Önleme (Instant Readbacks)' seçeneğinin AÇIK olduğundan emin olun.".to_string(),
|
||||
recommendation: "Launcher üzerinde 'Doku Bozulması ve Sararma Önleme (Instant Readbacks)' ve 'Asenkron Geri Okuma (Önerilen)' seçeneklerinin AÇIK olduğundan emin olun.".to_string(),
|
||||
log_snippet: extract_relevant_snippet(&tail_str, "readback"),
|
||||
});
|
||||
}
|
||||
|
||||
// NVIDIA Vulkan Driver Dynamic Rendering / VRAM Sınırı Çökmesi (libnvidia-glcore / EndRendering / 0x108)
|
||||
if (tail_str.contains("libnvidia-glcore") || tail_str.contains("EndRendering"))
|
||||
&& (tail_str.contains("0x108") || tail_str.contains("FlushBarriers") || tail_str.contains("DispatchRecord"))
|
||||
{
|
||||
return Some(CrashDiagnosis {
|
||||
title: "💥 NVIDIA Vulkan Sürücü Çökmesi (Dynamic Rendering / VRAM Sınırı)".to_string(),
|
||||
description: "NVIDIA Vulkan sürücüsü (libnvidia-glcore), sahne bariyerleri boşaltılırken (FlushBarriers -> EndRendering) VRAM yetersizliği veya komut senkronizasyonu hatası nedeniyle çöktü (Hata adresi: 0x108). Bu durum özellikle 8 GB ekran kartlarında doku temizleme bütçesi aşırı yüksek seçildiğinde veya çoklu iş parçacığı çakışmasında meydana gelir.".to_string(),
|
||||
recommendation: "1. Launcher üzerinden 'Doku Havuzu (VRAM GC)' ayarını 5120 MB veya 4096 MB olarak seçin (8 GB kartlar için güvenli sınır).\n2. Launcher v2.0 güncellemesiyle anlık geri okuma senkronizasyonu ve otomatik taşma koruması devrededir. Oyunu tekrar başlatabilirsiniz.".to_string(),
|
||||
log_snippet: extract_relevant_snippet(&tail_str, "libnvidia-glcore"),
|
||||
});
|
||||
}
|
||||
|
||||
// General NVIDIA driver crash
|
||||
if tail_str.contains("libnvidia-glcore") {
|
||||
return Some(CrashDiagnosis {
|
||||
title: "💥 NVIDIA Grafik Sürücüsü Hatası (libnvidia-glcore)".to_string(),
|
||||
description: "NVIDIA Vulkan sürücüsü grafik komutlarını işlerken beklenmedik bir hata ile kapandı.".to_string(),
|
||||
recommendation: "Ekran kartı sürücünüzün güncel olduğundan emin olun, VRAM GC bütçesini 4096-5120 MB seviyesine çekin ve arka plandaki diğer GPU uygulamalarını kapatın.".to_string(),
|
||||
log_snippet: extract_relevant_snippet(&tail_str, "libnvidia-glcore"),
|
||||
});
|
||||
}
|
||||
|
||||
// 4. Check for Assertion Failure or SIGSEGV
|
||||
if tail_str.contains("Assertion failed") || tail_str.contains("SIGSEGV") || tail_str.contains("panic") || (exit_code.is_some() && exit_code != Some(0)) {
|
||||
let code_str = exit_code.map(|c| c.to_string()).unwrap_or_else(|| "Bilinmeyen".to_string());
|
||||
@@ -154,3 +189,45 @@ fn extract_relevant_snippet(log: &str, keyword: &str) -> String {
|
||||
snippet.join("\n")
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_diagnose_nvidia_endrendering_crash() {
|
||||
let temp_dir = std::env::temp_dir().join("gow3_crash_test_nvidia");
|
||||
let _ = fs::create_dir_all(&temp_dir);
|
||||
let log_content = r#"
|
||||
Host fault (signal 11) in /usr/lib/libnvidia-glcore.so.615.78.08+0xd60b72 (?), address 0x108
|
||||
#2 /usr/lib/libnvidia-glcore.so.615.78.08+0xd60b72 (?)
|
||||
#3 /usr/lib/libnvidia-glcore.so.615.78.08+0xd56693 (?)
|
||||
#4 .../gow3-linux/bin/lib/libgow3gpu.so+0x31ec70 (_ZN6Vulkan9Scheduler12EndRenderingEv)
|
||||
#5 .../gow3-linux/bin/lib/libgow3gpu.so+0x2fb5d4 (_ZN6Vulkan7Runtime13FlushBarriersEv)
|
||||
#6 .../gow3-linux/bin/lib/libgow3gpu.so+0x2d98e5 (_ZN6Vulkan10Rasterizer14DispatchRecordEPKNS_15ComputePipelineE)
|
||||
#7 .../gow3-linux/bin/lib/libgow3gpu.so+0x2f02a0 (_ZN6Vulkan10Rasterizer13RunDrawPacketEPvPKhj)
|
||||
"#;
|
||||
fs::write(temp_dir.join("gow3_log.txt"), log_content).unwrap();
|
||||
let diag = analyze_post_game(&temp_dir, Some(11)).expect("Should diagnose NVIDIA EndRendering crash");
|
||||
assert!(diag.title.contains("NVIDIA Vulkan Sürücü Çökmesi"));
|
||||
assert!(diag.recommendation.contains("5120 MB"));
|
||||
let _ = fs::remove_dir_all(&temp_dir);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_diagnose_liverpool_pm4_packet_crash() {
|
||||
let temp_dir = std::env::temp_dir().join("gow3_crash_test_pm4");
|
||||
let _ = fs::create_dir_all(&temp_dir);
|
||||
let log_content = r#"
|
||||
GPU [Lib.GnmDriver] <Error> liverpool.cpp:66 NextPacket: : packet length exceeds remaining submission size. Packet dword count=18, remaining submission dwords=8
|
||||
GPU [Debug] <Critical> liverpool.cpp:745 ProcessGraphics: Unreachable code!
|
||||
Unimplemented PM4 type 0, base reg: 0, size: 1
|
||||
STOP: GPU library assertion failed (see GPU log above)
|
||||
"#;
|
||||
fs::write(temp_dir.join("gow3_log.txt"), log_content).unwrap();
|
||||
let diag = analyze_post_game(&temp_dir, Some(1)).expect("Should diagnose PM4 packet overrun crash");
|
||||
assert!(diag.title.contains("GPU Komut Akışı (PM4 / Liverpool)"));
|
||||
assert!(diag.recommendation.contains("kapatılmıştır"));
|
||||
let _ = fs::remove_dir_all(&temp_dir);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
+376
-19
@@ -9,6 +9,7 @@ pub enum Language {
|
||||
Spanish,
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
impl Language {
|
||||
pub fn all() -> &'static [Language] {
|
||||
&[Language::Turkish, Language::English, Language::German, Language::Spanish]
|
||||
@@ -55,6 +56,7 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::Turkish, "tag_hardware") => "D O N A N I M V E S İ S T E M",
|
||||
(Language::Turkish, "tag_game_location") => "O Y U N K O N U M U",
|
||||
(Language::Turkish, "tag_patches") => "P E R F O R M A N S V E Y A M A L A R",
|
||||
(Language::Turkish, "tag_mods") => "O Y U N M O D L A R I",
|
||||
(Language::Turkish, "tag_display") => "E K R A N V E G R A F İ K",
|
||||
(Language::Turkish, "tag_controller") => "K O N T R O L C Ü V E G A M E P A D",
|
||||
(Language::Turkish, "tag_keyboard") => "K L A V Y E A T A M A L A R I",
|
||||
@@ -108,16 +110,63 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::Turkish, "target_fps") => "Hedef FPS:",
|
||||
(Language::Turkish, "readback_patch") => "Doku Bozulması ve Sararma Önleme (Instant Readbacks)",
|
||||
(Language::Turkish, "readback_desc") => "Gecikmeli geri okumaları kapatıp anlık doğrusal bellek okuması sağlayarak karlı ve parlak sahnelerdeki altın sarısı ve doku bozulmalarını tamamen çözer.",
|
||||
(Language::Turkish, "async_readbacks") => "Asenkron Geri Okuma (Anti-Stutter & Drop Önleme)",
|
||||
(Language::Turkish, "async_readbacks_desc") => "CPU'nun GPU çizimlerini beklemeden önceki kareyi okumasını ve yazmaların takılmadan sürmesini sağlar. Ani FPS düşüşlerini ve mikro takılmaları tamamen engeller.",
|
||||
(Language::Turkish, "async_readbacks") => "⚡ Asenkron Geri Okuma (Deneysel - Önerilen)",
|
||||
(Language::Turkish, "async_readbacks_desc") => "CPU ile GPU senkronizasyonunu ayrıştırarak CPU'nun GPU render kuyruğunda beklemesini önler. Donma, kasma ve anlık FPS düşüşlerini ortadan kaldırır. Akıcı ve stabil bir oyun deneyimi için AÇIK tutulması önerilir.",
|
||||
(Language::Turkish, "launch_while_compiling_shaders") => "Shader'lar Derlenirken Oyun Açılsın",
|
||||
(Language::Turkish, "launch_while_compiling_shaders_desc") => "Açık: Oyun hemen açılır ve shader'lar arka planda derlenmeye devam eder. Kapalı: Shader'lar %100 derlenene kadar oyun başlamaz (Spartan Rage yükleme ekranı gösterilir, oyun içi takılmaları önler).",
|
||||
(Language::Turkish, "show_shader_rage_meter") => "Shader Derleme Ekranı Görünümü (Spartan Rage Barı)",
|
||||
(Language::Turkish, "show_shader_rage_meter_desc") => "Açık: Shader derleme sürecini Spartan Rage öfke barı ve boru hattı sayacı ile gösterir (Derleme %100 bitince oyun penceresi açılana kadar siyah ekranda bekler). Kapalı (PS4 Modu): Öfke barı ve sayaç gizlenir, oyun penceresi açılana kadar sadece animasyonlu PS4 açılış görseli (pic1.png) gösterilir.",
|
||||
(Language::Turkish, "shader_cache_title") => "⚡ Resmi Shader Önbelleği (Steam Tarzı Pre-Caching)",
|
||||
(Language::Turkish, "shader_cache_desc") => "Oyunun tüm haritaları, efektleri ve patron dövüşleri taranarak derlenmiş temiz ve güvenli 28.000+ shader önbelleğidir. Yeni bölgelere girerken veya büyüler kullanılırken oluşan tüm donma ve render takılmalarını sıfırlar.",
|
||||
(Language::Turkish, "shader_download_btn") => "☁️ Tam Shader Paketini İndir / Yükle (17 MB)",
|
||||
(Language::Turkish, "shader_download_btn_update") => "🔄 Shader Paketini Yeniden Doğrula / Yükle (17 MB)",
|
||||
(Language::Turkish, "shader_installed_badge") => "✅ Tam Sürüm Shader Paketi Aktif ({} Shader Hazır)",
|
||||
(Language::Turkish, "shader_missing_badge") => "⚠️ Önbellek Eksik veya Kısmi ({} Shader Bulundu - İndirme Önerilir)",
|
||||
(Language::Turkish, "shader_downloading") => "Shader paketi işleniyor (~17 MB)... Lütfen bekleyin...",
|
||||
(Language::Turkish, "shader_extracting") => "Önbellek arşivi açılıyor ve kontrol ediliyor...",
|
||||
(Language::Turkish, "shader_success") => "✅ Shader paketi başarıyla kuruldu! ({} shader önbelleğe alındı)",
|
||||
(Language::Turkish, "skip_cinematics") => "Sinematikleri 'X' Tuşuyla Atlama Yaması",
|
||||
(Language::Turkish, "skip_cinematics_desc") => "Ara sahneleri kumandanızın X tuşuna basarak anında geçmenizi sağlar.",
|
||||
(Language::Turkish, "nav_home") => "ANASAYFA",
|
||||
(Language::Turkish, "nav_mods") => "MODLAR",
|
||||
(Language::Turkish, "mods_title") => "God of War III Mod Yöneticisi",
|
||||
(Language::Turkish, "mods_desc") => "Yüklenen karakter, kostüm ve doku modlarını buradan kolayca yönetebilirsiniz. Orijinal oyun dosyalarınıza dokunulmadan dinamik olarak oyuna aktarılır.",
|
||||
(Language::Turkish, "mods_open_folder") => "Modlar Klasörünü Aç",
|
||||
(Language::Turkish, "mods_refresh") => "Modları Yenile",
|
||||
(Language::Turkish, "mods_count_summary") => "Yüklü Mod: {} | Aktif: {} | Devre Dışı: {}",
|
||||
(Language::Turkish, "mods_empty_title") => "Henüz Yüklü Mod Bulunamadı",
|
||||
(Language::Turkish, "mods_empty_desc") => "'Modlar Klasörünü Aç' butonuna basarak indirdiğiniz mod klasörünü buraya bırakın ve ardından 'Modları Yenile'ye tıklayın.",
|
||||
(Language::Turkish, "mods_status_active") => "● Oyunda Devrede",
|
||||
(Language::Turkish, "mods_status_disabled") => "○ Devre Dışı",
|
||||
(Language::Turkish, "mods_author") => "Yazar",
|
||||
(Language::Turkish, "mods_files_replaced") => "Değiştirilen Dosya",
|
||||
(Language::Turkish, "nav_settings") => "AYARLAR",
|
||||
(Language::Turkish, "nav_graphics") => "GRAFİKLER",
|
||||
(Language::Turkish, "nav_game_location") => "OYUN KONUMU",
|
||||
(Language::Turkish, "nav_controls") => "KONTROLLER",
|
||||
(Language::Turkish, "nav_shaders") => "SHADER AYARI",
|
||||
(Language::Turkish, "launcher_version_label") => "LAUNCHER SÜRÜMÜ",
|
||||
(Language::Turkish, "lang_options_title") => "DİL SEÇENEKLERİ",
|
||||
(Language::Turkish, "system_specs_title") => "SİSTEM ÖZELLİKLERİ",
|
||||
(Language::Turkish, "play_btn_label") => "OYNA",
|
||||
(Language::Turkish, "menu_play") => "OYNA",
|
||||
(Language::Turkish, "menu_latest_news") => "GÜNCELLEME NOTLARI",
|
||||
(Language::Turkish, "menu_options") => "AYARLAR",
|
||||
(Language::Turkish, "menu_back") => "GERİ DÖN",
|
||||
(Language::Turkish, "release_notes_title") => "God of War III Launcher - Sürüm Notları (v2.1)",
|
||||
(Language::Turkish, "release_notes_content") => "🔥 GOD OF WAR III LAUNCHER v2.1 YENİLİKLERİ:\n\n• 🎮 Gelişmiş Discord Rich Presence (Bölüm & Boss Fight Tespiti):\n - Resmi 'God of War III: Remastered' Discord App ID (1440140183675867156) ve yüksek çözünürlüklü kapak görseli entegre edildi.\n - Canlı Bölüm ve Chapter Takibi: 'Olympus Dağı', 'Yeraltı Dünyası', 'Labirent', 'Tartarus', 'Olimpiya Şehri', 'Alev Odası' vb.\n - Boss Karşılaşmaları: 'Olympus Dağı (Poseidon Boss Fight)', 'Yeraltı Dünyası (Hades Boss Fight)', 'Tartarus (Kronos Boss Fight)', 'Forum (Herkül Boss Fight)', 'Olimpos Zirvesi (Zeus Boss Fight)' ve diğerleri anlık olarak Discord profilinizde görünür.\n - Özel Modlar: 'Olimpos Mücadeleleri (Challenge of Olympus)' ve 'Savaş Arenası (Combat Arena)' durumu canlı paylaşılır.\n\n• ⚡ Sıfır Performans Kaybı & Geniş İstemci Desteği:\n - Windows Named Pipes, Linux yerel soketleri, Vesktop, Discord Flatpak ve Snap istemcilerini otomatik algılar.\n\n• 🛠️ Genel İyileştirmeler & Kararlılık Güncellemeleri.",
|
||||
(Language::Turkish, "discord_rpc_toggle") => "Discord Rich Presence (Oynuyor Durumu)",
|
||||
(Language::Turkish, "discord_rpc_desc") => "Discord profilinizde 'God of War III: Remastered', bulunduğunuz bölüm, boss savaşları ve oynama sürenizi canlı gösterir.",
|
||||
(Language::Turkish, "discord_client_id_label") => "Discord Uygulama Kimliği (Client ID):",
|
||||
(Language::Turkish, "discord_reset_btn") => "Varsayılana Sıfırla",
|
||||
(Language::Turkish, "gamemode_toggle") => "Feral GameMode (gamemoderun)",
|
||||
(Language::Turkish, "gamemode_desc") => "CPU zamanlayıcısını ve GPU performansını oyun için en yüksek seviyeye ayarlar.",
|
||||
(Language::Turkish, "save_apply") => "Ayarları Kaydet ve Uygula",
|
||||
(Language::Turkish, "view_log") => "Log Dosyasını Görüntüle",
|
||||
(Language::Turkish, "play_ready") => "OYUNU BAŞLAT",
|
||||
(Language::Turkish, "play_running") => "OYUN ÇALIŞIYOR...",
|
||||
(Language::Turkish, "loading_shaders") => "LOADING SHADERS...",
|
||||
(Language::Turkish, "loading_shaders_sub") => "Vulkan boru hatları derleniyor...",
|
||||
(Language::Turkish, "force_quit_btn") => "Zorla Kapat",
|
||||
(Language::Turkish, "force_quit_tooltip") => "Oyun kilitlendiğinde veya kapanmadığında süreci anında zorla sonlandırır.",
|
||||
(Language::Turkish, "force_quit_status") => "Oyun süreci zorla sonlandırıldı.",
|
||||
@@ -154,6 +203,11 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::Turkish, "latest_commit") => "Son Commit:",
|
||||
(Language::Turkish, "commit_date") => "Tarih:",
|
||||
(Language::Turkish, "view_on_github") => "GitHub'da Görüntüle",
|
||||
(Language::Turkish, "remind_later") => "⏰ Sonra Hatırlat",
|
||||
(Language::Turkish, "update_available_badge") => "🚀 Güncelleme Mevcut!",
|
||||
(Language::Turkish, "btn_update") => "Güncelle",
|
||||
(Language::Turkish, "btn_update_now") => "🚀 Şimdi Güncelle",
|
||||
(Language::Turkish, "updating_in_progress") => "⏳ Güncelleme indiriliyor ve kuruluyor... Lütfen bekleyin...",
|
||||
(Language::Turkish, "python_dep") => "Python 3 Bağımlılığı:",
|
||||
(Language::Turkish, "python_ready") => "Yüklü / Hazır",
|
||||
(Language::Turkish, "python_missing") => "Bulunamadı",
|
||||
@@ -179,6 +233,8 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::Turkish, "controller_header") => "Kumanda / Gamepad Ayarları",
|
||||
(Language::Turkish, "bg_input") => "Arka Planda Kumanda Girişi (Background Input)",
|
||||
(Language::Turkish, "bg_input_desc") => "Oyun penceresi odakta değilken bile kumanda girdilerini algılamaya devam eder.",
|
||||
(Language::Turkish, "hide_mouse_cursor") => "Fare İşaretçisini Oyunda Gizle",
|
||||
(Language::Turkish, "hide_mouse_cursor_desc") => "Oyun odaktayken fare imlecini gizler; oyundan çıkıldığında veya başka pencereye geçildiğinde görünür yapar.",
|
||||
(Language::Turkish, "motion_controls") => "Hareket / Jiroskop Sensörleri (Gyro / Motion)",
|
||||
(Language::Turkish, "motion_controls_desc") => "DualShock 4 / DualSense dahili hareket algılama sensörlerini etkinleştirir.",
|
||||
(Language::Turkish, "deadzone_left") => "Sol Analog Ölü Bölge (Left Stick Deadzone):",
|
||||
@@ -186,9 +242,11 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::Turkish, "deadzone_desc") => "Düşük değer daha hassas kontrol sağlar; analog çubuğunuzda kendi kendine kayma (drift) varsa değeri artırın.",
|
||||
(Language::Turkish, "keyboard_header") => "Klavye Tuş Atamaları (Keyboard Bindings)",
|
||||
(Language::Turkish, "keyboard_desc") => "Değiştirmek istediğiniz tuşa tıklayın ve yeni tuşa basın. İptal etmek için ESC tuşuna basın.",
|
||||
(Language::Turkish, "preset_label") => "Hızlı Tuş Düzeni (Preset):",
|
||||
(Language::Turkish, "preset_standard") => "Standart WASD + CVBN (Önerilen)",
|
||||
(Language::Turkish, "preset_numpad") => "WASD + Numpad (8462)",
|
||||
(Language::Turkish, "preset_label") => "Hazır Tuş Profilleri:",
|
||||
(Language::Turkish, "preset_recommended") => "🎯 Önerilen Preset",
|
||||
(Language::Turkish, "preset_mouse_kb") => "🖱️ İkinci Preset (Fare + Klavye)",
|
||||
(Language::Turkish, "preset_standard") => "🎯 Önerilen Preset",
|
||||
(Language::Turkish, "preset_numpad") => "🖱️ İkinci Preset (Fare + Klavye)",
|
||||
(Language::Turkish, "reset_defaults") => "Varsayılanlara Sıfırla",
|
||||
(Language::Turkish, "press_any_key") => "[ Bir tuşa basın... / ESC ]",
|
||||
(Language::Turkish, "sec_face_buttons") => "Eylem Tuşları (Saldırı & Zıplama)",
|
||||
@@ -219,6 +277,39 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::Turkish, "act_cam_down") => "Sağ Analog: Aşağı",
|
||||
(Language::Turkish, "act_cam_left") => "Sağ Analog: Sol",
|
||||
(Language::Turkish, "act_cam_right") => "Sağ Analog: Sağ",
|
||||
(Language::Turkish, "key_bind_modal_title") => "🎮 Tuş / Fare Butonu Atama",
|
||||
(Language::Turkish, "key_bind_modal_desc") => "Klavyeden bir tuşa basın, fareye tıklayın veya aşağıdaki seçeneklerden birini seçin:",
|
||||
(Language::Turkish, "sec_mouse_bindings") => "🖱 Fare Butonları (Mouse)",
|
||||
(Language::Turkish, "sec_numpad_bindings") => "🔢 Numpad Tuşları (Sayı Takımı)",
|
||||
(Language::Turkish, "sec_digits_bindings") => "🔢 Standart Sayı Satırı (1 - 0)",
|
||||
(Language::Turkish, "mouse_left_btn") => "🖱 Sol Tık (Mouse 1)",
|
||||
(Language::Turkish, "mouse_right_btn") => "🖱 Sağ Tık (Mouse 2)",
|
||||
(Language::Turkish, "mouse_middle_btn") => "🖱 Orta Tık (Mouse 3)",
|
||||
(Language::Turkish, "mouse_side1_btn") => "🖱 Yan Tuş 1 (Geri / M4)",
|
||||
(Language::Turkish, "mouse_side2_btn") => "🖱 Yan Tuş 2 (İleri / M5)",
|
||||
(Language::Turkish, "mouse_wheel_up") => "🖱 Tekerlek Yukarı",
|
||||
(Language::Turkish, "mouse_wheel_down") => "🖱 Tekerlek Aşağı",
|
||||
(Language::Turkish, "cancel_btn") => "İptal (ESC)",
|
||||
(Language::Turkish, "launcher_log_btn") => "📋 Launcher Logu",
|
||||
(Language::Turkish, "game_log_btn") => "🎮 Oyun Logu",
|
||||
(Language::Turkish, "err_modal_title") => "⚠️ Bir Sorun Oluştu",
|
||||
(Language::Turkish, "copy_error") => "📋 Hatayı Kopyala",
|
||||
(Language::Turkish, "copied_notice") => "✅ Kopyalandı!",
|
||||
(Language::Turkish, "open_log_file") => "📄 Log Dosyasını Aç",
|
||||
(Language::Turkish, "open_in_editor") => "📝 Dış Düzenleyicide Aç",
|
||||
(Language::Turkish, "refresh_log") => "🔄 Yenile",
|
||||
(Language::Turkish, "err_engine_dl_title") => "❌ Oyun Motoru İndirilemedi",
|
||||
(Language::Turkish, "err_engine_dl_summary") => "God of War III oyun motoru paketi indirilemedi veya arşivden çıkarılamadı.",
|
||||
(Language::Turkish, "err_engine_dl_hint") => "Lütfen internet bağlantınızı kontrol edin. GitHub indirmesi başarısız olmuş veya disk alanı yetersiz olabilir.",
|
||||
(Language::Turkish, "engine_download_alt") => "Alternatif İndir",
|
||||
(Language::Turkish, "engine_download_alt_tooltip") => "Normal indirmede sorun yaşıyorsanız alternatif sunucuyu ve farklı indirme yöntemini kullanır.",
|
||||
(Language::Turkish, "retry_with_alt") => "⚡ Alternatif Motor İndirmeyi Dene",
|
||||
(Language::Turkish, "err_python_dl_title") => "❌ Python Ortamı İndirilemedi",
|
||||
(Language::Turkish, "err_python_dl_summary") => "Oyun hazırlık betikleri için gerekli taşınabilir Python 3 çalışma ortamı indirilemedi.",
|
||||
(Language::Turkish, "err_python_dl_hint") => "Sisteminizde yerel Python 3 kurulu olduğundan emin olun veya bağlantınızı kontrol edip tekrar deneyin.",
|
||||
(Language::Turkish, "err_game_launch_title") => "❌ Oyun Başlatma Hatası",
|
||||
(Language::Turkish, "err_game_launch_summary") => "God of War III başlatılırken bir hazırlık veya yürütme hatası oluştu.",
|
||||
(Language::Turkish, "err_game_launch_hint") => "Oyun klasörünüzde eboot.bin ve dosyaların tam olduğunu doğrulayın. Aşağıdaki detaylardan veya Log dosyasından hatayı inceleyebilirsiniz.",
|
||||
|
||||
// English
|
||||
(Language::English, "hero_badge") => "🔥 Open Source PC Launcher",
|
||||
@@ -231,6 +322,7 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::English, "tag_hardware") => "H A R D W A R E & S Y S T E M",
|
||||
(Language::English, "tag_game_location") => "G A M E L O C A T I O N",
|
||||
(Language::English, "tag_patches") => "P E R F O R M A N C E & P A T C H E S",
|
||||
(Language::English, "tag_mods") => "G A M E M O D S",
|
||||
(Language::English, "tag_display") => "D I S P L A Y & G R A P H I C S",
|
||||
(Language::English, "tag_controller") => "C O N T R O L L E R & G A M E P A D",
|
||||
(Language::English, "tag_keyboard") => "K E Y B O A R D B I N D I N G S",
|
||||
@@ -284,16 +376,63 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::English, "target_fps") => "Target FPS:",
|
||||
(Language::English, "readback_patch") => "Texture Corruption & Yellow Tint Fix (Instant Readbacks)",
|
||||
(Language::English, "readback_desc") => "Forces immediate linear readbacks and disables stale buffers, completely eliminating yellow tint and corrupted textures in bright or snow scenes.",
|
||||
(Language::English, "async_readbacks") => "Asynchronous Readbacks (Anti-Stutter & Drop Prevention)",
|
||||
(Language::English, "async_readbacks_desc") => "Allows CPU writes and texture reads to proceed asynchronously without stalling on GPU fences. Eliminates periodic FPS drops and stuttering.",
|
||||
(Language::English, "async_readbacks") => "⚡ Asynchronous Readbacks (Experimental - Recommended)",
|
||||
(Language::English, "async_readbacks_desc") => "Decouples CPU from GPU render fences, preventing the CPU from stalling on GPU draw calls. Eliminates FPS drops, micro-stutters, and pacing hitches. Recommended ON.",
|
||||
(Language::English, "launch_while_compiling_shaders") => "Launch Game While Compiling Shaders",
|
||||
(Language::English, "launch_while_compiling_shaders_desc") => "On: Game opens immediately while shaders compile in the background. Off: Game does not launch until shaders are 100% compiled (shows Spartan Rage bar, eliminates in-game stutter).",
|
||||
(Language::English, "show_shader_rage_meter") => "Shader Compilation Display (Spartan Rage Bar)",
|
||||
(Language::English, "show_shader_rage_meter_desc") => "On: Displays shader compilation progress with the Spartan Rage meter and pipeline counter (Holds black screen after 100% until game window is ready). Off (PS4 Mode): Hides the rage bar and counter, displaying only the animated PS4 splash artwork (pic1.png) until the game window is ready.",
|
||||
(Language::English, "shader_cache_title") => "⚡ Official Shader Cache (Steam-style Pre-Caching)",
|
||||
(Language::English, "shader_cache_desc") => "Official clean and safe pre-compiled shader cache covering all maps, cutscenes, effects, and boss fights. Completely eliminates in-game stuttering and render pauses.",
|
||||
(Language::English, "shader_download_btn") => "☁️ Download & Install Full Shader Cache (17 MB)",
|
||||
(Language::English, "shader_download_btn_update") => "🔄 Re-verify & Install Shader Cache (17 MB)",
|
||||
(Language::English, "shader_installed_badge") => "✅ Full Shader Cache Active ({} Shaders Ready)",
|
||||
(Language::English, "shader_missing_badge") => "⚠️ Cache Incomplete ({} Shaders Found - Download Recommended)",
|
||||
(Language::English, "shader_downloading") => "Processing shader cache (~17 MB)... Please wait...",
|
||||
(Language::English, "shader_extracting") => "Extracting and verifying shader cache...",
|
||||
(Language::English, "shader_success") => "✅ Shader cache installed successfully! ({} shaders cached)",
|
||||
(Language::English, "skip_cinematics") => "Skip Cutscenes with 'X' Button",
|
||||
(Language::English, "skip_cinematics_desc") => "Allows skipping any cutscene immediately by pressing the X button.",
|
||||
(Language::English, "nav_home") => "HOME",
|
||||
(Language::English, "nav_mods") => "MODS",
|
||||
(Language::English, "mods_title") => "God of War III Mod Manager",
|
||||
(Language::English, "mods_desc") => "Easily manage character, costume, and texture mods. Safely loaded into the game via non-destructive virtual overlay.",
|
||||
(Language::English, "mods_open_folder") => "Open Mods Folder",
|
||||
(Language::English, "mods_refresh") => "Refresh Mods",
|
||||
(Language::English, "mods_count_summary") => "Installed: {} | Active: {} | Disabled: {}",
|
||||
(Language::English, "mods_empty_title") => "No Mods Installed Yet",
|
||||
(Language::English, "mods_empty_desc") => "Click 'Open Mods Folder', drop your mod directory inside, and click 'Refresh Mods'.",
|
||||
(Language::English, "mods_status_active") => "● Active In-Game",
|
||||
(Language::English, "mods_status_disabled") => "○ Disabled",
|
||||
(Language::English, "mods_author") => "Author",
|
||||
(Language::English, "mods_files_replaced") => "Replaced Files",
|
||||
(Language::English, "nav_settings") => "SETTINGS",
|
||||
(Language::English, "nav_graphics") => "GRAPHICS",
|
||||
(Language::English, "nav_game_location") => "GAME LOCATION",
|
||||
(Language::English, "nav_controls") => "CONTROLS",
|
||||
(Language::English, "nav_shaders") => "SHADER SETTINGS",
|
||||
(Language::English, "launcher_version_label") => "LAUNCHER VERSION",
|
||||
(Language::English, "lang_options_title") => "LANGUAGE OPTIONS",
|
||||
(Language::English, "system_specs_title") => "SYSTEM SPECIFICATIONS",
|
||||
(Language::English, "play_btn_label") => "PLAY",
|
||||
(Language::English, "menu_play") => "PLAY",
|
||||
(Language::English, "menu_latest_news") => "LATEST NEWS",
|
||||
(Language::English, "menu_options") => "OPTIONS",
|
||||
(Language::English, "menu_back") => "BACK",
|
||||
(Language::English, "release_notes_title") => "God of War III Launcher - Release Notes (v2.1)",
|
||||
(Language::English, "release_notes_content") => "🔥 GOD OF WAR III LAUNCHER v2.1 CHANGELOG:\n\n• 🎮 Advanced Discord Rich Presence (Chapters & Boss Fights):\n - Official 'God of War III: Remastered' Discord App ID (1440140183675867156) and official artwork.\n - Real-time Chapter Tracking: 'Mount Olympus', 'Realm of Hades', 'The Labyrinth', 'Tartarus', 'City of Olympia', etc.\n - Boss Fight Detection: 'Olympus Dağı (Poseidon Boss Fight)', 'Yeraltı Dünyası (Hades Boss Fight)', 'Tartarus (Kronos Boss Fight)', 'Forum (Hercules Boss Fight)', 'Mount Olympus Summit (Zeus Boss Fight)', etc.\n - Special Modes: 'Challenge of Olympus' and 'Combat Arena' detected automatically.\n\n• ⚡ Broad Client Support:\n - Works with native Discord, Vesktop, Flatpak, Snap, and Windows Named Pipes.",
|
||||
(Language::English, "discord_rpc_toggle") => "Discord Rich Presence (Activity Status)",
|
||||
(Language::English, "discord_rpc_desc") => "Displays 'God of War III: Remastered', your active chapter, boss fights, and elapsed play time on Discord.",
|
||||
(Language::English, "discord_client_id_label") => "Discord Application ID (Client ID):",
|
||||
(Language::English, "discord_reset_btn") => "Reset Default",
|
||||
(Language::English, "gamemode_toggle") => "Feral GameMode (gamemoderun)",
|
||||
(Language::English, "gamemode_desc") => "Configures CPU governor and GPU clocks for optimal gaming performance.",
|
||||
(Language::English, "save_apply") => "Save & Apply Settings",
|
||||
(Language::English, "view_log") => "View Log File",
|
||||
(Language::English, "play_ready") => "LAUNCH GAME",
|
||||
(Language::English, "play_running") => "GAME IS RUNNING...",
|
||||
(Language::English, "loading_shaders") => "LOADING SHADERS...",
|
||||
(Language::English, "loading_shaders_sub") => "Compiling Vulkan pipelines...",
|
||||
(Language::English, "force_quit_btn") => "Force Quit",
|
||||
(Language::English, "force_quit_tooltip") => "Immediately kills the game process if it hangs or freezes.",
|
||||
(Language::English, "force_quit_status") => "Game process was forcefully terminated.",
|
||||
@@ -330,6 +469,11 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::English, "latest_commit") => "Latest Commit:",
|
||||
(Language::English, "commit_date") => "Date:",
|
||||
(Language::English, "view_on_github") => "View on GitHub",
|
||||
(Language::English, "remind_later") => "⏰ Remind Me Later",
|
||||
(Language::English, "update_available_badge") => "🚀 Update Available!",
|
||||
(Language::English, "btn_update") => "Update",
|
||||
(Language::English, "btn_update_now") => "🚀 Update Now",
|
||||
(Language::English, "updating_in_progress") => "⏳ Downloading and installing update... Please wait...",
|
||||
(Language::English, "python_dep") => "Python 3 Dependency:",
|
||||
(Language::English, "python_ready") => "Installed / Ready",
|
||||
(Language::English, "python_missing") => "Missing",
|
||||
@@ -355,6 +499,8 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::English, "controller_header") => "Gamepad & Controller Settings",
|
||||
(Language::English, "bg_input") => "Background Controller Input",
|
||||
(Language::English, "bg_input_desc") => "Allows gamepad inputs even when the game window is not actively focused.",
|
||||
(Language::English, "hide_mouse_cursor") => "Hide Mouse Cursor in Game",
|
||||
(Language::English, "hide_mouse_cursor_desc") => "Hides mouse cursor when game is focused; automatically restores cursor when focus is lost.",
|
||||
(Language::English, "motion_controls") => "Motion & Gyroscope Controls",
|
||||
(Language::English, "motion_controls_desc") => "Enables DualShock 4 / DualSense internal accelerometer and gyroscope features.",
|
||||
(Language::English, "deadzone_left") => "Left Stick Deadzone:",
|
||||
@@ -362,9 +508,11 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::English, "deadzone_desc") => "Lower values provide more responsiveness; increase if your stick suffers from drift.",
|
||||
(Language::English, "keyboard_header") => "Keyboard Bindings",
|
||||
(Language::English, "keyboard_desc") => "Click any button to assign a new key. Press ESC to cancel.",
|
||||
(Language::English, "preset_label") => "Quick Preset:",
|
||||
(Language::English, "preset_standard") => "Standard WASD + CVBN (Recommended)",
|
||||
(Language::English, "preset_numpad") => "WASD + Numpad (8462)",
|
||||
(Language::English, "preset_label") => "Quick Presets:",
|
||||
(Language::English, "preset_recommended") => "🎯 Recommended Preset",
|
||||
(Language::English, "preset_mouse_kb") => "🖱️ Second Preset (Mouse + Keyboard)",
|
||||
(Language::English, "preset_standard") => "🎯 Recommended Preset",
|
||||
(Language::English, "preset_numpad") => "🖱️ Second Preset (Mouse + Keyboard)",
|
||||
(Language::English, "reset_defaults") => "Reset to Defaults",
|
||||
(Language::English, "press_any_key") => "[ Press key... / ESC ]",
|
||||
(Language::English, "sec_face_buttons") => "Action Buttons (Attacks & Jump)",
|
||||
@@ -395,6 +543,39 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::English, "act_cam_down") => "Right Stick: Down",
|
||||
(Language::English, "act_cam_left") => "Right Stick: Left",
|
||||
(Language::English, "act_cam_right") => "Right Stick: Right",
|
||||
(Language::English, "key_bind_modal_title") => "🎮 Assign Key / Mouse Button",
|
||||
(Language::English, "key_bind_modal_desc") => "Press a key, click mouse, or select from the quick options below:",
|
||||
(Language::English, "sec_mouse_bindings") => "🖱 Mouse Buttons",
|
||||
(Language::English, "sec_numpad_bindings") => "🔢 Numpad Keys",
|
||||
(Language::English, "sec_digits_bindings") => "🔢 Standard Number Row (1 - 0)",
|
||||
(Language::English, "mouse_left_btn") => "🖱 Left Click (Mouse 1)",
|
||||
(Language::English, "mouse_right_btn") => "🖱 Right Click (Mouse 2)",
|
||||
(Language::English, "mouse_middle_btn") => "🖱 Middle Click (Mouse 3)",
|
||||
(Language::English, "mouse_side1_btn") => "🖱 Side Button 1 (Back / M4)",
|
||||
(Language::English, "mouse_side2_btn") => "🖱 Side Button 2 (Forward / M5)",
|
||||
(Language::English, "mouse_wheel_up") => "🖱 Wheel Up",
|
||||
(Language::English, "mouse_wheel_down") => "🖱 Wheel Down",
|
||||
(Language::English, "cancel_btn") => "Cancel (ESC)",
|
||||
(Language::English, "launcher_log_btn") => "📋 Launcher Log",
|
||||
(Language::English, "game_log_btn") => "🎮 Game Log",
|
||||
(Language::English, "err_modal_title") => "⚠️ An Error Occurred",
|
||||
(Language::English, "copy_error") => "📋 Copy Error",
|
||||
(Language::English, "copied_notice") => "✅ Copied!",
|
||||
(Language::English, "open_log_file") => "📄 Open Log File",
|
||||
(Language::English, "open_in_editor") => "📝 Open in External Editor",
|
||||
(Language::English, "refresh_log") => "🔄 Refresh",
|
||||
(Language::English, "err_engine_dl_title") => "❌ Game Engine Download Failed",
|
||||
(Language::English, "err_engine_dl_summary") => "Failed to download or extract the God of War III game engine package.",
|
||||
(Language::English, "err_engine_dl_hint") => "Please check your internet connection. GitHub download might have failed or disk space could be low.",
|
||||
(Language::English, "engine_download_alt") => "Alternative Download",
|
||||
(Language::English, "engine_download_alt_tooltip") => "Uses an alternative mirror and download method if the standard download fails.",
|
||||
(Language::English, "retry_with_alt") => "⚡ Try Alternative Engine Download",
|
||||
(Language::English, "err_python_dl_title") => "❌ Python Runtime Download Failed",
|
||||
(Language::English, "err_python_dl_summary") => "Failed to download the portable Python 3 runtime required for game preparation scripts.",
|
||||
(Language::English, "err_python_dl_hint") => "Ensure Python 3 is installed on your system or check your connection and retry.",
|
||||
(Language::English, "err_game_launch_title") => "❌ Game Launch Error",
|
||||
(Language::English, "err_game_launch_summary") => "An error occurred during God of War III preparation or execution.",
|
||||
(Language::English, "err_game_launch_hint") => "Verify that eboot.bin and game files are intact. Check the details below or the Log file.",
|
||||
|
||||
// German
|
||||
(Language::German, "hero_badge") => "🔥 Open-Source-PC-Launcher",
|
||||
@@ -407,6 +588,7 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::German, "tag_hardware") => "H A R D W A R E & S Y S T E M",
|
||||
(Language::German, "tag_game_location") => "S P I E L P F A D",
|
||||
(Language::German, "tag_patches") => "L E I S T U N G & P A T C H E S",
|
||||
(Language::German, "tag_mods") => "S P I E L - M O D S",
|
||||
(Language::German, "tag_display") => "A N Z E I G E & G R A F I K",
|
||||
(Language::German, "tag_controller") => "C O N T R O L L E R & G A M E P A D",
|
||||
(Language::German, "tag_keyboard") => "T A S T A T U R B E L E G U N G",
|
||||
@@ -460,10 +642,55 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::German, "target_fps") => "Ziel-FPS:",
|
||||
(Language::German, "readback_patch") => "Texturfehler- & Gelbstich-Behebung (Instant Readbacks)",
|
||||
(Language::German, "readback_desc") => "Erzwingt sofortige lineare Readbacks und verhindert goldgelbe Texturen und Artefakte in Schneeszenen.",
|
||||
(Language::German, "async_readbacks") => "Asynchrone Readbacks (Anti-Ruckler & Drop-Schutz)",
|
||||
(Language::German, "async_readbacks_desc") => "Entkoppelt CPU- und GPU-Wartezeiten für Texturoperationen. Verhindert plötzliche FPS-Drops und Ruckler.",
|
||||
(Language::German, "async_readbacks") => "⚡ Asynchrone Readbacks (Experimentell - Empfohlen)",
|
||||
(Language::German, "async_readbacks_desc") => "Entkoppelt CPU- und GPU-Wartezeiten für Texturen. Verhindert FPS-Einbrüche und Mikroruckler für eine flüssige Darstellung. Empfohlen: EIN.",
|
||||
(Language::German, "launch_while_compiling_shaders") => "Spiel während Shader-Kompilierung starten",
|
||||
(Language::German, "launch_while_compiling_shaders_desc") => "Ein: Das Spiel startet sofort, Shader werden im Hintergrund kompiliert. Aus: Spiel startet erst nach 100%iger Shader-Kompilierung mit Spartan-Rage-Ladebildschirm.",
|
||||
(Language::German, "show_shader_rage_meter") => "Shader-Kompilierungsanzeige (Spartan Rage Leiste)",
|
||||
(Language::German, "show_shader_rage_meter_desc") => "Ein: Zeigt die Shader-Kompilierung mit der Spartan-Rage-Leiste und Pipeline-Zähler an (hält nach 100% einen schwarzen Bildschirm, bis das Spielfenster bereit ist). Aus (PS4-Modus): Blendet die Leiste aus und zeigt stattdessen das animierte PS4-Artwork (pic1.png).",
|
||||
(Language::German, "shader_cache_title") => "⚡ Offizieller Shader-Cache (Steam-Style Pre-Caching)",
|
||||
(Language::German, "shader_cache_desc") => "Offizieller, sauberer Shader-Cache mit über 28.000 kompilierten Shadern für alle Bereiche und Bosse. Beseitigt Mikroruckler und Render-Pausen komplett.",
|
||||
(Language::German, "shader_download_btn") => "☁️ Vollständigen Shader-Cache herunterladen (17 MB)",
|
||||
(Language::German, "shader_download_btn_update") => "🔄 Shader-Cache erneut verifizieren & laden (17 MB)",
|
||||
(Language::German, "shader_installed_badge") => "✅ Vollständiger Shader-Cache Aktiv ({} Shader Bereit)",
|
||||
(Language::German, "shader_missing_badge") => "⚠️ Cache Unvollständig ({} Shader Gefunden - Download Empfohlen)",
|
||||
(Language::German, "shader_downloading") => "Shader-Cache wird verarbeitet (~17 MB)...",
|
||||
(Language::German, "shader_extracting") => "Shader-Cache wird entpackt und verifiziert...",
|
||||
(Language::German, "shader_success") => "✅ Shader-Cache erfolgreich installiert! ({} Shader im Cache)",
|
||||
(Language::German, "skip_cinematics") => "Zwischensequenzen mit 'X'-Taste überspringen",
|
||||
(Language::German, "skip_cinematics_desc") => "Ermöglicht das sofortige Überspringen von Zwischensequenzen mit der X-Taste.",
|
||||
(Language::German, "nav_home") => "STARTSEITE",
|
||||
(Language::German, "nav_mods") => "MODS",
|
||||
(Language::German, "mods_title") => "God of War III Mod-Manager",
|
||||
(Language::German, "mods_desc") => "Verwalten Sie Charakter-, Kostüm- und Textur-Mods. Sicheres Laden über ein virtuelles Dateisystem.",
|
||||
(Language::German, "mods_open_folder") => "Mods-Ordner öffnen",
|
||||
(Language::German, "mods_refresh") => "Mods aktualisieren",
|
||||
(Language::German, "mods_count_summary") => "Installiert: {} | Aktiv: {} | Deaktiviert: {}",
|
||||
(Language::German, "mods_empty_title") => "Noch keine Mods installiert",
|
||||
(Language::German, "mods_empty_desc") => "Klicken Sie auf 'Mods-Ordner öffnen', fügen Sie Ihren Mod-Ordner ein und klicken Sie auf 'Mods aktualisieren'.",
|
||||
(Language::German, "mods_status_active") => "● Im Spiel aktiv",
|
||||
(Language::German, "mods_status_disabled") => "○ Deaktiviert",
|
||||
(Language::German, "mods_author") => "Autor",
|
||||
(Language::German, "mods_files_replaced") => "Ersetzte Dateien",
|
||||
(Language::German, "nav_settings") => "EINSTELLUNGEN",
|
||||
(Language::German, "nav_graphics") => "GRAFIK",
|
||||
(Language::German, "nav_game_location") => "SPIELPFAD",
|
||||
(Language::German, "nav_controls") => "STEUERUNG",
|
||||
(Language::German, "nav_shaders") => "SHADER-EINSTELLUNGEN",
|
||||
(Language::German, "launcher_version_label") => "LAUNCHER-VERSION",
|
||||
(Language::German, "lang_options_title") => "SPRACHOPTIONEN",
|
||||
(Language::German, "system_specs_title") => "SYSTEMSPEZIFIKATIONEN",
|
||||
(Language::German, "play_btn_label") => "SPIELEN",
|
||||
(Language::German, "menu_play") => "SPIELEN",
|
||||
(Language::German, "menu_latest_news") => "NEUIGKEITEN",
|
||||
(Language::German, "menu_options") => "OPTIONEN",
|
||||
(Language::German, "menu_back") => "ZURÜCK",
|
||||
(Language::German, "release_notes_title") => "God of War III Launcher - Versionshinweise (v2.1)",
|
||||
(Language::German, "release_notes_content") => "🔥 GOD OF WAR III LAUNCHER v2.1 NEUIGKEITEN:\n\n• 🎮 Discord Rich Presence Integration:\n - Zeigt 'Spielt God of War III Remastered' mit Kratos-Cover und Spielzeitzähler in deinem Discord-Profil an.\n - Automatische Statusmeldungen für Hauptmenü, Shader-Kompilierung und Spielverlauf.\n - In den Einstellungen ein-/ausschaltbar mit optionaler benutzerdefinierter Client-ID.\n\n• ⚡ Keine Performance-Einbußen & Nahtlose Verbindung.",
|
||||
(Language::German, "discord_rpc_toggle") => "Discord Rich Presence (Spielstatus)",
|
||||
(Language::German, "discord_rpc_desc") => "Zeigt 'Spielt God of War III Remastered' und die Spielzeit in deinem Discord-Profil an.",
|
||||
(Language::German, "discord_client_id_label") => "Discord Anwendungs-ID (Client ID):",
|
||||
(Language::German, "discord_reset_btn") => "Standard wiederherstellen",
|
||||
(Language::German, "gamemode_toggle") => "Feral GameMode (gamemoderun)",
|
||||
(Language::German, "gamemode_desc") => "Optimiert CPU-Governor und GPU für maximale Gaming-Leistung.",
|
||||
(Language::German, "save_apply") => "Einstellungen speichern & anwenden",
|
||||
@@ -506,6 +733,11 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::German, "latest_commit") => "Neuester Commit:",
|
||||
(Language::German, "commit_date") => "Datum:",
|
||||
(Language::German, "view_on_github") => "Auf GitHub ansehen",
|
||||
(Language::German, "remind_later") => "⏰ Später erinnern",
|
||||
(Language::German, "update_available_badge") => "🚀 Update verfügbar!",
|
||||
(Language::German, "btn_update") => "Aktualisieren",
|
||||
(Language::German, "btn_update_now") => "🚀 Jetzt aktualisieren",
|
||||
(Language::German, "updating_in_progress") => "⏳ Update wird heruntergeladen und installiert... Bitte warten...",
|
||||
(Language::German, "python_dep") => "Python 3 Abhängigkeit:",
|
||||
(Language::German, "python_ready") => "Installiert / Bereit",
|
||||
(Language::German, "python_missing") => "Nicht gefunden",
|
||||
@@ -531,6 +763,8 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::German, "controller_header") => "Gamepad- & Controller-Einstellungen",
|
||||
(Language::German, "bg_input") => "Hintergrund-Controller-Eingabe",
|
||||
(Language::German, "bg_input_desc") => "Ermöglicht Gamepad-Eingaben auch wenn das Spielfenster nicht fokussiert ist.",
|
||||
(Language::German, "hide_mouse_cursor") => "Mauszeiger im Spiel ausblenden",
|
||||
(Language::German, "hide_mouse_cursor_desc") => "Blendet den Mauszeiger im Fokus aus und zeigt ihn wieder an, wenn der Fokus verloren geht.",
|
||||
(Language::German, "motion_controls") => "Bewegungs- & Gyrosensoren",
|
||||
(Language::German, "motion_controls_desc") => "Aktiviert interne Beschleunigungsmesser und Gyroskop der DualShock 4 / DualSense Controller.",
|
||||
(Language::German, "deadzone_left") => "Linker Stick Totzone:",
|
||||
@@ -539,8 +773,10 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::German, "keyboard_header") => "Tastaturbelegung",
|
||||
(Language::German, "keyboard_desc") => "Klicken Sie auf eine Taste und drücken Sie eine Taste auf der Tastatur. ESC zum Abbrechen.",
|
||||
(Language::German, "preset_label") => "Schnell-Voreinstellung:",
|
||||
(Language::German, "preset_standard") => "Standard WASD + CVBN (Empfohlen)",
|
||||
(Language::German, "preset_numpad") => "WASD + Numpad (8462)",
|
||||
(Language::German, "preset_recommended") => "🎯 Empfohlenes Profil",
|
||||
(Language::German, "preset_mouse_kb") => "🖱️ Zweites Profil (Maus + Tastatur)",
|
||||
(Language::German, "preset_standard") => "🎯 Empfohlenes Profil",
|
||||
(Language::German, "preset_numpad") => "🖱️ Zweites Profil (Maus + Tastatur)",
|
||||
(Language::German, "reset_defaults") => "Auf Standard zurücksetzen",
|
||||
(Language::German, "press_any_key") => "[ Taste drücken... / ESC ]",
|
||||
(Language::German, "sec_face_buttons") => "Aktionstasten (Angriff & Sprung)",
|
||||
@@ -571,6 +807,39 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::German, "act_cam_down") => "Rechter Stick: Runter",
|
||||
(Language::German, "act_cam_left") => "Rechter Stick: Links",
|
||||
(Language::German, "act_cam_right") => "Rechter Stick: Rechts",
|
||||
(Language::German, "key_bind_modal_title") => "🎮 Taste / Maustaste zuweisen",
|
||||
(Language::German, "key_bind_modal_desc") => "Drücken Sie eine Taste, klicken Sie mit der Maus oder wählen Sie unten:",
|
||||
(Language::German, "sec_mouse_bindings") => "🖱 Maustasten",
|
||||
(Language::German, "sec_numpad_bindings") => "🔢 Ziffernblock (Numpad)",
|
||||
(Language::German, "sec_digits_bindings") => "🔢 Standard-Zahlenreihe (1 - 0)",
|
||||
(Language::German, "mouse_left_btn") => "🖱 Linksklick (Maus 1)",
|
||||
(Language::German, "mouse_right_btn") => "🖱 Rechtsklick (Maus 2)",
|
||||
(Language::German, "mouse_middle_btn") => "🖱 Mittelklick (Maus 3)",
|
||||
(Language::German, "mouse_side1_btn") => "🖱 Seitentaste 1 (Maus 4)",
|
||||
(Language::German, "mouse_side2_btn") => "🖱 Seitentaste 2 (Maus 5)",
|
||||
(Language::German, "mouse_wheel_up") => "🖱 Mausrad Hoch",
|
||||
(Language::German, "mouse_wheel_down") => "🖱 Mausrad Runter",
|
||||
(Language::German, "cancel_btn") => "Abbrechen (ESC)",
|
||||
(Language::German, "launcher_log_btn") => "📋 Launcher-Protokoll",
|
||||
(Language::German, "game_log_btn") => "🎮 Spiel-Protokoll",
|
||||
(Language::German, "err_modal_title") => "⚠️ Ein Fehler ist aufgetreten",
|
||||
(Language::German, "copy_error") => "📋 Fehler kopieren",
|
||||
(Language::German, "copied_notice") => "✅ Kopiert!",
|
||||
(Language::German, "open_log_file") => "📄 Protokolldatei öffnen",
|
||||
(Language::German, "open_in_editor") => "📝 Im Editor öffnen",
|
||||
(Language::German, "refresh_log") => "🔄 Aktualisieren",
|
||||
(Language::German, "err_engine_dl_title") => "❌ Download der Spiel-Engine fehlgeschlagen",
|
||||
(Language::German, "err_engine_dl_summary") => "Das Spiel-Engine-Paket für God of War III konnte nicht heruntergeladen oder entpackt werden.",
|
||||
(Language::German, "err_engine_dl_hint") => "Bitte überprüfen Sie Ihre Internetverbindung. Der GitHub-Download ist möglicherweise fehlgeschlagen oder der Speicherplatz reicht nicht aus.",
|
||||
(Language::German, "engine_download_alt") => "Alternativer Download",
|
||||
(Language::German, "engine_download_alt_tooltip") => "Verwendet einen alternativen Server und eine andere Download-Methode, falls der Standard-Download fehlschlägt.",
|
||||
(Language::German, "retry_with_alt") => "⚡ Alternativen Engine-Download versuchen",
|
||||
(Language::German, "err_python_dl_title") => "❌ Python-Laufzeitumgebung Download fehlgeschlagen",
|
||||
(Language::German, "err_python_dl_summary") => "Die für die Vorbereitungsskripte erforderliche portable Python 3-Umgebung konnte nicht heruntergeladen werden.",
|
||||
(Language::German, "err_python_dl_hint") => "Stellen Sie sicher, dass Python 3 auf Ihrem System installiert ist, oder überprüfen Sie Ihre Verbindung.",
|
||||
(Language::German, "err_game_launch_title") => "❌ Fehler beim Spielstart",
|
||||
(Language::German, "err_game_launch_summary") => "Beim Vorbereiten oder Starten von God of War III ist ein Fehler aufgetreten.",
|
||||
(Language::German, "err_game_launch_hint") => "Überprüfen Sie, ob eboot.bin und die Spieldateien intakt sind. Überprüfen Sie die Details unten oder die Protokolldatei.",
|
||||
|
||||
// Spanish
|
||||
(Language::Spanish, "hero_badge") => "🔥 Lanzador de PC de Código Abierto",
|
||||
@@ -583,6 +852,7 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::Spanish, "tag_hardware") => "H A R D W A R E Y S I S T E M A",
|
||||
(Language::Spanish, "tag_game_location") => "U B I C A C I Ó N D E L J U E G O",
|
||||
(Language::Spanish, "tag_patches") => "R E N D I M I E N T O Y P A R C H E S",
|
||||
(Language::Spanish, "tag_mods") => "M O D S D E L J U E G O",
|
||||
(Language::Spanish, "tag_display") => "P A N T A L L A Y G R Á F I C O S",
|
||||
(Language::Spanish, "tag_controller") => "M A N D O Y G A M E P A D",
|
||||
(Language::Spanish, "tag_keyboard") => "A S I G N A C I Ó N D E T E C L A S",
|
||||
@@ -636,10 +906,55 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::Spanish, "target_fps") => "FPS Objetivo:",
|
||||
(Language::Spanish, "readback_patch") => "Corrección de Texturas y Tinte Amarillo (Instant Readbacks)",
|
||||
(Language::Spanish, "readback_desc") => "Fuerza lecturas lineales inmediatas, eliminando por completo el tinte amarillo y texturas corruptas en escenas de nieve o alto brillo.",
|
||||
(Language::Spanish, "async_readbacks") => "Lecturas Asíncronas (Anti-Tirones y Prevención de Caídas de FPS)",
|
||||
(Language::Spanish, "async_readbacks_desc") => "Desacopla la CPU de las esperas de la GPU para operaciones de textura. Elimina tirones y caídas repentinas de FPS.",
|
||||
(Language::Spanish, "async_readbacks") => "⚡ Lecturas Asíncronas (Experimental - Recomendado)",
|
||||
(Language::Spanish, "async_readbacks_desc") => "Desacopla la CPU de las esperas de la GPU para texturas. Elimina caídas de FPS y tirones para una experiencia fluida. Recomendado: ACTIVADO.",
|
||||
(Language::Spanish, "launch_while_compiling_shaders") => "Iniciar Juego Mientras se Compilan los Shaders",
|
||||
(Language::Spanish, "launch_while_compiling_shaders_desc") => "Activado: El juego se abre inmediatamente y compila en segundo plano. Desactivado: El juego espera a que los shaders estén al 100% para evitar tirones.",
|
||||
(Language::Spanish, "show_shader_rage_meter") => "Visualización de Compilación de Shaders (Barra de Furia Espartana)",
|
||||
(Language::Spanish, "show_shader_rage_meter_desc") => "Activado: Muestra el progreso de compilación con la barra de Furia Espartana y contador de pipelines (espera en pantalla negra al 100% hasta que la ventana del juego esté lista). Desactivado (Modo PS4): Oculta la barra y muestra solo el arte de inicio animado de PS4 (pic1.png).",
|
||||
(Language::Spanish, "shader_cache_title") => "⚡ Caché Oficial de Shaders (Estilo Steam Pre-Caching)",
|
||||
(Language::Spanish, "shader_cache_desc") => "Caché oficial limpia y segura con más de 28.000 shaders precompilados para todas las áreas y jefes. Elimina completamente tirones y congelaciones.",
|
||||
(Language::Spanish, "shader_download_btn") => "☁️ Descargar e Instalar Caché Completa de Shaders (17 MB)",
|
||||
(Language::Spanish, "shader_download_btn_update") => "🔄 Re-verificar e Instalar Caché de Shaders (17 MB)",
|
||||
(Language::Spanish, "shader_installed_badge") => "✅ Caché Completa de Shaders Activa ({} Shaders Listos)",
|
||||
(Language::Spanish, "shader_missing_badge") => "⚠️ Caché Incompleta ({} Shaders Encontrados - Se Recomienda Descargar)",
|
||||
(Language::Spanish, "shader_downloading") => "Procesando caché de shaders (~17 MB)... Por favor espere...",
|
||||
(Language::Spanish, "shader_extracting") => "Extrayendo y verificando la caché de shaders...",
|
||||
(Language::Spanish, "shader_success") => "✅ ¡Caché de shaders instalada con éxito! ({} shaders en caché)",
|
||||
(Language::Spanish, "skip_cinematics") => "Omitir Cinemáticas con el Botón 'X'",
|
||||
(Language::Spanish, "skip_cinematics_desc") => "Permite saltar cualquier cinemática o vídeo pulsando el botón X del mando.",
|
||||
(Language::Spanish, "nav_home") => "INICIO",
|
||||
(Language::Spanish, "nav_mods") => "MODS",
|
||||
(Language::Spanish, "mods_title") => "Gestor de Mods de God of War III",
|
||||
(Language::Spanish, "mods_desc") => "Administra fácilmente mods de personajes, trajes y texturas. Se cargan de forma segura sin modificar archivos originales.",
|
||||
(Language::Spanish, "mods_open_folder") => "Abrir Carpeta de Mods",
|
||||
(Language::Spanish, "mods_refresh") => "Actualizar Mods",
|
||||
(Language::Spanish, "mods_count_summary") => "Instalados: {} | Activos: {} | Desactivados: {}",
|
||||
(Language::Spanish, "mods_empty_title") => "No hay mods instalados",
|
||||
(Language::Spanish, "mods_empty_desc") => "Haz clic en 'Abrir Carpeta de Mods', coloca la carpeta de tu mod dentro y haz clic en 'Actualizar Mods'.",
|
||||
(Language::Spanish, "mods_status_active") => "● Activo en el Juego",
|
||||
(Language::Spanish, "mods_status_disabled") => "○ Desactivado",
|
||||
(Language::Spanish, "mods_author") => "Autor",
|
||||
(Language::Spanish, "mods_files_replaced") => "Archivos Reemplazados",
|
||||
(Language::Spanish, "nav_settings") => "AJUSTES",
|
||||
(Language::Spanish, "nav_graphics") => "GRÁFICOS",
|
||||
(Language::Spanish, "nav_game_location") => "UBICACIÓN DEL JUEGO",
|
||||
(Language::Spanish, "nav_controls") => "CONTROLES",
|
||||
(Language::Spanish, "nav_shaders") => "AJUSTES DE SHADER",
|
||||
(Language::Spanish, "launcher_version_label") => "VERSIÓN DEL LAUNCHER",
|
||||
(Language::Spanish, "lang_options_title") => "OPCIONES DE IDIOMA",
|
||||
(Language::Spanish, "system_specs_title") => "ESPECIFICACIONES DEL SISTEMA",
|
||||
(Language::Spanish, "play_btn_label") => "JUGAR",
|
||||
(Language::Spanish, "menu_play") => "JUGAR",
|
||||
(Language::Spanish, "menu_latest_news") => "ÚLTIMAS NOTICIAS",
|
||||
(Language::Spanish, "menu_options") => "OPCIONES",
|
||||
(Language::Spanish, "menu_back") => "VOLVER",
|
||||
(Language::Spanish, "release_notes_title") => "God of War III Launcher - Notas de la Versión (v2.1)",
|
||||
(Language::Spanish, "release_notes_content") => "🔥 NOVEDADES DE GOD OF WAR III LAUNCHER v2.1:\n\n• 🎮 Integración con Discord Rich Presence:\n - Muestra 'Jugando a God of War III Remastered' con arte de Kratos y contador de tiempo en tu perfil de Discord.\n - Estados automáticos: En el Menú Principal, Compilando Shaders y Escalando el Monte Olimpo.\n - Se puede activar/desactivar en Ajustes con soporte para Client ID personalizado.\n\n• ⚡ Cero impacto en el rendimiento y conexión inteligente.",
|
||||
(Language::Spanish, "discord_rpc_toggle") => "Discord Rich Presence (Estado de Juego)",
|
||||
(Language::Spanish, "discord_rpc_desc") => "Muestra 'Jugando a God of War III Remastered' y el tiempo de juego en tu perfil de Discord.",
|
||||
(Language::Spanish, "discord_client_id_label") => "ID de Aplicación de Discord (Client ID):",
|
||||
(Language::Spanish, "discord_reset_btn") => "Restablecer por Defecto",
|
||||
(Language::Spanish, "gamemode_toggle") => "Feral GameMode (gamemoderun)",
|
||||
(Language::Spanish, "gamemode_desc") => "Optimiza la CPU y GPU para máximo rendimiento en juegos.",
|
||||
(Language::Spanish, "save_apply") => "Guardar y Aplicar",
|
||||
@@ -682,6 +997,11 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::Spanish, "latest_commit") => "Último Commit:",
|
||||
(Language::Spanish, "commit_date") => "Fecha:",
|
||||
(Language::Spanish, "view_on_github") => "Ver en GitHub",
|
||||
(Language::Spanish, "remind_later") => "⏰ Recordármelo más tarde",
|
||||
(Language::Spanish, "update_available_badge") => "🚀 ¡Actualización disponible!",
|
||||
(Language::Spanish, "btn_update") => "Actualizar",
|
||||
(Language::Spanish, "btn_update_now") => "🚀 Actualizar ahora",
|
||||
(Language::Spanish, "updating_in_progress") => "⏳ Descargando e instalando actualización... Por favor espere...",
|
||||
(Language::Spanish, "python_dep") => "Dependencia Python 3:",
|
||||
(Language::Spanish, "python_ready") => "Instalado / Listo",
|
||||
(Language::Spanish, "python_missing") => "No encontrado",
|
||||
@@ -707,6 +1027,8 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::Spanish, "controller_header") => "Ajustes de Mando / Gamepad",
|
||||
(Language::Spanish, "bg_input") => "Entrada de mando en segundo plano",
|
||||
(Language::Spanish, "bg_input_desc") => "Permite entradas del mando incluso cuando la ventana del juego no está activa.",
|
||||
(Language::Spanish, "hide_mouse_cursor") => "Ocultar cursor del ratón en el juego",
|
||||
(Language::Spanish, "hide_mouse_cursor_desc") => "Oculta el cursor del ratón cuando el juego está enfocado; se vuelve visible al perder el foco.",
|
||||
(Language::Spanish, "motion_controls") => "Controles de movimiento y giroscopio",
|
||||
(Language::Spanish, "motion_controls_desc") => "Activa el acelerómetro y giroscopio internos de mandos DualShock 4 / DualSense.",
|
||||
(Language::Spanish, "deadzone_left") => "Zona muerta palanca izquierda:",
|
||||
@@ -714,9 +1036,11 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::Spanish, "deadzone_desc") => "Valores más bajos ofrecen mayor sensibilidad; auméntelo si su palanca sufre de deriva (drift).",
|
||||
(Language::Spanish, "keyboard_header") => "Asignación de Teclas (Keyboard Bindings)",
|
||||
(Language::Spanish, "keyboard_desc") => "Haz clic en cualquier botón y pulsa la nueva tecla. Pulsa ESC para cancelar.",
|
||||
(Language::Spanish, "preset_label") => "Ajuste rápido:",
|
||||
(Language::Spanish, "preset_standard") => "Estándar WASD + CVBN (Recomendado)",
|
||||
(Language::Spanish, "preset_numpad") => "WASD + Teclado Numérico (8462)",
|
||||
(Language::Spanish, "preset_label") => "Ajustes Rápidos:",
|
||||
(Language::Spanish, "preset_recommended") => "🎯 Perfil Recomendado",
|
||||
(Language::Spanish, "preset_mouse_kb") => "🖱️ Segundo Perfil (Ratón + Teclado)",
|
||||
(Language::Spanish, "preset_standard") => "🎯 Perfil Recomendado",
|
||||
(Language::Spanish, "preset_numpad") => "🖱️ Segundo Perfil (Ratón + Teclado)",
|
||||
(Language::Spanish, "reset_defaults") => "Restablecer por defecto",
|
||||
(Language::Spanish, "press_any_key") => "[ Presiona una tecla... / ESC ]",
|
||||
(Language::Spanish, "sec_face_buttons") => "Botones de acción (Ataques y Salto)",
|
||||
@@ -747,6 +1071,39 @@ pub fn text(lang: Language, key: &str) -> &'static str {
|
||||
(Language::Spanish, "act_cam_down") => "Palanca Der: Abajo",
|
||||
(Language::Spanish, "act_cam_left") => "Palanca Der: Izquierda",
|
||||
(Language::Spanish, "act_cam_right") => "Palanca Der: Derecha",
|
||||
(Language::Spanish, "key_bind_modal_title") => "🎮 Asignar tecla / botón del ratón",
|
||||
(Language::Spanish, "key_bind_modal_desc") => "Presiona una tecla, haz clic o elige una opción abajo:",
|
||||
(Language::Spanish, "sec_mouse_bindings") => "🖱 Botones del Ratón",
|
||||
(Language::Spanish, "sec_numpad_bindings") => "🔢 Teclado Numérico (Numpad)",
|
||||
(Language::Spanish, "sec_digits_bindings") => "🔢 Fila de Números Estándar (1 - 0)",
|
||||
(Language::Spanish, "mouse_left_btn") => "🖱 Clic Izquierdo (Ratón 1)",
|
||||
(Language::Spanish, "mouse_right_btn") => "🖱 Clic Derecho (Ratón 2)",
|
||||
(Language::Spanish, "mouse_middle_btn") => "🖱 Clic Central (Ratón 3)",
|
||||
(Language::Spanish, "mouse_side1_btn") => "🖱 Botón Lateral 1 (Ratón 4)",
|
||||
(Language::Spanish, "mouse_side2_btn") => "🖱 Botón Lateral 2 (Ratón 5)",
|
||||
(Language::Spanish, "mouse_wheel_up") => "🖱 Rueda Arriba",
|
||||
(Language::Spanish, "mouse_wheel_down") => "🖱 Rueda Abajo",
|
||||
(Language::Spanish, "cancel_btn") => "Cancelar (ESC)",
|
||||
(Language::Spanish, "launcher_log_btn") => "📋 Registro del Launcher",
|
||||
(Language::Spanish, "game_log_btn") => "🎮 Registro del Juego",
|
||||
(Language::Spanish, "err_modal_title") => "⚠️ Ocurrió un Error",
|
||||
(Language::Spanish, "copy_error") => "📋 Copiar Error",
|
||||
(Language::Spanish, "copied_notice") => "✅ ¡Copiado!",
|
||||
(Language::Spanish, "open_log_file") => "📄 Abrir Archivo de Registro",
|
||||
(Language::Spanish, "open_in_editor") => "📝 Abrir en el Editor",
|
||||
(Language::Spanish, "refresh_log") => "🔄 Actualizar",
|
||||
(Language::Spanish, "err_engine_dl_title") => "❌ Error al Descargar el Motor del Juego",
|
||||
(Language::Spanish, "err_engine_dl_summary") => "No se pudo descargar o extraer el paquete del motor del juego God of War III.",
|
||||
(Language::Spanish, "err_engine_dl_hint") => "Por favor revise su conexión a internet. La descarga de GitHub pudo fallar o el espacio en disco es insuficiente.",
|
||||
(Language::Spanish, "engine_download_alt") => "Descarga Alternativa",
|
||||
(Language::Spanish, "engine_download_alt_tooltip") => "Usa un servidor alternativo y otro método de descarga si la descarga estándar falla.",
|
||||
(Language::Spanish, "retry_with_alt") => "⚡ Probar Descarga Alternativa del Motor",
|
||||
(Language::Spanish, "err_python_dl_title") => "❌ Error al Descargar el Entorno de Python",
|
||||
(Language::Spanish, "err_python_dl_summary") => "No se pudo descargar el entorno portátil de Python 3 necesario para los scripts de preparación del juego.",
|
||||
(Language::Spanish, "err_python_dl_hint") => "Asegúrese de que Python 3 esté instalado en su sistema o verifique su conexión e intente nuevamente.",
|
||||
(Language::Spanish, "err_game_launch_title") => "❌ Error al Iniciar el Juego",
|
||||
(Language::Spanish, "err_game_launch_summary") => "Ocurrió un error durante la preparación o ejecución de God of War III.",
|
||||
(Language::Spanish, "err_game_launch_hint") => "Verifique que eboot.bin y los archivos del juego estén completos. Revise los detalles abajo o el archivo de registro.",
|
||||
|
||||
_ => "",
|
||||
}
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
use std::fs::{self, OpenOptions};
|
||||
use std::io::Write;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::{Mutex, OnceLock};
|
||||
|
||||
static LOG_PATH: OnceLock<PathBuf> = OnceLock::new();
|
||||
static LOG_MUTEX: Mutex<()> = Mutex::new(());
|
||||
|
||||
/// Formats current SystemTime as UTC "YYYY-MM-DD HH:MM:SS" without external dependencies
|
||||
pub fn format_current_timestamp() -> String {
|
||||
let now = std::time::SystemTime::now()
|
||||
.duration_since(std::time::UNIX_EPOCH)
|
||||
.unwrap_or_default();
|
||||
let total_secs = now.as_secs();
|
||||
let sec = (total_secs % 60) as u32;
|
||||
let min = ((total_secs / 60) % 60) as u32;
|
||||
let hour = ((total_secs / 3600) % 24) as u32;
|
||||
let days = (total_secs / 86400) as i64;
|
||||
|
||||
// Convert days since 1970-01-01 to year, month, day (Howard Hinnant civil algorithm)
|
||||
let z = days + 719468;
|
||||
let era = (if z >= 0 { z } else { z - 146096 }) / 146097;
|
||||
let doe = (z - era * 146097) as u32;
|
||||
let yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365;
|
||||
let y = yoe as i64 + era * 400;
|
||||
let doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
|
||||
let mp = (5 * doy + 2) / 153;
|
||||
let d = doy - (153 * mp + 2) / 5 + 1;
|
||||
let m = if mp < 10 { mp + 3 } else { mp - 9 };
|
||||
let y = if m <= 2 { y + 1 } else { y };
|
||||
|
||||
format!("{:04}-{:02}-{:02} {:02}:{:02}:{:02} UTC", y, m, d, hour, min, sec)
|
||||
}
|
||||
|
||||
/// Initializes the global log file path in base_dir/launcher_log.txt and writes startup banner
|
||||
pub fn init_logger(base_dir: &Path) {
|
||||
let path = base_dir.join("launcher_log.txt");
|
||||
let _ = LOG_PATH.set(path.clone());
|
||||
|
||||
// Write session divider banner
|
||||
let sep = "================================================================================";
|
||||
write_log("INFO", sep);
|
||||
write_log(
|
||||
"INFO",
|
||||
&format!(
|
||||
"God of War III Launcher Log started (v2.0) | OS: {} | Arch: {}",
|
||||
std::env::consts::OS,
|
||||
std::env::consts::ARCH
|
||||
),
|
||||
);
|
||||
write_log("INFO", &format!("Base Directory: {}", base_dir.display()));
|
||||
write_log("INFO", sep);
|
||||
}
|
||||
|
||||
/// Appends a formatted log line to stdout/stderr and launcher_log.txt
|
||||
pub fn write_log(level: &str, message: &str) {
|
||||
let timestamp = format_current_timestamp();
|
||||
let formatted = format!("[{}] [{}] {}", timestamp, level, message);
|
||||
|
||||
if level == "ERROR" {
|
||||
eprintln!("{}", formatted);
|
||||
} else {
|
||||
println!("{}", formatted);
|
||||
}
|
||||
|
||||
if let Some(path) = LOG_PATH.get() {
|
||||
if let Ok(_guard) = LOG_MUTEX.lock() {
|
||||
if let Ok(mut f) = OpenOptions::new().create(true).append(true).open(path) {
|
||||
let _ = writeln!(f, "{}", formatted);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Reads the current content of launcher_log.txt
|
||||
pub fn read_launcher_log(base_dir: &Path) -> String {
|
||||
let path = base_dir.join("launcher_log.txt");
|
||||
if path.is_file() {
|
||||
fs::read_to_string(&path).unwrap_or_else(|e| format!("Log dosyası okunamadı: {}", e))
|
||||
} else {
|
||||
"Launcher log dosyası henüz oluşturulmadı.".to_string()
|
||||
}
|
||||
}
|
||||
|
||||
/// Opens any file in the OS default text editor or viewer (e.g. Notepad, xdg-open)
|
||||
pub fn open_file_path(path: &Path) {
|
||||
if !path.exists() {
|
||||
return;
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
use std::os::windows::process::CommandExt;
|
||||
const CREATE_NO_WINDOW: u32 = 0x08000000;
|
||||
let _ = std::process::Command::new("cmd")
|
||||
.args(["/C", "start", "", &path.to_string_lossy()])
|
||||
.creation_flags(CREATE_NO_WINDOW)
|
||||
.spawn();
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
let _ = std::process::Command::new("xdg-open")
|
||||
.arg(path)
|
||||
.spawn();
|
||||
}
|
||||
}
|
||||
|
||||
/// Opens the launcher_log.txt file in the OS default text editor (e.g. Notepad, xdg-open)
|
||||
pub fn open_log_in_editor(base_dir: &Path) {
|
||||
let log_file = base_dir.join("launcher_log.txt");
|
||||
if !log_file.exists() {
|
||||
let _ = fs::write(&log_file, "God of War III Launcher Log\n");
|
||||
}
|
||||
open_file_path(&log_file);
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! log_info {
|
||||
($($arg:tt)*) => {
|
||||
$crate::logger::write_log("INFO", &format!($($arg)*))
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! log_warn {
|
||||
($($arg:tt)*) => {
|
||||
$crate::logger::write_log("WARN", &format!($($arg)*))
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! log_error {
|
||||
($($arg:tt)*) => {
|
||||
$crate::logger::write_log("ERROR", &format!($($arg)*))
|
||||
};
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_format_current_timestamp() {
|
||||
let ts = format_current_timestamp();
|
||||
assert!(ts.contains("UTC"));
|
||||
assert_eq!(ts.len(), 23); // "YYYY-MM-DD HH:MM:SS UTC"
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_write_and_read_log() {
|
||||
let temp_dir = std::env::temp_dir().join("gow3_logger_test");
|
||||
let _ = fs::create_dir_all(&temp_dir);
|
||||
let test_file = temp_dir.join("launcher_log.txt");
|
||||
let _ = fs::remove_file(&test_file);
|
||||
|
||||
init_logger(&temp_dir);
|
||||
log_info!("Test info message 123");
|
||||
log_warn!("Test warning message 456");
|
||||
log_error!("Test error message 789");
|
||||
|
||||
let content = read_launcher_log(&temp_dir);
|
||||
assert!(content.contains("Test info message 123"));
|
||||
assert!(content.contains("Test warning message 456"));
|
||||
assert!(content.contains("Test error message 789"));
|
||||
|
||||
let _ = fs::remove_dir_all(&temp_dir);
|
||||
}
|
||||
}
|
||||
+35
-6
@@ -2,11 +2,16 @@ mod app;
|
||||
mod config;
|
||||
mod crash_analyzer;
|
||||
mod i18n;
|
||||
pub mod logger;
|
||||
mod runner;
|
||||
mod scanner;
|
||||
mod system;
|
||||
mod tuner;
|
||||
mod updater;
|
||||
mod runner;
|
||||
mod shader_downloader;
|
||||
pub mod mods_manager;
|
||||
pub mod discord_rpc;
|
||||
pub mod win_input;
|
||||
|
||||
use app::LauncherApp;
|
||||
use eframe::egui;
|
||||
@@ -33,25 +38,32 @@ fn main() -> eframe::Result<()> {
|
||||
std::env::current_dir().unwrap_or_else(|_| PathBuf::from("."))
|
||||
};
|
||||
|
||||
// Initialize launcher file logging
|
||||
logger::init_logger(&base_dir);
|
||||
|
||||
let args: Vec<String> = std::env::args().collect();
|
||||
if args.iter().any(|a| a == "--play" || a == "--start" || a == "-p") {
|
||||
log_info!("Command line argument '--play' detected. Launching game directly...");
|
||||
let config = config::LauncherConfig::load(&base_dir);
|
||||
let gamemode_avail = system::is_gamemode_available();
|
||||
let use_gamemode = gamemode_avail && config.use_gamemode;
|
||||
let _ = tuner::apply_settings(&base_dir, &config);
|
||||
match runner::launch_gow3(&base_dir, &config, use_gamemode, None) {
|
||||
Ok(code) => std::process::exit(code),
|
||||
Ok(code) => {
|
||||
log_info!("Game process exited with status code: {}", code);
|
||||
std::process::exit(code);
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!("Error launching God of War III: {}", e);
|
||||
log_error!("Error launching God of War III via CLI: {}", e);
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let mut viewport = egui::ViewportBuilder::default()
|
||||
.with_title("God of War® III Remastered - Launcher")
|
||||
.with_inner_size([800.0, 720.0])
|
||||
.with_min_inner_size([650.0, 550.0])
|
||||
.with_title("God of War® III Remastered")
|
||||
.with_inner_size([1024.0, 576.0])
|
||||
.with_min_inner_size([854.0, 480.0])
|
||||
.with_resizable(true);
|
||||
|
||||
if let Some(icon) = load_window_icon(&base_dir) {
|
||||
@@ -69,6 +81,23 @@ fn main() -> eframe::Result<()> {
|
||||
native_options,
|
||||
Box::new(move |cc| {
|
||||
egui_extras::install_image_loaders(&cc.egui_ctx);
|
||||
|
||||
// Register God of War Font and make it primary for Spartan style with unicode fallback
|
||||
let mut fonts = egui::FontDefinitions::default();
|
||||
fonts.font_data.insert(
|
||||
"GodOfWar".to_owned(),
|
||||
std::sync::Arc::new(egui::FontData::from_static(include_bytes!("../assets/godofwar.ttf"))),
|
||||
);
|
||||
fonts.families.insert(
|
||||
egui::FontFamily::Name("GodOfWar".into()),
|
||||
vec!["GodOfWar".to_owned()],
|
||||
);
|
||||
// Prepend GodOfWar to Proportional font family so headers and labels use it automatically
|
||||
if let Some(prop) = fonts.families.get_mut(&egui::FontFamily::Proportional) {
|
||||
prop.insert(0, "GodOfWar".to_owned());
|
||||
}
|
||||
cc.egui_ctx.set_fonts(fonts);
|
||||
|
||||
Ok(Box::new(LauncherApp::new(cc, base_dir_clone)))
|
||||
}),
|
||||
)
|
||||
|
||||
@@ -0,0 +1,207 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct InstalledMod {
|
||||
pub folder_name: String,
|
||||
pub title: String,
|
||||
pub author: String,
|
||||
pub version: String,
|
||||
pub description: String,
|
||||
pub file_count: usize,
|
||||
pub sample_files: Vec<String>,
|
||||
pub is_enabled: bool,
|
||||
}
|
||||
|
||||
pub fn resolve_mods_dir(base_dir: &Path) -> PathBuf {
|
||||
if base_dir.join("mods").is_dir() {
|
||||
base_dir.join("mods")
|
||||
} else if base_dir.join("gow3-linux/mods").is_dir() {
|
||||
base_dir.join("gow3-linux/mods")
|
||||
} else {
|
||||
base_dir.join("mods")
|
||||
}
|
||||
}
|
||||
|
||||
pub fn open_mods_folder(base_dir: &Path) {
|
||||
let dir = resolve_mods_dir(base_dir);
|
||||
let _ = std::fs::create_dir_all(&dir);
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
let _ = std::process::Command::new("xdg-open").arg(&dir).spawn();
|
||||
}
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
let _ = std::process::Command::new("explorer").arg(&dir).spawn();
|
||||
}
|
||||
}
|
||||
|
||||
pub fn scan_installed_mods(base_dir: &Path, disabled_mods: &[String]) -> Vec<InstalledMod> {
|
||||
let mods_dir = resolve_mods_dir(base_dir);
|
||||
|
||||
if !mods_dir.is_dir() {
|
||||
let _ = std::fs::create_dir_all(&mods_dir);
|
||||
return Vec::new();
|
||||
}
|
||||
|
||||
let mut list = Vec::new();
|
||||
|
||||
if let Ok(entries) = std::fs::read_dir(&mods_dir) {
|
||||
for entry in entries.flatten() {
|
||||
let path = entry.path();
|
||||
if !path.is_dir() {
|
||||
continue;
|
||||
}
|
||||
let folder_name = entry.file_name().to_string_lossy().to_string();
|
||||
if folder_name.starts_with('.')
|
||||
|| folder_name.eq_ignore_ascii_case("gow3-windows")
|
||||
|| folder_name.eq_ignore_ascii_case("gow3-linux")
|
||||
|| path.join("run.py").is_file()
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
let mut title = folder_name.clone();
|
||||
let mut author = "Bilinmeyen Yazar".to_string();
|
||||
let mut version = "v1.0".to_string();
|
||||
let mut description = String::new();
|
||||
|
||||
// 1. Try reading mod.json
|
||||
let json_path = path.join("mod.json");
|
||||
if json_path.is_file() {
|
||||
if let Ok(text) = std::fs::read_to_string(&json_path) {
|
||||
if let Ok(val) = serde_json::from_str::<serde_json::Value>(&text) {
|
||||
if let Some(n) = val["name"].as_str() {
|
||||
title = n.to_string();
|
||||
}
|
||||
if let Some(a) = val["author"].as_str() {
|
||||
author = a.to_string();
|
||||
}
|
||||
if let Some(v) = val["version"].as_str() {
|
||||
version = v.to_string();
|
||||
}
|
||||
if let Some(d) = val["description"].as_str() {
|
||||
description = d.to_string();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Try reading README.txt if description or author is still default
|
||||
if description.is_empty() {
|
||||
let readme_candidates = [
|
||||
path.join("README.txt"),
|
||||
path.join("readme.txt"),
|
||||
path.join("README.md"),
|
||||
path.join("readme.md"),
|
||||
];
|
||||
for r in &readme_candidates {
|
||||
if r.is_file() {
|
||||
if let Ok(text) = std::fs::read_to_string(r) {
|
||||
for line in text.lines() {
|
||||
let l = line.trim();
|
||||
if let Some(stripped) = l.strip_prefix("Mod Name :") {
|
||||
if title == folder_name {
|
||||
title = stripped.trim().to_string();
|
||||
}
|
||||
} else if let Some(stripped) = l.strip_prefix("Author :") {
|
||||
author = stripped.trim().to_string();
|
||||
} else if let Some(stripped) = l.strip_prefix("Description :") {
|
||||
description = stripped.trim().to_string();
|
||||
} else if let Some(stripped) = l.strip_prefix("Version :") {
|
||||
version = stripped.trim().to_string();
|
||||
}
|
||||
}
|
||||
if description.is_empty() {
|
||||
description = text.chars().take(220).collect();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Scan mod files
|
||||
let mut file_count = 0;
|
||||
let mut sample_files = Vec::new();
|
||||
scan_mod_files_recursive(&path, &mut file_count, &mut sample_files);
|
||||
|
||||
let is_enabled = !disabled_mods.contains(&folder_name);
|
||||
|
||||
list.push(InstalledMod {
|
||||
folder_name,
|
||||
title,
|
||||
author,
|
||||
version,
|
||||
description,
|
||||
file_count,
|
||||
sample_files,
|
||||
is_enabled,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
list.sort_by(|a, b| a.title.to_lowercase().cmp(&b.title.to_lowercase()));
|
||||
list
|
||||
}
|
||||
|
||||
fn scan_mod_files_recursive(dir: &Path, count: &mut usize, samples: &mut Vec<String>) {
|
||||
if let Ok(entries) = std::fs::read_dir(dir) {
|
||||
for entry in entries.flatten() {
|
||||
let p = entry.path();
|
||||
if p.is_dir() {
|
||||
scan_mod_files_recursive(&p, count, samples);
|
||||
} else if p.is_file() {
|
||||
let name = entry.file_name().to_string_lossy().to_string();
|
||||
let lower = name.to_lowercase();
|
||||
if lower.ends_with(".txt")
|
||||
|| lower.ends_with(".md")
|
||||
|| lower.ends_with(".json")
|
||||
|| lower.ends_with(".jpg")
|
||||
|| lower.ends_with(".png")
|
||||
|| lower.ends_with(".ini")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
*count += 1;
|
||||
if samples.len() < 3 {
|
||||
samples.push(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_scan_installed_mods() {
|
||||
let base_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).parent().unwrap().to_path_buf();
|
||||
let mods = scan_installed_mods(&base_dir, &[]);
|
||||
assert!(mods.len() >= 2, "Should discover at least CJ and Golden Blades");
|
||||
|
||||
let cj = mods.iter().find(|m| m.folder_name.contains("CJ"));
|
||||
assert!(cj.is_some(), "CJ mod should be found");
|
||||
let cj_mod = cj.unwrap();
|
||||
assert_eq!(cj_mod.file_count, 17);
|
||||
assert!(cj_mod.is_enabled);
|
||||
|
||||
let gb = mods.iter().find(|m| m.folder_name.contains("Golden Blades"));
|
||||
assert!(gb.is_some(), "Golden Blades mod should be found");
|
||||
let gb_mod = gb.unwrap();
|
||||
assert_eq!(gb_mod.file_count, 1);
|
||||
assert_eq!(gb_mod.author, "Machi");
|
||||
assert!(gb_mod.is_enabled);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_disabled_mods() {
|
||||
let base_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).parent().unwrap().to_path_buf();
|
||||
let disabled = vec!["Golden Blades".to_string()];
|
||||
let mods = scan_installed_mods(&base_dir, &disabled);
|
||||
let gb = mods.iter().find(|m| m.folder_name == "Golden Blades").unwrap();
|
||||
assert!(!gb.is_enabled);
|
||||
}
|
||||
}
|
||||
+903
-79
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,248 @@
|
||||
use std::fs;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::Command;
|
||||
|
||||
pub const SHADER_REPO_URL: &str =
|
||||
"https://raw.githubusercontent.com/ScreamAngel/gow3_launcher/main/shaders/gow3-shader-cache.tar.xz";
|
||||
pub const SHADER_FALLBACK_URL: &str =
|
||||
"https://github.com/ScreamAngel/gow3_launcher/releases/download/v2.0/gow3-shader-cache.tar.xz";
|
||||
|
||||
/// Resolves the shader cache directory for God of War III.
|
||||
/// Handles both running from root repo or directly inside `gow3-linux`.
|
||||
pub fn resolve_cache_dir(base_dir: &Path) -> PathBuf {
|
||||
if base_dir.join("gow3-linux/user").is_dir() {
|
||||
base_dir.join("gow3-linux/user/cache")
|
||||
} else {
|
||||
base_dir.join("user/cache")
|
||||
}
|
||||
}
|
||||
|
||||
/// Counts total pre-compiled shader and pipeline key files for God of War III.
|
||||
pub fn count_cached_shaders(base_dir: &Path) -> usize {
|
||||
let cache_dir = resolve_cache_dir(base_dir);
|
||||
let primary = cache_dir.join("CUSA01715");
|
||||
let fallback = cache_dir.join("CUSA01623");
|
||||
let target = if primary.is_dir() {
|
||||
primary
|
||||
} else if fallback.is_dir() {
|
||||
fallback
|
||||
} else {
|
||||
return 0;
|
||||
};
|
||||
|
||||
let mut count = 0;
|
||||
if let Ok(entries) = fs::read_dir(target) {
|
||||
for e in entries.flatten() {
|
||||
let p = e.path();
|
||||
if p.extension().map_or(false, |ext| ext == "spv" || ext == "meta" || ext == "key") {
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
count
|
||||
}
|
||||
|
||||
/// Finds a local pre-built shader archive if present in the repo or parent dirs.
|
||||
pub fn find_local_shader_archive(base_dir: &Path) -> Option<PathBuf> {
|
||||
let candidates = [
|
||||
base_dir.join("shaders/gow3-shader-cache.tar.xz"),
|
||||
base_dir.join("../shaders/gow3-shader-cache.tar.xz"),
|
||||
];
|
||||
for c in &candidates {
|
||||
if c.is_file() {
|
||||
return Some(c.clone());
|
||||
}
|
||||
}
|
||||
if let Some(parent) = base_dir.parent() {
|
||||
let p = parent.join("shaders/gow3-shader-cache.tar.xz");
|
||||
if p.is_file() {
|
||||
return Some(p);
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
/// Downloads and extracts the official complete shader cache.
|
||||
/// Sets up cross-title compatibility for both CUSA01715 and CUSA01623.
|
||||
pub fn download_and_install_shaders(base_dir: &Path) -> Result<usize, String> {
|
||||
let cache_dir = resolve_cache_dir(base_dir);
|
||||
let _ = fs::create_dir_all(&cache_dir);
|
||||
|
||||
// 1. Check for local shader archive first (avoids unnecessary re-download)
|
||||
let archive_path = if let Some(local_path) = find_local_shader_archive(base_dir) {
|
||||
local_path
|
||||
} else {
|
||||
let temp_archive = cache_dir.join("gow3-shader-cache.tar.xz.tmp");
|
||||
let _ = fs::remove_file(&temp_archive);
|
||||
|
||||
http_download_with_fallback(SHADER_REPO_URL, SHADER_FALLBACK_URL, &temp_archive)?;
|
||||
temp_archive
|
||||
};
|
||||
|
||||
// 2. Extract archive into cache directory
|
||||
let extract_res = extract_tar_xz(&archive_path, &cache_dir);
|
||||
|
||||
// If a temporary download file was used, clean it up
|
||||
if archive_path.to_string_lossy().ends_with(".tmp") {
|
||||
let _ = fs::remove_file(&archive_path);
|
||||
}
|
||||
|
||||
extract_res?;
|
||||
|
||||
// 3. Ensure cross-compatibility between CUSA01715 (EU/TR) and CUSA01623 (US)
|
||||
link_regional_caches(&cache_dir);
|
||||
|
||||
let final_count = count_cached_shaders(base_dir);
|
||||
Ok(final_count)
|
||||
}
|
||||
|
||||
fn http_download(url: &str, dest: &Path) -> Result<(), String> {
|
||||
// 1. Try curl (available on Linux, macOS, and modern Windows 10+)
|
||||
if let Ok(out) = Command::new("curl")
|
||||
.args(["-fsSL", "-H", "User-Agent: gow3-launcher", url, "-o", dest.to_str().unwrap_or("")])
|
||||
.output()
|
||||
{
|
||||
if out.status.success() && dest.is_file() {
|
||||
if let Ok(meta) = fs::metadata(dest) {
|
||||
if meta.len() > 1024 {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Fallback to PowerShell on Windows
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
let ps_code = format!(
|
||||
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
|
||||
$wc = New-Object System.Net.WebClient; \
|
||||
$wc.Headers.Add('User-Agent', 'gow3-launcher'); \
|
||||
$wc.DownloadFile('{}', '{}')",
|
||||
url.replace('\'', "''"),
|
||||
dest.to_string_lossy().replace('\'', "''")
|
||||
);
|
||||
if let Ok(out) = Command::new("powershell")
|
||||
.args(["-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", &ps_code])
|
||||
.output()
|
||||
{
|
||||
if out.status.success() && dest.is_file() {
|
||||
if let Ok(meta) = fs::metadata(dest) {
|
||||
if meta.len() > 1024 {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Err(format!("Dosya indirilemedi: {}", url))
|
||||
}
|
||||
|
||||
fn http_download_with_fallback(primary_url: &str, fallback_url: &str, dest: &Path) -> Result<(), String> {
|
||||
if http_download(primary_url, dest).is_ok() {
|
||||
return Ok(());
|
||||
}
|
||||
http_download(fallback_url, dest)
|
||||
}
|
||||
|
||||
fn extract_tar_xz(archive: &Path, dest_dir: &Path) -> Result<(), String> {
|
||||
let _ = fs::create_dir_all(dest_dir);
|
||||
|
||||
// 1. Try system tar (available on Linux, macOS, and modern Windows 10/11 tar.exe)
|
||||
if let Ok(st) = Command::new("tar")
|
||||
.args(["-xf", archive.to_str().unwrap_or(""), "-C", dest_dir.to_str().unwrap_or("")])
|
||||
.status()
|
||||
{
|
||||
if st.success() {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Try 7z fallback (if user has 7z installed)
|
||||
if let Ok(st) = Command::new("7z")
|
||||
.args([
|
||||
"x",
|
||||
archive.to_str().unwrap_or(""),
|
||||
&format!("-o{}", dest_dir.to_str().unwrap_or("")),
|
||||
"-y",
|
||||
])
|
||||
.status()
|
||||
{
|
||||
if st.success() {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
Err("Shader arşivi açılamadı (tar veya 7z aracı bulunamadı).".to_string())
|
||||
}
|
||||
|
||||
/// Links CUSA01715 and CUSA01623 caches so both versions share the exact same shaders without duplication.
|
||||
pub fn link_regional_caches(cache_dir: &Path) {
|
||||
let cusa1715 = cache_dir.join("CUSA01715");
|
||||
let cusa1623 = cache_dir.join("CUSA01623");
|
||||
|
||||
if cusa1715.is_dir() && !cusa1623.exists() {
|
||||
#[cfg(unix)]
|
||||
{
|
||||
let _ = std::os::unix::fs::symlink("CUSA01715", &cusa1623);
|
||||
}
|
||||
#[cfg(windows)]
|
||||
{
|
||||
let _ = Command::new("cmd")
|
||||
.args(["/C", "mklink", "/J", cusa1623.to_str().unwrap_or(""), cusa1715.to_str().unwrap_or("")])
|
||||
.output();
|
||||
}
|
||||
} else if cusa1623.is_dir() && !cusa1715.exists() {
|
||||
#[cfg(unix)]
|
||||
{
|
||||
let _ = std::os::unix::fs::symlink("CUSA01623", &cusa1715);
|
||||
}
|
||||
#[cfg(windows)]
|
||||
{
|
||||
let _ = Command::new("cmd")
|
||||
.args(["/C", "mklink", "/J", cusa1715.to_str().unwrap_or(""), cusa1623.to_str().unwrap_or("")])
|
||||
.output();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_count_cached_shaders() {
|
||||
let temp_dir = std::env::temp_dir().join("gow3_test_shader_count");
|
||||
let cache = temp_dir.join("user/cache/CUSA01715");
|
||||
let _ = fs::create_dir_all(&cache);
|
||||
|
||||
fs::write(cache.join("0x123.spv"), b"spv").unwrap();
|
||||
fs::write(cache.join("0x123.meta"), b"meta").unwrap();
|
||||
fs::write(cache.join("0x123.key"), b"key").unwrap();
|
||||
fs::write(cache.join("ignore.txt"), b"txt").unwrap();
|
||||
|
||||
let count = count_cached_shaders(&temp_dir);
|
||||
assert_eq!(count, 3);
|
||||
|
||||
let _ = fs::remove_dir_all(&temp_dir);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_link_regional_caches() {
|
||||
let temp_dir = std::env::temp_dir().join("gow3_test_shader_link");
|
||||
let cache = temp_dir.join("user/cache");
|
||||
let cusa1715 = cache.join("CUSA01715");
|
||||
let _ = fs::create_dir_all(&cusa1715);
|
||||
fs::write(cusa1715.join("test.spv"), b"spv").unwrap();
|
||||
|
||||
link_regional_caches(&cache);
|
||||
let cusa1623 = cache.join("CUSA01623");
|
||||
assert!(cusa1623.exists());
|
||||
|
||||
let count = count_cached_shaders(&temp_dir);
|
||||
assert_eq!(count, 1);
|
||||
|
||||
let _ = fs::remove_dir_all(&temp_dir);
|
||||
}
|
||||
}
|
||||
+65
-7
@@ -34,13 +34,16 @@ fn update_xml_patches(base_dir: &Path, target_hz: u32) -> Result<(), String> {
|
||||
if let Ok(content) = fs::read_to_string(path) {
|
||||
let mut new_lines = Vec::new();
|
||||
for line in content.lines() {
|
||||
let low = line.to_lowercase();
|
||||
if (line.contains("Delta-Time")
|
||||
|| line.contains("120 FPS")
|
||||
|| line.contains("144 FPS")
|
||||
|| line.contains("165 FPS")
|
||||
|| line.contains("240 FPS")
|
||||
|| line.contains("60 FPS"))
|
||||
&& line.contains("value=\"")
|
||||
&& low.contains("value=\"")
|
||||
{
|
||||
if let Some(start) = line.find("value=\"") {
|
||||
if let Some(start) = low.find("value=\"") {
|
||||
let prefix = &line[..start + 7];
|
||||
if let Some(end) = line[start + 7..].find('\"') {
|
||||
let suffix = &line[start + 7 + end..];
|
||||
@@ -123,12 +126,14 @@ fn update_run_sh(base_dir: &Path, config: &LauncherConfig) -> Result<(), String>
|
||||
let effective_budget = config.get_effective_vram_budget();
|
||||
replace_or_insert_env(&mut content, "GOW3_GC_BUDGET_MB", &effective_budget.to_string());
|
||||
replace_or_insert_env(&mut content, "GOW3_DMEM_POOL_MB", &config.dmem_mb.to_string());
|
||||
replace_or_insert_env(&mut content, "GOW3_DMEM_MB", &config.dmem_mb.to_string());
|
||||
replace_or_insert_env(&mut content, "GOW3_DEFAULT_ENGINE_FPS", &config.target_fps.to_string());
|
||||
replace_or_insert_env(&mut content, "GOW3_FORCE_READBACK", if config.patch_readbacks { "1" } else { "0" });
|
||||
replace_or_insert_env(&mut content, "GOW3_READBACKS", if config.patch_readbacks { "1" } else { "0" });
|
||||
replace_or_insert_env(&mut content, "GOW3_READBACK_LINEAR", if config.patch_readbacks { "1" } else { "0" });
|
||||
replace_or_insert_env(&mut content, "GOW3_DEFERRED_READBACK", if config.async_readbacks { "1" } else { "0" });
|
||||
replace_or_insert_env(&mut content, "GOW3_STALE_READBACK", if config.async_readbacks { "1" } else { "0" });
|
||||
remove_env_if_present(&mut content, "GOW3_COPY_GPU_BUFFERS");
|
||||
|
||||
let cpu_threads = if config.cached_hardware.cpu_threads > 0 {
|
||||
config.cached_hardware.cpu_threads
|
||||
@@ -139,21 +144,45 @@ fn update_run_sh(base_dir: &Path, config: &LauncherConfig) -> Result<(), String>
|
||||
(2, 1)
|
||||
} else if cpu_threads <= 8 {
|
||||
(4, 2)
|
||||
} else {
|
||||
} else if cpu_threads <= 12 {
|
||||
(6, 4)
|
||||
} else {
|
||||
(8, 4)
|
||||
};
|
||||
replace_or_insert_env(&mut content, "GOW3_PREP_WORKERS", &prep_workers.to_string());
|
||||
replace_or_insert_env(&mut content, "GOW3_COPY_THREADS", ©_threads.to_string());
|
||||
replace_or_insert_env(&mut content, "GOW3_INTERP_INT_FIX", "1");
|
||||
replace_or_insert_env(&mut content, "GOW3_DIRECT_MEMORY_ACCESS", "1");
|
||||
replace_or_insert_env(&mut content, "GOW3_PIPELINE_CACHE", "1");
|
||||
replace_or_insert_env(&mut content, "GOW3_PIPELINE_BINARIES", "1");
|
||||
replace_or_insert_env(&mut content, "GOW3_PARALLEL_WARMUP", "1");
|
||||
replace_or_insert_env(&mut content, "GOW3_BACKGROUND_WARMUP", "1");
|
||||
replace_or_insert_env(&mut content, "GOW3_BACKGROUND_WARMUP", "0");
|
||||
replace_or_insert_env(&mut content, "GOW3_VK_RECORD_THREAD", "1");
|
||||
replace_or_insert_env(&mut content, "GOW3_PRESENT_THREAD", "1");
|
||||
replace_or_insert_env(&mut content, "GOW3_ASYNC_FENCES", "1");
|
||||
replace_or_insert_env(&mut content, "GOW3_ASYNC_SHADERS", "1");
|
||||
replace_or_insert_env(&mut content, "GOW3_FPS_LIMIT", &config.target_fps.to_string());
|
||||
|
||||
// Clean up any deprecated experimental env vars from earlier launches
|
||||
remove_env_if_present(&mut content, "GOW3_STAGING_KEEP_MB");
|
||||
remove_env_if_present(&mut content, "GOW3_COPY_MERGE_KB");
|
||||
remove_env_if_present(&mut content, "GOW3_HOT_PAGES");
|
||||
remove_env_if_present(&mut content, "GOW3_TEXTURE_HELPER");
|
||||
remove_env_if_present(&mut content, "GOW3_DRAW_PIPE");
|
||||
remove_env_if_present(&mut content, "__GL_YIELD");
|
||||
remove_env_if_present(&mut content, "GOW3_FRAMES_AHEAD");
|
||||
remove_env_if_present(&mut content, "radv_zero_vram");
|
||||
|
||||
// Driver Shader Disk Cache & Multithreaded Optimizations (10GB disk cache)
|
||||
replace_or_insert_env(&mut content, "__GL_SHADER_DISK_CACHE", "1");
|
||||
replace_or_insert_env(&mut content, "__GL_SHADER_DISK_CACHE_SIZE", "10737418240");
|
||||
replace_or_insert_env(&mut content, "__GL_SHADER_DISK_CACHE_SKIP_CLEANUP", "1");
|
||||
replace_or_insert_env(&mut content, "__GL_THREADED_OPTIMIZATIONS", "1");
|
||||
replace_or_insert_env(&mut content, "__GL_VRR_ALLOWED", "1");
|
||||
replace_or_insert_env(&mut content, "__GL_MaxFramesAllowed", "1");
|
||||
replace_or_insert_env(&mut content, "MESA_SHADER_CACHE_MAX_SIZE", "10G");
|
||||
replace_or_insert_env(&mut content, "GOW3_ASYNC_SHADERS", "1");
|
||||
replace_or_insert_env(&mut content, "GOW3_FPS_LIMIT", &config.target_fps.to_string());
|
||||
replace_or_insert_env(&mut content, "GOW3_FULL_BARRIERS", "1");
|
||||
replace_or_insert_env(&mut content, "GOW3_FORCE_PATCHES", "1");
|
||||
replace_or_insert_env(&mut content, "GOW3_PREBUILT", "1");
|
||||
@@ -171,12 +200,33 @@ fn update_run_sh(base_dir: &Path, config: &LauncherConfig) -> Result<(), String>
|
||||
let pad_map = config.build_gow3_pad_map();
|
||||
replace_or_insert_env(&mut content, "GOW3_KEY_MAP", &key_map);
|
||||
replace_or_insert_env(&mut content, "GOW3_PAD_MAP", pad_map);
|
||||
replace_or_insert_env(
|
||||
&mut content,
|
||||
"GOW3_HIDE_CURSOR",
|
||||
if config.hide_mouse_cursor { "1" } else { "0" },
|
||||
);
|
||||
remove_env_if_present(&mut content, "LD_PRELOAD");
|
||||
if config.hide_mouse_cursor || config.is_mouse_button_bound() {
|
||||
let input_lib = base_dir.join("bin/lib/libgow3input.so");
|
||||
if input_lib.is_file() {
|
||||
let safe_lib = crate::runner::ensure_safe_preload_lib(base_dir).unwrap_or(input_lib);
|
||||
replace_or_insert_env(&mut content, "LD_PRELOAD", &safe_lib.to_string_lossy());
|
||||
}
|
||||
}
|
||||
replace_or_insert_env(
|
||||
&mut content,
|
||||
"SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS",
|
||||
if config.background_controller_input { "1" } else { "0" },
|
||||
);
|
||||
|
||||
let icon_bmp = base_dir.join("gow3.bmp");
|
||||
let icon_png = base_dir.join("gow3.png");
|
||||
if icon_bmp.is_file() {
|
||||
replace_or_insert_env(&mut content, "GOW3_WINDOW_ICON", &icon_bmp.to_string_lossy());
|
||||
} else if icon_png.is_file() {
|
||||
replace_or_insert_env(&mut content, "GOW3_WINDOW_ICON", &icon_png.to_string_lossy());
|
||||
}
|
||||
|
||||
fs::write(&run_sh, content).map_err(|e| e.to_string())?;
|
||||
Ok(())
|
||||
}
|
||||
@@ -235,7 +285,7 @@ fn update_gow3_ini(base_dir: &Path, config: &LauncherConfig) -> Result<(), Strin
|
||||
deferred_readback=0\n\
|
||||
stale_readback=0\n\
|
||||
async_shaders=1\n\
|
||||
frames_queued=1\n\
|
||||
frames_queued=2\n\
|
||||
readbacks=true\n\
|
||||
readbackLinearImages=true\n\
|
||||
budget=6144\n".to_string()
|
||||
@@ -274,7 +324,7 @@ fn update_gow3_ini(base_dir: &Path, config: &LauncherConfig) -> Result<(), Strin
|
||||
replace_ini_key(&mut content, "budget", &effective_budget.to_string());
|
||||
replace_ini_key(&mut content, "engine_fps", &config.target_fps.to_string());
|
||||
replace_ini_key(&mut content, "fps_limit", &config.target_fps.to_string());
|
||||
replace_ini_key(&mut content, "frames_queued", "1");
|
||||
replace_ini_key(&mut content, "frames_queued", "2");
|
||||
replace_ini_key(&mut content, "vsync", if config.vsync { "1" } else { "0" });
|
||||
replace_ini_key(&mut content, "display_mode", config.display_mode.as_str());
|
||||
|
||||
@@ -366,7 +416,15 @@ fn update_user_config_toml(base_dir: &Path, config: &LauncherConfig) -> Result<(
|
||||
if let Some(end) = content[idx..].find('\n') {
|
||||
let prefix = &content[..idx];
|
||||
let suffix = &content[idx + end..];
|
||||
content = format!("{}vulkan_gc_budget = {}{}", prefix, config.vram_gc_budget_mb, suffix);
|
||||
let effective_budget = config.get_effective_vram_budget();
|
||||
content = format!("{}vulkan_gc_budget = {}{}", prefix, effective_budget, suffix);
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure presentMode is removed so Vulkan uses default FIFO swapchain pacing (eliminating logo black screen blinks)
|
||||
if let Some(idx) = content.find("presentMode =") {
|
||||
if let Some(end) = content[idx..].find('\n') {
|
||||
content.replace_range(idx..=idx + end, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+58
-4
@@ -5,10 +5,46 @@ use std::process::Command;
|
||||
use crate::config::LauncherConfig;
|
||||
use crate::tuner::apply_settings;
|
||||
|
||||
pub const BUILTIN_VERSION: &str = "v1.7";
|
||||
pub const BUILTIN_VERSION: &str = "v2.1";
|
||||
pub const GITHUB_REPO: &str = "ScreamAngel/gow3_launcher";
|
||||
pub const GITHUB_REPO_URL: &str = "https://github.com/ScreamAngel/gow3_launcher.git";
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct GithubReleaseNote {
|
||||
pub tag_name: String,
|
||||
pub title: String,
|
||||
pub published_at: String,
|
||||
pub body: String,
|
||||
}
|
||||
|
||||
pub fn fetch_github_release_notes() -> Result<Vec<GithubReleaseNote>, String> {
|
||||
let url = "https://api.github.com/repos/ScreamAngel/gow3_launcher/releases";
|
||||
let body = http_get_string(url).ok_or_else(|| "GitHub Releases bağlantısı kurulamadı.".to_string())?;
|
||||
|
||||
let val: serde_json::Value = serde_json::from_str(&body).map_err(|e| format!("JSON parse hatası: {}", e))?;
|
||||
let mut notes = Vec::new();
|
||||
|
||||
if let Some(arr) = val.as_array() {
|
||||
for item in arr {
|
||||
let tag = item["tag_name"].as_str().unwrap_or("").to_string();
|
||||
let title = item["name"].as_str().unwrap_or("").to_string();
|
||||
let published_at = item["published_at"].as_str().unwrap_or("").to_string();
|
||||
let body_text = item["body"].as_str().unwrap_or("").to_string();
|
||||
|
||||
if !tag.is_empty() {
|
||||
notes.push(GithubReleaseNote {
|
||||
tag_name: tag,
|
||||
title: if title.is_empty() { "Sürüm Notu".to_string() } else { title },
|
||||
published_at,
|
||||
body: body_text,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(notes)
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct UpdateInfo {
|
||||
pub commit_sha: String,
|
||||
@@ -193,6 +229,7 @@ pub fn check_github_update(
|
||||
_current_commit: &str,
|
||||
current_version: &str,
|
||||
) -> Result<UpdateInfo, String> {
|
||||
crate::log_info!("Checking updates for running launcher {} (repo: {})...", current_version, GITHUB_REPO);
|
||||
let release_api_url = format!("https://api.github.com/repos/{}/releases/latest", GITHUB_REPO);
|
||||
let commit_api_url = format!("https://api.github.com/repos/{}/commits/HEAD", GITHUB_REPO);
|
||||
|
||||
@@ -300,6 +337,14 @@ pub fn check_github_update(
|
||||
// Prevents redundant re-downloads when already running v1.7.
|
||||
let is_new = is_newer_version || has_missing_files;
|
||||
|
||||
crate::log_info!(
|
||||
"Update check complete: remote tag={:?}, is_newer_version={}, has_missing_files={} -> is_new={}",
|
||||
version_tag,
|
||||
is_newer_version,
|
||||
has_missing_files,
|
||||
is_new
|
||||
);
|
||||
|
||||
Ok(UpdateInfo {
|
||||
commit_sha: remote_sha,
|
||||
commit_message,
|
||||
@@ -417,10 +462,9 @@ mod tests {
|
||||
assert!(info.is_new);
|
||||
}
|
||||
|
||||
// Test with current version v1.7: should NOT report as an update
|
||||
let res_current = check_github_update(Path::new(".."), "test_dummy_sha", "v1.7");
|
||||
// Test with current version (v2.0.2): should NOT report as an update against current GitHub release (v2.0.1)
|
||||
let res_current = check_github_update(Path::new(".."), "test_dummy_sha", BUILTIN_VERSION);
|
||||
if let Ok(info) = res_current {
|
||||
// Because remote release on GitHub is v1.6.1.6, and current is v1.7, and files are present, is_new must be false!
|
||||
assert!(!info.is_new);
|
||||
}
|
||||
}
|
||||
@@ -432,5 +476,15 @@ mod tests {
|
||||
assert_eq!(compare_version_strings("v1.5", "v1.4"), std::cmp::Ordering::Greater);
|
||||
assert_eq!(compare_version_strings("v1.10", "v1.9"), std::cmp::Ordering::Greater);
|
||||
assert_eq!(compare_version_strings("1.4", "v1.4"), std::cmp::Ordering::Equal);
|
||||
assert_eq!(compare_version_strings("v2.2", "v2.1"), std::cmp::Ordering::Greater);
|
||||
assert_eq!(compare_version_strings("v2.1", "v2.1"), std::cmp::Ordering::Equal);
|
||||
assert_eq!(compare_version_strings("v2.0.3", "v2.1"), std::cmp::Ordering::Less);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_fetch_github_release_notes() {
|
||||
if let Ok(notes) = fetch_github_release_notes() {
|
||||
assert!(!notes.is_empty(), "Should fetch at least one release note from GitHub");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,345 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// God of War III Remastered - Windows Input Bridge & Window Manager
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
mod imp {
|
||||
use std::ffi::c_void;
|
||||
use std::sync::atomic::{AtomicBool, AtomicU32, Ordering};
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
|
||||
static HOOK_RUNNING: AtomicBool = AtomicBool::new(false);
|
||||
static GAME_PID: AtomicU32 = AtomicU32::new(0);
|
||||
static HIDE_CURSOR_ENABLED: AtomicBool = AtomicBool::new(false);
|
||||
static HOOK_HANDLE: std::sync::atomic::AtomicIsize = std::sync::atomic::AtomicIsize::new(0);
|
||||
|
||||
type HWND = *mut c_void;
|
||||
type HHOOK = isize;
|
||||
type HINSTANCE = isize;
|
||||
type LRESULT = isize;
|
||||
type WPARAM = usize;
|
||||
type LPARAM = isize;
|
||||
type HOOKPROC = unsafe extern "system" fn(code: i32, wparam: WPARAM, lparam: LPARAM) -> LRESULT;
|
||||
|
||||
const WH_MOUSE_LL: i32 = 14;
|
||||
const WM_LBUTTONDOWN: usize = 0x0201;
|
||||
const WM_LBUTTONUP: usize = 0x0202;
|
||||
const WM_RBUTTONDOWN: usize = 0x0204;
|
||||
const WM_RBUTTONUP: usize = 0x0205;
|
||||
const WM_MBUTTONDOWN: usize = 0x0207;
|
||||
const WM_MBUTTONUP: usize = 0x0208;
|
||||
const WM_MOUSEWHEEL: usize = 0x020A;
|
||||
const WM_XBUTTONDOWN: usize = 0x020B;
|
||||
const WM_XBUTTONUP: usize = 0x020C;
|
||||
const WM_QUIT: u32 = 0x0012;
|
||||
|
||||
const VK_F13: u8 = 0x7C;
|
||||
const VK_F14: u8 = 0x7D;
|
||||
const VK_F15: u8 = 0x7E;
|
||||
const VK_F16: u8 = 0x7F;
|
||||
const VK_F17: u8 = 0x80;
|
||||
const VK_F18: u8 = 0x81;
|
||||
const VK_F19: u8 = 0x82;
|
||||
|
||||
// Direct Windows hardware scan codes for F13-F19 mapped by SDL3's windows_scancode_table:
|
||||
// 0x64 -> SDL_SCANCODE_F13 (Square / Light Attack)
|
||||
// 0x65 -> SDL_SCANCODE_F14 (Triangle / Heavy Attack)
|
||||
// 0x66 -> SDL_SCANCODE_F15 (Circle / Grab)
|
||||
// 0x67 -> SDL_SCANCODE_F16 (Cross / Jump)
|
||||
// 0x68 -> SDL_SCANCODE_F17
|
||||
// 0x69 -> SDL_SCANCODE_F18
|
||||
// 0x6A -> SDL_SCANCODE_F19
|
||||
const SCAN_F13: u8 = 0x64;
|
||||
const SCAN_F14: u8 = 0x65;
|
||||
const SCAN_F15: u8 = 0x66;
|
||||
const SCAN_F16: u8 = 0x67;
|
||||
const SCAN_F17: u8 = 0x68;
|
||||
const SCAN_F18: u8 = 0x69;
|
||||
const SCAN_F19: u8 = 0x6A;
|
||||
|
||||
const KEYEVENTF_KEYUP: u32 = 0x0002;
|
||||
const SW_SHOW: i32 = 5;
|
||||
const GA_ROOT: u32 = 2;
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy)]
|
||||
struct POINT {
|
||||
x: i32,
|
||||
y: i32,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
struct MSLLHOOKSTRUCT {
|
||||
pt: POINT,
|
||||
mouse_data: u32,
|
||||
flags: u32,
|
||||
time: u32,
|
||||
extra_info: usize,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
struct MSG {
|
||||
hwnd: HWND,
|
||||
message: u32,
|
||||
w_param: WPARAM,
|
||||
l_param: LPARAM,
|
||||
time: u32,
|
||||
pt: POINT,
|
||||
}
|
||||
|
||||
#[link(name = "user32")]
|
||||
#[link(name = "winmm")]
|
||||
unsafe extern "system" {
|
||||
fn SetWindowsHookExA(id_hook: i32, lpfn: HOOKPROC, h_mod: HINSTANCE, dw_thread_id: u32) -> HHOOK;
|
||||
fn UnhookWindowsHookEx(hhk: HHOOK) -> i32;
|
||||
fn CallNextHookEx(hhk: HHOOK, n_code: i32, w_param: WPARAM, l_param: LPARAM) -> LRESULT;
|
||||
fn GetForegroundWindow() -> HWND;
|
||||
fn GetWindowThreadProcessId(hwnd: HWND, lpdw_process_id: *mut u32) -> u32;
|
||||
fn GetWindowTextA(hwnd: HWND, lp_string: *mut u8, n_max_count: i32) -> i32;
|
||||
fn keybd_event(b_vk: u8, b_scan: u8, dw_flags: u32, dw_extra_info: usize);
|
||||
fn GetMessageA(lp_msg: *mut MSG, hwnd: HWND, w_msg_filter_min: u32, w_msg_filter_max: u32) -> i32;
|
||||
fn PostThreadMessageA(id_thread: u32, msg: u32, w_param: WPARAM, l_param: LPARAM) -> i32;
|
||||
fn GetCurrentThreadId() -> u32;
|
||||
fn ShowWindow(hwnd: HWND, n_cmd_show: i32) -> i32;
|
||||
fn SetForegroundWindow(hwnd: HWND) -> i32;
|
||||
fn BringWindowToTop(hwnd: HWND) -> i32;
|
||||
fn EnumWindows(lp_enum_func: unsafe extern "system" fn(hwnd: HWND, lparam: LPARAM) -> i32, lparam: LPARAM) -> i32;
|
||||
fn IsWindowVisible(hwnd: HWND) -> i32;
|
||||
fn timeBeginPeriod(u_period: u32) -> u32;
|
||||
fn timeEndPeriod(u_period: u32) -> u32;
|
||||
fn WindowFromPoint(point: POINT) -> HWND;
|
||||
fn GetAncestor(hwnd: HWND, ga_flags: u32) -> HWND;
|
||||
fn AttachThreadInput(id_attach: u32, id_attach_to: u32, f_attach: i32) -> i32;
|
||||
}
|
||||
|
||||
unsafe fn is_game_window(hwnd: HWND) -> bool {
|
||||
if hwnd.is_null() {
|
||||
return false;
|
||||
}
|
||||
let my_pid = std::process::id();
|
||||
let expected_pid = GAME_PID.load(Ordering::SeqCst);
|
||||
let mut win_pid: u32 = 0;
|
||||
unsafe {
|
||||
GetWindowThreadProcessId(hwnd, &mut win_pid);
|
||||
}
|
||||
if win_pid == my_pid {
|
||||
return false; // Asla launcher penceresiyle eşleşme!
|
||||
}
|
||||
if expected_pid > 0 && win_pid == expected_pid {
|
||||
return true;
|
||||
}
|
||||
|
||||
let mut title_buf = [0u8; 128];
|
||||
let len = unsafe { GetWindowTextA(hwnd, title_buf.as_mut_ptr(), 127) };
|
||||
if len > 0 {
|
||||
let title = String::from_utf8_lossy(&title_buf[..len as usize]);
|
||||
if title.contains("Launcher") || title.contains("gow3-launcher") {
|
||||
return false;
|
||||
}
|
||||
if title.contains("God of War") || title.contains("gow3") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
unsafe extern "system" fn low_level_mouse_proc(code: i32, wparam: WPARAM, lparam: LPARAM) -> LRESULT {
|
||||
if code >= 0 {
|
||||
unsafe {
|
||||
let fg = GetForegroundWindow();
|
||||
let p_mouse = &*(lparam as *const MSLLHOOKSTRUCT);
|
||||
let hwnd_pt = WindowFromPoint(p_mouse.pt);
|
||||
let is_fg = is_game_window(fg);
|
||||
let is_pt = is_game_window(hwnd_pt) || is_game_window(GetAncestor(hwnd_pt, GA_ROOT));
|
||||
|
||||
if is_fg || is_pt {
|
||||
match wparam {
|
||||
WM_LBUTTONDOWN => {
|
||||
keybd_event(VK_F13, SCAN_F13, 0, 0);
|
||||
}
|
||||
WM_LBUTTONUP => {
|
||||
keybd_event(VK_F13, SCAN_F13, KEYEVENTF_KEYUP, 0);
|
||||
}
|
||||
WM_RBUTTONDOWN => {
|
||||
keybd_event(VK_F14, SCAN_F14, 0, 0);
|
||||
}
|
||||
WM_RBUTTONUP => {
|
||||
keybd_event(VK_F14, SCAN_F14, KEYEVENTF_KEYUP, 0);
|
||||
}
|
||||
WM_MBUTTONDOWN => {
|
||||
keybd_event(VK_F15, SCAN_F15, 0, 0);
|
||||
}
|
||||
WM_MBUTTONUP => {
|
||||
keybd_event(VK_F15, SCAN_F15, KEYEVENTF_KEYUP, 0);
|
||||
}
|
||||
WM_XBUTTONDOWN => {
|
||||
let xbtn = (p_mouse.mouse_data >> 16) as u16;
|
||||
if xbtn == 1 {
|
||||
keybd_event(VK_F16, SCAN_F16, 0, 0);
|
||||
} else if xbtn == 2 {
|
||||
keybd_event(VK_F17, SCAN_F17, 0, 0);
|
||||
}
|
||||
}
|
||||
WM_XBUTTONUP => {
|
||||
let xbtn = (p_mouse.mouse_data >> 16) as u16;
|
||||
if xbtn == 1 {
|
||||
keybd_event(VK_F16, SCAN_F16, KEYEVENTF_KEYUP, 0);
|
||||
} else if xbtn == 2 {
|
||||
keybd_event(VK_F17, SCAN_F17, KEYEVENTF_KEYUP, 0);
|
||||
}
|
||||
}
|
||||
WM_MOUSEWHEEL => {
|
||||
let delta = (p_mouse.mouse_data >> 16) as i16;
|
||||
if delta > 0 {
|
||||
keybd_event(VK_F18, SCAN_F18, 0, 0);
|
||||
keybd_event(VK_F18, SCAN_F18, KEYEVENTF_KEYUP, 0);
|
||||
} else if delta < 0 {
|
||||
keybd_event(VK_F19, SCAN_F19, 0, 0);
|
||||
keybd_event(VK_F19, SCAN_F19, KEYEVENTF_KEYUP, 0);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let hhk = HOOK_HANDLE.load(Ordering::SeqCst);
|
||||
unsafe { CallNextHookEx(hhk, code, wparam, lparam) }
|
||||
}
|
||||
|
||||
struct EnumParam {
|
||||
target_pid: u32,
|
||||
found_hwnd: HWND,
|
||||
}
|
||||
|
||||
unsafe extern "system" fn enum_win_proc(hwnd: HWND, lparam: LPARAM) -> i32 {
|
||||
let p = unsafe { &mut *(lparam as *mut EnumParam) };
|
||||
let mut pid: u32 = 0;
|
||||
unsafe {
|
||||
GetWindowThreadProcessId(hwnd, &mut pid);
|
||||
if pid == std::process::id() {
|
||||
return 1; // Launcher penceresini asla hedef alma!
|
||||
}
|
||||
if IsWindowVisible(hwnd) != 0 {
|
||||
if p.target_pid > 0 && pid == p.target_pid {
|
||||
p.found_hwnd = hwnd;
|
||||
return 0; // Hedef oyun PID'sine ait görünür pencere bulundu!
|
||||
} else if p.target_pid == 0 && is_game_window(hwnd) {
|
||||
p.found_hwnd = hwnd;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
1 // continue
|
||||
}
|
||||
|
||||
pub fn find_game_hwnd(pid: u32) -> Option<HWND> {
|
||||
let mut param = EnumParam {
|
||||
target_pid: pid,
|
||||
found_hwnd: std::ptr::null_mut(),
|
||||
};
|
||||
unsafe {
|
||||
EnumWindows(enum_win_proc, &mut param as *mut _ as LPARAM);
|
||||
}
|
||||
if !param.found_hwnd.is_null() {
|
||||
Some(param.found_hwnd)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn bring_game_window_to_front(pid: u32) {
|
||||
if let Some(hwnd) = find_game_hwnd(pid) {
|
||||
unsafe {
|
||||
let cur_fg = GetForegroundWindow();
|
||||
let cur_thread = GetCurrentThreadId();
|
||||
let mut fg_pid = 0u32;
|
||||
let fg_thread = GetWindowThreadProcessId(cur_fg, &mut fg_pid);
|
||||
if fg_thread != 0 && cur_thread != fg_thread {
|
||||
AttachThreadInput(cur_thread, fg_thread, 1);
|
||||
}
|
||||
ShowWindow(hwnd, SW_SHOW);
|
||||
BringWindowToTop(hwnd);
|
||||
SetForegroundWindow(hwnd);
|
||||
if fg_thread != 0 && cur_thread != fg_thread {
|
||||
AttachThreadInput(cur_thread, fg_thread, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct WinInputGuard {
|
||||
thread_id: u32,
|
||||
}
|
||||
|
||||
impl Drop for WinInputGuard {
|
||||
fn drop(&mut self) {
|
||||
HOOK_RUNNING.store(false, Ordering::SeqCst);
|
||||
if self.thread_id != 0 {
|
||||
unsafe {
|
||||
PostThreadMessageA(self.thread_id, WM_QUIT, 0, 0);
|
||||
timeEndPeriod(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn start_mouse_hook(pid: u32, hide_cursor: bool) -> WinInputGuard {
|
||||
GAME_PID.store(pid, Ordering::SeqCst);
|
||||
HIDE_CURSOR_ENABLED.store(hide_cursor, Ordering::SeqCst);
|
||||
HOOK_RUNNING.store(true, Ordering::SeqCst);
|
||||
|
||||
let (tx, rx) = std::sync::mpsc::channel();
|
||||
|
||||
thread::spawn(move || {
|
||||
unsafe {
|
||||
timeBeginPeriod(1);
|
||||
|
||||
let tid = GetCurrentThreadId();
|
||||
let hook = SetWindowsHookExA(WH_MOUSE_LL, low_level_mouse_proc, 0, 0);
|
||||
HOOK_HANDLE.store(hook, Ordering::SeqCst);
|
||||
let _ = tx.send(tid);
|
||||
|
||||
if hook != 0 {
|
||||
let mut msg: MSG = std::mem::zeroed();
|
||||
while HOOK_RUNNING.load(Ordering::SeqCst) && GetMessageA(&mut msg, std::ptr::null_mut(), 0, 0) > 0 {
|
||||
// Hook message loop
|
||||
}
|
||||
UnhookWindowsHookEx(hook);
|
||||
HOOK_HANDLE.store(0, Ordering::SeqCst);
|
||||
}
|
||||
timeEndPeriod(1);
|
||||
}
|
||||
});
|
||||
|
||||
let thread_id = rx.recv_timeout(Duration::from_millis(500)).unwrap_or(0);
|
||||
WinInputGuard { thread_id }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
pub use imp::*;
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
mod stub {
|
||||
pub struct WinInputGuard;
|
||||
pub fn start_mouse_hook(_pid: u32, _hide_cursor: bool) -> WinInputGuard {
|
||||
WinInputGuard
|
||||
}
|
||||
pub fn bring_game_window_to_front(pid: u32) {
|
||||
if pid > 0 {
|
||||
let _ = std::process::Command::new("hyprctl")
|
||||
.args(["dispatch", "focuswindow", &format!("pid:{}", pid)])
|
||||
.output();
|
||||
let _ = std::process::Command::new("xdotool")
|
||||
.args(["search", "--pid", &pid.to_string(), "windowactivate"])
|
||||
.output();
|
||||
}
|
||||
}
|
||||
pub fn find_game_hwnd(_pid: u32) -> Option<isize> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
pub use stub::*;
|
||||
+42
-16
@@ -2,9 +2,12 @@
|
||||
"first_launch_done": true,
|
||||
"language": "tr",
|
||||
"game_dir": "/home/screamangel/İndirilenler/GOW3 Emu Linux/CUSA01715",
|
||||
"target_fps": 60,
|
||||
"target_fps": 144,
|
||||
"patch_delta_time": true,
|
||||
"patch_readbacks": true,
|
||||
"async_readbacks": true,
|
||||
"launch_while_compiling_shaders": false,
|
||||
"show_shader_compile_rage_meter": false,
|
||||
"skip_cinematics": true,
|
||||
"use_gamemode": true,
|
||||
"vram_gc_budget_mb": 6144,
|
||||
@@ -13,28 +16,51 @@
|
||||
"gpu_name": "NVIDIA GeForce RTX 4070 Laptop GPU",
|
||||
"vram_mb": 8188,
|
||||
"ram_mb": 15603,
|
||||
"refresh_rate_hz": 144
|
||||
"refresh_rate_hz": 144,
|
||||
"cpu_name": "12th Gen Intel(R) Core(TM) i7-12700H",
|
||||
"cpu_cores": 14,
|
||||
"cpu_threads": 20
|
||||
},
|
||||
"last_git_commit": "0b4abe07acb711848d1b5d72402a9de8c0ad9844",
|
||||
"launcher_version": "v2.1",
|
||||
"discord_rpc_enabled": true,
|
||||
"discord_client_id": "1124351711486689290",
|
||||
"disabled_mods": [
|
||||
"(OPTIONAL) God Armor",
|
||||
"Blades of Athena Damage Boost",
|
||||
"CJ (Mod by Gamer JP)",
|
||||
"game",
|
||||
"Game",
|
||||
"god armor By Richarito v2",
|
||||
"Golden Blades",
|
||||
"DiamondSword v1.1 Author YT @MustopuhGGI",
|
||||
"Skeleton Kratos Skin"
|
||||
],
|
||||
"render_resolution": "native",
|
||||
"fsr_enabled": false,
|
||||
"disable_motion_blur": false,
|
||||
"disable_dof": false,
|
||||
"graphic_preset": "Balanced",
|
||||
"display_mode": "Borderless",
|
||||
"vsync": true,
|
||||
"background_controller_input": false,
|
||||
"hide_mouse_cursor": true,
|
||||
"is_motion_controls_enabled": true,
|
||||
"deadzone_left": 2,
|
||||
"deadzone_right": 2,
|
||||
"keyboard_bindings": {
|
||||
"triangle": "c",
|
||||
"circle": "b",
|
||||
"cross": "n",
|
||||
"square": "v",
|
||||
"triangle": "u",
|
||||
"circle": "j",
|
||||
"cross": "g",
|
||||
"square": "t",
|
||||
"l1": "q",
|
||||
"r1": "u",
|
||||
"l2": "e",
|
||||
"r2": "o",
|
||||
"l3": "x",
|
||||
"r3": "m",
|
||||
"r1": "e",
|
||||
"l2": "z",
|
||||
"r2": "x",
|
||||
"l3": "c",
|
||||
"r3": "v",
|
||||
"options": "enter",
|
||||
"touchpad_center": "space",
|
||||
"touchpad_center": "backspace",
|
||||
"pad_up": "up",
|
||||
"pad_down": "down",
|
||||
"pad_left": "left",
|
||||
@@ -43,9 +69,9 @@
|
||||
"axis_left_x_plus": "d",
|
||||
"axis_left_y_minus": "w",
|
||||
"axis_left_y_plus": "s",
|
||||
"axis_right_x_minus": "j",
|
||||
"axis_right_x_plus": "l",
|
||||
"axis_right_y_minus": "i",
|
||||
"axis_right_y_plus": "k"
|
||||
"axis_right_x_minus": "kp4",
|
||||
"axis_right_x_plus": "kp6",
|
||||
"axis_right_y_minus": "kp8",
|
||||
"axis_right_y_plus": "kp2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"disabled": [
|
||||
"(OPTIONAL) God Armor",
|
||||
"Blades of Athena Damage Boost",
|
||||
"CJ (Mod by Gamer JP)",
|
||||
"game",
|
||||
"Game",
|
||||
"god armor By Richarito v2",
|
||||
"Golden Blades",
|
||||
"DiamondSword v1.1 Author YT @MustopuhGGI",
|
||||
"Skeleton Kratos Skin"
|
||||
],
|
||||
"order": []
|
||||
}
|
||||
+121
-30
@@ -19,24 +19,40 @@ def child(folder, name):
|
||||
return folder / name
|
||||
|
||||
|
||||
KNOWN_GOW3_DIRS = {
|
||||
'exec', 'dutch', 'english', 'french', 'german',
|
||||
'italian', 'polish', 'portuguese', 'russian', 'spanish'
|
||||
}
|
||||
|
||||
|
||||
def content_root(folder):
|
||||
"""(root, prefix): where a mod's files are and the game path they go to, or None.
|
||||
|
||||
Accepted layouts: <mod>/dvdroot_ps4, <mod>/app0/dvdroot_ps4 and one wrapper folder around
|
||||
either (an archive extracted into a folder of its name)."""
|
||||
Accepted layouts: <mod>/dvdroot_ps4, <mod>/app0/dvdroot_ps4, <mod>/EXEC,
|
||||
<mod>/Game/EXEC, XML patches, and wrapper folders around them."""
|
||||
folder = Path(folder)
|
||||
if not folder.is_dir():
|
||||
return None
|
||||
for wrapper in ('', 'app0'):
|
||||
base = child(folder, wrapper) if wrapper else folder
|
||||
dvdroot = child(base, 'dvdroot_ps4')
|
||||
if dvdroot.is_dir():
|
||||
return base, ''
|
||||
entries = [e for e in folder.iterdir() if not e.name.startswith('.')]
|
||||
folders = [e for e in entries if e.is_dir()]
|
||||
if len(folders) == 1 and not [e for e in entries if e.is_file() and
|
||||
e.suffix.casefold() not in ('.txt', '.md', '.jpg', '.png', '.ini')]:
|
||||
return content_root(folders[0])
|
||||
if folder.name.casefold() in ('gow3-windows', 'gow3-linux') or (folder / 'run.py').is_file():
|
||||
return None
|
||||
|
||||
candidates = [folder]
|
||||
for _ in range(3):
|
||||
next_candidates = []
|
||||
for cand in candidates:
|
||||
if not cand.is_dir():
|
||||
continue
|
||||
if child(cand, 'dvdroot_ps4').is_dir():
|
||||
return cand, ''
|
||||
for d in KNOWN_GOW3_DIRS:
|
||||
if child(cand, d).is_dir():
|
||||
return cand, ''
|
||||
if list(cand.glob('*.xml')) or child(cand, 'patches').is_dir():
|
||||
return cand, ''
|
||||
for sub in cand.iterdir():
|
||||
if sub.is_dir() and not sub.name.startswith('.'):
|
||||
next_candidates.append(sub)
|
||||
candidates = next_candidates
|
||||
return None
|
||||
|
||||
|
||||
@@ -67,10 +83,12 @@ def selected(root, config):
|
||||
|
||||
|
||||
def mod_files(folder):
|
||||
"""(game path, source) of every file a mod replaces or adds under dvdroot_ps4."""
|
||||
"""(game path, source) of every file a mod replaces or adds under the game root."""
|
||||
layout = content_root(folder)
|
||||
if not layout:
|
||||
raise ValueError(f'{folder}: expected dvdroot_ps4 (or chr/, parts/, ...) inside the mod folder')
|
||||
if list(Path(folder).rglob('*.xml')):
|
||||
return
|
||||
raise ValueError(f'{folder}: expected EXEC/ or dvdroot_ps4/ inside the mod folder')
|
||||
root, prefix = layout
|
||||
root = root.resolve()
|
||||
for directory, folders, files in os.walk(root, followlinks=False):
|
||||
@@ -81,14 +99,24 @@ def mod_files(folder):
|
||||
for name in sorted(files):
|
||||
source = directory / name
|
||||
relative = Path(prefix) / source.relative_to(root) if prefix else source.relative_to(root)
|
||||
# Readme/metadata stay outside the mounted game. This loader handles assets;
|
||||
# executable patches use the existing patch compiler, with address validation.
|
||||
if relative.parts[0].casefold() != 'dvdroot_ps4':
|
||||
if relative.parts[0].casefold() in ('eboot.bin', 'sce_module', 'sce_sys'):
|
||||
# Skip documentation / metadata at the mod root
|
||||
if len(relative.parts) == 1:
|
||||
if source.suffix.casefold() in ('.txt', '.md', '.json', '.jpg', '.png', '.ini'):
|
||||
continue
|
||||
# Strip packaging wrapper prefixes (app0, dvdroot_ps4, game) so files align with the game root
|
||||
while len(relative.parts) > 1 and relative.parts[0].casefold() in ('app0', 'dvdroot_ps4', 'game'):
|
||||
relative = Path(*relative.parts[1:])
|
||||
|
||||
# Skip patch XML files in mod folder (handled by patches.py)
|
||||
if source.suffix.casefold() == '.xml':
|
||||
continue
|
||||
|
||||
if relative.parts[0].casefold() in ('eboot.bin', 'sce_module', 'sce_sys'):
|
||||
if relative.parts[0].casefold() in ('eboot.bin', 'sce_module'):
|
||||
raise ValueError(f'Executable/system replacement is unsupported: {source}')
|
||||
continue
|
||||
if not source.is_file():
|
||||
raise ValueError(f'Not a regular mod file: {source}')
|
||||
continue
|
||||
yield relative, source
|
||||
|
||||
|
||||
@@ -123,6 +151,16 @@ LINKED = {}
|
||||
|
||||
|
||||
def make_link(link, target):
|
||||
if link.is_symlink() or link.is_file():
|
||||
try:
|
||||
link.unlink()
|
||||
except OSError:
|
||||
pass
|
||||
elif link.is_dir():
|
||||
try:
|
||||
remove_link(link)
|
||||
except OSError:
|
||||
pass
|
||||
try:
|
||||
link.symlink_to(target, target_is_directory=target.is_dir())
|
||||
return
|
||||
@@ -131,13 +169,19 @@ def make_link(link, target):
|
||||
raise
|
||||
if target.is_dir():
|
||||
import _winapi
|
||||
_winapi.CreateJunction(str(target), str(link))
|
||||
try:
|
||||
_winapi.CreateJunction(str(target), str(link))
|
||||
except OSError:
|
||||
# Fallback if junction creation fails across volumes or permissions
|
||||
shutil.copytree(target, link, dirs_exist_ok=True)
|
||||
else:
|
||||
try:
|
||||
os.link(target, link)
|
||||
except OSError:
|
||||
shutil.copy2(target, link)
|
||||
LINKED[str(link)] = target
|
||||
p_str = str(link)
|
||||
LINKED[p_str] = target
|
||||
LINKED[p_str.casefold()] = target
|
||||
|
||||
|
||||
def symlinks_work(directory):
|
||||
@@ -152,19 +196,52 @@ def symlinks_work(directory):
|
||||
|
||||
|
||||
def is_link(path):
|
||||
return path.is_symlink() or str(path) in LINKED or (hasattr(path, 'is_junction') and path.is_junction())
|
||||
p_str = str(path)
|
||||
if path.is_symlink():
|
||||
return True
|
||||
if p_str in LINKED or p_str.casefold() in LINKED:
|
||||
return True
|
||||
if hasattr(path, 'is_junction') and path.is_junction():
|
||||
return True
|
||||
if os.name == 'nt':
|
||||
try:
|
||||
import stat
|
||||
mode = os.lstat(path).st_mode
|
||||
if stat.S_ISLNK(mode):
|
||||
return True
|
||||
except OSError:
|
||||
pass
|
||||
return False
|
||||
|
||||
|
||||
def link_target(path):
|
||||
return LINKED.get(str(path)) or path.resolve(strict=True)
|
||||
p_str = str(path)
|
||||
return LINKED.get(p_str) or LINKED.get(p_str.casefold()) or path.resolve(strict=True)
|
||||
|
||||
|
||||
def remove_link(path):
|
||||
if hasattr(path, 'is_junction') and path.is_junction():
|
||||
os.rmdir(path)
|
||||
else:
|
||||
path.unlink()
|
||||
LINKED.pop(str(path), None)
|
||||
p_str = str(path)
|
||||
try:
|
||||
if path.is_symlink():
|
||||
path.unlink()
|
||||
elif hasattr(path, 'is_junction') and path.is_junction():
|
||||
os.rmdir(path)
|
||||
elif path.is_dir():
|
||||
os.rmdir(path)
|
||||
else:
|
||||
path.unlink()
|
||||
except OSError:
|
||||
try:
|
||||
if path.is_symlink():
|
||||
path.unlink()
|
||||
elif os.path.isdir(path):
|
||||
os.rmdir(path)
|
||||
else:
|
||||
path.unlink()
|
||||
except OSError:
|
||||
pass
|
||||
LINKED.pop(p_str, None)
|
||||
LINKED.pop(p_str.casefold(), None)
|
||||
|
||||
|
||||
def expand(directory):
|
||||
@@ -174,7 +251,7 @@ def expand(directory):
|
||||
if not target.is_dir():
|
||||
raise ValueError(f'File/directory conflict at {directory.name}')
|
||||
remove_link(directory)
|
||||
directory.mkdir()
|
||||
directory.mkdir(exist_ok=True)
|
||||
for entry in target.iterdir():
|
||||
make_link(directory / entry.name, entry)
|
||||
elif directory.exists() and not directory.is_dir():
|
||||
@@ -183,6 +260,17 @@ def expand(directory):
|
||||
directory.mkdir(exist_ok=True)
|
||||
|
||||
|
||||
def on_rm_error(func, path, exc_info):
|
||||
try:
|
||||
os.chmod(path, 0o777)
|
||||
if os.path.isdir(path):
|
||||
os.rmdir(path)
|
||||
else:
|
||||
os.unlink(path)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
||||
def build_overlay(game, out, mods):
|
||||
game = Path(game).resolve(strict=True)
|
||||
replacements = []
|
||||
@@ -201,6 +289,9 @@ def build_overlay(game, out, mods):
|
||||
return game
|
||||
out = Path(out).resolve()
|
||||
out.mkdir(parents=True, exist_ok=True)
|
||||
for old_dir in out.glob('mod-game-*'):
|
||||
if old_dir.is_dir():
|
||||
shutil.rmtree(old_dir, onerror=on_rm_error)
|
||||
if os.name == 'nt' and not symlinks_work(out) and out.drive.casefold() != game.drive.casefold():
|
||||
# Hard links only reach files on the same volume: the overlay goes beside the game.
|
||||
out = game.parent
|
||||
@@ -227,7 +318,7 @@ def build_overlay(game, out, mods):
|
||||
print(f'Mods: {replaced} game files replaced, {added} added', file=sys.stderr)
|
||||
return overlay
|
||||
except BaseException:
|
||||
shutil.rmtree(overlay)
|
||||
shutil.rmtree(overlay, onerror=on_rm_error)
|
||||
raise
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -134,7 +134,7 @@ def external_patches(directory, app_version, exclude, ids):
|
||||
key is "<file name>/<patch name>" (the launcher's selection, patches.json)."""
|
||||
found=[]
|
||||
directory=Path(directory)
|
||||
for path in sorted(directory.glob('*.xml')) if directory.is_dir() else []:
|
||||
for path in sorted(directory.rglob('*.xml')) if directory.is_dir() else []:
|
||||
if path.resolve()==Path(exclude).resolve(): continue # the built-in file (patches/ in a checkout)
|
||||
try:
|
||||
root=ET.parse(path).getroot()
|
||||
@@ -144,7 +144,7 @@ def external_patches(directory, app_version, exclude, ids):
|
||||
file_ids={e.text.strip() for e in root.iter('ID') if e.text}
|
||||
if file_ids and not file_ids&ids: continue
|
||||
for meta in root.iter('Metadata'):
|
||||
if meta.get('AppVer')==app_version and meta.get('AppElf','eboot.bin')=='eboot.bin':
|
||||
if (meta.get('AppVer')==app_version or meta.get('AppVer') in ('01.00', '01.02')) and meta.get('AppElf','eboot.bin')=='eboot.bin':
|
||||
found.append((f'{path.name}/{meta.get("Name")}',path,meta))
|
||||
return found
|
||||
|
||||
|
||||
Binary file not shown.
Reference in new issue
Block a user