Skip to content

Commit c7aad9e

Browse files
committed
up
1 parent 6dc1445 commit c7aad9e

11 files changed

Lines changed: 271 additions & 120 deletions

File tree

src/ColorMC.Gui/Manager/ThemeManager.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,10 @@ public static IBrush GetColor(string key)
303303
{
304304
return NowThemeColor.RadioGroupBG;
305305
}
306+
else if (key == nameof(ThemeObj.BorderBG))
307+
{
308+
return NowThemeColor.BorderBG;
309+
}
306310

307311
return Brushes.Transparent;
308312
}
@@ -560,7 +564,8 @@ static ThemeManager()
560564
SelectItemOver = Brush.Parse("#FFCCCCCC"),
561565
MenuBG = Brush.Parse("#FFF4F4F5"),
562566
BorderColor = Brush.Parse("#e5e7eb"),
563-
RadioGroupBG = Brush.Parse("#f3f4f6")
567+
RadioGroupBG = Brush.Parse("#f3f4f6"),
568+
BorderBG = Brush.Parse("#f8fafc")
564569
};
565570

566571
s_dark = new()
@@ -587,7 +592,8 @@ static ThemeManager()
587592
SelectItemOver = Brush.Parse("#FF454545"),
588593
MenuBG = Brush.Parse("#FF2c2c2c"),
589594
BorderColor = Brush.Parse("#e5e7eb"),
590-
RadioGroupBG = Brush.Parse("#f3f4f6")
595+
RadioGroupBG = Brush.Parse("#f3f4f6"),
596+
BorderBG = Brush.Parse("#f8fafc")
591597
};
592598
}
593599
}

src/ColorMC.Gui/Objs/Enums.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,13 @@ public enum ItemsGridType
227227
Grid,
228228
GridInfo
229229
}
230+
231+
/// <summary>
232+
/// 皮肤动画
233+
/// </summary>
234+
public enum SkinAnimationType
235+
{
236+
None,
237+
Walk,
238+
Custom
239+
}

src/ColorMC.Gui/Objs/ThemeObj.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ public record ThemeObj
4848
public IBrush MenuBG;
4949
public IBrush BorderColor;
5050
public IBrush RadioGroupBG;
51-
51+
public IBrush BorderBG;
5252
}

src/ColorMC.Gui/Resource/Language/zh-cn.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -824,10 +824,20 @@
824824
"SkinWindow.Text5": "显示第二层",
825825
"SkinWindow.Text6": "显示披风",
826826
"SkinWindow.Text7": "行走动画",
827-
"SkinWindow.Text8": "重置动作",
828-
"SkinWindow.Text9": "抗锯齿",
829-
"SkinWindow.Text10": "菜单",
827+
"SkinWindow.Text8": "重置旋转角度",
828+
"SkinWindow.Text9": "抗锯齿(FXAA)",
830829
"SkinWindow.Text11": "没有皮肤文件",
830+
"SkinWindow.Text12": "皮肤选项",
831+
"SkinWindow.Text13": "皮肤模型类型",
832+
"SkinWindow.Text14": "动画类型",
833+
"SkinWindow.Text15": "静止动画",
834+
"SkinWindow.Text17": "手动角度",
835+
"SkinWindow.Text18": "关节角度",
836+
"SkinWindow.Text19": "旋转轴:X",
837+
"SkinWindow.Text20": "旋转轴:Y",
838+
"SkinWindow.Text21": "旋转轴:Z",
839+
"SkinWindow.Text22": "渲染帧率:",
840+
"SkinWindow.Text23": "渲染器:",
831841
"ServerPackWindow.Title": "生成服务器实例 {0}",
832842
"ServerPackWindow.Tabs.Text1": "总体设定",
833843
"ServerPackWindow.Tab1.Text1": "服务器包会复制游戏实例的所有设置,包括JVM参数,运行前启动等数据",

src/ColorMC.Gui/Style/ComboBox.axaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
<Style Selector="ComboBox.t1">
3939
<Setter Property="MaxDropDownHeight" Value="300" />
4040
<Setter Property="VerticalContentAlignment" Value="Center" />
41-
<Setter Property="Background" Value="#f9fafb" />
42-
<Setter Property="BorderBrush" Value="#e5e7eb" />
41+
<Setter Property="Background" Value="{setting:Theme BorderBG}" />
42+
<Setter Property="BorderBrush" Value="{setting:Theme BorderColor}" />
4343
<Setter Property="BorderThickness" Value="1" />
4444
<Setter Property="CornerRadius" Value="5" />
4545

