Merge branch 'develop' of ssh://git.pthub.vn:3222/Unity/perfect-world-unity into fix-ui

This commit is contained in:
Chomper9981
2026-04-06 13:39:58 +07:00
35 changed files with 22127 additions and 37409 deletions
@@ -20,7 +20,7 @@ MonoBehaviour:
m_IncludeLabelsInCatalog: 1
m_InternalIdNamingMode: 0
m_CacheClearBehavior: 0
m_IncludeInBuild: 1
m_IncludeInBuild: 0
m_BundledAssetProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider
@@ -0,0 +1,53 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: empty
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5ec58c5879c1b944e9ffe75104d09a69
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:
@@ -30,6 +30,9 @@ AnimatorStateMachine:
- serializedVersion: 1
m_State: {fileID: -4168332861537921842}
m_Position: {x: 410, y: 390, z: 0}
- serializedVersion: 1
m_State: {fileID: -5604009941558051294}
m_Position: {x: 173, y: 281, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
@@ -39,7 +42,7 @@ AnimatorStateMachine:
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 4680987466827899697}
m_DefaultState: {fileID: -5604009941558051294}
--- !u!1102 &-8169011669238131426
AnimatorState:
serializedVersion: 6
@@ -66,6 +69,32 @@ AnimatorState:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &-5604009941558051294
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: empty
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 5ec58c5879c1b944e9ffe75104d09a69, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &-4168332861537921842
AnimatorState:
serializedVersion: 6
@@ -64,7 +64,7 @@ AnimatorState:
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 2d078e760e20f8a408d08a742ee73a12, type: 2}
m_Motion: {fileID: 7400000, guid: 217896426b9421043b9d831f475d7fd6, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
@@ -2178,7 +2178,7 @@ Transform:
m_GameObject: {fileID: 5309046727013202809}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.012923843, y: -1.3504136, z: -0.4613162}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
@@ -327,7 +327,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 683691332668038506}
serializedVersion: 2
m_LocalRotation: {x: -0.11101045, y: -0.04166929, z: -0.5077211, w: 0.8533228}
m_LocalRotation: {x: -0.11101045, y: -0.041669287, z: -0.5077211, w: 0.8533227}
m_LocalPosition: {x: 0.09138348, y: -0.0000002315723, z: 0.000000084809784}
m_LocalScale: {x: 1, y: 1, z: 0.99999994}
m_ConstrainProportionsScale: 0
@@ -584,9 +584,9 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2766410454018355639}
serializedVersion: 2
m_LocalRotation: {x: -0.49705055, y: -0.50293314, z: 0.50293213, w: 0.49704963}
m_LocalPosition: {x: -2.4329233e-27, y: 2.0678083e-25, z: -3.287398e-11}
m_LocalScale: {x: 0.99999994, y: 1, z: 1}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4351620120512775520}
@@ -774,7 +774,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4720879457648212373}
serializedVersion: 2
m_LocalRotation: {x: 0.024982965, y: 0.00096658804, z: -0.9989833, w: 0.037512425}
m_LocalRotation: {x: 0.024982966, y: 0.0009665881, z: -0.9989834, w: 0.03751243}
m_LocalPosition: {x: -0.08085043, y: -0.07029506, z: -0.013821308}
m_LocalScale: {x: 0.9999999, y: 0.99999994, z: 0.99999994}
m_ConstrainProportionsScale: 0
@@ -1493,7 +1493,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7384772661047576604}
serializedVersion: 2
m_LocalRotation: {x: -0.00038805598, y: -0.22343403, z: 0.00008893757, w: 0.97471905}
m_LocalRotation: {x: -0.000388056, y: -0.22343402, z: 0.00008893758, w: 0.974719}
m_LocalPosition: {x: 0.08985962, y: 0.018896379, z: -0.0053303735}
m_LocalScale: {x: 1, y: 0.9999999, z: 1}
m_ConstrainProportionsScale: 0
@@ -1636,7 +1636,7 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 3432869450322735176}
- component: {fileID: 8487291170773602984}
- component: {fileID: 7911336747716875204}
m_Layer: 0
m_Name: "2014\u65B0\u79CD\u65CF\u5DE7\u5320"
m_TagString: Untagged
@@ -1660,7 +1660,7 @@ Transform:
- {fileID: 4714765410777422588}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &8487291170773602984
--- !u!114 &7911336747716875204
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@@ -1675,14 +1675,7 @@ MonoBehaviour:
_Animator: {fileID: 4328270040671007892}
_ActionOnDisable: 0
_PlayAutomatically: 1
_Animations:
- {fileID: 7400000, guid: ff7f1e5e882324a469a70cfefa9c815e, type: 2}
- {fileID: 7400000, guid: 171b0c7c8f63347439332ac5c833d337, type: 2}
- {fileID: 7400000, guid: 20a8352695b4d4a6d8ed1cf119af9ccf, type: 2}
- {fileID: 7400000, guid: 03d1d0dceb1e74cbfaca89d2783d7319, type: 2}
- {fileID: 7400000, guid: 9cbe42f89845e4b31af0b10e6cf274a2, type: 2}
- {fileID: 7400000, guid: bde667d51444f4e6b94641f17deaf307, type: 2}
- {fileID: 7400000, guid: eeaa622c67e5c480dbc95a8074b5c38f, type: 2}
_Animations: []
--- !u!1 &7981313314164196668
GameObject:
m_ObjectHideFlags: 0
@@ -1770,7 +1763,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8647186964427882809}
serializedVersion: 2
m_LocalRotation: {x: 0.07870702, y: -0.078707896, z: -0.7027125, w: 0.70271283}
m_LocalRotation: {x: 0.078707024, y: -0.0787079, z: -0.70271254, w: 0.7027129}
m_LocalPosition: {x: -1.0297341, y: -0.0000007519037, z: -0.2618062}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
@@ -1836,7 +1829,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8716198479051244947}
serializedVersion: 2
m_LocalRotation: {x: -0.50000006, y: 0.49999994, z: 0.49999988, w: 0.50000006}
m_LocalRotation: {x: -0.5000001, y: 0.49999997, z: 0.4999999, w: 0.5000001}
m_LocalPosition: {x: 0.81044877, y: 0.19025493, z: -0.18675323}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
@@ -120,8 +120,8 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1365927648587094752}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.012923843, y: -1.3504136, z: -0.4613162}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
@@ -130,7 +130,7 @@ Transform:
- {fileID: 5081897400159099243}
- {fileID: 6219556052433732146}
m_Father: {fileID: 4511886399783565272}
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!95 &7617229724733668831
Animator:
serializedVersion: 7
@@ -2001,7 +2001,7 @@ MonoBehaviour:
_ActionOnDisable: 0
_PlayAutomatically: 1
_Animations:
- {fileID: 7400000, guid: 01a151ebb1153164180c7daceca0c369, type: 2}
- {fileID: 7400000, guid: d41c0ac6d2feb814fa5909eee11f08a1, type: 2}
- {fileID: 7400000, guid: 980ce179e505aeb4a890c294faa12d09, type: 2}
- {fileID: 7400000, guid: 38722ca2f20193d46a2ec001ba821bf4, type: 2}
- {fileID: 7400000, guid: 20c7d8667e95984498389bc2fcac0eb9, type: 2}
@@ -0,0 +1,39 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: LoginScreenCharacterRT
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_IsAlphaChannelOptional: 0
serializedVersion: 6
m_Width: 512
m_Height: 512
m_AntiAliasing: 1
m_MipCount: -1
m_DepthStencilFormat: 90
m_ColorFormat: 12
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_UseDynamicScaleExplicit: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_EnableRandomWrite: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 0
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1
m_ShadowSamplingMode: 2
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7b35d3c1ebbb32d47a5ed61606928730
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 8400000
userData:
assetBundleName:
assetBundleVariant:
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4b854fd255462f21d3b44d27526138345930a673f5c74cd2c1ca261ebd834048
size 106212
oid sha256:5fedb46b8c46815ef20d80e72e93f234c41654ea51bee27911deff7bb480572b
size 111019
@@ -159,6 +159,7 @@ namespace BrewMonster.Scripts
return true;
}
/// <summary>C++ <c>CECInventory::MergeItem</c>: walk slots, call <c>CECIvtrItem::MergeItem</c>, then new slot if needed.</summary>
public bool MergeItem(int tid, int iExpireDate, int iAmount, out int piLastSlot, out int piLastAmount)
{
piLastSlot = -1;
@@ -171,16 +172,8 @@ namespace BrewMonster.Scripts
var slotItem = m_aItems[i];
if (slotItem != null)
{
if (slotItem.GetTemplateID() != tid)
continue;
int pileLimit = Math.Max(1, EC_IvtrItem.GetPileLimit(tid));
int canAdd = Math.Max(0, pileLimit - Math.Max(0, slotItem.GetCount()));
if (canAdd <= 0) continue;
int add = Math.Min(canAdd, iAmount);
slotItem.AddAmount(add);
iAmount -= add;
int iNumMerge = slotItem.MergeItem(tid, iAmount);
iAmount -= iNumMerge;
if (iAmount == 0)
{
@@ -22,10 +22,15 @@ namespace BrewMonster.Scripts.Managers
{
[Header("Pack Buttons (assign in Inspector)")]
[SerializeField] private List<Button> inventoryPackButtons = new List<Button>(); // byPackage: 0
[Tooltip("Main slot grid: shows IVTRTYPE_PACK (0) on Item tab and IVTRTYPE_TASKPACK (2) on Task tab.")]
[SerializeField] private List<Button> inventoryPackButtons = new List<Button>();
[SerializeField] private List<Button> equipmentPackButtons = new List<Button>(); // byPackage: 1
[SerializeField] private List<Button> fashionPackButtons = new List<Button>(); // byPackage: 3
[Header("Inventory tabs — Item vs Task (original PW)")]
[SerializeField] private Button tabItemButton;
[SerializeField] private Button tabTaskButton;
[Header("Detail Panel (assign in Inspector)")]
[SerializeField] private ItemInfo detailPanelRoot;
[SerializeField] private Vector2 detailPanelOffset = new Vector2(20f, 0f);
@@ -89,14 +94,24 @@ namespace BrewMonster.Scripts.Managers
private EC_IvtrItem currentSelectedItem;
private EC_IvtrItem currentSelectedEquipment;
private const byte PKG_INVENTORY = 0;
private const byte PKG_EQUIPMENT = 1;
private const byte PKG_FASHION = 3; // Note: byPackage 3 used for Fashion
private const byte PKG_INVENTORY = InventoryConst.IVTRTYPE_PACK;
private const byte PKG_EQUIPMENT = InventoryConst.IVTRTYPE_EQUIPPACK;
private const byte PKG_TASK = InventoryConst.IVTRTYPE_TASKPACK;
private const byte PKG_FASHION = 3; // Trash / fashion box slot in legacy client (GetInventory may not resolve; see host)
public enum InventoryBagTab
{
Item,
Task,
}
private InventoryBagTab _bagTab = InventoryBagTab.Item;
private void Awake()
{
model = new InventoryModel();
view = new InventoryView();
WireBagTabButtons();
//if (currentDragImage == null)
//{
@@ -115,7 +130,7 @@ namespace BrewMonster.Scripts.Managers
private void Start()
{
RefreshAll();
SetBagTab(InventoryBagTab.Item);
if (hideDetailOnStart)
{
ShowDetailPanel(false);
@@ -130,6 +145,29 @@ namespace BrewMonster.Scripts.Managers
ApplyPendingCurrency();
UpdateCharacterInfo();
ShowDetailPanel(false);
RefreshAll();
}
private void WireBagTabButtons()
{
if (tabItemButton != null)
{
tabItemButton.onClick.RemoveAllListeners();
tabItemButton.onClick.AddListener(() => SetBagTab(InventoryBagTab.Item));
}
if (tabTaskButton != null)
{
tabTaskButton.onClick.RemoveAllListeners();
tabTaskButton.onClick.AddListener(() => SetBagTab(InventoryBagTab.Task));
}
}
/// <summary>Switches main bag view between normal items (tab 1) and task / quest bag (tab 2), like legacy PW.</summary>
public void SetBagTab(InventoryBagTab tab)
{
_bagTab = tab;
ShowDetailPanel(false);
RefreshAll();
}
private void Update()
@@ -149,9 +187,10 @@ namespace BrewMonster.Scripts.Managers
/// </summary>
public void UpdateCooldownOverlays()
{
// Update inventory pack cooldowns
// Main grid shows either normal pack or task pack depending on tab
// 更新背包冷却
UpdatePackageCooldowns(inventoryPackButtons, PKG_INVENTORY);
byte mainPack = _bagTab == InventoryBagTab.Item ? PKG_INVENTORY : PKG_TASK;
UpdatePackageCooldowns(inventoryPackButtons, mainPack);
}
/// <summary>
@@ -204,8 +243,16 @@ namespace BrewMonster.Scripts.Managers
var invItems = model.GetInventoryData(PKG_INVENTORY);
var eqpItems = model.GetInventoryData(PKG_EQUIPMENT);
var fshItems = model.GetInventoryData(PKG_FASHION);
var taskItems = model.GetInventoryData(PKG_TASK);
view.RenderPackage(inventoryPackButtons, invItems, PKG_INVENTORY, OnInventoryButtonClicked, GetDisplayTextForItem);
if (_bagTab == InventoryBagTab.Item)
{
view.RenderPackage(inventoryPackButtons, invItems, PKG_INVENTORY, OnInventoryButtonClicked, GetDisplayTextForItem);
}
else
{
view.RenderPackage(inventoryPackButtons, taskItems, PKG_TASK, OnInventoryButtonClicked, GetDisplayTextForItem);
}
view.RenderPackage(equipmentPackButtons, eqpItems, PKG_EQUIPMENT, OnInventoryButtonClicked, GetDisplayTextForItem);
view.RenderPackage(fashionPackButtons, fshItems, PKG_FASHION, OnInventoryButtonClicked, GetDisplayTextForItem);
UpdateCharacterInfo();
@@ -378,7 +425,7 @@ namespace BrewMonster.Scripts.Managers
return;
}
if (currentSelectedPackage == PKG_INVENTORY)
if (currentSelectedPackage == PKG_INVENTORY || currentSelectedPackage == PKG_TASK)
{
// Check if item is equipment
if (currentSelectedItem.IsEquipment())
@@ -415,9 +462,9 @@ namespace BrewMonster.Scripts.Managers
return;
}
if (currentSelectedPackage != PKG_INVENTORY)
if (currentSelectedPackage != PKG_INVENTORY && currentSelectedPackage != PKG_TASK)
{
Debug.LogWarning("[InventoryUI] Can only use items from inventory package");
Debug.LogWarning("[InventoryUI] Can only use items from inventory or task package");
return;
}
@@ -873,6 +920,23 @@ namespace BrewMonster.Scripts.Managers
}
}
/// <summary>
/// Stack count label under slot buttons: prefabs use <c>text_quatity</c> (typo) or <c>text_quantity</c>; legacy code used <c>text_quality</c>.
/// Only checks immediate children (Unity <see cref="Transform.Find"/>); deeper layouts fall back to <see cref="Component.GetComponentInChildren{T}"/> below.
/// </summary>
private static Transform FindStackCountTextTransform(Transform root)
{
if (root == null) return null;
string[] names = { "text_quality", "text_quatity", "text_quantity" };
for (int n = 0; n < names.Length; n++)
{
var t = root.Find(names[n]);
if (t != null) return t;
}
return null;
}
/// <summary>
/// Update or create text component to show item count on the button
/// </summary>
@@ -885,22 +949,19 @@ namespace BrewMonster.Scripts.Managers
TMPro.TextMeshProUGUI tmpText = null;
Text legacyText = null;
// Find text component
var textTransform = button.transform.Find("text_quality");
var textTransform = FindStackCountTextTransform(button.transform);
if (textTransform != null)
{
tmpText = textTransform.GetComponent<TMPro.TextMeshProUGUI>();
legacyText = textTransform.GetComponent<Text>();
}
else
if (tmpText == null && legacyText == null)
{
// Fallback: find any text in children
tmpText = button.GetComponentInChildren<TMPro.TextMeshProUGUI>();
if (tmpText == null)
{
legacyText = button.GetComponentInChildren<Text>();
}
}
// Update text
@@ -950,6 +1011,7 @@ namespace BrewMonster.Scripts.Managers
switch (package)
{
case PKG_INVENTORY:
case PKG_TASK:
list = inventoryPackButtons;
break;
case PKG_EQUIPMENT:
@@ -1061,7 +1123,7 @@ namespace BrewMonster.Scripts.Managers
var tmpText = equipButton.GetComponentInChildren<TMPro.TextMeshProUGUI>();
if (tmpText != null)
{
if (package == PKG_INVENTORY)
if (package == PKG_INVENTORY || package == PKG_TASK)
{
//if item is @EC_IvtrEquip and is not equipped, show equip button
if(item is EC_IvtrEquip)
@@ -1088,7 +1150,7 @@ namespace BrewMonster.Scripts.Managers
}
else
{
if (package == PKG_INVENTORY)
if (package == PKG_INVENTORY || package == PKG_TASK)
{
if(item is EC_IvtrEquip)
{
@@ -1210,14 +1210,12 @@ namespace BrewMonster.Scripts
return iNumAdd;
}
/// <summary>Add item amount. Returns new amount of item.</summary>
/// <summary>Add item amount. Returns new count (C++ <c>a_Clamp</c> to <c>m_iPileLimit</c>).</summary>
public int AddAmount(int iAmount)
{
Debug.Log($"[EC_IvtrItem] Old Amount: {m_iCount}");
m_iCount += iAmount;
if (m_iCount < 0) m_iCount = 0;
//if (m_iCount > m_iPileLimit) m_iCount = m_iPileLimit;
Debug.Log($"[EC_IvtrItem] New Amount: {m_iCount}");
if (m_iCount > m_iPileLimit) m_iCount = m_iPileLimit;
return m_iCount;
}
@@ -0,0 +1,108 @@
using System.Collections.Generic;
using BrewMonster.Scripts.Managers;
using CSNetwork.Protocols.RPCData;
using UnityEngine;
namespace BrewMonster.Scripts
{
public class PlayerModelPreview : MonoBehaviour
{
[SerializeField] private Transform modelRoot;
public List<GameObject> playerModels = new();
public List<int> playerModelIds = new();
private int _loadVersion;
private void Awake()
{
if (modelRoot == null)
modelRoot = transform;
}
private void OnDestroy()
{
ClearModelsImmediate();
}
/// <summary>
/// Loads one preview instance per role (via <see cref="NPCManager.GetModelPlayer"/>).
/// All instances stay hidden until <see cref="ShowPlayerModel"/> is called.
/// </summary>
public async void ShowAllPlayerModels(List<RoleInfo> roleInfos)
{
_loadVersion++;
int version = _loadVersion;
ClearModels();
if (roleInfos == null || roleInfos.Count == 0 || NPCManager.Instance == null)
return;
for (int i = 0; i < roleInfos.Count; i++)
{
RoleInfo role = roleInfos[i];
GameObject model = await NPCManager.Instance.GetModelPlayer(role.occupation, role.gender);
if (version != _loadVersion)
{
if (model != null)
Destroy(model);
return;
}
if (model == null)
continue;
model.transform.SetParent(modelRoot, false);
model.transform.localPosition = Vector3.zero;
model.transform.localRotation = Quaternion.identity;
model.SetActive(false);
playerModels.Add(model);
playerModelIds.Add(role.roleid);
}
}
/// <summary>
/// Shows the preview for the given role id (matches <see cref="RoleInfo.roleid"/>). Hides all others.
/// </summary>
public void ShowPlayerModel(int playerModelId)
{
int n = Mathf.Min(playerModels.Count, playerModelIds.Count);
for (int i = 0; i < n; i++)
{
GameObject go = playerModels[i];
if (go == null)
continue;
go.SetActive(playerModelIds[i] == playerModelId);
}
}
private void ClearModels()
{
for (int i = 0; i < playerModels.Count; i++)
{
if (playerModels[i] != null)
Destroy(playerModels[i]);
}
playerModels.Clear();
playerModelIds.Clear();
}
private void ClearModelsImmediate()
{
for (int i = 0; i < playerModels.Count; i++)
{
if (playerModels[i] != null)
{
if (Application.isPlaying)
Destroy(playerModels[i]);
else
DestroyImmediate(playerModels[i]);
}
}
playerModels.Clear();
playerModelIds.Clear();
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 23db063ab37a953418e01ed3b67c0134
@@ -244,7 +244,7 @@ namespace BrewMonster
m_SelectedEquip?.Freeze(false);
m_SelectedEquip = null;
m_FirstInvSlot = -1;
m_TxtFirstName.text = "___";
m_TxtFirstName.text = "";
ClearSlotIcon(m_SlotFirstParent);
if (m_Mode == InstallMode.Disenchase)
{
@@ -263,7 +263,7 @@ namespace BrewMonster
m_SelectedMaterial?.Freeze(false);
m_SelectedMaterial = null;
m_SecondInvSlot = -1;
m_TxtSecondName.text = "___";
m_TxtSecondName.text = "Nguyên liệu";
ClearSlotIcon(m_SlotSecondParent);
m_TxtMoney.text = "0";
m_install_price = -1;
@@ -392,11 +392,11 @@ namespace BrewMonster
m_SelectedEquip = null;
m_SelectedMaterial = null;
m_TxtFirstName.text = "___";
m_TxtFirstName.text = "";
m_TxtMoney.text = "0";
if (m_Mode == InstallMode.Enchase)
m_TxtSecondName.text = "___";
m_TxtSecondName.text = "Nguyên liệu";
ClearSlotIcon(m_SlotFirstParent);
if (m_Mode == InstallMode.Enchase)
@@ -368,7 +368,7 @@ namespace BrewMonster.UI
ClearSlotIcon(m_pImg_Item);
if (m_pTxtName != null)
m_pTxtName.text = "___";
m_pTxtName.text = "";
if(m_pTxtGold != null)
m_pTxtGold.text = "0";
@@ -190,7 +190,7 @@ namespace BrewMonster.UI
m_nSlot = -1;
if (m_pTxt_Name != null)
m_pTxt_Name.text = "___";
m_pTxt_Name.text = "";
if (m_pTxt_Gold != null)
m_pTxt_Gold.text = "0";
+1 -1
View File
@@ -6213,7 +6213,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 50000/500
m_text: 0
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 369c2e14814cc9a4b8e3ad4e37769134, type: 2}
m_sharedMaterial: {fileID: 9092487103257209053, guid: 369c2e14814cc9a4b8e3ad4e37769134, type: 2}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+137
View File
@@ -4881,6 +4881,142 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &3077515738806293153
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3272361582337230618}
- component: {fileID: 9055023317888487093}
- component: {fileID: 327034515469265908}
m_Layer: 0
m_Name: title
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3272361582337230618
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3077515738806293153}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7273766423879916230}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -2.458, y: 357.688}
m_SizeDelta: {x: 453.1381, y: 53.376}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &9055023317888487093
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3077515738806293153}
m_CullTransparentMesh: 1
--- !u!114 &327034515469265908
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3077515738806293153}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "Th\u01B0\u01A1ng Ph\u1EA9m"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 369c2e14814cc9a4b8e3ad4e37769134, type: 2}
m_sharedMaterial: {fileID: 9092487103257209053, guid: 369c2e14814cc9a4b8e3ad4e37769134, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 36
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &3191595193309321024
GameObject:
m_ObjectHideFlags: 0
@@ -9612,6 +9748,7 @@ RectTransform:
- {fileID: 3438859306002015039}
- {fileID: 746082193864232598}
- {fileID: 8774337134237393560}
- {fileID: 3272361582337230618}
m_Father: {fileID: 2620840836205932051}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+18 -19
View File
@@ -1961,7 +1961,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &64585481268713917
RectTransform:
m_ObjectHideFlags: 0
@@ -1977,9 +1977,9 @@ RectTransform:
- {fileID: 7063925482172052076}
m_Father: {fileID: 4359352035478671586}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 92.65, y: -36.303}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 185.3, y: 72.606}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6580926924470282336
@@ -10280,7 +10280,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &7214549036987193986
RectTransform:
m_ObjectHideFlags: 0
@@ -10296,9 +10296,9 @@ RectTransform:
- {fileID: 8707107604074202174}
m_Father: {fileID: 4359352035478671586}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 463.25, y: -36.30285}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 185.3, y: 72.6057}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6248269220837765992
@@ -10322,7 +10322,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Color: {r: 1, g: 1, b: 1, a: 0.33333334}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
@@ -10378,7 +10378,7 @@ MonoBehaviour:
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_Interactable: 0
m_TargetGraphic: {fileID: 8383648154857910679}
m_OnClick:
m_PersistentCalls:
@@ -12562,6 +12562,8 @@ MonoBehaviour:
- {fileID: 6415804096478650164}
- {fileID: 486249631205428665}
fashionPackButtons: []
tabItemButton: {fileID: 1025193074652694500}
tabTaskButton: {fileID: 8447324723389536767}
detailPanelRoot: {fileID: 759109931263093524}
detailPanelOffset: {x: 20, y: 0}
hideDetailOnStart: 1
@@ -12576,9 +12578,6 @@ MonoBehaviour:
moneyTextsLegacy: []
moneyTextsTMP:
- {fileID: 776624419558043962}
cashTextsLegacy: []
cashTextsTMP:
- {fileID: 0}
characterNameTextLegacy: {fileID: 0}
characterNameTextTMP: {fileID: 6101848964131719891}
characterLevelTextLegacy: {fileID: 0}
@@ -14589,7 +14588,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &6872360865646447011
RectTransform:
m_ObjectHideFlags: 0
@@ -14605,9 +14604,9 @@ RectTransform:
- {fileID: 3208901167605625288}
m_Father: {fileID: 4359352035478671586}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 277.95, y: -36.30285}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 185.3, y: 72.6057}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8787094950878048123
@@ -15483,8 +15482,8 @@ MonoBehaviour:
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
rgba: 1677721599
m_fontColor: {r: 1, g: 1, b: 1, a: 0.3882353}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
@@ -516,6 +516,78 @@ MonoBehaviour:
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &4802983704394444715
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7742996028187596120}
- component: {fileID: 8266368899107907004}
- component: {fileID: 4268845758980371891}
m_Layer: 5
m_Name: Preview
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7742996028187596120
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4802983704394444715}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5968911800527563993}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1024, y: 1024}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8266368899107907004
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4802983704394444715}
m_CullTransparentMesh: 1
--- !u!114 &4268845758980371891
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4802983704394444715}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 8400000, guid: 7b35d3c1ebbb32d47a5ed61606928730, type: 2}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!1 &4925246028977896636
GameObject:
m_ObjectHideFlags: 0
@@ -854,6 +926,7 @@ RectTransform:
- {fileID: 8811543958641262336}
- {fileID: 8724103834249725641}
- {fileID: 8190183238285994582}
- {fileID: 7742996028187596120}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
@@ -917,6 +990,7 @@ MonoBehaviour:
createCharacterButton: {fileID: 2685968509838782728}
_btnEnterGame: {fileID: 5173447691193350084}
createCharacterScreen: {fileID: 0}
playerModelPreview: {fileID: 0}
--- !u!1 &7510180475820570348
GameObject:
m_ObjectHideFlags: 0
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 507c3ee5c51766042bc54e9207552521
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 1.4 MiB

