public void SetWindowPanelAndIcon(int panel, HomeIcons icon) { m_windowPanel = panel; m_windowIcon = icon; Logger.LogDetail($"Module_Home::SetWindowPanelAndIcon: <color=#00FF00><b>[Panel:{m_windowPanel}, Icon:{m_windowIcon}]</b></color>"); }
/// <summary> /// 更新主界面图标的标记状态 若 index != 0 && index != 1 表示更改全部标记状态 /// </summary> /// <param name="icon">图标类型</param> /// <param name="mark">标记是否可见?</param> /// <param name="index">0 或 1 一个图标可以包含两个状态</param> public void UpdateIconState(HomeIcons icon, bool mark, int index = 0) { if (icon < HomeIcons.Welfare || icon >= HomeIcons.Count) { Logger.LogWarning("Module_Home::UpdateIconState: Unknow icon type {0}", icon); return; } var id = (int)icon; if (index == 0 || index != 1) { var old = m_iconMask0.BitMask(id); m_iconMask0 = m_iconMask0.BitMask(id, mark); if (old ^ mark) { DispatchModuleEvent(EventIconState, icon, 0, mark); } } if (index == 1 || index != 0) { var old = m_iconMask1.BitMask(id); m_iconMask1 = m_iconMask1.BitMask(id, mark); if (old ^ mark) { DispatchModuleEvent(EventIconState, icon, 1, mark); } } }
/// <summary> /// 获取指定图标的标记状态 /// </summary> /// <param name="icon">图标类型</param> /// <param name="index">标记位置 0 或 1 一个图标可以包含两个标记</param> /// <returns></returns> public bool GetIconState(HomeIcons icon, int index = 0) { if (icon < HomeIcons.Welfare || icon >= HomeIcons.Count) { return(false); } return(index == 0 ? m_iconMask0.BitMask((int)icon) : index == 1 ? m_iconMask1.BitMask((int)icon) : false); }
public void UpdateIconState(HomeIcons icon) { var iid = (int)icon; MarkableIcon.UpdateState(iid < 1 || iid >= m_homeIcons.Length ? null : m_homeIcons[(int)icon], moduleHome.GetIconState(icon, 0), moduleHome.GetIconState(icon, 1)); }
public void UpdateIconState(HomeIcons icon, int index, bool state) { var iid = (int)icon; MarkableIcon.UpdateIconState(iid < 1 || iid >= m_homeIcons.Length ? null : m_homeIcons[(int)icon], index, state); }
/// <summary> /// Show home window /// <para> /// panel: Main = 0, Fight = 1, Dungeon = 2, CommStreet = 3 /// </para> /// </summary> /// <param name="panel">Sub panel</param> /// <returns></returns> public static void Show(int panel, HomeIcons icon) { GotoSubWindow <Window_Home>(panel << 16 | (int)icon & 0xFFFF); }