src/ColorMC.Gui/UI/Controls/Skin/OpenGL/SkinRender.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Avalonia.OpenGL.Controls;
88
using Avalonia.Rendering;
99
using ColorMC.Gui.Manager;
10+
using ColorMC.Gui.Objs;
1011
using ColorMC.Gui.UI.Model.Skin;
1112
using MinecraftSkinRender;
1213
using MinecraftSkinRender.OpenGL;
@@ -43,9 +44,9 @@ private void Model_PropertyChanged(object? sender, PropertyChangedEventArgs e)
4344
{
4445
skin.SkinType = model.SteveModelType;
4546
}
46-
else if (e.PropertyName == nameof(SkinModel.EnableAnimation))
47+
else if (e.PropertyName == nameof(SkinModel.SkinAnimation))
4748
{
48-
skin.Animation = model.EnableAnimation;
49+
skin.Animation = model.SkinAnimation == SkinAnimationType.Walk;
4950
}
5051
else if (e.PropertyName == nameof(SkinModel.EnableCape))
5152
{
@@ -201,7 +202,7 @@ protected override unsafe void OnOpenGlInit(GlInterface gl)
201202
BackColor = new(0, 0, 0, 0),
202203
EnableCape = model.EnableCape,
203204
EnableTop = model.EnableTop,
204-
Animation = model.EnableAnimation
205+
Animation = model.SkinAnimation == SkinAnimationType.Walk
205206
};
206207
skin.SetSkinTex(ImageManager.SkinBitmap);
207208
skin.SetCapeTex(ImageManager.CapeBitmap);

src/ColorMC.Gui/UI/Controls/Skin/SkinControl.axaml

Lines changed: 51 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,49 @@
1313
d:DesignWidth="800"
1414
x:DataType="model:SkinModel"
1515
mc:Ignorable="d">
16-
<Grid Margin="10,0,10,10" ColumnDefinitions="2*,*">
17-
<Panel Margin="10,10,10,10">
16+
<DockPanel>
17+
<Rectangle
18+
Height="1"
19+
DockPanel.Dock="Top"
20+
Fill="{setting:Theme BorderColor}" />
21+
<Border
22+
Background="#FFFFFF"
23+
BorderBrush="#e5e7eb"
24+
BorderThickness="0,1,0,0"
25+
DockPanel.Dock="Bottom">
26+
<StackPanel Margin="20,5,10,5" Orientation="Horizontal">
27+
<TextBlock
28+
Classes="t1"
29+
FontSize="12"
30+
Text="{setting:Localize SkinWindow.Text22}" />
31+
<TextBlock
32+
Margin="0,0,10,0"
33+
Classes="t1"
34+
FontSize="12"
35+
Text="{Binding NowFps, FallbackValue=0Fps}" />
36+
<TextBlock
37+
Classes="t1"
38+
FontSize="12"
39+
Text="{setting:Localize SkinWindow.Text23}" />
40+
<TextBlock
41+
Width="400"
42+
Classes="t1"
43+
FontSize="12"
44+
MaxLines="1"
45+
Text="{Binding Info}"
46+
TextTrimming="CharacterEllipsis"
47+
TextWrapping="NoWrap">
48+
<ToolTip.Tip>
49+
<TextBlock
50+
MaxLines="3"
51+
Text="{Binding Info}"
52+
TextWrapping="Wrap" />
53+
</ToolTip.Tip>
54+
</TextBlock>
55+
</StackPanel>
56+
</Border>
57+
<view1:SkinSideControl DockPanel.Dock="Right" />
58+
<Panel>
1859
<view2:SkinRender Name="Skin" IsVisible="{Binding HaveSkin}" />
1960
<Grid
2061
HorizontalAlignment="Left"
@@ -249,30 +290,13 @@
249290
<TextBlock Text="" />
250291
</RepeatButton>
251292
</StackPanel>
252-
<StackPanel VerticalAlignment="Bottom" IsVisible="{Binding HaveSkin}">
253-
<TextBlock
254-
Margin="2"
255-
HorizontalAlignment="Left"
256-
Text="{Binding NowFps}" />
257-
<TextBlock
258-
Margin="2"
259-
Text="{Binding Info}"
260-
TextWrapping="Wrap" />
261-
</StackPanel>
262-
<Border Classes="t2" IsVisible="{Binding !HaveSkin, FallbackValue=true}">
263-
<TextBlock
264-
HorizontalAlignment="Center"
265-
VerticalAlignment="Center"
266-
FontSize="20"
267-
Foreground="{setting:Theme FontColor}"
268-
Text="{setting:Localize SkinWindow.Text11}" />
269-
</Border>
293+
<TextBlock
294+
HorizontalAlignment="Center"
295+
VerticalAlignment="Center"
296+
FontSize="20"
297+
Foreground="{setting:Theme FontColor}"
298+
IsVisible="{Binding !HaveSkin, FallbackValue=true}"
299+
Text="{setting:Localize SkinWindow.Text11}" />
270300
</Panel>
271-
<Border
272-
Grid.Column="1"
273-
Margin="0,10,10,10"
274-
Classes="t2">
275-
<view1:SkinSideControl />
276-
</Border>
277-
</Grid>
301+
</DockPanel>
278302
</UserControl>

0 commit comments

Comments
 (0)