Skip to content

Commit

Permalink
fix apply and broker messages author (close #301, close #302)
Browse files Browse the repository at this point in the history
  • Loading branch information
foglio1024 committed Oct 26, 2023
1 parent 5b8f973 commit fdbd5b8
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 24 deletions.
1 change: 1 addition & 0 deletions TCC.Core/Data/Chat/ApplyMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public ApplyMessage(uint playerId, Class c, short level, string name, uint serve
{
Channel = ChatChannel.Apply;
Author = name;
DisplayedAuthor = Author;
PlayerId = playerId;
PlayerLevel = level;
UserClass = c;
Expand Down
1 change: 1 addition & 0 deletions TCC.Core/Data/Chat/BrokerChatMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public BrokerChatMessage(uint playerId, uint listing, int item, long amount, lon
ContainsPlayerName = true;
Channel = ChatChannel.Bargain;
Author = name;
DisplayedAuthor = Author;
ListingId = listing;
PlayerId = playerId;

Expand Down
2 changes: 1 addition & 1 deletion TCC.Core/Data/Chat/ChatMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public bool IsVisible
}
public int Size => App.Settings.FontSize;
public string PlainMessage { get; protected init; }
public string DisplayedAuthor { get; } = string.Empty;
public string DisplayedAuthor { get; protected init; } = string.Empty;

#endregion

Expand Down
43 changes: 30 additions & 13 deletions TCC.Core/UI/Controls/Chat/ApplyBody.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,59 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" d:DataContext="{d:DesignData ApplyMessage}">
<StackPanel Orientation="Horizontal" Height="Auto" Margin="2,0,0,0">

<Border Height="Auto" Width="Auto" CornerRadius="9" Background="#7000" Padding="6,0">
<StackPanel.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="2"/>
<Setter Property="Background" >
<Setter.Value>
<SolidColorBrush Color="{StaticResource RevampBorderColor}" Opacity=".4"/>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" >
<Setter.Value>
<SolidColorBrush Color="{StaticResource RevampBorderColor}" Opacity=".8"/>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</StackPanel.Resources>
<Border Height="Auto" Width="Auto" Background="#7000" Padding="6,0">
<StackPanel Orientation="Horizontal">
<Path Data="{Binding UserClass, Converter={StaticResource ClassToSvg}}"
Width="19" Height="19" Fill="White"
Width="Auto" Height="12" Fill="White"
Margin="0,0,3,0" RenderOptions.BitmapScalingMode="HighQuality" />

<TextBlock Text="{Binding PlayerLevel}" Foreground="#afff" FontSize="13" HorizontalAlignment="Center"
VerticalAlignment="Center" Margin="0,-1,0,0" />

</StackPanel>
</Border>
<Border Background="{StaticResource GreenBrush}" Margin="2,0" CornerRadius="11" Padding="6,0" Opacity=".9"
<Border Margin="2,0" Padding="10 0" Opacity=".9"
Cursor="Hand" PreviewMouseLeftButtonDown="AcceptApplyBtn">
<StackPanel Orientation="Horizontal">
<Path Height="12" Width="12" Data="{StaticResource SvgConfirm}" Margin="2 0 4 0"
<Path Height="10" Width="Auto" Data="{StaticResource SvgConfirm}" Margin="0"
Fill="White" />
<TextBlock Text="ACCEPT" Foreground="White" VerticalAlignment="Center" />
<TextBlock Text="ACCEPT" Foreground="White" VerticalAlignment="Center" Margin="4 0" />
</StackPanel>
</Border>
<Border Background="{StaticResource ChatPartyBrush}" Margin="2,0" CornerRadius="11" Padding="6,0" Opacity=".9"
<Border Margin="2,0" Padding="10 0" Opacity=".9"
Cursor="Hand" PreviewMouseLeftButtonDown="InspectBtn">
<StackPanel Orientation="Horizontal">
<Path Height="12" Width="12" Data="{StaticResource SvgEye}" Margin="2 0 4 0"
<Path Height="10" Width="Auto" Data="{StaticResource SvgEye}" Margin="0"
Fill="White" />

<TextBlock Text="INSPECT" Foreground="White" VerticalAlignment="Center" />
<TextBlock Text="INSPECT" Foreground="White" VerticalAlignment="Center" Margin="4 0"/>

</StackPanel>
</Border>
<Border Background="{StaticResource HpBrush}" Margin="2,0" CornerRadius="11" Opacity=".9" Padding="6,0"
<Border Margin="2,0" Opacity=".9" Padding="10 0"
Cursor="Hand" PreviewMouseLeftButtonDown="DeclineApplyBtn">
<StackPanel Orientation="Horizontal">
<Path Height="12" Width="12" Data="{StaticResource SvgClose}" Margin="2 0 4 0"
<Path Height="10" Width="Auto" Data="{StaticResource SvgClose}" Margin="0"
Fill="White" />
<TextBlock Text="DECLINE" Foreground="White" VerticalAlignment="Center" />
<TextBlock Text="DECLINE" Foreground="White" VerticalAlignment="Center" Margin="4 0"/>
</StackPanel>
</Border>
</StackPanel>
Expand Down
7 changes: 4 additions & 3 deletions TeraPacketParser/Messages/S_OTHER_USER_APPLY_PARTY.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ public S_OTHER_USER_APPLY_PARTY(TeraMessageReader reader) : base(reader)
else
{
var nameOffset = reader.ReadUInt16();
reader.Skip(1);
reader.Skip(1); // isRaid?
PlayerId = reader.ReadUInt32();
Class = (Class)reader.ReadInt16();
reader.Skip(4);
reader.Skip(4); //race, gender
Level = reader.ReadInt16();
reader.BaseStream.Position = nameOffset - 4;
reader.RepositionAt(nameOffset);
// bool isWorldEventTarget?
Name = reader.ReadTeraString();
}
}
Expand Down
14 changes: 7 additions & 7 deletions TeraPacketParser/Messages/S_TRADE_BROKER_DEAL_SUGGESTED.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

public class S_TRADE_BROKER_DEAL_SUGGESTED : ParsedMessage
{
public uint PlayerId { get; private set; }
public uint Listing { get; private set; }
public int Item { get; private set; }
public long Amount { get; private set; }
public long SellerPrice { get; private set; }
public long OfferedPrice { get; private set; }
public string Name { get; private set; }
public uint PlayerId { get; }
public uint Listing { get; }
public int Item { get; }
public long Amount { get; }
public long SellerPrice { get; }
public long OfferedPrice { get; }
public string Name { get; }

public S_TRADE_BROKER_DEAL_SUGGESTED(TeraMessageReader reader) : base(reader)
{
Expand Down

0 comments on commit fdbd5b8

Please sign in to comment.