From 21ee39ad170070294b9881abb913d914ec575c9d Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Mon, 1 Aug 2022 14:13:26 +0200 Subject: [PATCH] Several changes - made preparations for environment settings - now launcher hides when you launch the game - now `Config::try_get_wine_executable` can return `Some("wine")` - removed old wine and dxvk versions; added new Wine-GE-Proton and GE-Proton builds --- assets/dxvk.json | 36 +- assets/icons/64x64.ico | Bin 16958 -> 0 bytes assets/resources.xml | 3 - assets/ui/main.blp | 5 +- assets/ui/preferences/enhancements.blp | 4 +- assets/ui/preferences/environment.blp | 81 +++++ assets/ui/preferences/general.blp | 2 +- assets/wine.json | 333 +++--------------- src/lib/config/mod.rs | 13 +- src/ui/main.rs | 38 +- .../{enhancements_page.rs => enhancements.rs} | 2 +- src/ui/preferences/environment.rs | 119 +++++++ .../{general_page.rs => general.rs} | 2 +- src/ui/preferences/mod.rs | 18 +- 14 files changed, 324 insertions(+), 332 deletions(-) delete mode 100644 assets/icons/64x64.ico create mode 100644 assets/ui/preferences/environment.blp rename src/ui/preferences/{enhancements_page.rs => enhancements.rs} (99%) create mode 100644 src/ui/preferences/environment.rs rename src/ui/preferences/{general_page.rs => general.rs} (99%) diff --git a/assets/dxvk.json b/assets/dxvk.json index 1fb4875..39e4ffa 100644 --- a/assets/dxvk.json +++ b/assets/dxvk.json @@ -34,19 +34,19 @@ "name": "dxvk-1.9.2", "version": "1.9.2", "uri": "https://github.com/doitsujin/dxvk/releases/download/v1.9.2/dxvk-1.9.2.tar.gz", - "recommended": true + "recommended": false }, { "name": "dxvk-1.9.1", "version": "1.9.1", "uri": "https://github.com/doitsujin/dxvk/releases/download/v1.9.1/dxvk-1.9.1.tar.gz", - "recommended": true + "recommended": false }, { "name": "dxvk-1.9", "version": "1.9", "uri": "https://github.com/doitsujin/dxvk/releases/download/v1.9/dxvk-1.9.tar.gz", - "recommended": true + "recommended": false }, { "name": "dxvk-1.8.1", @@ -71,30 +71,6 @@ "version": "1.7.2", "uri": "https://github.com/doitsujin/dxvk/releases/download/v1.7.2/dxvk-1.7.2.tar.gz", "recommended": false - }, - { - "name": "dxvk-1.7.1", - "version": "1.7.1", - "uri": "https://github.com/doitsujin/dxvk/releases/download/v1.7.1/dxvk-1.7.1.tar.gz", - "recommended": false - }, - { - "name": "dxvk-1.7", - "version": "1.7", - "uri": "https://github.com/doitsujin/dxvk/releases/download/v1.7/dxvk-1.7.tar.gz", - "recommended": false - }, - { - "name": "dxvk-1.6.1", - "version": "1.6.1", - "uri": "https://github.com/doitsujin/dxvk/releases/download/v1.6.1/dxvk-1.6.1.tar.gz", - "recommended": false - }, - { - "name": "dxvk-1.6", - "version": "1.6", - "uri": "https://github.com/doitsujin/dxvk/releases/download/v1.6/dxvk-1.6.tar.gz", - "recommended": false } ], "async": [ @@ -132,19 +108,19 @@ "name": "dxvk-async-1.9.2", "version": "1.9.2", "uri": "https://github.com/Sporif/dxvk-async/releases/download/1.9.4/dxvk-async-1.9.4.tar.gz", - "recommended": true + "recommended": false }, { "name": "dxvk-async-1.9.1", "version": "1.9.1", "uri": "https://github.com/Sporif/dxvk-async/releases/download/1.9.1/dxvk-async-1.9.1.tar.gz", - "recommended": true + "recommended": false }, { "name": "dxvk-async-1.9", "version": "1.9", "uri": "https://github.com/Sporif/dxvk-async/releases/download/1.9/dxvk-async-1.9.tar.gz", - "recommended": true + "recommended": false }, { "name": "dxvk-async-1.8.1", diff --git a/assets/icons/64x64.ico b/assets/icons/64x64.ico deleted file mode 100644 index 8025d8b928100c5ccb551613097eeb25a8076981..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16958 zcmdU0cUV+c`o1bin+7us3|){a#R38<0@8aGkZxC06f98@6)dQz*b#d-uF*tI))uqI z6iuuflbC93u_ne86Qj}h_nr$rn=OCjiR72v%ky#W+`0G6dB6UhbFL({;a^0A#Q!dm zS072zOOoV8;w5Q1NnDqY2uX7FZ>Hu8t^2>Da|cO~+CnKAwQVQa8VpikV4xHb5FjZO z3Q4cmOQx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}Upts#c@Pu;jR$x%aJC@9_UL z^j5j%>E$UI^g5vjdMAzgP)dLwo{Q>(D%JrP7c9mbwRIS?U>$}n+KzEKMRH8oMjYFO zEQNkkUw@59oNwaytI4ZHjOkNZ!%W~h?gG}c8wFnk52)WypAopX7nGnWw*Uis_JXI4 z&3W#>j1u4i{QV^>=4XHOp)fa*j7|BTgK;}Iox=P`B=>$41b4?u%C|H$1hIu9QUAsz z^yhqbbZ`VJlUScHXIW2O-AuiGibb?Szt@o#vF=^KJZdrHg_uiO&KS8t=s`g-b-bCj zv0cO8n85GD-93J^QK>emEiK&z-q6qxsTbd|`u{lGTk3qhLlyT| z+Gs2#Tke4theoA#(<+psUDWDbj(Yo#ht64sHSgcRgw;EtwR62_ZfZ6{t1#c)QD^ma zxQ9Ci^yneak*uWNuNS_IHQ#1IeIDz%Jnkj(H`w0xwliFI(OI2UDa{+rlonCe zj!tIG?tkfENvD4C$dyP8!dP@G?{3Q=BH_6Vvb?0-Q75BeBZ>iEsCVW>@p;1Tp z`UU(wDlX-#+1p=0?bhwEaddu_`(*V78ym@o?`!JmtIZYMvCm?qEy<{blziU7+D3A< zcaj|R+;8_kbVSF-Ns-~<(u2#_#HfXHi0};#{bJiYr!lN%Ce&8iMXt66BRdCsIiLO? zg7%w-8qm436dW8Zsan?EEELNA34QZ^c=7Z(qz)MHqlvlM2=2>nqtRMP+?)EF`~6?L zv4dL&Nz9pOoE_SknJGrcW@LT8Wakb zjkl#=DD@2R`!pz`_YJatwzi(4 zFY#Xdf5X9@mmJ14rcy_LLmS?5-_zE)_(Ep<>CILb#D3WjC=C;|K3h-x!&A{ diff --git a/assets/resources.xml b/assets/resources.xml index c440f83..18718a2 100644 --- a/assets/resources.xml +++ b/assets/resources.xml @@ -3,7 +3,4 @@ images/icon.png - - icons/64x64.ico - diff --git a/assets/ui/main.blp b/assets/ui/main.blp index 6c3a781..616769f 100644 --- a/assets/ui/main.blp +++ b/assets/ui/main.blp @@ -5,8 +5,6 @@ Adw.ApplicationWindow window { default-width: 900; default-height: 600; - icon-name: "resource:///org/app/assets/icons/64x64"; - content: Adw.ToastOverlay toast_overlay { Adw.Leaflet leaflet { can-navigate-back: true; @@ -34,7 +32,7 @@ Adw.ApplicationWindow window { Adw.StatusPage status_page { icon-name: "image-loading-symbolic"; title: "Loading data"; - + vexpand: true; } @@ -92,7 +90,6 @@ Adw.ApplicationWindow window { spacing: 20; Gtk.ProgressBar progress_bar { - text: "Downloading: 37% (3.7 of 10 GB)"; show-text: true; width-request: 360; diff --git a/assets/ui/preferences/enhancements.blp b/assets/ui/preferences/enhancements.blp index 7403748..0ac9c96 100644 --- a/assets/ui/preferences/enhancements.blp +++ b/assets/ui/preferences/enhancements.blp @@ -1,9 +1,7 @@ using Gtk 4.0; using Adw 1; -Adw.PreferencesPage enhanced_page { - title: "Enhancements"; - +Adw.PreferencesPage page { Adw.PreferencesGroup { title: "Wine"; diff --git a/assets/ui/preferences/environment.blp b/assets/ui/preferences/environment.blp new file mode 100644 index 0000000..9c7cbe0 --- /dev/null +++ b/assets/ui/preferences/environment.blp @@ -0,0 +1,81 @@ +using Gtk 4.0; +using Adw 1; + +Adw.PreferencesPage page { + Adw.PreferencesGroup { + title: "New variable"; + + Gtk.Box { + orientation: horizontal; + spacing: 8; + + Gtk.Entry { + placeholder-text: "Name"; + } + + Gtk.Entry { + placeholder-text: "Value"; + hexpand: true; + } + } + + Gtk.Button { + label: "Add"; + + margin-top: 8; + halign: start; + } + } + + Adw.PreferencesGroup { + title: "Variables"; + + Adw.ActionRow { + title: "DXVK_HUD"; + subtitle: "1"; + + Gtk.Button { + icon-name: "user-trash-symbolic"; + valign: center; + + styles ["flat"] + } + } + + Adw.ActionRow { + title: "DXVK_HUD"; + subtitle: "1"; + + Gtk.Button { + icon-name: "user-trash-symbolic"; + valign: center; + + styles ["flat"] + } + } + + Adw.ActionRow { + title: "DXVK_HUD"; + subtitle: "1"; + + Gtk.Button { + icon-name: "user-trash-symbolic"; + valign: center; + + styles ["flat"] + } + } + + Adw.ActionRow { + title: "DXVK_HUD"; + subtitle: "1"; + + Gtk.Button { + icon-name: "user-trash-symbolic"; + valign: center; + + styles ["flat"] + } + } + } +} diff --git a/assets/ui/preferences/general.blp b/assets/ui/preferences/general.blp index cf74028..3a14052 100644 --- a/assets/ui/preferences/general.blp +++ b/assets/ui/preferences/general.blp @@ -1,7 +1,7 @@ using Gtk 4.0; using Adw 1; -Adw.PreferencesPage general_page { +Adw.PreferencesPage page { Adw.PreferencesGroup { title: "General"; diff --git a/assets/wine.json b/assets/wine.json index 9166bf5..14a3a87 100644 --- a/assets/wine.json +++ b/assets/wine.json @@ -3,6 +3,32 @@ "title": "Wine-GE-Proton", "subtitle": null, "versions": [ + { + "family": "Wine-GE-Proton", + "name": "lutris-GE-Proton7-24-x86_64", + "title": "Wine-GE-Proton 7-24", + "uri": "https://github.com/GloriousEggroll/wine-ge-custom/releases/download/GE-Proton7-24/wine-lutris-GE-Proton7-24-x86_64.tar.xz", + "files": { + "wine": "bin/wine64", + "wineserver": "bin/wineserver", + "wineboot": "bin/wineboot", + "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" + }, + "recommended": true + }, + { + "family": "Wine-GE-Proton", + "name": "lutris-GE-Proton7-23-x86_64", + "title": "Wine-GE-Proton 7-23", + "uri": "https://github.com/GloriousEggroll/wine-ge-custom/releases/download/GE-Proton7-23/wine-lutris-GE-Proton7-23-x86_64.tar.xz", + "files": { + "wine": "bin/wine64", + "wineserver": "bin/wineserver", + "wineboot": "bin/wineboot", + "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" + }, + "recommended": true + }, { "family": "Wine-GE-Proton", "name": "lutris-GE-Proton7-22-x86_64", @@ -66,7 +92,7 @@ "wineboot": "bin/wineboot", "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" }, - "recommended": true + "recommended": false }, { "family": "Wine-GE-Proton", @@ -79,7 +105,7 @@ "wineboot": "bin/wineboot", "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" }, - "recommended": true + "recommended": false }, { "family": "Wine-GE-Proton", @@ -119,123 +145,6 @@ "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" }, "recommended": false - }, - { - "family": "Wine-GE-Proton", - "name": "lutris-GE-Proton7-9-x86_64", - "title": "Wine-GE-Proton 7-9", - "uri": "https://github.com/GloriousEggroll/wine-ge-custom/releases/download/GE-Proton7-9/wine-lutris-GE-Proton7-9-x86_64.tar.xz", - "files": { - "wine": "bin/wine64", - "wineserver": "bin/wineserver", - "wineboot": "bin/wineboot", - "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "Wine-GE-Proton", - "name": "lutris-GE-Proton7-8-x86_64", - "title": "Wine-GE-Proton 7-8", - "uri": "https://github.com/GloriousEggroll/wine-ge-custom/releases/download/GE-Proton7-8/wine-lutris-GE-Proton7-8-x86_64.tar.xz", - "files": { - "wine": "bin/wine64", - "wineserver": "bin/wineserver", - "wineboot": "bin/wineboot", - "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "Wine-GE-Proton", - "name": "lutris-GE-Proton7-7-x86_64", - "title": "Wine-GE-Proton 7-7", - "uri": "https://github.com/GloriousEggroll/wine-ge-custom/releases/download/GE-Proton7-7/wine-lutris-GE-Proton7-7-x86_64.tar.xz", - "files": { - "wine": "bin/wine64", - "wineserver": "bin/wineserver", - "wineboot": "bin/wineboot", - "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "Wine-GE-Proton", - "name": "lutris-GE-Proton7-6-x86_64", - "title": "Wine-GE-Proton 7-6", - "uri": "https://github.com/GloriousEggroll/wine-ge-custom/releases/download/GE-Proton7-6/wine-lutris-GE-Proton7-6-x86_64.tar.xz", - "files": { - "wine": "bin/wine64", - "wineserver": "bin/wineserver", - "wineboot": "bin/wineboot", - "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "Wine-GE-Proton", - "name": "lutris-GE-Proton7-5-x86_64", - "title": "Wine-GE-Proton 7-5", - "uri": "https://github.com/GloriousEggroll/wine-ge-custom/releases/download/GE-Proton7-5/wine-lutris-GE-Proton7-5-x86_64.tar.xz", - "files": { - "wine": "bin/wine64", - "wineserver": "bin/wineserver", - "wineboot": "bin/wineboot", - "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "Wine-GE-Proton", - "name": "lutris-GE-Proton7-4-x86_64", - "title": "Wine-GE-Proton 7-4", - "uri": "https://github.com/GloriousEggroll/wine-ge-custom/releases/download/GE-Proton7-4/wine-lutris-GE-Proton7-4-x86_64.tar.xz", - "files": { - "wine": "bin/wine64", - "wineserver": "bin/wineserver", - "wineboot": "bin/wineboot", - "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "Wine-GE-Proton", - "name": "lutris-GE-Proton7-3-x86_64", - "title": "Wine-GE-Proton 7-3", - "uri": "https://github.com/GloriousEggroll/wine-ge-custom/releases/download/GE-Proton7-3/wine-lutris-GE-Proton7-3-x86_64.tar.xz", - "files": { - "wine": "bin/wine64", - "wineserver": "bin/wineserver", - "wineboot": "bin/wineboot", - "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "Wine-GE-Proton", - "name": "lutris-GE-Proton7-2-x86_64", - "title": "Wine-GE-Proton 7-2", - "uri": "https://github.com/GloriousEggroll/wine-ge-custom/releases/download/GE-Proton7-2/wine-lutris-GE-Proton7-2-x86_64.tar.xz", - "files": { - "wine": "bin/wine64", - "wineserver": "bin/wineserver", - "wineboot": "bin/wineboot", - "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "Wine-GE-Proton", - "name": "lutris-GE-Proton7-1-x86_64", - "title": "Wine-GE-Proton 7-1", - "uri": "https://github.com/GloriousEggroll/wine-ge-custom/releases/download/GE-Proton7-1/wine-lutris-GE-Proton7-1-x86_64.tar.xz", - "files": { - "wine": "bin/wine64", - "wineserver": "bin/wineserver", - "wineboot": "bin/wineboot", - "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false } ] }, @@ -243,6 +152,32 @@ "title": "GE-Proton", "subtitle": "This version includes its own DXVK builds and you can use DXVK_ASYNC variable", "versions": [ + { + "family": "GE-Proton", + "name": "GE-Proton7-28", + "title": "GE-Proton 7-28", + "uri": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton7-28/GE-Proton7-28.tar.gz", + "files": { + "wine": "files/bin/wine64", + "wineserver": "files/bin/wineserver", + "wineboot": "files/bin/wineboot", + "winecfg": "files/lib64/wine/x86_64-windows/winecfg.exe" + }, + "recommended": true + }, + { + "family": "GE-Proton", + "name": "GE-Proton7-27", + "title": "GE-Proton 7-27", + "uri": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton7-27/GE-Proton7-27.tar.gz", + "files": { + "wine": "files/bin/wine64", + "wineserver": "files/bin/wineserver", + "wineboot": "files/bin/wineboot", + "winecfg": "files/lib64/wine/x86_64-windows/winecfg.exe" + }, + "recommended": true + }, { "family": "GE-Proton", "name": "GE-Proton7-26", @@ -332,7 +267,7 @@ "wineboot": "files/bin/wineboot", "winecfg": "files/lib64/wine/x86_64-windows/winecfg.exe" }, - "recommended": true + "recommended": false }, { "family": "GE-Proton", @@ -345,7 +280,7 @@ "wineboot": "files/bin/wineboot", "winecfg": "files/lib64/wine/x86_64-windows/winecfg.exe" }, - "recommended": true + "recommended": false }, { "family": "GE-Proton", @@ -372,123 +307,6 @@ "winecfg": "files/lib64/wine/x86_64-windows/winecfg.exe" }, "recommended": false - }, - { - "family": "GE-Proton", - "name": "GE-Proton7-9", - "title": "GE-Proton 7-9", - "uri": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton7-9/GE-Proton7-9.tar.gz", - "files": { - "wine": "files/bin/wine64", - "wineserver": "files/bin/wineserver", - "wineboot": "files/bin/wineboot", - "winecfg": "files/lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "GE-Proton", - "name": "GE-Proton7-8", - "title": "GE-Proton 7-8", - "uri": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton7-8/GE-Proton7-8.tar.gz", - "files": { - "wine": "files/bin/wine64", - "wineserver": "files/bin/wineserver", - "wineboot": "files/bin/wineboot", - "winecfg": "files/lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "GE-Proton", - "name": "GE-Proton7-7", - "title": "GE-Proton 7-7", - "uri": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton7-7/GE-Proton7-7.tar.gz", - "files": { - "wine": "files/bin/wine64", - "wineserver": "files/bin/wineserver", - "wineboot": "files/bin/wineboot", - "winecfg": "files/lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "GE-Proton", - "name": "GE-Proton7-6", - "title": "GE-Proton 7-6", - "uri": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton7-6/GE-Proton7-6.tar.gz", - "files": { - "wine": "files/bin/wine64", - "wineserver": "files/bin/wineserver", - "wineboot": "files/bin/wineboot", - "winecfg": "files/lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "GE-Proton", - "name": "GE-Proton7-5", - "title": "GE-Proton 7-5", - "uri": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton7-5/GE-Proton7-5.tar.gz", - "files": { - "wine": "files/bin/wine64", - "wineserver": "files/bin/wineserver", - "wineboot": "files/bin/wineboot", - "winecfg": "files/lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "GE-Proton", - "name": "GE-Proton7-4", - "title": "GE-Proton 7-4", - "uri": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton7-4/GE-Proton7-4.tar.gz", - "files": { - "wine": "files/bin/wine64", - "wineserver": "files/bin/wineserver", - "wineboot": "files/bin/wineboot", - "winecfg": "files/lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "GE-Proton", - "name": "GE-Proton7-3", - "title": "GE-Proton 7-3", - "uri": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton7-3/GE-Proton7-3.tar.gz", - "files": { - "wine": "files/bin/wine64", - "wineserver": "files/bin/wineserver", - "wineboot": "files/bin/wineboot", - "winecfg": "files/lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "GE-Proton", - "name": "GE-Proton7-2", - "title": "GE-Proton 7-2", - "uri": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton7-2/GE-Proton7-2.tar.gz", - "files": { - "wine": "dist/bin/wine64", - "wineserver": "dist/bin/wineserver", - "wineboot": "files/bin/wineboot", - "winecfg": "dist/lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "GE-Proton", - "name": "GE-Proton7-1", - "title": "GE-Proton 7-1", - "uri": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton7-1/GE-Proton7-1.tar.gz", - "files": { - "wine": "dist/bin/wine64", - "wineserver": "dist/bin/wineserver", - "wineboot": "files/bin/wineboot", - "winecfg": "dist/lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false } ] }, @@ -709,45 +527,6 @@ "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" }, "recommended": false - }, - { - "family": "Lutris", - "name": "lutris-6.13-3-x86_64", - "title": "Lutris 6.13-3", - "uri": "https://github.com/lutris/wine/releases/download/lutris-6.13-3/wine-lutris-6.13-3-x86_64.tar.xz", - "files": { - "wine": "bin/wine64", - "wineserver": "bin/wineserver", - "wineboot": "bin/wineboot", - "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "Lutris", - "name": "lutris-6.13-2-x86_64", - "title": "Lutris 6.13-2", - "uri": "https://github.com/lutris/wine/releases/download/lutris-6.13-2/wine-lutris-6.13-2-x86_64.tar.xz", - "files": { - "wine": "bin/wine64", - "wineserver": "bin/wineserver", - "wineboot": "bin/wineboot", - "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false - }, - { - "family": "Lutris", - "name": "lutris-6.13-x86_64", - "title": "Lutris 6.13", - "uri": "https://github.com/lutris/wine/releases/download/lutris-6.13/wine-lutris-6.13-x86_64.tar.xz", - "files": { - "wine": "bin/wine64", - "wineserver": "bin/wineserver", - "wineboot": "bin/wineboot", - "winecfg": "lib64/wine/x86_64-windows/winecfg.exe" - }, - "recommended": false } ] } diff --git a/src/lib/config/mod.rs b/src/lib/config/mod.rs index 289ade4..f8a4184 100644 --- a/src/lib/config/mod.rs +++ b/src/lib/config/mod.rs @@ -1,7 +1,9 @@ use std::collections::HashMap; -use std::{fs::File, io::Read}; +use std::fs::File; +use std::io::Read; use std::path::Path; use std::io::{Error, ErrorKind, Write}; +use std::process::{Command, Stdio}; use serde::{Serialize, Deserialize}; @@ -122,6 +124,10 @@ pub struct Config { impl Config { /// Try to get a path to the wine executable based on `game.wine.builds` and `game.wine.selected` + /// + /// Returns `Some("wine")` if: + /// 1) `game.wine.selected = None` + /// 2) wine installed and available in system pub fn try_get_wine_executable(&self) -> Option { match &self.game.wine.selected { Some(selected) => { @@ -142,7 +148,10 @@ impl Config { // ???? None }, - None => None + None => match Command::new("wine").stdout(Stdio::null()).stderr(Stdio::null()).output() { + Ok(output) => if output.status.success() { Some(String::from("wine")) } else { None }, + Err(_) => None + } } } diff --git a/src/ui/main.rs b/src/ui/main.rs index f2a7963..a1d5486 100644 --- a/src/ui/main.rs +++ b/src/ui/main.rs @@ -7,6 +7,7 @@ use gtk4::glib::clone; use std::rc::Rc; use std::cell::Cell; use std::io::Error; +use std::process::{Command, Stdio}; use anime_game_core::prelude::*; use wait_not_await::Await; @@ -256,10 +257,35 @@ impl App { Ok(mut config) => { match state { LauncherState::Launch => { - // Display toast message if the game is failed to run - if let Err(err) = game::run(false) { - this.toast_error("Failed to run game", err); - } + let this = this.clone(); + + this.widgets.window.hide(); + + std::thread::spawn(move || { + // Display toast message if the game is failed to run + if let Err(err) = game::run(false) { + this.widgets.window.show(); + + this.toast_error("Failed to run game", err); + } + + else { + loop { + std::thread::sleep(std::time::Duration::from_secs(3)); + + match Command::new("ps").arg("-A").stdout(Stdio::piped()).output() { + Ok(output) => { + if !String::from_utf8_lossy(&output.stdout).contains("GenshinImpact.e") { + break; + } + }, + Err(_) => break + } + } + + this.widgets.window.show(); + } + }); }, LauncherState::PatchAvailable(patch) => { @@ -546,6 +572,7 @@ impl App { self.widgets.launch_game.add_css_class("suggested-action"); self.widgets.launch_game.remove_css_class("warning"); + self.widgets.launch_game.remove_css_class("destructive-action"); match &state { LauncherState::Launch => { @@ -559,6 +586,9 @@ impl App { Patch::Preparation { .. } => { self.widgets.launch_game.set_label("Patch not available"); self.widgets.launch_game.set_sensitive(false); + + self.widgets.launch_game.remove_css_class("suggested-action"); + self.widgets.launch_game.add_css_class("destructive-action"); } Patch::Testing { .. } => { diff --git a/src/ui/preferences/enhancements_page.rs b/src/ui/preferences/enhancements.rs similarity index 99% rename from src/ui/preferences/enhancements_page.rs rename to src/ui/preferences/enhancements.rs index b2fd4f5..2a77535 100644 --- a/src/ui/preferences/enhancements_page.rs +++ b/src/ui/preferences/enhancements.rs @@ -34,7 +34,7 @@ impl AppWidgets { let builder = gtk::Builder::from_string(include_str!("../../../assets/ui/.dist/preferences/enhancements.ui")); let result = Self { - page: get_object(&builder, "enhanced_page")?, + page: get_object(&builder, "page")?, sync_combo: get_object(&builder, "sync_combo")?, wine_lang: get_object(&builder, "wine_lang")?, diff --git a/src/ui/preferences/environment.rs b/src/ui/preferences/environment.rs new file mode 100644 index 0000000..81765b4 --- /dev/null +++ b/src/ui/preferences/environment.rs @@ -0,0 +1,119 @@ +use gtk4 as gtk; +use libadwaita::{self as adw, prelude::*}; + +use gtk4::glib; +use gtk4::glib::clone; + +use std::rc::Rc; +use std::cell::Cell; +use std::io::Error; + +use crate::ui::get_object; +use crate::lib::config; + +/// This structure is used to describe widgets used in application +/// +/// `AppWidgets::try_get` function loads UI file from `.assets/ui/.dist` folder and returns structure with references to its widgets +/// +/// This function does not implement events +#[derive(Clone, glib::Downgrade)] +pub struct AppWidgets { + pub page: adw::PreferencesPage +} + +impl AppWidgets { + fn try_get() -> Result { + let builder = gtk::Builder::from_string(include_str!("../../../assets/ui/.dist/preferences/environment.ui")); + + let result = Self { + page: get_object(&builder, "page")? + }; + + Ok(result) + } +} + +/// This enum is used to describe an action inside of this application +/// +/// It may be helpful if you want to add the same event for several widgets, or call an action inside of another action +#[derive(Debug)] +pub enum Actions { + None +} + +/// This enum is used to store some of this application data +/// +/// In this example we store a counter here to know what should we increment or decrement +/// +/// This must implement `Default` trait +#[derive(Debug, Default, glib::Downgrade)] +pub struct Values; + +/// The main application structure +/// +/// `Default` macro automatically calls `AppWidgets::default`, i.e. loads UI file and reference its widgets +/// +/// `Rc>` means this: +/// - `Rc` addeds ability to reference the same value from various clones of the structure. +/// This will guarantee us that inner `Cell` is the same for all the `App::clone()` values +/// - `Cell` addeds inner mutability to its value, so we can mutate it even without mutable reference. +/// +/// So we have a shared reference to some value that can be changed without mutable reference. +/// That's what we need and what we use in `App::update` method +#[derive(Clone, glib::Downgrade)] +pub struct App { + widgets: AppWidgets, + values: Rc> +} + +impl App { + /// Create new application + pub fn new() -> Result { + let result = Self { + widgets: AppWidgets::try_get()?, + values: Default::default() + }.init_events(); + + Ok(result) + } + + /// Add default events and values to the widgets + fn init_events(self) -> Self { + // .. + + self + } + + /// Update widgets state by calling some action + pub fn update(&self, action: Actions) { + let values = self.values.take(); + + match action { + Actions::None => () + } + + self.values.set(values); + } + + pub fn title() -> String { + String::from("Environment (WIP)") + } + + pub fn get_page(&self) -> adw::PreferencesPage { + self.widgets.page.clone() + } + + /// This method is being called by the `PreferencesStack::update` + pub fn prepare(&self, status_page: &adw::StatusPage) -> Result<(), Error> { + let config = config::get()?; + + status_page.set_description(Some("Loading environment...")); + + // .. + + Ok(()) + } +} + +unsafe impl Send for App {} +unsafe impl Sync for App {} diff --git a/src/ui/preferences/general_page.rs b/src/ui/preferences/general.rs similarity index 99% rename from src/ui/preferences/general_page.rs rename to src/ui/preferences/general.rs index b547f62..d036205 100644 --- a/src/ui/preferences/general_page.rs +++ b/src/ui/preferences/general.rs @@ -57,7 +57,7 @@ impl AppWidgets { let builder = gtk::Builder::from_string(include_str!("../../../assets/ui/.dist/preferences/general.ui")); let mut result = Self { - page: get_object(&builder, "general_page")?, + page: get_object(&builder, "page")?, voiceovers_row: get_object(&builder, "voiceovers_row")?, voieover_components: Default::default(), diff --git a/src/ui/preferences/mod.rs b/src/ui/preferences/mod.rs index c69bdbd..a8a9708 100644 --- a/src/ui/preferences/mod.rs +++ b/src/ui/preferences/mod.rs @@ -10,12 +10,14 @@ use std::io::Error; use crate::ui::*; use crate::ui::traits::prelude::*; -mod general_page; -mod enhancements_page; +mod general; +mod enhancements; +mod environment; pub mod pages { - pub use super::general_page::App as GeneralPage; - pub use super::enhancements_page::App as EnhancementsPage; + pub use super::general::App as GeneralPage; + pub use super::enhancements::App as EnhancementsPage; + pub use super::environment::App as EnvironmentPage; } #[derive(Clone, glib::Downgrade)] @@ -31,7 +33,8 @@ pub struct PreferencesStack { pub stack: gtk::Stack, pub general_page: pages::GeneralPage, - pub enhancements_page: pages::EnhancementsPage + pub enhancements_page: pages::EnhancementsPage, + pub environment_page: pages::EnvironmentPage } impl PreferencesStack { @@ -50,11 +53,13 @@ impl PreferencesStack { stack: get_object(&builder, "stack")?, general_page: pages::GeneralPage::new()?, - enhancements_page: pages::EnhancementsPage::new()? + enhancements_page: pages::EnhancementsPage::new()?, + environment_page: pages::EnvironmentPage::new()? }; result.stack.add_titled(&result.general_page.get_page(), None, &pages::GeneralPage::title()); result.stack.add_titled(&result.enhancements_page.get_page(), None, &pages::EnhancementsPage::title()); + result.stack.add_titled(&result.environment_page.get_page(), None, &pages::EnvironmentPage::title()); Ok(result) } @@ -75,6 +80,7 @@ impl PreferencesStack { self.general_page.prepare(&self.status_page)?; self.enhancements_page.prepare(&self.status_page)?; + self.environment_page.prepare(&self.status_page)?; self.status_page.hide(); self.flap.show();