@@ -482,6 +482,47 @@ namespace BrewMonster
}
}
}
/// <summary>C++ CECDealInventory::GetItemIndexByFlag</summary>
public int GetItemIndexByFlag(int iFlag)
{
int n = GetSize();
for (int i = 0; i < n; i++)
{
if (GetItem(i, false) != null && m_aItemInfo[i].iFlag == iFlag)
return i;
}
return -1;
}
/// <summary>C++ CECDealInventory::RemoveItemByFlag</summary>
public void RemoveItemByFlag(int iFlag, int iAmount)
{
int n = GetSize();
for (int i = 0; i < n; i++)
{
var slotItem = GetItem(i, false);
if (slotItem == null)
continue;
var info = m_aItemInfo[i];
if (info.iFlag != iFlag)
continue;
if (iAmount < 0 || iAmount >= info.iAmount)
{
SetItem(i, null);
}
else
{
info.iAmount -= iAmount;
m_aItemInfo[i] = info;
if (info.bDelete)
slotItem.AddAmount(-iAmount);
}
return;
}
}
}
// ̯ƱԶת
+60 -22
View File
@@ -594,7 +594,13 @@ namespace BrewMonster
UpdateEquipSkins();
}
/// <summary>Buy from NPC/booth: server sends PURCHASE_ITEM (cmd_purchase_item). C++ OnMsgHstPurchaseItems.</summary>
/// <summary>
/// Buy from NPC/booth: S2C PURCHASE_ITEM (<c>cmd_purchase_item</c>).
/// Port of <c>CECHostPlayer::OnMsgHstPurchaseItems</c> (EC_HostMsg.cpp): prefer <c>MergeItem</c> like the C++ client.
/// If merge lands on a different slot than <c>inv_index</c> (common when stacking into an earlier pile), we still accept
/// the merged slot—the strict C++ <c>iLastSlot == inv_index</c> check would skip updates and break buy/stack UI here.
/// Fallback: <c>PutItemInSlot(inv_index)</c> then <c>MergeItem</c> when merge alone fails.
/// </summary>
public void OnMsgHstPurchaseItems(ECMSG Msg)
{
var data = Msg.dwParam1 as byte[];
@@ -609,6 +615,7 @@ namespace BrewMonster
return;
var slotsNeedingDetail = new System.Collections.Generic.List<byte>();
bool purchaseSlotMismatch = false;
for (int i = 0; i < header.item_count && index + itemSize <= data.Length; i++)
{
@@ -616,37 +623,58 @@ namespace BrewMonster
int expire_date = BitConverter.ToInt32(data, index); index += 4;
int count = (int)BitConverter.ToUInt32(data, index); index += 4;
ushort inv_index = BitConverter.ToUInt16(data, index); index += 2;
index += 1; // booth_slot
byte booth_slot = data[index];
index += 1;
if (inv_index >= pPack.GetSize())
pPack.Resize(inv_index + 1);
bool placed = pPack.PutItemInSlot(inv_index, item_id, expire_date, count, out int lastSlot, out int slotNum);
int iLastSlot = 0;
int iSlotNum = 0;
bool placed = pPack.MergeItem(item_id, expire_date, count, out iLastSlot, out iSlotNum);
if (!placed)
placed = pPack.PutItemInSlot(inv_index, item_id, expire_date, count, out iLastSlot, out iSlotNum);
if (!placed)
placed = pPack.MergeItem(item_id, expire_date, count, out iLastSlot, out iSlotNum);
if (!placed)
{
placed = pPack.MergeItem(item_id, expire_date, count, out lastSlot, out slotNum);
if (!placed || lastSlot != inv_index)
continue;
#if UNITY_EDITOR
UnityEngine.Debug.LogWarning(
$"[OnMsgHstPurchaseItems] Could not place purchase tid={item_id} count={count} inv_index={inv_index}");
#endif
continue;
}
var pItem = pPack.GetItem(inv_index, false);
if (iLastSlot != inv_index)
purchaseSlotMismatch = true;
#if UNITY_EDITOR
if (iLastSlot != inv_index)
{
UnityEngine.Debug.Log(
$"[OnMsgHstPurchaseItems] Using merge slot {iLastSlot} (packet inv_index={inv_index}) tid={item_id}");
}
#endif
var pItem = pPack.GetItem(iLastSlot, false);
if (pItem != null)
{
pItem.Package = (byte)Inventory_type.IVTRTYPE_PACK;
pItem.Slot = inv_index;
int cid = pItem.GetClassID();
if (pItem.IsEquipment() ||
cid == (int)EC_IvtrItem.InventoryClassId.ICID_TASKNMMATTER ||
cid == (int)EC_IvtrItem.InventoryClassId.ICID_TASKDICE ||
cid == (int)EC_IvtrItem.InventoryClassId.ICID_TASKITEM ||
cid == (int)EC_IvtrItem.InventoryClassId.ICID_GOBLIN_EXPPILL ||
cid == (int)EC_IvtrItem.InventoryClassId.ICID_WEDDINGBOOKCARD ||
cid == (int)EC_IvtrItem.InventoryClassId.ICID_WEDDINGINVITECARD ||
cid == (int)EC_IvtrItem.InventoryClassId.ICID_SKILLTOME ||
cid == (int)EC_IvtrItem.InventoryClassId.ICID_GOBLIN ||
cid == (int)EC_IvtrItem.InventoryClassId.ICID_PETEGG)
pItem.Slot = iLastSlot;
// Keep stack size in sync with MergeItem/PutItemInSlot totals (authoritative for this slot).
if (iSlotNum > 0)
pItem.SetCount(iSlotNum);
if (pItem.IsEquipment())
slotsNeedingDetail.Add((byte)iLastSlot);
}
if (header.flag != 0 && GetBoothState() == 2)
{
var boothBPack = GetBoothBuyPack();
if (boothBPack != null)
{
slotsNeedingDetail.Add((byte)inv_index);
// C++: CDlgInfo FIXMSG_BOOTHBUY — no matching in-game UI hook here; update booth pack only.
boothBPack.RemoveItemByFlag(booth_slot, count);
}
}
}
@@ -656,8 +684,18 @@ namespace BrewMonster
foreach (byte slot in slotsNeedingDetail)
UnityGameSession.c2s_CmdGetItemInfo((byte)Inventory_type.IVTRTYPE_PACK, slot);
var ui = GameObject.FindFirstObjectByType<EC_InventoryUI>();
ui?.RefreshAll();
{
var ui = GameObject.FindFirstObjectByType<EC_InventoryUI>();
ui?.RefreshAll();
if (purchaseSlotMismatch)
{
UnityGameSession.RequestInventoryAsync(0, () =>
{
var ui2 = GameObject.FindFirstObjectByType<EC_InventoryUI>();
ui2?.RefreshAll();
});
}
}
UpdateEquipSkins();
}
+13
View File
@@ -1,12 +1,15 @@
using CSNetwork.Protocols.RPCData;
using System;
using System.Collections.Generic;
using BrewMonster.Scripts;
using UnityEngine;
using UnityEngine.UI;
using BrewMonster;
namespace BrewMonster.UI
{
// Select Character Screen
//TODO: Change the name to SelectCharacterScreen
public class SelecScreenCharacter : MonoBehaviour
{
[SerializeField] private GameObject characterItemPrefab;
@@ -15,6 +18,7 @@ namespace BrewMonster.UI
[SerializeField] private Button createCharacterButton;
[SerializeField] private Button _btnEnterGame;
[SerializeField] private CreateCharacterScreen createCharacterScreen;
[SerializeField] private PlayerModelPreview playerModelPreview;
private CharacterItemUI _selectingCharacterItemUI;
private Action<RoleInfo> _onClickItemChar;
@@ -91,6 +95,7 @@ namespace BrewMonster.UI
addButton.onClick.AddListener(OnCreateCharacterClicked);
}
}
}
else
{
@@ -100,9 +105,14 @@ namespace BrewMonster.UI
createCharacterButton.gameObject.SetActive(true);
}
}
// Load player preview 3D models
playerModelPreview?.ShowAllPlayerModels(roleInfos);
}
else
{
if (playerModelPreview != null)
playerModelPreview.ShowAllPlayerModels(null);
// If roleInfos is null, show createCharacterButton
if (createCharacterButton != null)
{
@@ -126,6 +136,9 @@ namespace BrewMonster.UI
_selectingCharacterItemUI = characterItemUI;
_selectingCharacterItemUI.SetFocus(true);
_btnEnterGame.gameObject.SetActive(true);
if (playerModelPreview != null && characterItemUI.RoleInfo != null)
playerModelPreview.ShowPlayerModel(characterItemUI.RoleInfo.roleid);
}
private void OnCreateCharacterClicked()
+1 -1
View File
@@ -141,7 +141,7 @@ PlayerSettings:
loadStoreDebugModeEnabled: 0
visionOSBundleVersion: 1.0
tvOSBundleVersion: 1.0
bundleVersion: 0.1.5
bundleVersion: 0.3
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0