Browse Source

fix: 🐛 Redraw the bullet in the map

Redraw the bullet in the map
tags/0.1.0
Shawqeem 2 years ago
parent
commit
ffe0e73fae
6 changed files with 18 additions and 17 deletions
  1. +11
    -11
      logic/Client/MainWindow.xaml.cs
  2. +1
    -2
      logic/Client/PlaybackClient.cs
  3. +1
    -1
      logic/Client/Properties/launchSettings.json
  4. +1
    -1
      logic/Server/Properties/launchSettings.json
  5. +1
    -1
      logic/cmd/gameServer.cmd
  6. +3
    -1
      logic/cmd/playback.cmd

+ 11
- 11
logic/Client/MainWindow.xaml.cs View File

@@ -247,8 +247,8 @@ namespace Client
TextBox icon = new() TextBox icon = new()
{ {
FontSize = 10, FontSize = 10,
Width = 20,
Height = 20,
Width = unitWidth,
Height = unitHeight,
Text = text, Text = text,
HorizontalAlignment = HorizontalAlignment.Left, HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top, VerticalAlignment = VerticalAlignment.Top,
@@ -764,11 +764,12 @@ namespace Client
{ {
Ellipse icon = new() Ellipse icon = new()
{ {
Width = 10,
Height = 10,
Width = unitWidth * radiusTimes,
Height = unitHeight * radiusTimes,
HorizontalAlignment = HorizontalAlignment.Left, HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top, VerticalAlignment = VerticalAlignment.Top,
Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth / 2, data.X * unitHeight / 1000.0 - unitHeight / 2, 0, 0),
Margin = new Thickness(data.Y * unitWidth / 1000.0 - unitWidth * radiusTimes / 2, data.X * unitHeight / 1000.0 - unitHeight * radiusTimes / 2, 0, 0),
Fill = Brushes.Red,
}; };
switch (data.Type) switch (data.Type)
{ {
@@ -778,9 +779,8 @@ namespace Client
case Protobuf.BulletType.CommonAttackOfTricker: case Protobuf.BulletType.CommonAttackOfTricker:
case Protobuf.BulletType.BombBomb: case Protobuf.BulletType.BombBomb:
case Protobuf.BulletType.JumpyDumpty: case Protobuf.BulletType.JumpyDumpty:
icon.Fill = Brushes.Red;
break;
default: default:
icon.Fill = Brushes.Red;
break; break;
} }
UpperLayerOfMap.Children.Add(icon); UpperLayerOfMap.Children.Add(icon);
@@ -1194,8 +1194,8 @@ namespace Client
} }
catch (Exception) catch (Exception)
{ {
// ErrorDisplayer error = new("发生错误。以下是系统报告\n" + exc.ToString());
// error.Show();
//ErrorDisplayer error = new("发生错误。以下是系统报告\n" + exc.ToString());
//error.Show();
} }
} }


@@ -1243,8 +1243,8 @@ namespace Client
} }
catch (Exception) catch (Exception)
{ {
// ErrorDisplayer error = new(exc.Message);
// error.Show();
//ErrorDisplayer error = new(exc.Message)
//error.Show()
} }
} }




+ 1
- 2
logic/Client/PlaybackClient.cs View File

@@ -52,7 +52,7 @@ namespace Client
{ {
var msg = mapCollecter.ReadOne(); var msg = mapCollecter.ReadOne();
if (msg == null) if (msg == null)
throw new Exception("Map messgae is not in the playback file!");
throw new Exception("Map message is not in the playback file!");
foreach (var obj in msg.ObjMessage) foreach (var obj in msg.ObjMessage)
{ {
if (obj.MessageOfObjCase == MessageOfObj.MessageOfObjOneofCase.MapMessage) if (obj.MessageOfObjCase == MessageOfObj.MessageOfObjOneofCase.MapMessage)
@@ -78,7 +78,6 @@ namespace Client
break; break;
} }
} }

}; };


new Thread(() => new Thread(() =>


+ 1
- 1
logic/Client/Properties/launchSettings.json View File

@@ -2,7 +2,7 @@
"profiles": { "profiles": {
"Client": { "Client": {
"commandName": "Project", "commandName": "Project",
"commandLineArgs": "--cl --ip 127.0.0.1 --port 8888 --characterID 0 --type 1 --occupation 1"
"commandLineArgs": " --cl --port 8888 --characterID 0 --type 1 --occupation 1"
} }
} }
} }

+ 1
- 1
logic/Server/Properties/launchSettings.json View File

@@ -2,7 +2,7 @@
"profiles": { "profiles": {
"Server": { "Server": {
"commandName": "Project", "commandName": "Project",
"commandLineArgs": "--ip 0.0.0.0 -p 8888 --teamCount 1 --studentCount 1 --trickerCount 0"
"commandLineArgs": "--ip 0.0.0.0 -p 8888 --studentCount 1 --trickerCount 1"
} }
} }
} }

+ 1
- 1
logic/cmd/gameServer.cmd View File

@@ -4,7 +4,7 @@ start cmd /k ..\Server\bin\Debug\net6.0\Server.exe --ip 0.0.0.0 --port 8888 --s


ping -n 2 127.0.0.1 > NUL ping -n 2 127.0.0.1 > NUL


start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port 8888 --characterID 4 --type 2 --occupation 2
start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --port 8888 --characterID 4 --type 2 --occupation 1


ping -n 2 127.0.0.1 > NUL ping -n 2 127.0.0.1 > NUL




+ 3
- 1
logic/cmd/playback.cmd View File

@@ -1,3 +1,5 @@
@echo off @echo off


start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --playbackFile D:\2_autumn\thuai6\THUAI6\logic\cmd\test.thuaipb
start cmd /k ..\Client\bin\Debug\net6.0-windows\Client.exe --cl --playbackFile D:\2_autumn\thuai6\THUAI6\logic\cmd\test.thuaipb

ping -n 2 127.0.0.1 > NUL

Loading…
Cancel
Save