Window size for translation needs fix #387

This commit is contained in:
ZouJin 2024-06-10 19:30:42 +08:00
parent b6d5f096bd
commit 475ffde189
13 changed files with 64 additions and 14 deletions

View File

@ -62,13 +62,13 @@ namespace VPet_Simulator.Windows
LocalizeCore.TranslateFunc = (str) =>
{
var destr = Sub.TextDeReplace(str);
if (destr == str)
return str;
if (LocalizeCore.CurrentLPS != null && LocalizeCore.CurrentLPS.Assemblage.TryGetValue(destr, out ILine line))
if (destr != str && LocalizeCore.CurrentLPS != null && LocalizeCore.CurrentLPS.Assemblage.TryGetValue(destr, out ILine line))
{
return line.GetString();
}
return str;
if(str.Contains('_') && double.TryParse(str.Split('_').Last(), out double d))
return d.ToString();
return null;
};
CultureInfo.CurrentCulture = new CultureInfo(CultureInfo.CurrentCulture.Name);

View File

@ -5,7 +5,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" Foreground="{StaticResource PrimaryText}"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pu="https://opensource.panuon.com/wpf-ui" xmlns:local="clr-namespace:VPet_Simulator.Windows"
mc:Ignorable="d" Height="550" Width="800" FontSize="14" WindowStartupLocation="CenterScreen"
mc:Ignorable="d" Height="{ll:Dbe BetterBuyHeight_550, DefValue=550}"
Width="{ll:Dbe BetterBuyWidth_800, DefValue=800}" FontSize="14" WindowStartupLocation="CenterScreen"
Background="{DynamicResource PrimaryLighter}" pu:WindowXCaption.Height="45"
pu:WindowXCaption.Background="{DynamicResource DARKPrimary}" pu:WindowXCaption.Foreground="#FFFFFF"
pu:WindowXCaption.Buttons="Close" Icon="/Res/BetterBuy.png"

View File

@ -6,7 +6,7 @@
xmlns:local="clr-namespace:VPet_Simulator.Windows" mc:Ignorable="d"
xmlns:pu="https://opensource.panuon.com/wpf-ui" Foreground="{StaticResource PrimaryText}"
xmlns:ll="clr-namespace:LinePutScript.Localization.WPF;assembly=LinePutScript.Localization.WPF"
Title="{ll:Str 访客表}" MinHeight="400" Height="400" Width="660" Closed="Window_Closed"
Title="{ll:Str 访客表}" MinHeight="400" Height="{ll:Dbe MutiPlayerHeight_400, DefValue=400}" Width="{ll:Dbe MutiPlayerWidth_660, DefValue=660}" Closed="Window_Closed"
Style="{DynamicResource BaseWindowXStyle}" Background="{DynamicResource PrimaryLighter}"
FontSize="{Binding FontSize, Source={x:Static pu:GlobalSettings.Setting}}" MaxHeight="400"
ResizeMode="CanMinimize" Closing="Window_Closing">

View File

@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" Foreground="{StaticResource PrimaryText}"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pu="https://opensource.panuon.com/wpf-ui" xmlns:local="clr-namespace:VPet_Simulator.Windows"
mc:Ignorable="d" Height="550" Width="800" FontSize="14"
mc:Ignorable="d" Height="{ll:Dbe BetterBuyHeight_550, DefValue=550}" Width="{ll:Dbe BetterBuyWidth_800, DefValue=800}" FontSize="14"
WindowStartupLocation="CenterScreen"
Background="{DynamicResource PrimaryLighter}" pu:WindowXCaption.Height="45"
pu:WindowXCaption.Background="{DynamicResource DARKPrimary}" pu:WindowXCaption.Foreground="#FFFFFF"

View File

@ -5,7 +5,8 @@
xmlns:ll="clr-namespace:LinePutScript.Localization.WPF;assembly=LinePutScript.Localization.WPF"
xmlns:local="clr-namespace:VPet_Simulator.Windows" Foreground="{StaticResource PrimaryText}"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" Title="面板" Width="500" Height="500"
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" Title="面板"
Width="{ll:Dbe CharacterPanelWidth_500, DefValue=500}" Height="{ll:Dbe CharacterPanelHeight_500, DefValue=500}"
Style="{DynamicResource BaseWindowXStyle}" WindowStartupLocation="CenterScreen" mc:Ignorable="d"
Closed="WindowX_Closed">
<Window.Resources>

View File

