This commit is contained in:
DismissedLight
2023-02-28 11:52:43 +08:00
parent e50c1b9184
commit f3387bb8c8
7 changed files with 11 additions and 19 deletions

View File

@@ -83,16 +83,6 @@ internal sealed class ExtendedWindow<TWindow> : IRecipient<BackdropTypeChangedMe
UpdateDragRectangles(appWindow.TitleBar, message.IsOpen); UpdateDragRectangles(appWindow.TitleBar, message.IsOpen);
} }
private static (string PosString, string SizeString) GetPostionAndSize(AppWindow appWindow)
{
PointInt32 pos = appWindow.Position;
string posString = $"{pos.X},{pos.Y}";
SizeInt32 size = appWindow.Size;
string sizeString = $"{size.Width},{size.Height}";
return (posString, sizeString);
}
private void InitializeWindow() private void InitializeWindow()
{ {
appWindow.Title = string.Format(SH.AppNameAndVersion, CoreEnvironment.Version); appWindow.Title = string.Format(SH.AppNameAndVersion, CoreEnvironment.Version);
@@ -101,10 +91,6 @@ internal sealed class ExtendedWindow<TWindow> : IRecipient<BackdropTypeChangedMe
Persistence.RecoverOrInit(appWindow, window.PersistSize, window.InitSize); Persistence.RecoverOrInit(appWindow, window.PersistSize, window.InitSize);
// Log basic window state here.
(string pos, string size) = GetPostionAndSize(appWindow);
logger.LogInformation("Postion: [{pos}], Size: [{size}]", pos, size);
// appWindow.Show(true); // appWindow.Show(true);
// appWindow.Show can't bring window to top. // appWindow.Show can't bring window to top.
window.Activate(); window.Activate();
@@ -192,6 +178,11 @@ internal sealed class ExtendedWindow<TWindow> : IRecipient<BackdropTypeChangedMe
// 48 is the navigation button leftInset // 48 is the navigation button leftInset
RectInt32 dragRect = StructMarshal.RectInt32(new(48, 0), titleBar.ActualSize).Scale(scale); RectInt32 dragRect = StructMarshal.RectInt32(new(48, 0), titleBar.ActualSize).Scale(scale);
appTitleBar.SetDragRectangles(dragRect.Enumerate().ToArray()); appTitleBar.SetDragRectangles(dragRect.Enumerate().ToArray());
// workaround for https://github.com/microsoft/WindowsAppSDK/issues/2976
SizeInt32 size = appWindow.ClientSize;
size.Height -= (int)(31 * scale);
appWindow.ResizeClient(size);
} }
} }
} }

View File

@@ -62,4 +62,4 @@ internal sealed partial class LaunchGameWindow : Window, IDisposable, IExtendedW
pInfo->ptMaxTrackSize.X = (int)Math.Min(MaxWidth * scalingFactor, pInfo->ptMaxTrackSize.X); pInfo->ptMaxTrackSize.X = (int)Math.Min(MaxWidth * scalingFactor, pInfo->ptMaxTrackSize.X);
pInfo->ptMaxTrackSize.Y = (int)Math.Min(MaxHeight * scalingFactor, pInfo->ptMaxTrackSize.Y); pInfo->ptMaxTrackSize.Y = (int)Math.Min(MaxHeight * scalingFactor, pInfo->ptMaxTrackSize.Y);
} }
} }

View File

@@ -84,7 +84,7 @@ internal sealed class FetterInfo
/// <summary> /// <summary>
/// 料理 /// 料理
/// </summary> /// </summary>
public CookBonus? CookBonus2 { get; set; } public CookBonus? CookBonus { get; set; }
/// <summary> /// <summary>
/// 好感语音 /// 好感语音

View File

@@ -12,7 +12,7 @@
<Identity <Identity
Name="60568DGPStudio.SnapHutao" Name="60568DGPStudio.SnapHutao"
Publisher="CN=35C8E923-85DF-49A7-9172-B39DC6312C52" Publisher="CN=35C8E923-85DF-49A7-9172-B39DC6312C52"
Version="1.4.15.0" /> Version="1.5.1.0" />
<Properties> <Properties>
<DisplayName>Snap Hutao</DisplayName> <DisplayName>Snap Hutao</DisplayName>

View File

@@ -319,6 +319,7 @@ internal sealed class PackageConverter
// System.IO.IOException: Received an unexpected EOF or 0 bytes from the transport stream. // System.IO.IOException: Received an unexpected EOF or 0 bytes from the transport stream.
// We want to retry forever. // We want to retry forever.
fileStream.Seek(0, SeekOrigin.Begin);
} }
} }
} }

View File

@@ -25,7 +25,7 @@
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision> <AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled> <AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
<GenerateTestArtifacts>False</GenerateTestArtifacts> <GenerateTestArtifacts>False</GenerateTestArtifacts>
<AppxBundle>Always</AppxBundle> <AppxBundle>Never</AppxBundle>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks> <HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
<StartupObject>Snap.Hutao.Program</StartupObject> <StartupObject>Snap.Hutao.Program</StartupObject>
<DefineConstants>$(DefineConstants);DISABLE_XAML_GENERATED_MAIN;DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION;DISABLE_XAML_GENERATED_BINDING_DEBUG_OUTPUT</DefineConstants> <DefineConstants>$(DefineConstants);DISABLE_XAML_GENERATED_MAIN;DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION;DISABLE_XAML_GENERATED_BINDING_DEBUG_OUTPUT</DefineConstants>

View File

@@ -139,7 +139,7 @@ internal sealed class WikiAvatarViewModel : Abstraction.ViewModel
foreach (Avatar avatar in avatars) foreach (Avatar avatar in avatars)
{ {
avatar.Collocation = idCollocations.GetValueOrDefault(avatar.Id); avatar.Collocation = idCollocations.GetValueOrDefault(avatar.Id);
avatar.CookBonusView ??= CookBonusView.Create(avatar.FetterInfo.CookBonus2, idMaterialMap); avatar.CookBonusView ??= CookBonusView.Create(avatar.FetterInfo.CookBonus, idMaterialMap);
avatar.CultivationItemsView ??= avatar.CultivationItems.SelectList(i => idMaterialMap[i]); avatar.CultivationItemsView ??= avatar.CultivationItems.SelectList(i => idMaterialMap[i]);
} }
} }