Merge branch 'develop' into feature/friend

This commit is contained in:
HungDK
2026-03-17 17:38:59 +07:00
23 changed files with 900 additions and 996 deletions
@@ -620,7 +620,7 @@ GameObject:
- component: {fileID: 8250962023850685786}
- component: {fileID: 7766051278568089760}
m_Layer: 5
m_Name: ButtonOk
m_Name: ButtonYes
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -927,7 +927,7 @@ MonoBehaviour:
imageProgress: {fileID: 0}
titleText: {fileID: 5031655611580643013}
messageText: {fileID: 7448521238108099750}
okButton: {fileID: 7766051278568089760}
_yesButton: {fileID: 7766051278568089760}
_noButton: {fileID: 7010901635634620631}
_closeButton: {fileID: 482550456836939169}
--- !u!1 &5664175764923475105
+455 -4
View File
@@ -774,6 +774,96 @@ MonoBehaviour:
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &613919380239545636
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7289690895179691343}
- component: {fileID: 690144092504553638}
- component: {fileID: 8175991538683025488}
- component: {fileID: 7195446286131223763}
m_Layer: 5
m_Name: Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7289690895179691343
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 613919380239545636}
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: 5747822187000379196}
m_Father: {fileID: 5798497331256291745}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 10, y: -10}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &690144092504553638
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 613919380239545636}
m_CullTransparentMesh: 1
--- !u!114 &8175991538683025488
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 613919380239545636}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, 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_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &7195446286131223763
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 613919380239545636}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 1
--- !u!1 &649076494997171084
GameObject:
m_ObjectHideFlags: 0
@@ -910,6 +1000,93 @@ MonoBehaviour:
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &659277667126742134
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1505082503590519222}
- component: {fileID: 2952576131963749004}
- component: {fileID: 3464748071021900582}
- component: {fileID: 2027788820829355354}
m_Layer: 5
m_Name: Panel (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1505082503590519222
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 659277667126742134}
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: 5798497331256291745}
m_Father: {fileID: 2907261990866691440}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 133.1923, y: -138.03845}
m_SizeDelta: {x: 0, y: 11}
m_Pivot: {x: 0, y: 0.5}
--- !u!222 &2952576131963749004
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 659277667126742134}
m_CullTransparentMesh: 1
--- !u!114 &3464748071021900582
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 659277667126742134}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 0
m_Right: 0
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 0
m_Spacing: 25
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 1
m_ChildControlWidth: 0
m_ChildControlHeight: 0
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!114 &2027788820829355354
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 659277667126742134}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalFit: 2
m_VerticalFit: 0
--- !u!1 &806379414455135824
GameObject:
m_ObjectHideFlags: 0
@@ -2297,6 +2474,7 @@ RectTransform:
- {fileID: 7749074831901819156}
- {fileID: 5949267495910746152}
- {fileID: 9121369084142034904}
- {fileID: 1416757586547742942}
m_Father: {fileID: 2780428059708698453}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
@@ -4635,6 +4813,91 @@ MonoBehaviour:
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &4870054906152145333
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5798497331256291745}
- component: {fileID: 3469126208788821280}
m_Layer: 5
m_Name: BuffIconTemplate
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5798497331256291745
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4870054906152145333}
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: 7289690895179691343}
m_Father: {fileID: 1505082503590519222}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &3469126208788821280
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4870054906152145333}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 0
m_TargetGraphic: {fileID: 8175991538683025488}
toggleTransition: 1
graphic: {fileID: 886384831200045356}
m_Group: {fileID: 0}
onValueChanged:
m_PersistentCalls:
m_Calls: []
m_IsOn: 1
--- !u!1 &5137013593162142802
GameObject:
m_ObjectHideFlags: 0
@@ -7676,6 +7939,81 @@ MonoBehaviour:
serializedVersion: 2
m_Bits: 64
_target: {x: 0, y: 0, z: 0}
--- !u!1 &7770570364241053217
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5747822187000379196}
- component: {fileID: 4010750841144926585}
- component: {fileID: 886384831200045356}
m_Layer: 5
m_Name: Checkmark
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5747822187000379196
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7770570364241053217}
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: 7289690895179691343}
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: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4010750841144926585
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7770570364241053217}
m_CullTransparentMesh: 1
--- !u!114 &886384831200045356
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7770570364241053217}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, 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_Sprite: {fileID: -2152444580018807177, guid: 7c25a5fa6c0f21a4293b99a5a43b5441, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &7786113674810984593
GameObject:
m_ObjectHideFlags: 0
@@ -14314,6 +14652,116 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 67fd391520cbfd44f84a1c6bb57673c0, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &8152930184191170387
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 3233441867675090637}
m_Modifications:
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7292124547459743165, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_SizeDelta.x
value: 6.26355
objectReference: {fileID: 0}
- target: {fileID: 9152579472324007262, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_Name
value: Win_TeamMain
objectReference: {fileID: 0}
- target: {fileID: 9152579472324007262, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
--- !u!224 &1416757586547742942 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 7101142292773392269, guid: 2060bbc2e61f6db4590ab041243b6294, type: 3}
m_PrefabInstance: {fileID: 8152930184191170387}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &8244659259478137406
PrefabInstance:
m_ObjectHideFlags: 0
@@ -15113,18 +15561,21 @@ PrefabInstance:
m_AddedGameObjects:
- targetCorrespondingSourceObject: {fileID: 6806681442789174374, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
insertIndex: 7
addedObject: {fileID: 5191021986578083479}
addedObject: {fileID: 1505082503590519222}
- targetCorrespondingSourceObject: {fileID: 6806681442789174374, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
insertIndex: 8
addedObject: {fileID: 494610354563246192}
addedObject: {fileID: 5191021986578083479}
- targetCorrespondingSourceObject: {fileID: 6806681442789174374, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
insertIndex: 9
addedObject: {fileID: 2090006027067688671}
addedObject: {fileID: 494610354563246192}
- targetCorrespondingSourceObject: {fileID: 6806681442789174374, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
insertIndex: 10
addedObject: {fileID: 5264098290850076161}
addedObject: {fileID: 2090006027067688671}
- targetCorrespondingSourceObject: {fileID: 6806681442789174374, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
insertIndex: 11
addedObject: {fileID: 5264098290850076161}
- targetCorrespondingSourceObject: {fileID: 6806681442789174374, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
insertIndex: 12
addedObject: {fileID: 6421830357984996457}
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 76408ccdbeb4c654291462fcff24a8c5, type: 3}
+2 -2
View File
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:80240cfe7d09ee2bd71e83f71df212818695e4bb1f431eafb04dce66f2ced2a0
size 323449
oid sha256:47ff1377fe87865c1bdada70b8f6fee638a20879f70b84b40d62fb978aee203e
size 325051
@@ -106,11 +106,12 @@ namespace BrewMonster.Scripts.ChatUI
if (_userAtBottom)
ScrollToBottom();
}
void AddMessageView(string msg)
{
var view = _pool.Get();
view.transform.SetParent(content, false);
view.transform.SetAsLastSibling();
view.Bind(msg);
_visibleViews.Add(view);
@@ -138,12 +139,14 @@ namespace BrewMonster.Scripts.ChatUI
{
var view = _pool.Get();
view.transform.SetParent(content, false);
view.transform.SetAsLastSibling();
view.Bind(_messages[i]);
_visibleViews.Add(view);
}
Canvas.ForceUpdateCanvases();
ScrollToBottom();
}
public void ScrollToBottom()
@@ -171,4 +174,4 @@ namespace BrewMonster.Scripts.ChatUI
RefreshVisible();
}
}
}
}
@@ -124,3 +124,5 @@ namespace BrewMonster.Scripts
}
}
}
/// d 2000 la kn
/// d 1988 + so tien
@@ -426,8 +426,8 @@ namespace BrewMonster
// 这与C++逻辑匹配:当投射物击中地面(无目标)时使用m_szHitGrndGfx
bool bTargetExists = m_bTargetExist && m_nTargetID != 0;
GameObject prefab = bTargetExists ? m_pComposer.GetHitGFX() : m_pComposer.GetHitGrdGFX();
BMLogger.LogError("bTargetExists : " + bTargetExists);
BMLogger.LogError("HitGfx : " + m_pComposer.hitGfxName);
//BMLogger.LogError("bTargetExists : " + bTargetExists);
//BMLogger.LogError("HitGfx : " + m_pComposer.hitGfxName);
if (prefab == null)
{
@@ -460,14 +460,14 @@ namespace BrewMonster
if (m_bTraceTarget)
{
SkillGfxMan.InstanceSub?.AddTraceTargetGfx(m_hitGfxInstance, 0); // Skill ID not available, use 0
BMLogger.Log($"[TRACE_TARGET_GFX] SpawnHitGfx: Added hit GFX to trace target list (m_bTraceTarget=true)");
//BMLogger.Log($"[TRACE_TARGET_GFX] SpawnHitGfx: Added hit GFX to trace target list (m_bTraceTarget=true)");
}
else
{
// Destroy hit GFX after 5 seconds (unless m_bTraceTarget is true, then it follows target until destroyed)
// 5秒后销毁命中特效(除非m_bTraceTarget为true,否则它会跟随目标直到被销毁)
//HIT_GFX_MAX_TIMESPAN 5000
BMLogger.Log($"[TRACE_TARGET_GFX] SpawnHitGfx: GameObject.Destroy(m_hitGfxInstance, 5.0f);");
//BMLogger.Log($"[TRACE_TARGET_GFX] SpawnHitGfx: GameObject.Destroy(m_hitGfxInstance, 5.0f);");
GameObject.Destroy(m_hitGfxInstance, 5.0f);
}
}
@@ -1349,11 +1349,12 @@ namespace BrewMonster.Scripts
string message = $"Cannot find path to target position.\nPlease move manually to target location.\n\nMap Coordinates: ({mapX}, {mapZ}, ↑{mapY})";
string messageCN = $"无法找到到目标位置的路径。\n请手动移动到目标位置。\n\n地图坐标: ({mapX}, {mapZ}, ↑{mapY})";
CECUIManager.Instance.ShowMessageBox(
"Path Not Found", // 路径未找到
message, // English message with map coordinates
BrewMonster.MessageBoxType.YesButton
);
// CECUIManager.Instance.ShowMessageBox(
// "Path Not Found", // 路径未找到
// message, // English message with map coordinates
// BrewMonster.MessageBoxType.YesButton
// );
CECUIManager.Instance.ShowMessageBoxYes("Path Not Found", message, null, null);
}
else
{
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -28,7 +28,7 @@ namespace CSNetwork
enumEINum = enumEICustom + MAXNUM_CUSTOM_ITEM
}
public static void AUI_ConvertChatString(string pszChat, char[] pszConv, bool bName)
public static void AUI_ConvertChatString(ref string pszChat, ref char[] pszConv, bool bName)
{
if (string.IsNullOrEmpty(pszChat) || pszConv == null)
return;
@@ -320,6 +320,52 @@ namespace CSNetwork
return sb.ToString();
}
/// <summary>
/// Chuyển đổi định dạng printf (C-style: %s, %d) sang string.Format (C#-style: {0}, {1})
/// </summary>
public static string ConvertPrintfToCSharpFormat(string format)
{
if (string.IsNullOrEmpty(format)) return "";
StringBuilder sb = new StringBuilder();
int argIndex = 0;
for (int i = 0; i < format.Length; i++)
{
if (format[i] == '%' && i + 1 < format.Length)
{
char next = format[i + 1];
if (next == '%') // Trường hợp %% -> %
{
sb.Append('%');
i++;
}
else
{
sb.Append('{').Append(argIndex++).Append('}');
i++;
// Nhảy qua các ký tự định dạng (ví dụ: %02d, %ls, %f)
while (i < format.Length && (char.IsDigit(format[i]) || format[i] == '.' || format[i] == 'l' || format[i] == 'u' || format[i] == 'd' || format[i] == 's' || format[i] == 'f' || format[i] == 'x'))
{
// Nếu gặp ký tự kết thúc định dạng (s, d, f, ...) thì dừng lại sau ký tự đó
char c = format[i];
if (c == 's' || c == 'd' || c == 'f' || c == 'u' || c == 'x' || c == 'g')
{
// i++; // Đã ở đúng vị trí để vòng lặp cha thực hiện i++ tiếp theo
break;
}
i++;
}
}
}
else
{
sb.Append(format[i]);
}
}
return sb.ToString();
}
}
}
@@ -628,7 +674,7 @@ public class EditBoxItemBase
return true;
}
private bool TryParseInt(string text, int start, out int value)
{
int end = start;
@@ -638,7 +684,7 @@ public class EditBoxItemBase
return int.TryParse(text.Substring(start, end - start), out value);
}
private bool TryParseUInt(string text, int start, out uint value)
{
int end = start;
@@ -803,4 +849,4 @@ public class EditboxScriptItem
{
return Data?.Length ?? 0;
}
}
}
@@ -268,7 +268,7 @@ namespace CSNetwork
Debug.Log($"[GameSession] Creating role - UserID: {_currentUserId}, Localsid: {_localsid}, Profession: {roleInfo.occupation}, Gender: {roleInfo.gender}");
Debug.Log($"[GameSession] RoleInfo details - Name size: {roleInfo.name?.Size ?? 0}, Equipment count: {roleInfo.equipment?.Count ?? 0}, Custom data size: {roleInfo.custom_data?.Size ?? 0}, Race: {roleInfo.race}");
// Log first few bytes of custom_data for debugging
if (roleInfo.custom_data != null && roleInfo.custom_data.Size > 0)
{
@@ -277,7 +277,7 @@ namespace CSNetwork
string hexPreview = BitConverter.ToString(customDataPreview).Replace("-", " ");
Debug.Log($"[GameSession] Custom_data preview (first 16 bytes): {hexPreview}");
}
Debug.Log($"[GameSession] Sending createrole protocol (Type: {createRoleProtocol.Type})");
SendProtocol(createRoleProtocol);
}
@@ -340,7 +340,7 @@ namespace CSNetwork
// Initialize custom data exactly as C++ does: memset to 0, then set specific values
// This matches C++ LoadDefaultCustomizeData behavior
roleInfo.custom_data = CreateDefaultCustomizeData(profession, gender);
// Initialize other empty custom data fields
roleInfo.custom_status = new Octets();
roleInfo.charactermode = new Octets();
@@ -379,31 +379,31 @@ namespace CSNetwork
const int CUSTOMIZE_DATA_SIZE = 176; // Match server expectation (176 bytes from response)
const uint CUSTOMIZE_DATA_VERSION = 0x10007001; // CUSTOMIZE_DATA_VERSION from C++
byte[] customDataBytes = new byte[CUSTOMIZE_DATA_SIZE];
// Step 1: memset to 0 (already done by new byte[])
// Step 2: Set dwVersion at offset 0-3 (little-endian)
byte[] versionBytes = BitConverter.GetBytes(CUSTOMIZE_DATA_VERSION);
Array.Copy(versionBytes, 0, customDataBytes, 0, 4);
// Step 3: FACE_CUSTOMIZEDATA at offset 4-87 is already zero (84 bytes)
// (In C++ this would be loaded from INI, but for now we use zeros)
// Step 4: bodyID at offset 88-89 is already zero (2 bytes)
// Note: There might be 2 bytes padding here if struct is 4-byte aligned
// Step 5: Set colorBody to 0xffffffff
// Step 5: Set colorBody to 0xffffffff
// Try offset 90 first (no padding), if that doesn't work try 92 (with padding)
byte[] colorBodyBytes = BitConverter.GetBytes(0xffffffffu);
Array.Copy(colorBodyBytes, 0, customDataBytes, 90, 4); // Try 90 first
// Step 6: Set all 6 scale fields to 128
// Try offset 94 first (no padding), if that doesn't work try 96 (with padding)
for (int i = 94; i < 100; i++)
{
customDataBytes[i] = 128;
}
return new Octets(customDataBytes);
}
@@ -1057,7 +1057,7 @@ namespace CSNetwork
}
else if (pCmd.iMessage == 133 || pCmd.iMessage == 134)
{
// deal failed
// deal failed
//pGameRun.PostMessage(MSG_HST_BUY_SELL_FAIL, MAN_PLAYER, 0, (DWORD)pDataBuf, pCmdHeader.cmd);
}
else if (pCmd.iMessage == 158)
@@ -1403,7 +1403,7 @@ namespace CSNetwork
private void HandleCreateRoleResponse(createrole_re protocol)
{
Debug.Log($"[GameSession] HandleCreateRoleResponse - result: {protocol.result}, roleid: {protocol.roleid}");
if (protocol.result != (int)ErrCode.ERR_SUCCESS)
{
string errorMsg = $"Create role failed with result code: {protocol.result} (ERR_SUCCESS = {(int)ErrCode.ERR_SUCCESS})";
@@ -1424,7 +1424,7 @@ namespace CSNetwork
private void HandleErrorInfo(errorinfo protocol)
{
Debug.LogError($"[GameSession] Server error - Errcode: {protocol.Errcode}");
// If we're waiting for create role response and get an error, fail the callback
if (_createRoleCallback != null)
{
@@ -1716,8 +1716,8 @@ namespace CSNetwork
g.Data = C2SCommandFactory.CreatePlayerLogoutCmd(outType);
SendProtocol(g, complete);
}
public void c2s_SendCmdStopMove(in Vector3 vDest, float fSpeed, int iMoveMode,
byte byDir, ushort wStamp, int iTime)
{
@@ -1747,7 +1747,7 @@ namespace CSNetwork
{
if (string.IsNullOrEmpty(szMsg))
return;
publicchat p = new publicchat();
p.Channel = cChannel;
p.Roleid = m_iCharID;
@@ -1787,14 +1787,14 @@ namespace CSNetwork
BitConverter.GetBytes(index).CopyTo(bytes, 3);
p.Data.Replace(bytes);
}
byte[] unicodeBytes = Encoding.Unicode.GetBytes(szMsg);
p.Msg.Replace(unicodeBytes);
SendProtocol(p);
if (cChannel is (byte)ChatChannel.GP_CHAT_LOCAL
if (cChannel is (byte)ChatChannel.GP_CHAT_LOCAL
or (byte)ChatChannel.GP_CHAT_FARCRY
or (byte)ChatChannel.GP_CHAT_SUPERFARCRY
or (byte)ChatChannel.GP_CHAT_SUPERFARCRY
or (byte)ChatChannel.GP_CHAT_BATTLE
or (byte)ChatChannel.GP_CHAT_COUNTRY) {
CECHostPlayer pHost = EC_Game.GetGameRun().GetHostPlayer();
@@ -1821,7 +1821,7 @@ namespace CSNetwork
EventBus.Publish(new ChatMessageEvent(szMsg, p.Channel));
}
}
public void LoadConfigData()
{
getuiconfig p = new getuiconfig();
@@ -1836,7 +1836,7 @@ namespace CSNetwork
public void SaveConfigData(byte[] pBuf, int len)
{
BMLogger.Log($"[MH] Session.SaveConfigData | len={len}");
if (pBuf == null || len <= 0) return;
var p = new setuiconfig();
p.Roleid = m_iCharID;
@@ -1844,7 +1844,7 @@ namespace CSNetwork
byte[] slice = new byte[len];
Buffer.BlockCopy(pBuf, 0, slice, 0, len);
p.Ui_config = new Octets(slice);
// return;
SendProtocol(p);
}
@@ -1862,7 +1862,7 @@ namespace CSNetwork
OnTaskChatMessage(p.Msg.RawBuffer, p.Msg.Size);
return true;
}*/
// TODO: Porting logic OnPrtcWorldChat hoàn chỉnh từ C++ if needed
Debug.Log("[Cuong] OnPrtcWorldChat");
return true;
@@ -1878,7 +1878,7 @@ namespace CSNetwork
// Tương đương OnBattleChatMessage trong C++
// Hiện tại đơn giản hóa việc hiển thị, thực tế cần parse nội dung Battle cụ thể
Debug.Log($"[Battle Chat] RoleID: {p.Srcroleid}");
return true;
return true;
}
private bool OnFortressChatMessage(chatmessage p, List<int> pPendingFactions)
@@ -1904,7 +1904,7 @@ namespace CSNetwork
private bool OnPrtcChatMessage(Protocol pProtocol, bool bCalledagain)
{
CECGameUIMan pGameUI = EC_Game.GetGameRun().GetUIManager().GetInGameUIMan();
chatmessage p = (chatmessage)pProtocol;
//var channel = (ChatChannel)p.Channel;
Debug.Log("[Cuong] reciver chat channel: " + p.Channel);
@@ -1916,7 +1916,7 @@ namespace CSNetwork
}
EC_IvtrItem pItem = CHAT_S2C.CreateChatItem(p.Data);
string szMsg = null;
string strTemp = Encoding.Unicode.GetString(p.Msg.ToArray(), 0, p.Msg.Length);
string strMsgOrigion = strTemp;
@@ -1952,14 +1952,14 @@ namespace CSNetwork
}
break;
case 18: case 19: case 20: case 21: case 22: // Auction Message
// pGameUI.AddSysAuctionMessage(...)
// pGameUI.AddSysAuctionMessage(...)
Debug.Log("[Auction] " + strTemp);
EventBus.Publish(new ChatMessageEvent(strTemp, p.Channel));
break;
case 24: // Task Message
// OnTaskChatMessage(p.Data.RawBuffer, p.Data.Size);
break;
case 29: case 30: case 31: case 32: case 33: case 34:
case 29: case 30: case 31: case 32: case 33: case 34:
case 35: case 36: case 37: case 38: case 39: case 40:
case 41: case 42: case 43: case 45: // Fortress Message
OnFortressChatMessage(p, null);
@@ -2009,18 +2009,18 @@ namespace CSNetwork
{
Debug.Log("[Cuong] Other 1");
char[] szText = new char[80];
AUICommon.AUI_ConvertChatString(szName, szText, false);
AUICommon.AUI_ConvertChatString(ref szName,ref szText, false);
string fmt = AUICommon.ConvertPrintfToCSharpFormat(pStrTab.GetWideString((int)FixedMsg.FIXMSG_CHAT));
string str = string.Format(
pStrTab.GetWideString((int)FixedMsg.FIXMSG_CHAT),
fmt,
szName,
strTemp
);
// Convert to EventBus
/*EC_Game.GetGameRun().AddChatMessage(strTemp, p.Channel, p.Srcroleid,
/*EC_Game.GetGameRun().AddChatMessage(strTemp, p.Channel, p.Srcroleid,
null, 0, p.Emotion, null, strMsgOrigion);*/
EventBus.Publish(new ChatMessageEvent(strTemp, p.Channel));
EventBus.Publish(new ChatMessageEvent(str, p.Channel));
// Set player's last said words
CECPlayer pPlayer = EC_Game.GetGameRun().GetWorld().GetPlayerMan().GetPlayer(p.Srcroleid);
if (pPlayer != null)
@@ -2038,14 +2038,14 @@ namespace CSNetwork
if (pNPC != null)
{
string str;
string template = pStrTab.GetWideString((int)FixedMsg.FIXMSG_CHAT2);
string template = AUICommon.ConvertPrintfToCSharpFormat(pStrTab.GetWideString((int)FixedMsg.FIXMSG_CHAT2));
string message = string.Format(
template,
pNPC.GetName(),
strTemp
);
EC_Game.GetGameRun().AddChatMessage(
message,
p.Channel,
@@ -2090,7 +2090,7 @@ namespace CSNetwork
EC_Game.GetConfigs().ApplyUserSetting();
}
// Now, Get config data request is sent after all host initial data ready.
// Now, Get config data request is sent after all host initial data ready.
// so when we receive this reply, we can do some last work before game
// really starts. Maybe it's not the best place to do these work, but
// now we do it here.
@@ -2101,7 +2101,7 @@ namespace CSNetwork
pGameUI.EnableUI(true);
// Get referral name for adding friend or other display
//TODO: a Hung lam phan select role info di
//TODO: a Hung lam phan select role info di
/* RoleInfo info = EC_Game.GetGameRun().GetSelectedRoleInfo();
if (info.referrer_role > 0)
GetPlayerBriefInfo(1, info.referrer_role, 2);*/
@@ -2122,7 +2122,7 @@ namespace CSNetwork
CECMCDownload::GetInstance().SendGetDownloadOK();*/
}
}
private void OnPrtcSetConfigRe(Protocol pProtocol)
{
SetUIConfig_Re p = (SetUIConfig_Re)pProtocol;
@@ -2132,12 +2132,12 @@ namespace CSNetwork
if (CECGameRun.Instance != null)
{
TestLogoutLogic.Instance.WasClientSendLogoutMessage = true;
CECGameRun.Instance.GetPendingLogOut().TriggerAll();
CECGameRun.Instance.GetPendingLogOut().Clear();
}
}
private void OnPrtcPlayerBaseInfoRe(Protocol pProtocol)
{
playerbaseinfo_re p = (playerbaseinfo_re)pProtocol;
@@ -2255,7 +2255,7 @@ namespace CSNetwork
BYTE* pBuf = (BYTE*)a_malloctemp(iSize);
if (!pBuf)
return;
((cmd_header*)pBuf)->cmd = C2S::GET_OTHER_EQUIP;
cmd_get_other_equip* pCmd = (cmd_get_other_equip*)(pBuf + sizeof (cmd_header));
@@ -2272,7 +2272,7 @@ namespace CSNetwork
var idlist = new int[iNumSend];
for (int i=0; i < iNumSend; i++)
idlist[i] = aIDs[iCount+i];
gamedatasend gamedatasend = new gamedatasend();
gamedatasend.Data = C2SCommandFactory.CreateGetOtherEquipCmd(iNumID, idlist);
SendProtocol(gamedatasend);
@@ -2388,7 +2388,7 @@ namespace CSNetwork
gamedatasend.Data = C2SCommandFactory.CreateNakeCmd(C2SCommand.CommandID.STAND_UP);
SendProtocol(gamedatasend);
}
public void c2s_SendCmdAutoTeamSetGoal(int type, int goal_id, int op)
{
gamedatasend gamedatasend = new gamedatasend();
@@ -2513,9 +2513,9 @@ namespace CSNetwork
public void c2s_CmdGoto(float x, float y, float z)
{
c2s_SendCmdGoto(x, y, z);
c2s_SendCmdGoto(x, y, z);
}
// Send C2S::GOTO command data
void c2s_SendCmdGoto(float x, float y, float z)
{
@@ -2642,7 +2642,7 @@ namespace CSNetwork
gamedatasend.Data = C2SCommandFactory.CreateNPCSevRestorePetCmd(iPetIdx);
SendProtocol(gamedatasend);
}
// Cross-server get in (C++: c2s_CmdNPCSevCrossServerGetIn) — TODO: implement C2S packet when needed
public void c2s_CmdNPCSevCrossServerGetIn()
{
@@ -2654,6 +2654,6 @@ namespace CSNetwork
{
// TODO: C2SCommandFactory.CreateNPCSevCrossServerGetOutCmd() and SendProtocol
}
}
}
@@ -749,16 +749,13 @@ namespace BrewMonster.Network
}
// Show disconnect message box
CECUIManager.Instance?.ShowMessageBox(
title: "Disconnected",
message: "Connection to the server has been lost.",
messageBoxType: MessageBoxType.YesButton,
onClickedYes: () =>
CECUIManager.Instance?.ShowMessageBoxYes("Disconnected", "Connection to the server has been lost.", null,
() =>
{
// Return to login screen
LogoutAccount();
}
);
});
}
public static void c2s_CmdGoto(float x, float y, float z)
@@ -120,7 +120,6 @@ namespace BrewMonster
m_AttFlyMode = (GfxAttackMode)0;
m_AttHitMode = (GfxAttackMode)0;
m_dwFlyTime = 200;
m_bTraceTarget = true;
m_FlyClusterCount = 1;
m_FlyClusterInterval = 0;
m_HitClusterCount = 1;
+110 -30
View File
@@ -1,8 +1,9 @@
using System;
using System;
using BrewMonster.UI;
using PerfectWorld.Scripts.Common;
using UnityEngine;
using TMPro;
using UnityEngine.Serialization;
using UnityEngine.UI;
using static CECUIManager;
@@ -27,16 +28,19 @@ namespace BrewMonster
{
[SerializeField] private TMP_Text titleText;
[SerializeField] private TMP_Text messageText;
[SerializeField] private Button okButton;
[SerializeField] private Button _yesButton;
[SerializeField] private Button _noButton;
[SerializeField] private Button _closeButton;
private Action _onClickedYesBtn;
private Action _onClickedNoBtn;
private MessageBoxData _messageData;
public override void OnEnable()
{
base.OnEnable();
okButton.onClick.AddListener(OnOkClicked);
_yesButton.onClick.AddListener(OnYesClicked);
_noButton.onClick.AddListener(OnNoClicked);
_closeButton.onClick.AddListener(OnCloseClicked);
@@ -44,59 +48,135 @@ namespace BrewMonster
public override void OnDisable()
{
okButton.onClick.RemoveListener(OnOkClicked);
_yesButton.onClick.RemoveListener(OnYesClicked);
_noButton.onClick.RemoveListener(OnNoClicked);
_closeButton.onClick.RemoveListener(OnCloseClicked);
}
#region Button Events
private void OnOkClicked()
private void OnYesClicked()
{
EventBus.Publish(new MessageBoxEvent(1,_messageData.Dlg));
_messageData.OnClickedYes?.Invoke();
_onClickedYesBtn?.Invoke();
Show(false);
}
private void OnNoClicked()
{
EventBus.Publish(new MessageBoxEvent(0,_messageData.Dlg));
_messageData.OnClickedNo?.Invoke();
_onClickedNoBtn?.Invoke();
Show(false);
}
private void OnCloseClicked()
{
// treat the close button as OK button
OnOkClicked();
OnYesClicked();
}
#endregion
public void ShowMessageBox(MessageBoxData messageBoxData)
// public void ShowMessageBox(MessageBoxData messageBoxData)
// {
// _messageData = messageBoxData;
// messageBoxData.Message = EC_TextFormatter.FormatForTextMeshPro(messageBoxData.Message);
// SetName(string.IsNullOrEmpty(messageBoxData.Title) ? "" : messageBoxData.Title);
// messageText.text = string.IsNullOrEmpty(messageBoxData.Message) ? "" : messageBoxData.Message;
//
// _yesButton.gameObject.SetActive(false);
// _noButton.gameObject.SetActive(false);
// switch (_messageData.MessageBoxType)
// {
// case MessageBoxType.YesButton:
// _yesButton.gameObject.SetActive(true);
// break;
// case MessageBoxType.NoButton:
// _noButton.gameObject.SetActive(true);
// break;
// case MessageBoxType.BothYesNoButton:
// _yesButton.gameObject.SetActive(true);
// _noButton.gameObject.SetActive(true);
// break;
// }
// Show(true);
// }
/// <summary>
/// message with title and message only
/// </summary>
/// <param name="title"></param>
/// <param name="message"></param>
/// <param name="dlg"></param>
public void ShowMessageBoxGeneral(string title, string message, AUIDialog dlg)
{
_messageData = messageBoxData;
// messageBoxData.Message = messageBoxData.Message?
// .Replace("\r\n", "\n")
// .Replace("\r", "\n");
messageBoxData.Message = EC_TextFormatter.FormatForTextMeshPro(messageBoxData.Message);
SetName(string.IsNullOrEmpty(messageBoxData.Title) ? "" : messageBoxData.Title);
messageText.text = string.IsNullOrEmpty(messageBoxData.Message) ? "" : messageBoxData.Message;
okButton.gameObject.SetActive(false);
_onClickedYesBtn = null;
_onClickedYesBtn = null;
string formattedMessage = EC_TextFormatter.FormatForTextMeshPro(message);
SetName(string.IsNullOrEmpty(title) ? "" : title);
messageText.text = string.IsNullOrEmpty(formattedMessage) ? "" : formattedMessage;
_noButton.gameObject.SetActive(false);
switch (_messageData.MessageBoxType)
{
case MessageBoxType.YesButton:
okButton.gameObject.SetActive(true);
break;
case MessageBoxType.NoButton:
_noButton.gameObject.SetActive(true);
break;
case MessageBoxType.BothYesNoButton:
okButton.gameObject.SetActive(true);
_noButton.gameObject.SetActive(true);
break;
}
_yesButton.gameObject.SetActive(true);
Show(true);
transform.SetAsLastSibling();
}
/// <summary>
/// message with yes button only
/// </summary>
/// <param name="title"></param>
/// <param name="message"></param>
/// <param name="dlg"></param>
/// <param name="onClickedYes"></param>
public void ShowMessageBoxYes(string title, string message, AUIDialog dlg, Action onClickedYes)
{
_onClickedYesBtn = onClickedYes;
string formattedMessage = EC_TextFormatter.FormatForTextMeshPro(message);
SetName(string.IsNullOrEmpty(title) ? "" : title);
messageText.text = string.IsNullOrEmpty(formattedMessage) ? "" : formattedMessage;
_noButton.gameObject.SetActive(false);
_yesButton.gameObject.SetActive(true);
Show(true);
transform.SetAsLastSibling();
}
/// <summary>
/// message with no button only
/// </summary>
/// <param name="title"></param>
/// <param name="message"></param>
/// <param name="dlg"></param>
/// <param name="onClickedNo"></param>
public void ShowMessageBoxNo(string title, string message, AUIDialog dlg, Action onClickedNo)
{
_onClickedNoBtn = onClickedNo;
string formattedMessage = EC_TextFormatter.FormatForTextMeshPro(message);
SetName(string.IsNullOrEmpty(title) ? "" : title);
messageText.text = string.IsNullOrEmpty(formattedMessage) ? "" : formattedMessage;
_yesButton.gameObject.SetActive(false);
_noButton.gameObject.SetActive(true);
Show(true);
transform.SetAsLastSibling();
}
/// <summary>
/// message with yes and no button
/// </summary>
/// <param name="title"></param>
/// <param name="message"></param>
/// <param name="dlg"></param>
/// <param name="onClickedYes"></param>
/// <param name="onClickedNo"></param>
public void ShowMessageBoxYesAndNo(string title, string message, AUIDialog dlg, Action onClickedYes, Action onClickedNo)
{
_onClickedYesBtn = onClickedYes;
_onClickedNoBtn = onClickedNo;
string formattedMessage = EC_TextFormatter.FormatForTextMeshPro(message);
SetName(string.IsNullOrEmpty(title) ? "" : title);
messageText.text = string.IsNullOrEmpty(formattedMessage) ? "" : formattedMessage;
_yesButton.gameObject.SetActive(true);
_noButton.gameObject.SetActive(true);
Show(true);
transform.SetAsLastSibling();
}
}
}
@@ -431,11 +431,7 @@ namespace BrewMonster
if (nMoney > pHost.GetMoneyAmount())
{
message = GetGameUIMan().GetStringFromTable(226);
CECUIManager.Instance.ShowMessageBox(new MessageBoxData()
{
Message = message,
Dlg = this
});
CECUIManager.Instance.ShowMessageBoxGeneral("", message, this);
return;
}
@@ -443,11 +439,7 @@ namespace BrewMonster
if (!pIvtrA.IsEquipment())
{
message = GetGameUIMan().GetStringFromTable(223);
CECUIManager.Instance.ShowMessageBox(new MessageBoxData()
{
Message = message,
Dlg = this
});
CECUIManager.Instance.ShowMessageBoxGeneral("", message, this);
return;
}
@@ -457,11 +449,7 @@ namespace BrewMonster
if (pEquipA.GetEmptyHoleNum() <= 0)
{
message = GetGameUIMan().GetStringFromTable(224);
CECUIManager.Instance.ShowMessageBox(new MessageBoxData()
{
Message = message,
Dlg = this
});
CECUIManager.Instance.ShowMessageBoxGeneral("", message, this);
return;
}
@@ -469,11 +457,7 @@ namespace BrewMonster
if (pIvtrB == null || !pIvtrB.IsEmbeddable())
{
message = GetGameUIMan().GetStringFromTable(225);
CECUIManager.Instance.ShowMessageBox(new MessageBoxData()
{
Message = message,
Dlg = this
});
CECUIManager.Instance.ShowMessageBoxGeneral("", message, this);
return;
}
@@ -498,11 +482,7 @@ namespace BrewMonster
if (nStoneLevel > nEquipLevel)
{
message = GetGameUIMan().GetStringFromTable(300);
CECUIManager.Instance.ShowMessageBox(new MessageBoxData()
{
Message = message,
Dlg = this
});
CECUIManager.Instance.ShowMessageBoxGeneral("", message, this);
return;
}
@@ -515,46 +495,28 @@ namespace BrewMonster
pHost.GetPack(InventoryConst.IVTRTYPE_PACK).UnfreezeAllItems();
message = GetGameUIMan().GetStringFromTable(228);
CECUIManager.Instance.ShowMessageBox(new MessageBoxData()
{
Message = message,
Dlg = this
});
CECUIManager.Instance.ShowMessageBoxGeneral("", message, this);
}
else if (pHost != null && m_Mode == InstallMode.Disenchase)
{
if (pEquipA.GetEmptyHoleNum() == pEquipA.GetHoleNum())
{
message = GetGameUIMan().GetStringFromTable(227);
CECUIManager.Instance.ShowMessageBox(new MessageBoxData()
{
Message = message,
Dlg = this
});
CECUIManager.Instance.ShowMessageBoxGeneral("", message, this);
return;
}
message = GetGameUIMan().GetStringFromTable(229);
var x = new MessageBoxData()
CECUIManager.Instance.ShowMessageBoxYesAndNo("", message, this,
() =>
{
Message = message,
Dlg = this,
MessageBoxType = MessageBoxType.BothYesNoButton,
OnClickedYes = () =>
{
UnityGameSession.c2s_CmdNPCSevClearEmbeddedChip((ushort)m_FirstInvSlot, pIvtrA.GetTemplateID());
ClearEquiment();
pHost.GetPack(InventoryConst.IVTRTYPE_PACK).UnfreezeAllItems();
UnityGameSession.c2s_CmdNPCSevClearEmbeddedChip((ushort)m_FirstInvSlot, pIvtrA.GetTemplateID());
ClearEquiment();
pHost.GetPack(InventoryConst.IVTRTYPE_PACK).UnfreezeAllItems();
string successMessage = GetGameUIMan().GetStringFromTable(230);
CECUIManager.Instance.ShowMessageBox(new MessageBoxData()
{
Message = successMessage,
Dlg = this
});
}
};
CECUIManager.Instance.ShowMessageBox(x);
string successMessage = GetGameUIMan().GetStringFromTable(230);
CECUIManager.Instance.ShowMessageBoxGeneral("", message, this);
}, null);
}
else
{
@@ -137,7 +137,7 @@ namespace BrewMonster.UI
CDLGNPC_CARDRESPAWN = 0xFFFFF49, // ¿¨ÅÆ×ªÉú
CDLGNPC_QUERYCHARIOTAMOUNT = 0xFFFFF50, // Õ½³µÊýÁ¿
CDLGNPC_FLYSWORDIMPROVE = 0xFFFFF51, // ·É½£Ç¿»¯
CDLGNPC_OPEN_FACTION_PVP = 0xFFFFF52, // ¿ªÆô°ïÅÉÂÓ¶á
CDLGNPC_OPEN_FACTION_PVP = 0xFFFFF52, // ¿ªÆô°ïÅÉÂÓ¶á
CDLGNPC_FACTION_RENAME = 0xFFFFF53,
CDLGNPC_GOLD_SHOP = 0xFFFFF54,
CDLGNPC_PLAYER_CHANGE_GENDER = 0xFFFFF55; // ÐÞ¸ÄÐÔ±ð
@@ -765,10 +765,10 @@ namespace BrewMonster.UI
NPC_MAKE_SERVICE pService = (NPC_MAKE_SERVICE)pData;
string serviceName = Encoding.Unicode.GetString(MemoryMarshal.AsBytes<ushort>(pService.name));
m_pLst_Main.AddString(strText + serviceName);
// Log NPC_MAKE_SERVICE data
BMLogger.Log($"NPC_MAKE_SERVICE detected - ServiceID: {a_uiService[i]}, MakeServiceID: {pService.id}, Name: {serviceName}, MakeSkillID: {pService.id_make_skill}, ProduceType: {pService.produce_type}");
// Log pages data
if (pService.pages != null)
{
@@ -778,7 +778,7 @@ namespace BrewMonster.UI
string pageTitle = Encoding.Unicode.GetString(MemoryMarshal.AsBytes<ushort>(page.page_title));
// Trim null characters and whitespace from page title
pageTitle = pageTitle?.TrimEnd('\0', ' ', '\t', '\r', '\n') ?? "";
// Collect all non-zero goods IDs with their names
// Note: id_goods contains RECIPE IDs, not item IDs
List<string> goodsInfo = new List<string>();
@@ -804,7 +804,7 @@ namespace BrewMonster.UI
// Try recipe space first
DATA_TYPE dt = DATA_TYPE.DT_INVALID;
object recipeData = edm.get_data_ptr(recipeId, ID_SPACE.ID_SPACE_RECIPE, ref dt);
// Check if we got recipe data - sometimes dt is DT_INVALID but data is still RECIPE_ESSENCE
RECIPE_ESSENCE? recipe = null;
if (recipeData != null && recipeData is RECIPE_ESSENCE)
@@ -815,11 +815,11 @@ namespace BrewMonster.UI
{
recipe = (RECIPE_ESSENCE)recipeData;
}
if (recipe.HasValue)
{
RECIPE_ESSENCE recipeValue = recipe.Value;
// Get output item from first target (main output)
if (recipeValue.targets != null && recipeValue.targets.Length > 0)
{
@@ -853,7 +853,7 @@ namespace BrewMonster.UI
{
BMLogger.LogWarning($" Recipe {recipeId}: targets is null or empty");
}
// Get all materials
if (recipeValue.materials != null)
{
@@ -875,7 +875,7 @@ namespace BrewMonster.UI
{
materialName = $"error: {ex2.Message}";
}
string matEntry = !string.IsNullOrEmpty(materialName)
? $"{material.id} ({materialName}) x{material.num}"
: $"{material.id} (unknown) x{material.num}";
@@ -894,7 +894,7 @@ namespace BrewMonster.UI
{
BMLogger.LogWarning($" Failed to get data for recipe ID {recipeId}: {ex.Message}\n{ex.StackTrace}");
}
// Format: "RecipeID -> Output: ID (Name) | Materials: ID (Name) xCount, ..."
string goodsEntry = $"Recipe {recipeId}";
if (!string.IsNullOrEmpty(outputItemInfo))
@@ -917,7 +917,7 @@ namespace BrewMonster.UI
}
}
}
// Log page if it has a title or has goods
if (!string.IsNullOrEmpty(pageTitle) || goodsInfo.Count > 0)
{
@@ -931,22 +931,22 @@ namespace BrewMonster.UI
{
NPC_DECOMPOSE_SERVICE pService = (NPC_DECOMPOSE_SERVICE)pData;
string serviceName = Encoding.Unicode.GetString(MemoryMarshal.AsBytes<ushort>(pService.name));
// Log NPC_DECOMPOSE_SERVICE data
BMLogger.Log($"NPC_DECOMPOSE_SERVICE detected - ServiceID: {a_uiService[i]}, DecomposeServiceID: {pService.id}, Name: {serviceName}, DecomposeSkillID: {pService.id_decompose_skill}");
CECHostPlayer hostPlayer = GetHostPlayer();
bool hasRequiredSkill = false;
// TODO: Implement proper skill check when GetPassiveSkillNum() and GetPassiveSkillByIndex() are available
// For now, we'll use reflection to access private GetPassiveSkillByID method or implement a workaround
// The C++ code checks if player has the required decompose skill (TYPE_LIVE or TYPE_PRODUCE)
try
{
// Try using reflection to access private GetPassiveSkillByID method
var method = typeof(CECHostPlayer).GetMethod("GetPassiveSkillByID",
var method = typeof(CECHostPlayer).GetMethod("GetPassiveSkillByID",
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
if (method != null)
{
var pSkill = method.Invoke(hostPlayer, new object[] { (int)pService.id_decompose_skill, false }) as CECSkill;
@@ -954,9 +954,9 @@ namespace BrewMonster.UI
{
int skillType = pSkill.GetType();
int skillID = pSkill.GetSkillID();
BMLogger.Log($" Found skill by ID (via reflection): ID={skillID}, Type={skillType}");
// Check if this is the required decompose skill with correct type
if ((skillType == (int)CECSkill.SkillType.TYPE_LIVE ||
skillType == (int)CECSkill.SkillType.TYPE_PRODUCE) &&
@@ -999,7 +999,7 @@ namespace BrewMonster.UI
m_pLst_Main.SetItemData(m_pLst_Main.GetCount() - 1, a_uiService[i]);
m_pLst_Main.SetItemDataPtr(m_pLst_Main.GetCount() - 1, pData);
}
if (!hasRequiredSkill)
continue;
}
@@ -1134,7 +1134,7 @@ namespace BrewMonster.UI
// m_pLst_Main.AddString(strText + GetStringFromTable(699));
// m_pLst_Main.SetItemData(m_pLst_Main.GetCount() - 1, CDLGNPC_BATTLECHALLENGE);
// }
// // if( gtime.tm_wday == 5 && gtime.tm_hour >= 18 ||
// // if( gtime.tm_wday == 5 && gtime.tm_hour >= 18 ||
// // gtime.tm_wday == 6 ||
// // gtime.tm_wday == 0 )
// if (GetHostPlayer().GetFRoleID() != GNETRoles._R_UNMEMBER)
@@ -1647,7 +1647,7 @@ namespace BrewMonster.UI
SetDataPtr(pTalk, "ptr_talk_proc");
if (!IsShow()) Show(true);
}
// bool c(int idFunction, int iService, object pData)
// {
// AUIDialog pShow1 = null, pShow2 = null;
@@ -1687,7 +1687,7 @@ namespace BrewMonster.UI
// {
// shopManager.OpenNPCShop(npcID);
// }
// }
// }
// }
// else if (idFunction == (int)SERVICE_TYPE.NPC_INSTALL)
// {
@@ -1994,7 +1994,7 @@ namespace BrewMonster.UI
//
// return true;
// }
public void OnCommand_back(string szCommand)
{
NPC_ESSENCE? pCurNPCEssence = GetGameUIMan().m_pCurNPCEssence;
@@ -2096,7 +2096,7 @@ namespace BrewMonster.UI
if (id != pTalk.windows[i].id) continue;
// TO DO: fix later
// TO DO: show popup with content is talk_text and 1 btn OK
// TO DO: show popup with content is talk_text and 1 btn OK
//GetGameUIMan().MessageBox("", pTask.FormatTaskTalk(pTalk.windows[i].talk_text),
// MB_OK, A3DCOLORRGBA(255, 255, 255, 160));
GetGameUIMan().EndNPCService();
@@ -3236,21 +3236,21 @@ namespace BrewMonster.UI
{
NPC_MAKE_SERVICE pService = (NPC_MAKE_SERVICE)pData;
string serviceName = Encoding.Unicode.GetString(MemoryMarshal.AsBytes<ushort>(pService.name));
// Log NPC_MAKE_SERVICE data when selected
BMLogger.Log($"SelectListItem - NPC_MAKE_SERVICE selected - ServiceID: {iService}, MakeServiceID: {pService.id}, Name: {serviceName}, MakeSkillID: {pService.id_make_skill}, ProduceType: {pService.produce_type}");
idFunction = (int)SERVICE_TYPE.NPC_MAKE;
}
else if (DataType == DATA_TYPE.DT_NPC_DECOMPOSE_SERVICE)
{
NPC_DECOMPOSE_SERVICE pService = (NPC_DECOMPOSE_SERVICE)pData;
string serviceName = Encoding.Unicode.GetString(MemoryMarshal.AsBytes<ushort>(pService.name));
// Log NPC_DECOMPOSE_SERVICE data when selected
BMLogger.Log($"SelectListItem - NPC_DECOMPOSE_SERVICE selected - ServiceID: {iService}, DecomposeServiceID: {pService.id}, Name: {serviceName}, DecomposeSkillID: {pService.id_decompose_skill}");
BMLogger.Log($" Note: This decompose service is being treated as idFunction={SERVICE_TYPE.NPC_DECOMPOSE}");
idFunction = (int)SERVICE_TYPE.NPC_DECOMPOSE;
}
else if (DataType == DATA_TYPE.DT_NPC_IDENTIFY_SERVICE)
@@ -3342,7 +3342,7 @@ namespace BrewMonster.UI
CECTaskInterface pTask;
ad.m_ulCandItems = 0;
opt.param = 0;
// Check if the integer matches any enum value
if (Enum.IsDefined(typeof(SERVICE_TYPE), idFunction))
{
@@ -3391,7 +3391,7 @@ namespace BrewMonster.UI
if (pCurNPCEssence.HasValue)
{
uint npcID = pCurNPCEssence.Value.id;
// var dlgInstall =GetGameUIMan().GetDialog("Win_Enchase");
// dlgInstall.Show(true);
CECUIManager.Instance.ShowUI("Win_Enchase");
@@ -3446,14 +3446,14 @@ namespace BrewMonster.UI
else if (idFunction == (int)SERVICE_TYPE.NPC_MAKE)
{
NPC_MAKE_SERVICE pMake = (NPC_MAKE_SERVICE)pData;
BMLogger.Log($"PopupCorrespondingServiceDialog - NPC_MAKE: produce_type={pMake.produce_type}, MakeSkillID={pMake.id_make_skill}");
// Dialog loading commented out - Win_Produce dialog not yet implemented
// Determine which dialog to use based on produce_type
//string dialogName = (pMake.produce_type == 2) ? "Win_Produce1" : "Win_Produce";
//pShow1 = m_pAUIManager.GetDialog(dialogName);
//if (pShow1 == null)
//{
// BMLogger.LogError($"NPC_MAKE: Dialog '{dialogName}' not found! Service may not work correctly.");
@@ -3464,7 +3464,7 @@ namespace BrewMonster.UI
//{
// // Get or set DlgProduce reference (if it exists)
// // GetGameUIMan().m_pDlgProduce = (CDlgProduce*)pShow1;
//
//
// // Prepare NPC service
// try
// {
@@ -3474,7 +3474,7 @@ namespace BrewMonster.UI
// {
// BMLogger.LogError($"NPC_MAKE: Error calling PrepareNPCService: {ex.Message}");
// }
//
//
// // Set data pointer
// try
// {
@@ -3484,7 +3484,7 @@ namespace BrewMonster.UI
// {
// BMLogger.LogError($"NPC_MAKE: Error setting data pointer: {ex.Message}");
// }
//
//
// // Clear material for certain produce types
// if (pMake.produce_type == 1 ||
// pMake.produce_type == 3 ||
@@ -3502,10 +3502,10 @@ namespace BrewMonster.UI
// BMLogger.LogError($"NPC_MAKE: Error clearing material: {ex.Message}");
// }
// }
//
//
// // Get inventory dialog
// pShow2 = m_pAUIManager.GetDialog("Win_Inventory");
//
//
// // Update produce dialog
// try
// {
@@ -3683,7 +3683,7 @@ namespace BrewMonster.UI
pTask = GetHostPlayer().GetTaskInterface();
pTask.GetAwardCandidates(opt.param, ref ad);
if (ad.m_ulCandItems > 1)
{
dialogue1 = "Win_Award";
@@ -3831,12 +3831,6 @@ namespace BrewMonster.UI
return true;
}
public override void CloseDialogue()
{
base.CloseDialogue();
GetGameUIMan().EndNPCService();
}
public void OnCommand_CANCEL(string szCommand)
{
int idCurFinishTask = GetGameUIMan().m_idCurFinishTask;
@@ -3846,6 +3840,7 @@ namespace BrewMonster.UI
GetGameUIMan().m_idCurFinishTask = -1;
}
CloseDialogue();
GetGameUIMan().EndNPCService();
}
public override void Awake()
@@ -55,11 +55,7 @@ namespace BrewMonster
player.GetCurSkill() != null ||
player.IsFighting())
{
uiManager.ShowMessageBox(new MessageBoxData()
{
Title = "MessageBox",
Message = gameUIMan.GetStringFromTable(11327)
});
uiManager.ShowMessageBoxGeneral("MessageBox", gameUIMan.GetStringFromTable(11327), this);
}
int nCondition = CECHostSkillModel.Instance.CheckLearnCondition(m_skillID);
@@ -102,12 +98,14 @@ namespace BrewMonster
int needSp = CECHostSkillModel.Instance.GetSkillSp(m_skillID, m_curLevel + 1);
string str = GPDataTypeHelper.ReplacePercentD(GetStringFromTable(11326), needMoney, needSp);
var messagebox = uiManager.ShowMessageBox(new MessageBoxData()
{
Title = "Game_LearnSkill",
Message = str,
OnClickedYes = () => UnityGameSession.c2s_SendCmdNPCSevLearnSkill(m_skillID)
});
// var messagebox = uiManager.ShowMessageBox(new MessageBoxData()
// {
// Title = "Game_LearnSkill",
// Message = str,
// OnClickedYes = () => UnityGameSession.c2s_SendCmdNPCSevLearnSkill(m_skillID)
// });
var messagebox = uiManager.ShowMessageBoxYes("Game_LearnSkill", str, this,
() => UnityGameSession.c2s_SendCmdNPCSevLearnSkill(m_skillID));
messagebox.SetData((uint)m_skillID);
//GetGameUIMan()->MessageBox("Game_LearnSkill", str, //GetGameUIMan()->GetStringFromTable(231),
// MB_OKCANCEL, A3DCOLORRGBA(255, 255, 255, 160), &pMsgBox);
@@ -40,12 +40,8 @@ namespace BrewMonster.UI
void OnCommandRepick()
{
CECUIManager.Instance.ShowMessageBox(
title: "Thoát",
message: CECUIManager.Instance.GetInGameUIMan().GetStringFromTable(202),
messageBoxType: MessageBoxType.BothYesNoButton,
onClickedYes: OnClickYes
);
CECUIManager.Instance.ShowMessageBoxYes("Thoát",
CECUIManager.Instance.GetInGameUIMan().GetStringFromTable(202), null, OnClickYes);
}
void OnClickYes()
@@ -14,7 +14,7 @@ using UnityEngine.UI;
namespace BrewMonster.UI
{
/// <summary>
/// Login Flow:
/// Login Flow:
/// 1. Enter username and password
/// 2. Click login button
/// 3. Login success, get the list of characters
@@ -92,13 +92,14 @@ namespace BrewMonster.UI
#if UNITY_EDITOR
if (Input.GetKeyUp(KeyCode.LeftAlt))
{
_usernameInputField.text = "test004";
_usernameInputField.text = "test016";
_passwordInputField.text = "123456";
OnLoginButtonClicked();
}
if (Input.GetKeyUp(KeyCode.Tab))
{
_usernameInputField.text = "test002";
_usernameInputField.text = "test017";
_passwordInputField.text = "123456";
OnLoginButtonClicked();
}
@@ -135,7 +136,7 @@ namespace BrewMonster.UI
BMLogger.LogError("[LoginScreenUI] Username/password empty.");
await BeginGameLoginAsync(_usernameInputField.text, _passwordInputField.text);
}
}
private async Task BeginGameLoginAsync(string username, string password)
@@ -179,7 +180,7 @@ namespace BrewMonster.UI
// If we're returning to select role, skip straight to select role without showing login UI again, since we never fully left the game session.
OnLoginComplete(true);
return;
// Auto-login to reach Select Role like the original client, without showing Tech3C auth UI again.
if (!string.IsNullOrEmpty(_usernameInputField.text) && !string.IsNullOrEmpty(_passwordInputField.text))
{
@@ -192,7 +193,7 @@ namespace BrewMonster.UI
}
/// <summary>
/// Callback when the login is complete.
/// Callback when the login is complete.
/// Then get the list of characters
/// </summary>
private void OnLoginComplete(bool result)
@@ -214,7 +215,7 @@ namespace BrewMonster.UI
}
/// <summary>
/// Callback when the list of characters is retrieved.
/// Callback when the list of characters is retrieved.
/// Then move to the select character screen
/// </summary>
private void OnGetRoleListComplete(List<RoleInfo> roleInfos)
@@ -344,7 +345,7 @@ namespace BrewMonster.UI
UnityGameSession.EnterWorldAsync(roleInfo, OnEnterWorldComplete);
#else
string nameScene = UnityGameSession.Instance.GetWorldInstanceName();
UnityGameSession.Instance.LoadScene(nameScene, LoadSceneMode.Single,
UnityGameSession.Instance.LoadScene(nameScene, LoadSceneMode.Single,
(progress) =>
{
LoadingSceneController.Instance.SetProgress(progress);
@@ -356,7 +357,7 @@ namespace BrewMonster.UI
isDoneWorldRender = true;
actLoadChar?.Invoke();
UnityGameSession.EnterWorldAsync(roleInfo, OnEnterWorldComplete);
});
#endif
}, null);
@@ -435,4 +436,4 @@ namespace BrewMonster.UI
}
}
}
}
}
@@ -206,10 +206,10 @@ RectTransform:
- {fileID: 6133989890986254344}
m_Father: {fileID: 1983722419643715407}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 500, y: 426.75708}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!222 &6409592904291504631
CanvasRenderer:
@@ -458,11 +458,11 @@ RectTransform:
- {fileID: 4454076196230765805}
m_Father: {fileID: 6199635200021499044}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: -288.98}
m_SizeDelta: {x: 508.681, y: 53}
m_Pivot: {x: 0, y: 1}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: -396, y: 79}
m_SizeDelta: {x: 75, y: 75}
m_Pivot: {x: 0.5, y: 0}
--- !u!1 &4190358850504021446
GameObject:
m_ObjectHideFlags: 0
@@ -481,7 +481,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1983722419643715407
RectTransform:
m_ObjectHideFlags: 0
@@ -497,10 +497,10 @@ RectTransform:
- {fileID: 7473152984931807423}
m_Father: {fileID: 6199635200021499044}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: -783}
m_SizeDelta: {x: 508.681, y: 441.022}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: -346.5, y: 50}
m_SizeDelta: {x: 550, y: 450}
m_Pivot: {x: 0, y: 0}
--- !u!222 &5213722908587404148
CanvasRenderer:
@@ -764,7 +764,7 @@ RectTransform:
m_Father: {fileID: 3976287853544917220}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
@@ -859,7 +859,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5535948066766320732}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
@@ -1028,7 +1028,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "\u200B"
m_text: "<u>5</u>\u200B"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
@@ -1133,11 +1133,11 @@ RectTransform:
- {fileID: 7133716985767026273}
m_Father: {fileID: 4963429530816417249}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 116, y: -0.000026464}
m_SizeDelta: {x: 160, y: 50}
m_Pivot: {x: 0, y: 1}
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: 75, y: 75}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5054963699385999060
CanvasRenderer:
m_ObjectHideFlags: 0
@@ -1466,9 +1466,9 @@ RectTransform:
m_Father: {fileID: 1473672866371037475}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_SizeDelta: {x: -17, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!222 &4906838759260176767
CanvasRenderer:
+4 -2
View File
@@ -117,7 +117,8 @@ namespace BrewMonster
{
//pGameRun.AddFixedMessage(FIXMSG_PET_DEAD);
//Debug.LogError("FIXMSG_PET_DEAD");
pGameUI.ShowMessageBox("MessageBox", "PET_DEAD", MessageBoxType.YesButton);
// pGameUI.ShowMessageBox("MessageBox", "PET_DEAD", MessageBoxType.YesButton);
pGameUI.ShowMessageBoxYes("MessageBox", "PET_DEAD", null, null);
return false;
}
@@ -138,7 +139,8 @@ namespace BrewMonster
{
string strText = "";
strText = string.Format(pGameUI.GetInGameUIMan().GetStringFromTable(10787), iLevelRequired);
pGameUI.ShowMessageBox("MessageBox", strText, MessageBoxType.YesButton);
// pGameUI.ShowMessageBox("MessageBox", strText, MessageBoxType.YesButton);
pGameUI.ShowMessageBoxYes("MessageBox", strText, null, null);
}
return false;
}
+5 -5
View File
@@ -1112,19 +1112,19 @@ namespace BrewMonster
float fSkillRange = m_pPrepSkill.GetCastRange(m_ExtProps.ak.AttackRange, GetPrayDistancePlus());
bool bCanTouch = CanTouchTarget(vTargetPos, cECNPC.GetTouchRadius(), 2); // 2 = skill
BMLogger.Log($"[DISTANCE_DEBUG] CastSkill: Before sending c2s_CmdCastSkill (regular), skillID={prepSkillID}, " +
/* BMLogger.Log($"[DISTANCE_DEBUG] CastSkill: Before sending c2s_CmdCastSkill (regular), skillID={prepSkillID}, " +
$"hostPos=({vHostPos.x:F2}, {vHostPos.y:F2}, {vHostPos.z:F2}), " +
$"targetPos=({vTargetPos.x:F2}, {vTargetPos.y:F2}, {vTargetPos.z:F2}), " +
$"distance={fDistance:F2}, skillRange={fSkillRange:F2}, " +
$"targetRadius={cECNPC.GetTouchRadius():F2}, CanTouch={bCanTouch}, " +
$"target={idTarget}, byPVPMask={byPVPMask2}");
$"target={idTarget}, byPVPMask={byPVPMask2}");*/
}
else
/* else
{
BMLogger.Log($"[DISTANCE_DEBUG] CastSkill: Before sending c2s_CmdCastSkill (regular), skillID={prepSkillID}, " +
$"hostPos=({vHostPos.x:F2}, {vHostPos.y:F2}, {vHostPos.z:F2}), " +
$"target={idTarget} (target object is null), byPVPMask={byPVPMask2}");
}
}*/
// Debug.Log($"[SKILL_CAST_DEBUG] CastSkill: Sending c2s_CmdCastSkill (regular), skillID={prepSkillID}, " +
// $"target={idTarget}, count={targets}, byPVPMask={byPVPMask2}");
@@ -1924,4 +1924,4 @@ namespace BrewMonster
#endif
}
}
}
+19 -12
View File
@@ -656,12 +656,16 @@ namespace BrewMonster
// Duel invite: show accept/reject popup (origin MSG_PM_DUELOPT with command DUEL_RECV_REQUEST = 214)
if (idOpp != 0)
{
CECUIManager.Instance?.ShowMessageBox(
title: "",
message: "Bạn vừa nhận được lời thách đấu. Bạn có chấp nhận không?",
messageBoxType: MessageBoxType.BothYesNoButton,
onClickedYes: () => UnityGameSession.c2s_CmdDuelReply(true, idOpp),
onClickedNo: () => UnityGameSession.c2s_CmdDuelReply(false, idOpp));
// CECUIManager.Instance?.ShowMessageBox(
// title: "",
// message: "Bạn vừa nhận được lời thách đấu. Bạn có chấp nhận không?",
// messageBoxType: MessageBoxType.BothYesNoButton,
// onClickedYes: () => UnityGameSession.c2s_CmdDuelReply(true, idOpp),
// onClickedNo: () => UnityGameSession.c2s_CmdDuelReply(false, idOpp));
CECUIManager.Instance?.ShowMessageBoxYesAndNo("",
"Bạn vừa nhận được lời thách đấu. Bạn có chấp nhận không?", null,
()=>UnityGameSession.c2s_CmdDuelReply(true, idOpp),
() => UnityGameSession.c2s_CmdDuelReply(false, idOpp));
}
break;
case CommandID.DUEL_PREPARE:
@@ -712,12 +716,15 @@ namespace BrewMonster
if (idLeader == 0)
return;
int seqCapture = team_seq;
CECUIManager.Instance?.ShowMessageBox(
title: "",
message: "Bạn đã nhận được lời mời tham gia tổ đội. Bạn có chấp nhận không?",
messageBoxType: MessageBoxType.BothYesNoButton,
onClickedYes: () => UnityGameSession.c2s_CmdTeamAgreeInvite(idLeader, seqCapture),
onClickedNo: () => UnityGameSession.c2s_CmdTeamRejectInvite(idLeader));
// CECUIManager.Instance?.ShowMessageBox(
// title: "",
// message: "Bạn đã nhận được lời mời tham gia tổ đội. Bạn có chấp nhận không?",
// messageBoxType: MessageBoxType.BothYesNoButton,
// onClickedYes: () => UnityGameSession.c2s_CmdTeamAgreeInvite(idLeader, seqCapture),
// onClickedNo: () => UnityGameSession.c2s_CmdTeamRejectInvite(idLeader));
CECUIManager.Instance?.ShowMessageBoxYesAndNo("", "Bạn đã nhận được lời mời tham gia tổ đội. Bạn có chấp nhận không?",null,
()=>UnityGameSession.c2s_CmdTeamAgreeInvite(idLeader, seqCapture),
() => UnityGameSession.c2s_CmdTeamRejectInvite(idLeader));
}
/// <summary>Called when MSG_PM_PLAYERDUELOPT (229) is received; server may send duel start to both participants. If host is one of the two ids, set duel state.</summary>
+73 -26
View File
@@ -281,46 +281,95 @@ public class CECUIManager : MonoSingleton<CECUIManager>
_uiStack.Clear();
}
public CDlgMessageBox ShowMessageBox(MessageBoxData messageBoxData)
public CDlgMessageBox ShowMessageBoxGeneral(string title, string message, AUIDialog dlg)
{
var msgBox = GetInGameUIMan().GetDialog("DlgMessageBox") as CDlgMessageBox;
if (msgBox != null)
{
msgBox.ShowMessageBox(messageBoxData);
msgBox.ShowMessageBoxGeneral(title, message, dlg);
return msgBox;
}
else
{
Debug.LogError("DlgMessageBox not found in InGameUIMan");
}
Debug.LogError("DlgMessageBox not found in InGameUIMan");
return null;
}
public CDlgMessageBox ShowMessageBox(string title, string message, MessageBoxType messageBoxType,
Action onClickedYes = null, Action onClickedNo = null)
public CDlgMessageBox ShowMessageBoxYes(string title, string message, AUIDialog dlg, Action onClickedYes)
{
var msgBox = GetInGameUIMan().GetDialog("DlgMessageBox") as CDlgMessageBox;
if (msgBox != null)
{
msgBox.ShowMessageBox(new MessageBoxData()
{
Title = title,
Message = message,
MessageBoxType = messageBoxType,
OnClickedYes = onClickedYes,
OnClickedNo = onClickedNo
});
msgBox.ShowMessageBoxYes(title, message, dlg, onClickedYes);
return msgBox;
}
else
{
Debug.LogError("DlgMessageBox not found in InGameUIMan");
}
Debug.LogError("DlgMessageBox not found in InGameUIMan");
return null;
}
public CDlgMessageBox ShowMessageBoxNo(string title, string message, AUIDialog dlg, Action onClickedNo)
{
var msgBox = GetInGameUIMan().GetDialog("DlgMessageBox") as CDlgMessageBox;
if (msgBox != null)
{
msgBox.ShowMessageBoxNo(title, message, dlg, onClickedNo);
return msgBox;
}
Debug.LogError("DlgMessageBox not found in InGameUIMan");
return null;
}
public CDlgMessageBox ShowMessageBoxYesAndNo(string title, string message, AUIDialog dlg, Action onClickedYes, Action onClickedNo)
{
var msgBox = GetInGameUIMan().GetDialog("DlgMessageBox") as CDlgMessageBox;
if (msgBox != null)
{
msgBox.ShowMessageBoxYesAndNo(title, message, dlg,onClickedYes, onClickedNo);
return msgBox;
}
Debug.LogError("DlgMessageBox not found in InGameUIMan");
return null;
}
// public CDlgMessageBox ShowMessageBox(MessageBoxData messageBoxData)
// {
// var msgBox = GetInGameUIMan().GetDialog("DlgMessageBox") as CDlgMessageBox;
// if (msgBox != null)
// {
// msgBox.ShowMessageBox(messageBoxData);
// return msgBox;
// }
// else
// {
// Debug.LogError("DlgMessageBox not found in InGameUIMan");
// }
//
// return null;
// }
// public CDlgMessageBox ShowMessageBox(string title, string message, MessageBoxType messageBoxType,
// Action onClickedYes = null, Action onClickedNo = null)
// {
// var msgBox = GetInGameUIMan().GetDialog("DlgMessageBox") as CDlgMessageBox;
// if (msgBox != null)
// {
// msgBox.ShowMessageBox(new MessageBoxData()
// {
// Title = title,
// Message = message,
// MessageBoxType = messageBoxType,
// OnClickedYes = onClickedYes,
// OnClickedNo = onClickedNo
// });
// return msgBox;
// }
// else
// {
// Debug.LogError("DlgMessageBox not found in InGameUIMan");
// }
//
// return null;
// }
public void UpdateSkillRelatedUI()
{
@@ -464,10 +513,8 @@ public class CECUIManager : MonoSingleton<CECUIManager>
// m_pCurNPCEssence = NULL;
// m_pDlgInventory->Show(false);
pHost.GetPack((int)InventoryType.IVTRTYPE_PACK).UnfreezeAllItems();
ShowMessageBox(new MessageBoxData()
{
Message = pDlg.GetStringFromTable(228)
});
ShowMessageBoxGeneral("",pDlg.GetStringFromTable(228), null);
}
}
File diff suppressed because one or more lines are too long