@ -4,7 +4,8 @@
xmlns:ll="clr-namespace:LinePutScript.Localization.WPF;assembly=LinePutScript.Localization.WPF"
xmlns:local="clr-namespace:VPet_Simulator.Windows" Foreground="{StaticResource PrimaryText}"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" Width="450" Height="450" FontSize="16"
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" Width="{ll:Dbe ConsoleWidth_450, DefValue=450}"
Height="{ll:Dbe ConsoleHeight_450, DefValue=450}" FontSize="16"
mc:Ignorable="d" Closed="Window_Closed">
<TabControl pu:TabControlHelper.HeaderPanelBackground="{DynamicResource PrimaryLight}"
pu:TabControlHelper.ItemsSelectedBackground="White">

View File

@ -6,7 +6,8 @@
xmlns:local="clr-namespace:VPet_Simulator.Windows" Foreground="{StaticResource PrimaryText}"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" d:DesignHeight="1000"
xmlns:system="clr-namespace:System;assembly=mscorlib" Width="{ll:Dbe SettingWidth, DefValue=650}" Height="550"
xmlns:system="clr-namespace:System;assembly=mscorlib" Width="{ll:Dbe SettingWidth_650, DefValue=650}"
Height="{ll:Dbe SettingHeight_550, DefValue=550}"
Closing="WindowX_Closing" FontSize="16" Style="{DynamicResource BaseWindowXStyle}" Topmost="True"
WindowStartupLocation="CenterScreen" mc:Ignorable="d">
<!--<pu:WindowX.Resources>

View File

@ -4,8 +4,9 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" Foreground="{StaticResource PrimaryText}"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ll="clr-namespace:LinePutScript.Localization.WPF;assembly=LinePutScript.Localization.WPF"
xmlns:local="clr-namespace:VPet_Simulator.Windows" mc:Ignorable="d" Title="{ll:Str 工作面板}" Height="400"
Style="{DynamicResource BaseWindowXStyle}" Background="{DynamicResource PrimaryLighter}" Width="650"
xmlns:local="clr-namespace:VPet_Simulator.Windows" mc:Ignorable="d" Title="{ll:Str 工作面板}"
Height="{ll:Dbe WorkMenuHeight_400, DefValue=400}" Style="{DynamicResource BaseWindowXStyle}"
Background="{DynamicResource PrimaryLighter}" Width="{ll:Dbe WorkMenuWidth_650, DefValue=650}"
ResizeMode="CanMinimize" Closed="Window_Closed">
<pu:WindowX.Resources>
<Style x:Key="IconButtonStyle" TargetType="Button"
@ -22,7 +23,7 @@
<Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="140" />
<ColumnDefinition Width="{ll:Dbe WorkMenuColumnWidth_140, DefValue=140}" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Border Background="{DynamicResource DARKPrimaryText}" />

View File

@ -209,7 +209,7 @@ public partial class winWorkMenu : WindowX
break;
case 3:
detailTypes.ItemsSource = _starDetails;
btnStart.Content = "开始工作".Translate();
btnStart.Content = "开始活动".Translate();
ComboBoxHelper.SetWatermark(detailTypes, "---" + "请选择".Translate() + "---");
break;
case 4:

View File

@ -0,0 +1,15 @@
SettingWidth_650#720:|
SettingHeight_550#600:|
SettingMenuWidth_180#200:|
winConsoleWidth_450#500:|
winConsoleHeight_450#500:|
BetterBuyWidth_800#800:|
BetterBuyHeight_550#550:|
CharacterPanelWidth_500#520:|
CharacterPanelHeight_500#520:|
MutiPlayerWidth_660#680:|
MutiPlayerHeight_400#400:|
MutiPlayerItemsWidth_240#240:|
WorkMenuHeight_400#420:|
WorkMenuWidth_650#700:|
WorkMenuColumnWidth_140#140:|

View File

@ -0,0 +1,15 @@
SettingWidth_650#650:|
SettingHeight_550#550:|
SettingMenuWidth_180#180:|
winConsoleWidth_450#450:|
winConsoleHeight_450#450:|
BetterBuyWidth_800#800:|
BetterBuyHeight_550#550:|
CharacterPanelWidth_500#500:|
CharacterPanelHeight_500#500:|
MutiPlayerWidth_660#660:|
MutiPlayerHeight_400#400:|
MutiPlayerItemsWidth_240#240:|
WorkMenuHeight_400#400:|
WorkMenuWidth_650#650:|
WorkMenuColumnWidth_140#140:|

View File

@ -0,0 +1,15 @@
SettingWidth_650#650:|
SettingHeight_550#550:|
SettingMenuWidth_180#180:|
winConsoleWidth_450#450:|
winConsoleHeight_450#450:|
BetterBuyWidth_800#800:|
BetterBuyHeight_550#550:|
CharacterPanelWidth_500#500:|
CharacterPanelHeight_500#500:|
MutiPlayerWidth_660#660:|
MutiPlayerHeight_400#400:|
MutiPlayerItemsWidth_240#240:|
WorkMenuHeight_400#400:|
WorkMenuWidth_650#650:|
WorkMenuColumnWidth_140#140:|