Skip to content

Commit

Permalink
request unequip, request use item
Browse files Browse the repository at this point in the history
  • Loading branch information
shnok committed Aug 14, 2024
1 parent 3456c54 commit e6aaa66
Show file tree
Hide file tree
Showing 9 changed files with 171 additions and 122 deletions.
218 changes: 109 additions & 109 deletions l2-unity/Assets/Scenes/Menu.unity
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 0.245
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 1061591418}
m_IndirectSpecularColor: {r: 0.063133255, g: 0.093109384, b: 0.10891574, a: 0.245}
m_IndirectSpecularColor: {r: 0.029895507, g: 0.06798504, b: 0.08975239, a: 0.245}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
Expand Down Expand Up @@ -123,75 +123,6 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!21 &402365597
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Override
m_Shader: {fileID: 4800000, guid: a3a3bc8785681554d9558e2ea68f100e, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Ints: []
m_Floats:
- _AdvancedCat: 1
- _Banner: 1
- _DirectionalCat: 1
- _DirectionalFalloff: 2
- _DirectionalIntensity: 1
- _FarDistanceHeight: 0
- _FarDistanceOffset: 0
- _FogAxisMode: 1
- _FogCameraMode: 0
- _FogCat: 1
- _FogColorDuo: 1
- _FogDistanceEnd: 100
- _FogDistanceFalloff: 2
- _FogDistanceStart: 0
- _FogHeightEnd: 100
- _FogHeightFalloff: 2
- _FogHeightStart: 0
- _FogIntensity: 1
- _FogLayersMode: 0
- _IsHeightFogPreset: 1
- _IsHeightFogShader: 1
- _JitterIntensity: 1
- _NoiseCat: 1
- _NoiseDistanceEnd: 50
- _NoiseIntensity: 1
- _NoiseMax: 1
- _NoiseMin: 0
- _NoiseModeBlend: 1
- _NoiseScale: 30
- _SkyboxCat: 1
- _SkyboxFogBottom: 0
- _SkyboxFogFalloff: 1
- _SkyboxFogFill: 1
- _SkyboxFogHeight: 1
- _SkyboxFogIntensity: 1
- _SkyboxFogOffset: 0
m_Colors:
- _DirectionalColor: {r: 1, g: 0.7793103, b: 0.5, a: 1}
- _DirectionalDir: {r: 0, g: 0, b: 0, a: 0}
- _FogAxisOption: {r: 0, g: 0, b: 0, a: 0}
- _FogColorEnd: {r: 0.8862745, g: 1.443137, b: 2, a: 1}
- _FogColorStart: {r: 0.4411765, g: 0.722515, b: 1, a: 1}
- _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0}
m_BuildTextureStacks: []
--- !u!1 &413261805
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -241,6 +172,41 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!21 &453888385
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Height Fog Global
m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Ints: []
m_Floats:
- _AdvancedCat: 1
- _Banner: 1
- _DirectionalCat: 1
- _FogCat: 1
- _HeightFogGlobal: 1
- _IsHeightFogShader: 1
- _NoiseCat: 1
- _SkyboxCat: 1
m_Colors: []
m_BuildTextureStacks: []
--- !u!1001 &461980325
PrefabInstance:
m_ObjectHideFlags: 0
Expand All @@ -251,7 +217,7 @@ PrefabInstance:
m_Modifications:
- target: {fileID: 842763773635486120, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3}
propertyPath: _autoLogin
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4644061901774829026, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3}
propertyPath: m_LocalPosition.x
Expand Down Expand Up @@ -295,19 +261,19 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3}
propertyPath: _mapList.Array.size
value: 4
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3}
propertyPath: _mapList.Array.data[0]
value: 17_25
objectReference: {fileID: 0}
- target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3}
propertyPath: _mapList.Array.data[1]
value: 17_24
value: 16_24
objectReference: {fileID: 0}
- target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3}
propertyPath: _mapList.Array.data[2]
value: 16_25
value: 16_24
objectReference: {fileID: 0}
- target: {fileID: 5806285974765348047, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3}
propertyPath: _mapList.Array.data[3]
Expand All @@ -325,6 +291,75 @@ PrefabInstance:
insertIndex: -1
addedObject: {fileID: 1859807133}
m_SourcePrefab: {fileID: 100100000, guid: 2bc6245aea0342f4f8c76719bfe12012, type: 3}
--- !u!21 &589058360
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Override
m_Shader: {fileID: 4800000, guid: a3a3bc8785681554d9558e2ea68f100e, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Ints: []
m_Floats:
- _AdvancedCat: 1
- _Banner: 1
- _DirectionalCat: 1
- _DirectionalFalloff: 2
- _DirectionalIntensity: 1
- _FarDistanceHeight: 0
- _FarDistanceOffset: 0
- _FogAxisMode: 1
- _FogCameraMode: 0
- _FogCat: 1
- _FogColorDuo: 1
- _FogDistanceEnd: 100
- _FogDistanceFalloff: 2
- _FogDistanceStart: 0
- _FogHeightEnd: 100
- _FogHeightFalloff: 2
- _FogHeightStart: 0
- _FogIntensity: 1
- _FogLayersMode: 0
- _IsHeightFogPreset: 1
- _IsHeightFogShader: 1
- _JitterIntensity: 1
- _NoiseCat: 1
- _NoiseDistanceEnd: 50
- _NoiseIntensity: 1
- _NoiseMax: 1
- _NoiseMin: 0
- _NoiseModeBlend: 1
- _NoiseScale: 30
- _SkyboxCat: 1
- _SkyboxFogBottom: 0
- _SkyboxFogFalloff: 1
- _SkyboxFogFill: 1
- _SkyboxFogHeight: 1
- _SkyboxFogIntensity: 1
- _SkyboxFogOffset: 0
m_Colors:
- _DirectionalColor: {r: 1, g: 0.7793103, b: 0.5, a: 1}
- _DirectionalDir: {r: 0, g: 0, b: 0, a: 0}
- _FogAxisOption: {r: 0, g: 0, b: 0, a: 0}
- _FogColorEnd: {r: 0.8862745, g: 1.443137, b: 2, a: 1}
- _FogColorStart: {r: 0.4411765, g: 0.722515, b: 1, a: 1}
- _NoiseSpeed: {r: 0.5, g: 0, b: 0.5, a: 0}
m_BuildTextureStacks: []
--- !u!1 &803395386
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -840,41 +875,6 @@ PrefabInstance:
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8742fc349ac4f354d9cfb98ebb79a0e3, type: 3}
--- !u!21 &1214314565
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Height Fog Global
m_Shader: {fileID: 4800000, guid: 3a7ef1b66bafb7a448a880ef76d2e6e6, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs: []
m_Ints: []
m_Floats:
- _AdvancedCat: 1
- _Banner: 1
- _DirectionalCat: 1
- _FogCat: 1
- _HeightFogGlobal: 1
- _IsHeightFogShader: 1
- _NoiseCat: 1
- _SkyboxCat: 1
m_Colors: []
m_BuildTextureStacks: []
--- !u!21 &1337740698
Material:
serializedVersion: 8
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RequestUnEquipPacket : ClientPacket {
public RequestUnEquipPacket(int slot) : base((byte)GameClientPacketType.RequestUnEquip) {
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
@@ -0,0 +1,10 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class UseItemPacket : ClientPacket {
public UseItemPacket(int itemObjectId) : base((byte)GameClientPacketType.UseItem) {
WriteI(itemObjectId);
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 @@ -14,5 +14,7 @@ public enum GameClientPacketType : byte
RequestAutoAttack = 0x0B,
RequestCharSelect = 0x0C,
RequestInventoryOpen = 0x0D,
RequestInventoryUpdateOrder = 0x0E
RequestInventoryUpdateOrder = 0x0E,
UseItem = 0x0F,
RequestUnEquip = 0x10
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Threading;
using System;
using System.Threading;
using UnityEngine;

public class GameClientPacketHandler : ClientPacketHandler
Expand Down Expand Up @@ -109,5 +110,15 @@ public override void SendPacket(ClientPacket packet) {

_client.SendPacket(packet);
}

public void UseItem(int objectId) {
UseItemPacket packet = new UseItemPacket(objectId);
SendPacket(packet);
}

public void UnEquipItem(int position) {
RequestUnEquipPacket packet = new RequestUnEquipPacket(position);
SendPacket(packet);
}
}

5 changes: 1 addition & 4 deletions l2-unity/Assets/Scripts/UI/Game/Inventory/GearSlot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ public class GearSlot : InventorySlot
{
public GearSlot(int position, VisualElement slotElement, InventoryGearTab tab) : base(position, slotElement, tab) {
}

public GearSlot(int position, AbstractItem item, VisualElement slotElement, InventoryGearTab tab) : base(position, item, slotElement, tab) {
}

protected override void HandleRightClick() {

GameClient.Instance.ClientPacketHandler.UnEquipItem(_position);
}
}
Loading

0 comments on commit e6aaa66

Please sign in to comment.