修复bug和报错

This commit is contained in:
ZouJin 2023-08-13 20:23:17 +10:00
parent 60598ab292
commit 70c7e02784
4 changed files with 33 additions and 18 deletions

View File

@ -231,7 +231,10 @@ namespace VPet_Simulator.Windows
LocalizeCore.LoadCulture(Set.Language);
//旧版本设置兼容
var cgpteb = Set["CGPT"].Find("enable");
var cgpte = Set.FindLine("CGPT");
if (cgpte != null)
{
var cgpteb = cgpte.Find("enable");
if (cgpteb != null)
{
if (Set["CGPT"][(gbol)"enable"])
@ -244,6 +247,10 @@ namespace VPet_Simulator.Windows
}
Set["CGPT"].Remove(cgpteb);
}
}
else//新玩家,默认设置为
Set["CGPT"][(gstr)"type"] = "LB";
if (Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + @"\UserData") && !Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + @"\BackUP"))
{
Directory.Move(AppDomain.CurrentDomain.BaseDirectory + @"\UserData", AppDomain.CurrentDomain.BaseDirectory + @"\BackUP");

View File

@ -67,10 +67,16 @@ namespace VPet_Simulator.Windows
{
if (isclick)
{
try
{
DragMove();
isdragmove = Opacity == 0.8;
Cursor = Cursors.Hand;
Opacity = 1;
DragMove();
}
catch {
}
}
});
});

View File

@ -246,8 +246,8 @@ namespace VPet_Simulator.Windows
var b = mw.Main.FindDisplayBorder(ig);
ig.Run(b, item.ImageSource, () =>
{
mw.Main.EventTimer_Elapsed();
mw.Main.DisplayToNomal();
mw.Main.EventTimer_Elapsed();
});
}
}

View File

@ -31,7 +31,7 @@
</TabControl.ContentTemplate>
<TabItem Header="{ll:Str 图形}" Foreground="{DynamicResource PrimaryText}"
BorderBrush="{DynamicResource PrimaryDarker}">
<Grid>
<Grid Margin="0,0,-5,0">
<ScrollViewer>
<Grid>
<Grid.ColumnDefinitions>
@ -135,7 +135,7 @@
Background="{x:Null}" Grid.Row="1"
ToolTip="{ll:Str '桌宠图形渲染的分辨率,越高图形越清晰\&#13;但是高分辨率会占用更多内存\&#13;重启后生效'}" />
</Grid>
<TextBlock Grid.Row="5" Text="{ll:Str 分辨率}" VerticalAlignment="Center" Grid.ColumnSpan="2" />
<TextBlock Grid.Row="5" Text="{ll:Str 渲染分辨率}" VerticalAlignment="Center" Grid.ColumnSpan="2" />
<TextBlock Grid.Row="6" Text="{ll:Str 主题}" VerticalAlignment="Center" />
<ComboBox x:Name="ThemeBox" Grid.Row="6" Grid.Column="2" Margin="0,3,0,2"
SelectionChanged="ThemeBox_SelectionChanged" IsEnabled="False"
@ -627,7 +627,9 @@
<Button pu:ButtonHelper.CornerRadius="4" Content="{ll:Str 保存设置}" Margin="4" Grid.Column="1"
Background="{DynamicResource SecondaryLight}" Padding="1" Click="DIY_Save_Click" />
</Grid>
<ScrollViewer>
<StackPanel x:Name="StackDIY" />
</ScrollViewer>
</StackPanel>
</TabItem>