Merge pull request 'feature/fix-teamate' (#214) from feature/fix-teamate into develop
Reviewed-on: https://git.pthub.vn/Unity/perfect-world-unity/pulls/214
This commit is contained in:
@@ -1498,6 +1498,7 @@ MonoBehaviour:
|
||||
m_pBtn_Disband: {fileID: 6438025786369724724}
|
||||
m_pBtn_MakeLeader: {fileID: 7662012750042526494}
|
||||
m_pBtn_Refresh: {fileID: 5323838650917581558}
|
||||
m_pBtn_Close: {fileID: 4321133568498195476}
|
||||
m_pInput_Name: {fileID: 1502486576213604978}
|
||||
m_pChk_Random: {fileID: 6028060997031178228}
|
||||
m_pChk_Free: {fileID: 8630865055242674587}
|
||||
@@ -6289,19 +6290,7 @@ MonoBehaviour:
|
||||
m_TargetGraphic: {fileID: 3391660217384508209}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 2452003196178065293}
|
||||
m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine
|
||||
m_MethodName: SetActive
|
||||
m_Mode: 6
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
m_Calls: []
|
||||
--- !u!1 &7172228088205297695
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -31,6 +31,7 @@ namespace BrewMonster.UI
|
||||
[SerializeField] private Button m_pBtn_Disband;
|
||||
[SerializeField] private Button m_pBtn_MakeLeader;
|
||||
[SerializeField] private Button m_pBtn_Refresh;
|
||||
[SerializeField] private Button m_pBtn_Close;
|
||||
|
||||
[Header("Invite")]
|
||||
[SerializeField] private TMP_InputField m_pInput_Name;
|
||||
@@ -84,6 +85,7 @@ namespace BrewMonster.UI
|
||||
if (m_pBtn_Refresh != null) { m_pBtn_Refresh.onClick.RemoveListener(OnRefresh); m_pBtn_Refresh.onClick.AddListener(OnRefresh); }
|
||||
if (m_pChk_Random != null) m_pChk_Random.onValueChanged.AddListener(OnRandomToggled);
|
||||
if (m_pChk_Free != null) m_pChk_Free.onValueChanged.AddListener(OnFreeToggled);
|
||||
if (m_pBtn_Close != null) m_pBtn_Close.onClick.AddListener(OnClickClose);
|
||||
BindProfDropdown();
|
||||
}
|
||||
|
||||
@@ -97,6 +99,7 @@ namespace BrewMonster.UI
|
||||
if (m_pBtn_Refresh != null) m_pBtn_Refresh.onClick.RemoveListener(OnRefresh);
|
||||
if (m_pChk_Random != null) m_pChk_Random.onValueChanged.RemoveListener(OnRandomToggled);
|
||||
if (m_pChk_Free != null) m_pChk_Free.onValueChanged.RemoveListener(OnFreeToggled);
|
||||
if (m_pBtn_Close != null) m_pBtn_Close.onClick.RemoveListener(OnClickClose);
|
||||
UnbindProfDropdown();
|
||||
CloseProfFilterPanel();
|
||||
}
|
||||
@@ -191,7 +194,7 @@ namespace BrewMonster.UI
|
||||
if (listItem != null)
|
||||
{
|
||||
Debug.Log($"[DlgArrangeTeam] Set teammate item detail: level {m.GetLevel()}");
|
||||
listItem.SetDetail(m.GetLevel(), m.GetProfession());
|
||||
listItem.SetDetail(m.GetProfession());
|
||||
m_TeammateItems.Add(listItem);
|
||||
}
|
||||
}
|
||||
@@ -206,7 +209,7 @@ namespace BrewMonster.UI
|
||||
if (manPlayer != null && prefab != null)
|
||||
{
|
||||
HashSet<int> filterSet = GetSelectedProfessionSet();
|
||||
var nearby = new List<(string name, int cid, int prof, int level)>();
|
||||
var nearby = new List<(string name, int cid, int prof)>();
|
||||
var otherIds = manPlayer.GetOtherPlayerCharacterIds();
|
||||
foreach (int cid in otherIds)
|
||||
{
|
||||
@@ -217,15 +220,14 @@ namespace BrewMonster.UI
|
||||
if (string.IsNullOrEmpty(name)) name = "Player_" + cid;
|
||||
int prof = (p as CECPlayer) != null ? (p as CECPlayer).GetProfession() : 0;
|
||||
if (filterSet != null && !filterSet.Contains(prof)) continue;
|
||||
int level = (p as CECPlayer) != null ? (p as CECPlayer).GetLevel() : 0;
|
||||
nearby.Add((name, cid, prof, level));
|
||||
nearby.Add((name, cid, prof));
|
||||
}
|
||||
nearby.Sort((a, b) => { int c = a.prof.CompareTo(b.prof); if (c != 0) return c; return string.CompareOrdinal(a.name, b.name); });
|
||||
foreach (var t in nearby)
|
||||
{
|
||||
Debug.Log($"[DlgArrangeTeam] Nearby: {t.name} (id {t.cid}) (level: {t.level})");
|
||||
Debug.Log($"[DlgArrangeTeam] Nearby: {t.name} (id {t.cid})");
|
||||
CreateListItem(Content_Nearby, prefab, t.name, t.cid, false, out var listItem);
|
||||
listItem.SetDetail(t.level, t.prof);
|
||||
listItem.SetDetail(t.prof);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -398,5 +400,10 @@ namespace BrewMonster.UI
|
||||
{
|
||||
return m_selectedTeammateId;
|
||||
}
|
||||
|
||||
private void OnClickClose()
|
||||
{
|
||||
CECUIManager.Instance.HideCurrentUIInStack();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace BrewMonster.UI
|
||||
SetSelected(false);
|
||||
}
|
||||
|
||||
public void SetDetail(int level, int profession)
|
||||
public void SetDetail(int profession)
|
||||
{
|
||||
if (m_TextDetail != null)
|
||||
{
|
||||
@@ -38,7 +38,7 @@ namespace BrewMonster.UI
|
||||
string profName = gameRun?.GetProfName(profession);
|
||||
if(string.IsNullOrEmpty(profName))
|
||||
profName = $"{profession}";
|
||||
m_TextDetail.text = $"Cấp {level} {profName}";
|
||||
m_TextDetail.text = $"{profName}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2365,8 +2365,10 @@ namespace BrewMonster.UI
|
||||
// TO DO: fix later
|
||||
//GetGameUIMan().m_pDlgInventory.Show(true);
|
||||
//GetGameUIMan().m_pDlgPetHatch.Show(true);
|
||||
var dlgPetHatch = GetGameUIMan().GetDialog("DlgPetHatch");
|
||||
dlgPetHatch.Show(true);
|
||||
//var dlgPetHatch = GetGameUIMan().GetDialog("DlgPetHatch");
|
||||
//dlgPetHatch.Show(true);
|
||||
|
||||
CECUIManager.Instance.ShowUI("DlgPetHatch");
|
||||
return;
|
||||
}
|
||||
else if (iService == CDLGNPC.CDLGNPC_PETREC && (pEssence?.combined_services & 0x400) != 0)
|
||||
@@ -2375,8 +2377,11 @@ namespace BrewMonster.UI
|
||||
// TO DO: fix later
|
||||
//GetGameUIMan().m_pDlgPetList.Show(true);
|
||||
//GetGameUIMan().m_pDlgPetRec.Show(true);
|
||||
var dlgPetRec = GetGameUIMan().GetDialog("DlgPetRec");
|
||||
dlgPetRec.Show(true);
|
||||
|
||||
//var dlgPetRec = GetGameUIMan().GetDialog("DlgPetRec");
|
||||
//dlgPetRec.Show(true);
|
||||
|
||||
CECUIManager.Instance.ShowUI("DlgPetRec");
|
||||
return;
|
||||
}
|
||||
else if (iService == CDLGNPC.CDLGNPC_BATTLECHALLENGE && (pEssence?.combined_services & 0x800) != 0)
|
||||
@@ -3859,12 +3864,22 @@ namespace BrewMonster.UI
|
||||
{
|
||||
//CloseDialogue();
|
||||
|
||||
var pDlg = GetGameUIMan().GetDialog("Win_QuestList");
|
||||
if (pDlg)
|
||||
//var pDlg = GetGameUIMan().GetDialog("Win_QuestList");
|
||||
//if (pDlg)
|
||||
//{
|
||||
// pDlg.Show(true);
|
||||
//}
|
||||
//else // in case the dialog is missing or name changed...
|
||||
//{
|
||||
// GetGameUIMan().EndNPCService();
|
||||
//}
|
||||
|
||||
var dlg = CECUIManager.Instance;
|
||||
if(dlg != null)
|
||||
{
|
||||
pDlg.Show(true);
|
||||
dlg.ShowUI("Win_QuestList");
|
||||
}
|
||||
else // in case the dialog is missing or name changed...
|
||||
else
|
||||
{
|
||||
GetGameUIMan().EndNPCService();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ namespace BrewMonster.UI
|
||||
private readonly List<DlgTeamMate> m_pMates = new List<DlgTeamMate>();
|
||||
|
||||
private bool m_bPendingShow = false;
|
||||
private bool m_bHasShowOnce = false;
|
||||
|
||||
public override void Awake()
|
||||
{
|
||||
@@ -55,7 +54,6 @@ namespace BrewMonster.UI
|
||||
HideTeamList();
|
||||
ClearAllTeamMates();
|
||||
m_bPendingShow = false;
|
||||
m_bHasShowOnce = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -78,17 +76,21 @@ namespace BrewMonster.UI
|
||||
displayMembers.Add(member);
|
||||
}
|
||||
|
||||
if (displayMembers.Count > 0 && !IsShow() && (m_bPendingShow || !m_bHasShowOnce))
|
||||
if (displayMembers.Count > 0 && !IsShow() && m_bPendingShow)
|
||||
{
|
||||
Show(true);
|
||||
m_bPendingShow = false;
|
||||
m_bHasShowOnce = true;
|
||||
}
|
||||
|
||||
if (!IsShow())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
//if (!IsShow() && !m_bHasShowOnce)
|
||||
//{
|
||||
// return true;
|
||||
//}
|
||||
|
||||
//if(!IsShow() && m_bHasShowOnce && displayMembers.Count > 0)
|
||||
//{
|
||||
// Show(true);
|
||||
//}
|
||||
|
||||
int neededCount = displayMembers.Count;
|
||||
AdjustTeamMateCount(neededCount);
|
||||
@@ -219,8 +221,8 @@ namespace BrewMonster.UI
|
||||
|
||||
private void OnClickClose()
|
||||
{
|
||||
Show(false);
|
||||
m_bPendingShow = false;
|
||||
CECUIManager.Instance.HideCurrentUIInStack();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -653,11 +653,12 @@ namespace BrewMonster
|
||||
if (uiMan == null)
|
||||
return;
|
||||
|
||||
var dlgTeamMain = uiMan.GetDialog("Win_TeamMain") as DlgTeamMain;
|
||||
var dlgTeamMain = CECUIManager.Instance.GetUI("Win_TeamMain") as DlgTeamMain;
|
||||
if (dlgTeamMain != null)
|
||||
{
|
||||
if (showDialog)
|
||||
{
|
||||
CECUIManager.Instance.ShowUI("Win_TeamMain");
|
||||
dlgTeamMain.ShowTeamDialog();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -172,6 +172,11 @@ public class CECUIManager : MonoSingleton<CECUIManager>
|
||||
return Push(componentName);
|
||||
}
|
||||
|
||||
public void ShowUIFromButton(string componentName)
|
||||
{
|
||||
ShowUI(componentName);
|
||||
}
|
||||
|
||||
public void HideCurrentUIInStack()
|
||||
{
|
||||
Pop();
|
||||
@@ -741,4 +746,10 @@ public class CECUIManager : MonoSingleton<CECUIManager>
|
||||
|
||||
str = new string(chars);
|
||||
}
|
||||
|
||||
public AUIDialog GetUI(string componentName)
|
||||
{
|
||||
if(string.IsNullOrEmpty(componentName)) return null;
|
||||
return GetInGameUIMan().GetDialog(componentName);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user