finished refacor NPC shop UI
This commit is contained in:
@@ -1682,25 +1682,8 @@ namespace BrewMonster.UI
|
||||
if (pCurNPCEssence.HasValue)
|
||||
{
|
||||
uint npcID = pCurNPCEssence.Value.id;
|
||||
NPCShopUIManager shopManager = FindFirstObjectByType<NPCShopUIManager>();
|
||||
if (shopManager == null)
|
||||
{
|
||||
// Instantiate NPCShopUIManager if not found, similar to how DlgNPC is instantiated
|
||||
CECGameUIMan gameUIMan = GetGameUIMan();
|
||||
DialogScriptTableObject dialogResource = gameUIMan.GetDialogResource();
|
||||
Canvas canvas = gameUIMan.GetCanvas();
|
||||
|
||||
if (dialogResource != null && canvas != null)
|
||||
{
|
||||
GameObject ob = dialogResource.GetPrefabDialog("DialogNPCShop");
|
||||
if (ob != null)
|
||||
{
|
||||
shopManager = GameObject.Instantiate(ob, canvas.transform).GetComponent<NPCShopUIManager>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (shopManager != null)
|
||||
var dlg = CECUIManager.Instance.ShowUI("DialogNPCShop");
|
||||
if (dlg != null && dlg is NPCShopUIManager shopManager)
|
||||
{
|
||||
shopManager.OpenNPCShop(npcID);
|
||||
}
|
||||
@@ -1979,7 +1962,8 @@ namespace BrewMonster.UI
|
||||
|
||||
pDataMan.get_data_ptr((uint)iService, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
|
||||
|
||||
pShow1.Show(true);
|
||||
//dat update uimanager stack commented
|
||||
// pShow1.Show(true);
|
||||
|
||||
if (pShow2)
|
||||
{
|
||||
@@ -2002,7 +1986,8 @@ namespace BrewMonster.UI
|
||||
// pShow2.SetPosEx(x, y);
|
||||
//}
|
||||
|
||||
pShow2.Show(true);
|
||||
//dat update uimanager stack commented
|
||||
// pShow2.Show(true);
|
||||
}
|
||||
}
|
||||
//CloseDialogue();
|
||||
@@ -2012,7 +1997,6 @@ namespace BrewMonster.UI
|
||||
|
||||
public void OnCommand_back(string szCommand)
|
||||
{
|
||||
|
||||
NPC_ESSENCE? pCurNPCEssence = GetGameUIMan().m_pCurNPCEssence;
|
||||
|
||||
if (GetData() == NPC_DIALOG.NPC_DIALOG_TALK ||
|
||||
@@ -2076,13 +2060,13 @@ namespace BrewMonster.UI
|
||||
if (GetData() == NPC_DIALOG.NPC_DIALOG_TASK_LIST)
|
||||
{
|
||||
// �����ǰNPCֻ��������ط����ص�ͬ���˳�NPC����
|
||||
//CloseDialogue();
|
||||
CloseDialogue();
|
||||
GetGameUIMan().EndNPCService();
|
||||
}
|
||||
}
|
||||
else if (GetData() == NPC_DIALOG.NPC_DIALOG_ESSENCE)
|
||||
{
|
||||
//CloseDialogue();
|
||||
CloseDialogue();
|
||||
GetGameUIMan().EndNPCService();
|
||||
}
|
||||
}
|
||||
@@ -3382,25 +3366,8 @@ namespace BrewMonster.UI
|
||||
if (pCurNPCEssence.HasValue)
|
||||
{
|
||||
uint npcID = pCurNPCEssence.Value.id;
|
||||
NPCShopUIManager shopManager = FindFirstObjectByType<NPCShopUIManager>();
|
||||
if (shopManager == null)
|
||||
{
|
||||
// Instantiate NPCShopUIManager if not found, similar to how DlgNPC is instantiated
|
||||
CECGameUIMan gameUIMan = GetGameUIMan();
|
||||
DialogScriptTableObject dialogResource = gameUIMan.GetDialogResource();
|
||||
Canvas canvas = gameUIMan.GetCanvas();
|
||||
|
||||
if (dialogResource != null && canvas != null)
|
||||
{
|
||||
GameObject ob = dialogResource.GetPrefabDialog("DialogNPCShop");
|
||||
if (ob != null)
|
||||
{
|
||||
shopManager = GameObject.Instantiate(ob, canvas.transform).GetComponent<NPCShopUIManager>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (shopManager != null)
|
||||
var dlg = CECUIManager.Instance.ShowUI("DialogNPCShop");
|
||||
if (dlg != null && dlg is NPCShopUIManager shopManager)
|
||||
{
|
||||
shopManager.OpenNPCShop(npcID);
|
||||
}
|
||||
|
||||
@@ -1,141 +1,5 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &227740078161399208
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4508900108135688843}
|
||||
- component: {fileID: 1334248510954733382}
|
||||
- component: {fileID: 3535356980335466858}
|
||||
m_Layer: 0
|
||||
m_Name: Text (TMP)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4508900108135688843
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 227740078161399208}
|
||||
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: 6721994976154660856}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1334248510954733382
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 227740078161399208}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3535356980335466858
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 227740078161399208}
|
||||
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: Back
|
||||
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: 4281479730
|
||||
m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, 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: 24
|
||||
m_fontSizeBase: 24
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 512
|
||||
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 &239632690013192579
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -278,7 +142,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 111.435, y: -104}
|
||||
m_AnchoredPosition: {x: 111.435, y: -183.745}
|
||||
m_SizeDelta: {x: 222.87, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4686984658772048795
|
||||
@@ -1098,127 +962,6 @@ MonoBehaviour:
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &5475358239089109801
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6721994976154660856}
|
||||
- component: {fileID: 5149405871995786751}
|
||||
- component: {fileID: 853022486708302467}
|
||||
- component: {fileID: 6071484966713915762}
|
||||
m_Layer: 0
|
||||
m_Name: BtnBack
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6721994976154660856
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5475358239089109801}
|
||||
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: 4508900108135688843}
|
||||
m_Father: {fileID: 617338231045505643}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0}
|
||||
m_AnchorMax: {x: 0.5, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 30.9}
|
||||
m_SizeDelta: {x: 160, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5149405871995786751
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5475358239089109801}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &853022486708302467
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5475358239089109801}
|
||||
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: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
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 &6071484966713915762
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5475358239089109801}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, 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: 1
|
||||
m_TargetGraphic: {fileID: 853022486708302467}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!1 &5717174923209038532
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -1250,7 +993,6 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 1
|
||||
m_Children:
|
||||
- {fileID: 4417434749515336320}
|
||||
- {fileID: 6721994976154660856}
|
||||
- {fileID: 4320535810812211952}
|
||||
- {fileID: 412875348489889375}
|
||||
- {fileID: 1373151796210670601}
|
||||
@@ -2023,6 +1765,8 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 009ffcf832a02b545a5cce71d5e32877, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
skillNameText: {fileID: 0}
|
||||
imageProgress: {fileID: 0}
|
||||
npcShopMainPanel: {fileID: 8237288432181259026}
|
||||
npcShopDetailPanel: {fileID: 4704784074983072622}
|
||||
tabButtonContainer: {fileID: 412875348489889375}
|
||||
|
||||
Reference in New Issue
Block a user