Skip to content

Commit

Permalink
character restore
Browse files Browse the repository at this point in the history
  • Loading branch information
shnok committed Dec 6, 2024
1 parent 8814cc1 commit 34dbd8b
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void SetBool(HumanoidAnimType animType, bool value)
_lastValue = value;
_lastAnimationType = animType;

Debug.LogWarning($"{transform.name} - SetBool: {animType}={value}");
// Debug.LogWarning($"{transform.name} - SetBool: {animType}={value}");

base.SetBool(GetParameterId(animType, _weaponAnim), value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ public void SelectCharacter(int slot)
{
L2ConfirmWindow.Instance.ShowWindow(1555, () =>
{
GameClient.Instance.ClientPacketHandler.SendRequestRestoreCharacter(slot);
},
() =>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
public class RequestCharRestorePacket : ClientPacket
{
public RequestCharRestorePacket(int slot) : base((byte)GameClientPacketType.RequestCharRestore)
{
WriteI(slot);
BuildPacket();
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public enum GameClientPacketType : byte
ValidatePosition = 0x48,
RequestDestroyItem = 0x59,
GMCommand = 0x5b,
RequestCharRestore = 0x62,
RequestRestartPoint = 0x6d,
DoubleOPCode = 0xd0,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,10 @@ public void SendRequestDeleteCharacter(int slot)
RequestCharDeletePacket packet = new RequestCharDeletePacket(slot);
SendPacket(packet);
}

public void SendRequestRestoreCharacter(int slot)
{
RequestCharRestorePacket packet = new RequestCharRestorePacket(slot);
SendPacket(packet);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ private void OnCharSelectionInfoReceive(byte[] data)
GameManager.Instance.NotifyEvent(GameEvent.AUTH_ALLOWED);
});
}
else if (GameManager.Instance.State == GameState.CHAR_SELECT)
else if (GameManager.Instance.State == GameState.CHAR_SELECT || GameManager.Instance.State == GameState.CHAR_CREATION)
{
EventProcessor.Instance.QueueEvent(() =>
{
Expand Down
1 change: 0 additions & 1 deletion l2-unity/Assets/Scripts/UI/L2Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ protected virtual void InitWindow(VisualElement root)

public virtual void HideWindow(bool silent)
{
Debug.LogWarning("HideWindow: " + silent);
_isWindowHidden = true;
_windowEle.style.display = DisplayStyle.None;
_mouseOverDetection.Disable();
Expand Down

0 comments on commit 34dbd8b

Please sign in to comment.