Begin switch to UIX

This commit is contained in:
Yoshi Askharoun
2024-03-13 22:54:19 -05:00
parent 491040a49a
commit ae3cd60033
10 changed files with 1245 additions and 117 deletions
+49
View File
@@ -9,6 +9,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ZuneModCore", "ZuneModCore\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OwlCore.Wpf", "OwlCore.Wpf\OwlCore.Wpf.csproj", "{BD87C032-C255-409E-8402-2DE16BFCE801}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libs", "libs", "{8B47E55D-134C-4308-838A-F48A25302FC6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UIX", "libs\MicrosoftIris\UIX\UIX.csproj", "{78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IrisShell", "libs\MicrosoftIris\IrisShell\IrisShell.csproj", "{8EE5F27A-A763-45BB-97A5-E7C690FC594B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UIX.RenderApi", "libs\MicrosoftIris\UIX.RenderApi\UIX.RenderApi.csproj", "{CB2B7609-C7B8-4E2A-82D8-DD631B70B621}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -55,10 +63,51 @@ Global
{BD87C032-C255-409E-8402-2DE16BFCE801}.Release|x64.Build.0 = Release|Any CPU
{BD87C032-C255-409E-8402-2DE16BFCE801}.Release|x86.ActiveCfg = Release|Any CPU
{BD87C032-C255-409E-8402-2DE16BFCE801}.Release|x86.Build.0 = Release|Any CPU
{78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Debug|x64.ActiveCfg = Debug|x64
{78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Debug|x64.Build.0 = Debug|x64
{78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Debug|x86.ActiveCfg = Debug|x86
{78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Debug|x86.Build.0 = Debug|x86
{78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Release|Any CPU.Build.0 = Release|Any CPU
{78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Release|x64.ActiveCfg = Release|x64
{78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Release|x64.Build.0 = Release|x64
{78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Release|x86.ActiveCfg = Release|x86
{78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Release|x86.Build.0 = Release|x86
{8EE5F27A-A763-45BB-97A5-E7C690FC594B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8EE5F27A-A763-45BB-97A5-E7C690FC594B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8EE5F27A-A763-45BB-97A5-E7C690FC594B}.Debug|x64.ActiveCfg = Debug|x64
{8EE5F27A-A763-45BB-97A5-E7C690FC594B}.Debug|x64.Build.0 = Debug|x64
{8EE5F27A-A763-45BB-97A5-E7C690FC594B}.Debug|x86.ActiveCfg = Debug|x86
{8EE5F27A-A763-45BB-97A5-E7C690FC594B}.Debug|x86.Build.0 = Debug|x86
{8EE5F27A-A763-45BB-97A5-E7C690FC594B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8EE5F27A-A763-45BB-97A5-E7C690FC594B}.Release|Any CPU.Build.0 = Release|Any CPU
{8EE5F27A-A763-45BB-97A5-E7C690FC594B}.Release|x64.ActiveCfg = Release|x64
{8EE5F27A-A763-45BB-97A5-E7C690FC594B}.Release|x64.Build.0 = Release|x64
{8EE5F27A-A763-45BB-97A5-E7C690FC594B}.Release|x86.ActiveCfg = Release|x86
{8EE5F27A-A763-45BB-97A5-E7C690FC594B}.Release|x86.Build.0 = Release|x86
{CB2B7609-C7B8-4E2A-82D8-DD631B70B621}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB2B7609-C7B8-4E2A-82D8-DD631B70B621}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB2B7609-C7B8-4E2A-82D8-DD631B70B621}.Debug|x64.ActiveCfg = Debug|x64
{CB2B7609-C7B8-4E2A-82D8-DD631B70B621}.Debug|x64.Build.0 = Debug|x64
{CB2B7609-C7B8-4E2A-82D8-DD631B70B621}.Debug|x86.ActiveCfg = Debug|x86
{CB2B7609-C7B8-4E2A-82D8-DD631B70B621}.Debug|x86.Build.0 = Debug|x86
{CB2B7609-C7B8-4E2A-82D8-DD631B70B621}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB2B7609-C7B8-4E2A-82D8-DD631B70B621}.Release|Any CPU.Build.0 = Release|Any CPU
{CB2B7609-C7B8-4E2A-82D8-DD631B70B621}.Release|x64.ActiveCfg = Release|x64
{CB2B7609-C7B8-4E2A-82D8-DD631B70B621}.Release|x64.Build.0 = Release|x64
{CB2B7609-C7B8-4E2A-82D8-DD631B70B621}.Release|x86.ActiveCfg = Release|x86
{CB2B7609-C7B8-4E2A-82D8-DD631B70B621}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9} = {8B47E55D-134C-4308-838A-F48A25302FC6}
{8EE5F27A-A763-45BB-97A5-E7C690FC594B} = {8B47E55D-134C-4308-838A-F48A25302FC6}
{CB2B7609-C7B8-4E2A-82D8-DD631B70B621} = {8B47E55D-134C-4308-838A-F48A25302FC6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CB6377CF-90C6-4056-BA04-3AF40B6CEE1B}
EndGlobalSection
@@ -15,7 +15,6 @@ namespace ZuneModdingHelper
{
ViewModel = viewModel;
DataContext = ViewModel;
InitializeComponent();
}
public AbstractUIGroupDialog(AbstractUICollection group) : this(new AbstractUICollectionViewModel(group))
{
+62
View File
@@ -0,0 +1,62 @@
using System;
using CommunityToolkit.Mvvm.DependencyInjection;
using IrisShell;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
using Microsoft.AppCenter.Crashes;
namespace ZuneModdingHelper;
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public class App : IrisAppBase
{
public static readonly ReleaseVersion Version = new(2021, 12, 30, 0, Phase.Alpha);
public static readonly string VersionStr = Version.ToString();
public const string DonateLink = "http://josh.askharoun.com/donate";
public override string Title => "Zune Modding Helper";
public override string WindowSource => "clr-res://ZuneModdingHelper!Home.uix";
public App()
{
ServiceProviderReady += OnServiceProviderReady;
}
[STAThread]
public static int Main(string[] args)
{
ConfigureAppCenter();
App app = new();
return app.Run(args);
}
public static void OpenInBrowser(string url)
{
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(url)
{
UseShellExecute = true
});
}
private static void ConfigureAppCenter()
{
// Set up App Center analytics
AppCenter.SetCountryCode(System.Globalization.RegionInfo.CurrentRegion.TwoLetterISORegionName);
AppCenter.Start("24903c19-b3d9-4ab5-b445-b981ca647125", typeof(Analytics), typeof(Crashes));
#if DEBUG
// Disable crash and event analytics when in debug
AppCenter.SetEnabledAsync(false);
#endif
}
private void OnServiceProviderReady(object sender, IServiceProvider serviceProvider)
{
ServiceProviderReady -= OnServiceProviderReady;
Ioc.Default.ConfigureServices(serviceProvider);
}
}
-19
View File
@@ -1,19 +0,0 @@
<Application x:Class="ZuneModdingHelper.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ZuneModdingHelper"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<!-- Theme setting -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Magenta.xaml" />
</ResourceDictionary.MergedDictionaries>
<FontFamily x:Key="ZMHIcons">Assets/ZMH_Icons.ttf#ZMHIcons</FontFamily>
</ResourceDictionary>
</Application.Resources>
</Application>
-52
View File
@@ -1,52 +0,0 @@
using System.Windows;
using CommunityToolkit.Mvvm.DependencyInjection;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
using Microsoft.AppCenter.Crashes;
using Microsoft.Extensions.DependencyInjection;
namespace ZuneModdingHelper
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public const string Title = "Zune Modding Helper";
public static readonly ReleaseVersion Version = new(2021, 12, 30, 0, Phase.Alpha);
public static readonly string VersionStr = Version.ToString();
public const string DonateLink = "http://josh.askharoun.com/donate";
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
// Set up App Center analytics
AppCenter.SetCountryCode(System.Globalization.RegionInfo.CurrentRegion.TwoLetterISORegionName);
AppCenter.Start("24903c19-b3d9-4ab5-b445-b981ca647125", typeof(Analytics), typeof(Crashes));
#if DEBUG
// Disable crash and event analytics when in debug
AppCenter.SetEnabledAsync(false);
#endif
ConfigureServices();
}
public static void OpenInBrowser(string url)
{
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(url)
{
UseShellExecute = true
});
}
private static void ConfigureServices()
{
ServiceCollection services = new();
Ioc.Default.ConfigureServices(services.BuildServiceProvider());
}
}
}
File diff suppressed because it is too large Load Diff
+384
View File
@@ -0,0 +1,384 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
<UIX xmlns="http://schemas.microsoft.com/2007/uix"
xmlns:sys="assembly://mscorlib/System"
xmlns:isui="assembly://IrisShell/IrisShell.UI"
xmlns:iris="assembly://UIX/Microsoft.Iris"
xmlns:styles="clr-res://UIXControls!Controls.Styles.uix"
xmlns:page="clr-res://IrisShell!Controls.PageStack.uix"
xmlns:toptoolbar="clr-res://ZuneModdingHelper!Controls.TopToolbar.uix"
xmlns:popuplayer="clr-res://UIXControls!Controls.PopupLayer.uix"
xmlns:jil="clr-res://IrisShell!Controls.JumpInList.uix"
xmlns:bottomtoolbar="clr-res://IrisShell!Controls.BottomToolbar.uix"
xmlns:cnav="clr-res://IrisShell!Controls.CollectionNavigation.uix"
xmlns:snav="clr-res://IrisShell!Controls.SocialNavigation.uix"
xmlns:animations="clr-res://UIXControls!Controls.Animations.uix"
xmlns:nonclient="clr-res://IrisShell!Controls.NonClientControls.uix"
xmlns:focus="clr-res://IrisShell!Controls.FocusRect.uix">
<UI Name="Frame" Base="page:PageStack">
<Properties>
<isui:Shell Name="Shell" Shell="{(isui:Shell)isui:Shell.DefaultInstance}"/>
</Properties>
<Locals>
<isui:DictionaryCommandHandler Name="ShellCommandHandlers">
<Handlers>
<isui:CurrentPageCommandHandler Name="Page"/>
<isui:DictionaryCommandHandler Name="Collection"
DictionaryCommandHandler="{cnav:Navigation.Root}"/>
<isui:DictionaryCommandHandler Name="Device"
DictionaryCommandHandler="{cnav:DeviceNavigation.Root}"/>
<isui:DictionaryCommandHandler Name="Social"
DictionaryCommandHandler="{snav:Navigation.Root}"/>
<isui:WebUrlCommandHandler Name="Web"/>
<isui:HelpCommandHandler Name="Help"/>
</Handlers>
</isui:DictionaryCommandHandler>
<jil:JumpInList Name="JumpInList"/>
<AnchorLayoutInput Name="EnergyBarLayoutMax" Bottom="Parent,1" Left="Parent,0" Right="Parent,1,-1"/>
<AnchorLayoutInput Name="EnergyBarLayoutNorm" Bottom="Parent,1" Left="Parent,0,1" Right="Grabber,0"/>
<Int32 Name="MouseActivityTimeout" Int32="5000"/>
<sys:Boolean Name="AutoHideToolbars"/>
<Timer Name="KeyIdleTimer" Interval="{MouseActivityTimeout}" AutoRepeat="false" Enabled="false"/>
<styles:WindowState Name="WindowState"/>
</Locals>
<Input>
<ClickHandler Name="MouseDown" ClickType="Mouse" HandlerTransition="Down" HandlerStage="Routed" Handle="false"/>
<KeyHandler Name="CancelSettings" Key="Escape" DisallowedModifiers="Alt,Shift,Windows,Ctrl" HandlerStage="Bubbled" />
<ShortcutHandler Name="ShortcutPlay" Shortcut="Play" HandlerStage="Bubbled" Command="{isui:TransportControls.Instance.Play}"/>
<ShortcutHandler Name="ShortcutPause" Shortcut="Pause" HandlerStage="Bubbled" Command="{isui:TransportControls.Instance.Pause}"/>
<ShortcutHandler Name="ShortcutPlayPause" Shortcut="PlayPause" HandlerStage="Bubbled"/>
<ShortcutHandler Name="ShortcutStop" Shortcut="Stop" HandlerStage="Bubbled" Command="{isui:TransportControls.Instance.Stop}"/>
<ShortcutHandler Name="ShortcutSkipBack" Shortcut="SkipBack" HandlerStage="Bubbled" Command="{isui:TransportControls.Instance.Back}"/>
<ShortcutHandler Name="ShortcutSkipForward" Shortcut="SkipForward" HandlerStage="Bubbled" Command="{isui:TransportControls.Instance.Forward}"/>
<KeyHandler Name="KeyHandlerForward" Key="F" RequiredModifiers="Ctrl" DisallowedModifiers="Alt,Shift,Windows" HandlerStage="Bubbled" Command="{isui:TransportControls.Instance.Forward}"/>
<KeyHandler Name="KeyHandlerBack" Key="B" RequiredModifiers="Ctrl" DisallowedModifiers="Alt,Shift,Windows" HandlerStage="Bubbled" Command="{isui:TransportControls.Instance.Back}"/>
<KeyHandler Name="KeyHandlerStop" Key="S" RequiredModifiers="Ctrl" DisallowedModifiers="Alt,Shift,Windows" HandlerStage="Bubbled" Command="{isui:TransportControls.Instance.Stop}"/>
<KeyHandler Name="KeyHandlerPlayPause" Key="P" RequiredModifiers="Ctrl" DisallowedModifiers="Alt,Shift,Windows" HandlerStage="Bubbled"/>
<KeyHandler Name="KeyHandlerToggleShuffle" Key="H" RequiredModifiers="Ctrl" DisallowedModifiers="Alt,Shift,Windows" HandlerStage="Bubbled"/>
<KeyHandler Name="KeyHandlerToggleRepeat" Key="T" RequiredModifiers="Ctrl" DisallowedModifiers="Alt,Shift,Windows" HandlerStage="Bubbled"/>
<KeyHandler Name="KeyHandlerHelp" Key="F1" DisallowedModifiers="Alt,Shift,Ctrl,Windows" HandlerStage="Bubbled"/>
<KeyHandler Name="KeyHandlerToggleMute" Key="F7" DisallowedModifiers="Alt,Shift,Ctrl,Windows" HandlerStage="Bubbled"/>
<KeyHandler Name="KeyHandlerVolumeDown" Key="F8" DisallowedModifiers="Alt,Shift,Ctrl,Windows" HandlerStage="Bubbled"/>
<KeyHandler Name="KeyHandlerVolumeUp" Key="F9" DisallowedModifiers="Alt,Shift,Ctrl,Windows" HandlerStage="Bubbled"/>
<KeyHandler Name="KeyHandlerFastForward" Key="F" RequiredModifiers="Ctrl,Shift" DisallowedModifiers="Alt,Windows" HandlerStage="Bubbled" Command="{isui:TransportControls.Instance.FastforwardHotkey}"/>
<KeyHandler Name="KeyHandlerRewind" Key="B" RequiredModifiers="Ctrl,Shift" DisallowedModifiers="Alt,Windows" HandlerStage="Bubbled" Command="{isui:TransportControls.Instance.RewindHotkey}"/>
<KeyHandler Name="KeyHandlerSearchFocus" Key="E" RequiredModifiers="Ctrl" DisallowedModifiers="Alt,Shift,Windows" HandlerStage="Bubbled" Command="{isui:Search.Instance.SearchFocusHotkey}"/>
<FocusHandler Name="FocusChangedUsingKeyboard" Reason="Key" HandlerStage="Bubbled"/>
<KeyHandler Name="ShowFocusRectF10" Key="F10" Handle="false" HandlerStage="Routed"/>
<KeyHandler Name="ShowFocusRectApps" Key="Apps" Handle="false" HandlerStage="Routed"/>
<KeyHandler Name="SpaceKeyHandler" Key="Space" RequiredModifiers="Alt" DisallowedModifiers="Ctrl,Shift,Windows" HandlerStage="Routed,Direct" Repeat="false" />
<KeyHandler Name="AnyKeys" Key="Any" HandlerStage="Routed" Handle="false"/>
</Input>
<Scripts>
<Script>isui:Shell.DefaultInstance.CommandHandler = ShellCommandHandlers;</Script>
<Script>
MouseDown.Command = PopupLayer.MouseDownCommand;
</Script>
<Script>
//isui:IrisPage page = [Shell.CurrentPage];
isui:IrisPage page = Shell.CurrentPage;
if (page is isui:CategoryPage)
{
CancelSettings.Command = ((isui:CategoryPage) page).CancelButton;
}
else
{
CancelSettings.Command = null;
}
</Script>
<Script>
//bool modalPopup = [PopupLayer.IsModal];
//bool backArrow = [Shell.CurrentPage.ShowBackArrow];
//bool computerIcon = ([Shell.CurrentPage.ShowComputerIcon] != isui:ComputerIconState.Hide);
//bool nowPlayingX = [Shell.CurrentPage.ShowNowPlayingX];
bool modalPopup = PopupLayer.IsModal;
bool backArrow = Shell.CurrentPage.ShowBackArrow;
CanGoBack = !modalPopup &amp;&amp; backArrow;
</Script>
<Script>
ResizeBorders.Visible = (!iris:Application.Window.ShowWindowFrame) &amp;&amp;
//([iris:Application.Window.WindowState] != iris:WindowState.Maximized);
(iris:Application.Window.WindowState != iris:WindowState.Maximized);
</Script>
<Script>
if (iris:Application.Window.WindowState == iris:WindowState.Maximized)
{
EnergyBar.LayoutInput = EnergyBarLayoutMax;
Grabber.Visible = false;
}
else
{
Grabber.Visible = true;
EnergyBar.LayoutInput = EnergyBarLayoutNorm;
}
</Script>
<Script>
AutoHideToolbars = Shell.CurrentPage.AutoHideToolbars &amp;&amp; WindowState.CanHideMouse;
iris:Application.Window.HideMouseOnIdle = AutoHideToolbars;
</Script>
<Script>
iris:Application.Window.MouseIdleTimeout = MouseActivityTimeout;
</Script>
<Script>
[DeclareTrigger(Shell.CurrentPage)]
WindowState.PageInputActivity = false;
</Script>
<Script>
bool hideNow = AutoHideToolbars &amp;&amp;
!iris:Application.Window.MouseActive &amp;&amp;
!WindowState.KeysActive;
TopToolbar.InvisibleMode = hideNow;
BottomToolbar.InvisibleMode = hideNow;
FocusRect.Alpha = (float)!hideNow;
AnyKeys.StopRoute = hideNow;
styles:WindowState.InputActive = !hideNow;
</Script>
<Script>
[DeclareTrigger(AnyKeys.Pressing)]
WindowState.KeysActive = true;
KeyIdleTimer.Stop();
KeyIdleTimer.Start();
</Script>
<Script>
[DeclareTrigger(KeyIdleTimer.Tick)]
WindowState.KeysActive = false;
</Script>
<Script>
[DeclareTrigger(ShortcutPlayPause.Invoked)]
[DeclareTrigger(KeyHandlerPlayPause.Invoked)]
if (isui:TransportControls.Instance.Playing)
{
isui:TransportControls.Instance.Pause.Invoke();
}
else
{
isui:TransportControls.Instance.Play.Invoke();
}
</Script>
<Script>
bool shouldBeVisible = isui:JumpInListManager.Instance.IsActive;
if (shouldBeVisible &amp;&amp; !JumpInList.Helper.IsVisible)
{
JumpInList.Helper.Show(JumpInList);
}
else if (!shouldBeVisible &amp;&amp; JumpInList.Helper.IsVisible)
{
JumpInList.Helper.Hide();
}
</Script>
<Script>
if (!JumpInList.Helper.IsVisible)
{
isui:JumpInListManager.Instance.Clear();
}
</Script>
<Script>
SpaceKeyHandler.Command = TopToolbar.MenuCommand;
</Script>
<Script>
[DeclareTrigger(KeyHandlerToggleShuffle.Invoked)]
isui:TransportControls.Instance.Shuffling.NextValue(true);
</Script>
<Script>
[DeclareTrigger(KeyHandlerToggleRepeat.Invoked)]
isui:TransportControls.Instance.Repeating.NextValue(true);
</Script>
<Script>
[DeclareTrigger(KeyHandlerToggleMute.Invoked)]
isui:TransportControls.Instance.Muted.NextValue(true);
</Script>
<Script>
[DeclareTrigger(KeyHandlerVolumeDown.Invoked)]
isui:TransportControls.Instance.Volume.Value = isui:TransportControls.Instance.Volume.Value - 10.0;
</Script>
<Script>
[DeclareTrigger(KeyHandlerVolumeUp.Invoked)]
isui:TransportControls.Instance.Volume.Value = isui:TransportControls.Instance.Volume.Value + 10.0;
</Script>
<Script>
[DeclareTrigger(KeyHandlerHelp.Invoked)]
string helpPath = "Help\\" + isui:Shell.LoadString(&quot;IDS_ZUNECLIENT_LOCALE&quot;) + "\LandingPage.htm";
isui:Shell.DefaultInstance.Execute(helpPath, null);
</Script>
<Script>
[DeclareTrigger(FocusChangedUsingKeyboard.GainedFocus)]
[DeclareTrigger(ShowFocusRectF10.Invoked)]
[DeclareTrigger(ShowFocusRectApps.Invoked)]
FocusRect.Visible = true;
</Script>
<Script>
if (!iris:Application.Window.Active || !isui:PopupManager.Instance.AnyDialogs)
{
FocusRect.Visible = false;
}
</Script>
<Script>
MainBackground.Visible = Shell.CurrentPage.ShowAppBackground;
</Script>
<Script>
MainBackground.Content = new Image(Shell.BackgroundImage, styles:Styles.BackgroundMargins);
</Script>
</Scripts>
<Content>
<Panel Layout="Anchor">
<Children>
<focus:FocusRect Name="FocusRect" Visible="false">
<LayoutInput>
<AnchorLayoutInput Left="Focus,0,-1" Right="Focus,1,1" Top="Focus,0,-1" Bottom="Focus,1,1" ContributesToHeight="false" ContributesToWidth="false"/>
</LayoutInput>
</focus:FocusRect>
<nonclient:WindowResizeBorderLayer Name="ResizeBorders" Layout="Fill"/>
<popuplayer:PopupLayer Name="PopupLayer" Layout="Fill"/>
<Graphic Name="Grabber" Content="{styles:Styles.Grabber}" MaximumSize="9,6" Layout="Fill">
<LayoutInput>
<AnchorLayoutInput Name="GrabberLayout" Bottom="Parent,1" Right="Parent,1,-1"/>
</LayoutInput>
</Graphic>
<Graphic Name="EnergyBar" Content="{styles:Styles.EnergyBar}" MaximumSize="0,6" Layout="Fill" Visible="true" Margins="1,0,0,0"/>
<Panel Layout="Anchor" Navigation="RememberFocus,ContainAll,WrapTabOrder" FocusOrder="0">
<Children>
<Panel Layout="Dock">
<Children>
<toptoolbar:TopToolbar Name="TopToolbar" Shell="{Shell}" FocusOrder="1">
<LayoutInput>
<DockLayoutInput Position="Top"/>
</LayoutInput>
</toptoolbar:TopToolbar>
<bottomtoolbar:BottomToolbar Name="BottomToolbar" Shell="{Shell}" FocusOrder="4">
<LayoutInput>
<DockLayoutInput Position="Bottom"/>
</LayoutInput>
</bottomtoolbar:BottomToolbar>
<page:PageBase Name="ForegroundUI" Shell="{Shell}" Page="{Shell.CurrentPage}" FocusOrder="2" Margins="{styles:Styles.FrameMargins}">
<LayoutInput>
<DockLayoutInput Position="Client"/>
</LayoutInput>
</page:PageBase>
</Children>
</Panel>
<page:PageBase Name="BackgroundUI" Shell="{Shell}" Page="{Shell.CurrentPage}" FocusOrder="3" Layout="Fill"/>
</Children>
</Panel>
<Graphic
Name="MainBackground"
Layout="Fill"
ErrorImage="{styles:Styles.DefaultBackgroundImage}"
>
<Animations>
<Animation Animation="{animations:Animations.MainBackgroundPageTransitionHide}"/>
</Animations>
</Graphic>
</Children>
</Panel>
</Content>
</UI>
</UIX>
+16 -12
View File
@@ -4,6 +4,7 @@ using MahApps.Metro.Controls;
using MahApps.Metro.Controls.Dialogs;
using Microsoft.AppCenter.Analytics;
using Microsoft.WindowsAPICodePack.Dialogs;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OwlCore.AbstractUI.Models;
using Syroot.Windows.IO;
@@ -33,7 +34,6 @@ namespace ZuneModdingHelper
public MainWindow()
{
InitializeComponent();
// https://github.com/Arlodotexe/OwlCore/issues/1
OwlCore.Threading.SetPrimarySynchronizationContext(System.Threading.SynchronizationContext.Current!);
OwlCore.Threading.SetPrimaryThreadInvokeHandler(RunOnUI);
@@ -41,8 +41,8 @@ namespace ZuneModdingHelper
ThemeManager.Current.ThemeSyncMode = ThemeSyncMode.SyncWithAppMode;
ThemeManager.Current.SyncTheme();
ModList.ItemsSource = Mod.AvailableMods;
ZuneInstallDirBox.Text = Mod.ZuneInstallDir;
//ModList.ItemsSource = Mod.AvailableMods;
//ZuneInstallDirBox.Text = Mod.ZuneInstallDir;
}
private async System.Threading.Tasks.Task RunOnUI(Action action) => await Dispatcher.BeginInvoke(action);
@@ -65,7 +65,7 @@ namespace ZuneModdingHelper
{
var progDialog = await this.ShowProgressAsync("Getting ready...", "Preparing to apply mod", settings: defaultMetroDialogSettings);
Mod mod = (Mod)((FrameworkElement)sender).DataContext;
Mod.ZuneInstallDir = ZuneInstallDirBox.Text;
Mod.ZuneInstallDir = "";// ZuneInstallDirBox.Text;
progDialog.Maximum = 3;
int numCompleted = 0;
@@ -122,7 +122,7 @@ namespace ZuneModdingHelper
if (sender is FrameworkElement elem && elem.DataContext is Mod mod)
{
var progDialog = await this.ShowProgressAsync("Getting ready...", "Preparing to reset mod", settings: defaultMetroDialogSettings);
Mod.ZuneInstallDir = ZuneInstallDirBox.Text;
Mod.ZuneInstallDir = "";// ZuneInstallDirBox.Text;
progDialog.Maximum = 2;
int numCompleted = 0;
@@ -167,8 +167,8 @@ namespace ZuneModdingHelper
private void AboutButton_Click(object sender, RoutedEventArgs e)
{
AboutFlyout.Width = Math.Max(Math.Min(500, ActualWidth), ActualWidth / 3);
AboutFlyout.IsOpen = true;
//AboutFlyout.Width = Math.Max(Math.Min(500, ActualWidth), ActualWidth / 3);
//AboutFlyout.IsOpen = true;
}
private void Link_RequestNavigate(object sender, RequestNavigateEventArgs e)
@@ -184,11 +184,15 @@ namespace ZuneModdingHelper
try
{
var request = "https://api.github.com/repos/ZuneDev/ZuneModdingHelper/releases"
.WithHeader("User-Agent", App.Current.Title.Replace(" ", "") + "/" + App.VersionStr);
var response = await request.GetStreamAsync();
// Get releases list from GitHub
List<JObject> releases = await "https://api.github.com/repos/ZuneDev/ZuneModdingHelper/releases"
.WithHeader("User-Agent", App.Title.Replace(" ", "") + "/" + App.VersionStr)
.GetJsonAsync<List<JObject>>();
JObject latest = releases[0];
StreamReader streamReader = new(response);
var jsonReader = new JsonTextReader(streamReader);
var releases = await JArray.LoadAsync(jsonReader);
JObject latest = releases.OfType<JObject>().First();
string latestVerStr = latest["tag_name"].Value<string>();
if (!ReleaseVersion.TryParse(latestVerStr, out var latestVer) || App.Version >= latestVer)
{
@@ -284,7 +288,7 @@ namespace ZuneModdingHelper
CommonFileDialogResult result = dialog.ShowDialog();
if (result == CommonFileDialogResult.Ok)
{
ZuneInstallDirBox.Text = dialog.FileName;
//ZuneInstallDirBox.Text = dialog.FileName;
}
}
else
+5 -2
View File
@@ -2,8 +2,7 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<TargetFramework>net6.0-windows</TargetFramework>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Version>2021.12.30.0</Version>
<Authors>Joshua "Yoshi" Askharoun</Authors>
@@ -15,6 +14,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\libs\MicrosoftIris\IrisShell\IrisShell.csproj" />
<ProjectReference Include="..\OwlCore.Wpf\OwlCore.Wpf.csproj" />
<ProjectReference Include="..\ZuneModCore\ZuneModCore.csproj" />
</ItemGroup>
@@ -31,6 +31,9 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="**\*.uix" />
<None Remove="Controls\TOPTOOLBAR.UIX" />
<Resource Include="Assets\ZMH_Icons.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>