Merge pull request 'fixbug/quest-related-bug' (#339) from fixbug/quest-related-bug into develop

Reviewed-on: https://git.pthub.vn/Unity/perfect-world-unity/pulls/339
This commit is contained in:
namth
2026-04-13 10:00:51 +00:00
3 changed files with 47 additions and 6 deletions
+12 -3
View File
@@ -1831,9 +1831,18 @@ namespace BrewMonster.Scripts.Task.UI
public static string FormatTime(int nSec, string desc, int timeLimit)
{
var ts = System.TimeSpan.FromSeconds(System.Math.Max(0, nSec));
string label = string.IsNullOrEmpty(desc) ? string.Empty : desc;
return $"{label}{ts:hh\\:mm\\:ss}\n";
int total = System.Math.Max(0, nSec);
int h = total / 3600;
int m = (total % 3600) / 60;
int s = total % 60;
// Matches table printf "%d:%02d:%02d" (hours, zero-padded min/sec); works for durations over 24h.
string timeStr = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}:{1:D2}:{2:D2}", h, m, s);
if (string.IsNullOrEmpty(desc))
return timeStr;
const string kPrintfTime = "%d:%02d:%02d";
if (desc.IndexOf(kPrintfTime, System.StringComparison.Ordinal) >= 0)
return desc.Replace(kPrintfTime, timeStr);
return desc + timeStr;
}
// private static string GetStringFromTable(int id)
@@ -25,6 +25,11 @@ namespace BrewMonster.Scripts.UI
public void SetImage(Sprite sprite)
{
if (img == null)
{
return;
}
img.enabled = sprite != null;
img.sprite = sprite;
}
@@ -36,7 +41,11 @@ namespace BrewMonster.Scripts.UI
public void SetColor(Color color)
{
// TODO : Set color to relevant UI components
if (img == null)
{
return;
}
img.color = color;
}
public void SetHint(string text)
@@ -44,9 +53,24 @@ namespace BrewMonster.Scripts.UI
txtHint = text;
}
/// <summary>
/// Reset slot when this cell has no award (e.g. dialog reopened with fewer items).
/// 清空格子:再次打开奖励界面时清除上一轮的图标与点击逻辑。
/// </summary>
public void ClearCover()
{
// TODO : Implement cover clearing functionality
if (img != null)
{
img.sprite = null;
img.enabled = false;
img.color = Color.white;
}
if (btn != null)
{
btn.onClick.RemoveAllListeners();
}
txtHint = string.Empty;
isOn = false;
}
public void Show(bool show)
@@ -59,6 +59,14 @@ namespace BrewMonster.Scripts.UI
{
toggle.isOn = false;
}
if (itemInfoPanel != null)
{
itemInfoPanel.SetActive(false);
}
if (descriptionOutlet != null)
{
descriptionOutlet.Set(string.Empty);
}
_btnClose.onClick.AddListener(OnCloseDlgAward);
}
@@ -214,7 +222,7 @@ namespace BrewMonster.Scripts.UI
// sprintf(out szName, "Item_%02d01", i);
// pImage = (PAUIIMAGEPICTURE)GetDlgItem(szName);
// if (!pImage) break; // All done.
pImage = GetAwardItemAt(i, i);
pImage = GetAwardItemAt(i, 1);
if (!pImage) break;
// sprintf(out szName, "Rdo_Award%d", i);