Skip to content

Commit

Permalink
添加已进行回合的角标指示
Browse files Browse the repository at this point in the history
  • Loading branch information
LTCatt committed Aug 23, 2021
1 parent 0d78ca0 commit 9348c3e
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
10 changes: 9 additions & 1 deletion Client/Controls/UserToken.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Rectangle x:Name="rectLeft" Fill="#FF8283FF" RadiusX="5" RadiusY="5" Width="{Binding ActualWidth, ElementName=labLeft, Mode=OneWay}"/>
<Border x:Name="rectLeft" Background="#FF8283FF" CornerRadius="5" Width="{Binding ActualWidth, ElementName=labLeft, Mode=OneWay}"/>
<Border x:Name="rectLeftMark" Background="#FF8283FF" RenderTransformOrigin="0.5,0.5" CornerRadius="5" Width="{Binding ActualWidth, ElementName=labLeft, Mode=OneWay}">
<Border.Clip>
<PathGeometry Figures="M0 0L12 0L0 12Z" />
</Border.Clip>
<Border.RenderTransform>
<RotateTransform Angle="180" />
</Border.RenderTransform>
</Border>
<Label x:Name="labLeft" HorizontalAlignment="Left" HorizontalContentAlignment="Center" FontSize="18" VerticalAlignment="Center" Content="" MinWidth="35" Padding="7,5" FontFamily="Maiandra GD" MinHeight="35" VerticalContentAlignment="Center"/>
<TextBlock x:Name="labRight" TextWrapping="Wrap" VerticalAlignment="Center" FontSize="14" Grid.Column="1" Height="18" Margin="10,0,0,0"/>
</Grid>
Expand Down
7 changes: 4 additions & 3 deletions Client/Controls/UserToken.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
_Color = value
Select Case _Color
Case Colors.Red
rectLeft.Fill = New MyColor(255, 130, 130)
rectLeft.Background = New MyColor(255, 130, 130)
Case Colors.Green
rectLeft.Fill = New MyColor(130, 255, 130)
rectLeft.Background = New MyColor(130, 255, 130)
Case Colors.Blue
rectLeft.Fill = New MyColor(130, 130, 255)
rectLeft.Background = New MyColor(130, 130, 255)
End Select
End Set
End Property
Expand Down Expand Up @@ -51,6 +51,7 @@
Color = GetEnumFromString(GetType(Colors), parms(0))
RightText = parms(1)
LeftText = parms(2)
rectLeftMark.Visibility = If(parms(3), Visibility.Visible, Visibility.Hidden)
End Sub

Private Sub UserToken_MouseRightButtonUp(sender As Object, e As MouseButtonEventArgs) Handles Me.MouseRightButtonUp
Expand Down
2 changes: 1 addition & 1 deletion Client/formMain.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ Public Class formMain
th.Start()

Case "List"
'List(String[] 颜色/右/左):刷新用户列表
'List(String[] 颜色/右/左/角标):刷新用户列表
Dispatcher.Invoke(Sub()
panList.Items.Clear()
For Each u As String In Parms
Expand Down
7 changes: 4 additions & 3 deletions Server/formMain.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -719,12 +719,13 @@ Public Class formMain
For Each u As UserData In room.Users
Select Case u.GameState
Case UserGameStates.NotReady
BoardcastList += "Red/" & u.Name & "/|"
BoardcastList += "Red/" & u.Name & "/"
Case UserGameStates.Ready
BoardcastList += "Green/" & u.Name & "/准备|"
BoardcastList += "Green/" & u.Name & "/准备"
Case UserGameStates.Master
BoardcastList += "Blue/" & u.Name & "/房主|"
BoardcastList += "Blue/" & u.Name & "/房主"
End Select
BoardcastList += "/False|"
Next
End If
'Observe
Expand Down
6 changes: 3 additions & 3 deletions Server/modSayGuess.vb
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@
SGList = ""
'将描述者置顶显示
For Each u As formMain.UserData In room.Users
If u.SG.State = SGStates.Turning Then SGList += "Blue/" & u.Name & "/" & u.SG.Score & "|"
If u.SG.State = SGStates.Turning Then SGList += "Blue/" & u.Name & "/" & u.SG.Score & "/" & u.SG.Turned & "|"
Next
'显示其他玩家
For Each u As formMain.UserData In room.Users
Select Case u.SG.State
Case SGStates.Failed
SGList += "Red/" & u.Name & "/" & u.SG.Score & "|"
SGList += "Red/" & u.Name & "/" & u.SG.Score & "/" & u.SG.Turned & "|"
Case SGStates.Finished
SGList += "Green/" & u.Name & "/" & u.SG.Score & "|"
SGList += "Green/" & u.Name & "/" & u.SG.Score & "/" & u.SG.Turned & "|"
End Select
Next
End Function
Expand Down
2 changes: 1 addition & 1 deletion 指令表.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Msgbox String
Center String[] ����... ��������������������б�
Room String ���� ���뷿�䣬������������
Game String ���� ������Ϸҳ�棬����������
List String[] ��ɫ/��/��û����ݣ� ˢ���û��б�
List String[] ��ɫ/��/��/�DZ꣨�û����ݣ� ˢ���û��б�
Start Boolean �Ƿ���Կ�ʼ �����л��Ƿ���Կ�ʼ��Ϸ
Content String ����... �ı���Ϸ��ʾ������
Timer Integer ʱ��, String ��ɫ ���õ���ʱ
Expand Down

0 comments on commit 9348c3e

Please sign in to comment.