支持弹窗自动换行

This commit is contained in:
ZouJin 2024-03-22 22:46:51 +08:00
parent c00bab66ae
commit 7dfb9952dd
3 changed files with 12 additions and 8 deletions

View File

@ -10,13 +10,17 @@
<MediaElement x:Name="VoicePlayer" LoadedBehavior="Manual" UnloadedBehavior="Stop" x:FieldModifier="public" />
<Grid x:Name="UIGrid_Back" x:FieldModifier="public" VerticalAlignment="Top" Width="500" />
<Border x:Name="PetGrid" Height="500" VerticalAlignment="Top" Width="500" x:FieldModifier="public" />
<Border x:Name="PetGrid2" Height="500" VerticalAlignment="Top" Width="500" x:FieldModifier="public" Visibility="Collapsed"/>
<Border x:Name="PetGrid2" Height="500" VerticalAlignment="Top" Width="500" x:FieldModifier="public"
Visibility="Collapsed" />
<Grid x:Name="UIGrid" x:FieldModifier="public" VerticalAlignment="Top" Width="500" />
<Label x:Name="LabelDisplay" HorizontalAlignment="Center" VerticalAlignment="Center" Content="内容显示如下"
FontSize="30" Background="{DynamicResource DARKPrimaryTransA}"
<Label x:Name="LabelDisplay" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="30"
Background="{DynamicResource DARKPrimaryTransA}" d:Visibility="Visible"
Foreground="{DynamicResource DARKPrimaryText}" pu:LabelHelper.CornerRadius="15"
pu:LabelHelper.ShadowColor="{DynamicResource ShadowColor}" pu:ShadowHelper.Opacity="0.8"
x:FieldModifier="public" Margin="0,300,0,0" Padding="15,7" Visibility="Collapsed" />
x:FieldModifier="public" Margin="0,300,0,0" Padding="15,7" Visibility="Collapsed">
<TextBlock x:Name="LabelDisplayText" Text="Hello World!" x:FieldModifier="public"
TextWrapping="WrapWithOverflow" />
</Label>
</Grid>
</Viewbox>
</pu:ContentControlX>

View File

@ -484,7 +484,7 @@ namespace VPet_Simulator.Core
{//连Nomal都没有, 证明是未完成的动画, 修改设置+退出游戏
Dispatcher.Invoke(() =>
{
LabelDisplay.Content = "未找到可播放动画, 已停止运行桌宠模块".Translate();
LabelDisplayText.Text = "未找到可播放动画, 已停止运行桌宠模块".Translate();
LabelDisplay.Visibility = Visibility.Visible;
IsEnabled = false;
});

View File

@ -120,7 +120,7 @@ namespace VPet_Simulator.Core
labeldisplayhash = text.GetHashCode();
Dispatcher.Invoke(() =>
{
LabelDisplay.Content = text;
LabelDisplayText.Text = text;
LabelDisplay.Opacity = 1;
LabelDisplay.Visibility = Visibility.Visible;
labeldisplaycount = time / 10;
@ -149,7 +149,7 @@ namespace VPet_Simulator.Core
}
Dispatcher.Invoke(() =>
{
LabelDisplay.Content = string.Format(text, labeldisplaychangenum1, labeldisplaychangenum2);
LabelDisplayText.Text = string.Format(text, labeldisplaychangenum1, labeldisplaychangenum2);
LabelDisplay.Opacity = 1;
LabelDisplay.Visibility = Visibility.Visible;
labeldisplaycount = time / 10;