Skip to content

Commit

Permalink
update 2021.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
AinaSnow committed Jan 10, 2021
1 parent a2bcb5a commit 4ef04c8
Show file tree
Hide file tree
Showing 12 changed files with 200 additions and 309 deletions.
203 changes: 0 additions & 203 deletions .editorconfig

This file was deleted.

12 changes: 10 additions & 2 deletions XIVChat Desktop/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ public void RequestFriendList() {
this.outgoingMessages.Writer.TryWrite(msg.Encode());
}

public void ChangeChannel(InputChannel channel) {
var msg = new ClientChannel {
Channel = channel,
};
this.outgoingMessages.Writer.TryWrite(msg.Encode());
}

public void Disconnect() {
this.cancel.Cancel();
for (var i = 0; i < 2; i++) {
Expand Down Expand Up @@ -257,11 +264,12 @@ await stream.WriteAsync(new byte[] {
Close:
try {
this.client.Close();
} catch (ObjectDisposedException) { }
} catch (ObjectDisposedException) {
}
}

private async Task HandleIncoming(byte[] rawMessage) {
var type = (ServerOperation)rawMessage[0];
var type = (ServerOperation) rawMessage[0];
var payload = new byte[rawMessage.Length - 1];
Array.Copy(rawMessage, 1, payload, 0, payload.Length);

Expand Down
91 changes: 90 additions & 1 deletion XIVChat Desktop/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xmlns:cc="clr-namespace:XIVChat_Desktop.Controls"
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:server="clr-namespace:XIVChatCommon.Message.Server;assembly=XIVChatCommon"
xmlns:message="clr-namespace:XIVChatCommon.Message;assembly=XIVChatCommon"
ui:WindowHelper.UseModernWindowStyle="True"
ui:TitleBar.ExtendViewIntoTitleBar="{Binding App.Config.CompactMode}"
mc:Ignorable="d"
Expand Down Expand Up @@ -178,8 +179,96 @@

<TextBlock Margin="8,4,0,0"
Grid.Row="1"
Text="{Binding App.Connection.CurrentChannel, ElementName=Main, UpdateSourceTrigger=PropertyChanged}" />
MouseDown="Channel_MouseDown"
Text="{Binding App.Connection.CurrentChannel, ElementName=Main, UpdateSourceTrigger=PropertyChanged}">
<TextBlock.CommandBindings>
<CommandBinding Command="local:MainWindow.ChangeChannel"
CanExecute="ChangeChannel_CanExecute"
Executed="ChangeChannel_Execute" />
</TextBlock.CommandBindings>

<TextBlock.ContextMenu>
<ContextMenu
DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
<MenuItem Header="Tell"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.Tell}" />
<MenuItem Header="Say"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.Say}" />
<MenuItem Header="Party"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.Party}" />
<MenuItem Header="Alliance"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.Alliance}" />
<MenuItem Header="Yell"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.Yell}" />
<MenuItem Header="Shout"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.Shout}" />
<MenuItem Header="Free Company"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.FreeCompany}" />
<MenuItem Header="PvP Team"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.PvpTeam}" />
<MenuItem Header="Novice Network"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.NoviceNetwork}" />
<MenuItem Header="Cross-world Linkshell [1]"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.CrossLinkshell1}" />
<MenuItem Header="Cross-world Linkshell [2]"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.CrossLinkshell2}" />
<MenuItem Header="Cross-world Linkshell [3]"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.CrossLinkshell3}" />
<MenuItem Header="Cross-world Linkshell [4]"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.CrossLinkshell4}" />
<MenuItem Header="Cross-world Linkshell [5]"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.CrossLinkshell5}" />
<MenuItem Header="Cross-world Linkshell [6]"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.CrossLinkshell6}" />
<MenuItem Header="Cross-world Linkshell [7]"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.CrossLinkshell7}" />
<MenuItem Header="Cross-world Linkshell [8]"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.CrossLinkshell8}" />
<MenuItem Header="Linkshell [1]"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.Linkshell1}" />
<MenuItem Header="Linkshell [2]"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.Linkshell2}" />
<MenuItem Header="Linkshell [3]"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.Linkshell3}" />
<MenuItem Header="Linkshell [4]"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.Linkshell4}" />
<MenuItem Header="Linkshell [5]"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.Linkshell5}" />
<MenuItem Header="Linkshell [6]"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.Linkshell6}" />
<MenuItem Header="Linkshell [7]"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.Linkshell7}" />
<MenuItem Header="Linkshell [8]"
Command="local:MainWindow.ChangeChannel"
CommandParameter="{x:Static message:InputChannel.Linkshell8}" />
</ContextMenu>
</TextBlock.ContextMenu>
</TextBlock>

<TextBox x:Name="InputBox"
ui:ControlHelper.PlaceholderText="{Binding InputPlaceholder, ElementName=Main, UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{Binding App.Connection.Available, ElementName=Main, UpdateSourceTrigger=PropertyChanged, FallbackValue=False}"
Expand Down
Loading

0 comments on commit 4ef04c8

Please sign in to comment.