private static List <UIOfficerInfo> TransformConf2UI(List <ConfOfficer> conf_) { List <UIOfficerInfo> ret = new List <UIOfficerInfo>(); List <ConfOfficer> ori_data = conf_; foreach (var item in ori_data) { OfficerInfo server_info = GlobalInfo.MY_PLAYER_INFO.GetOfficerInfo(item.id); if (null != server_info) { UIOfficerInfo info = new UIOfficerInfo() { m_lvl = server_info.Level, m_data = item, }; ret.Add(info); } else { UIOfficerInfo info = new UIOfficerInfo() { m_lvl = 0, m_data = item, }; ret.Add(info); } } ret.Sort(OfficerCompare); return(ret); }
void OpenUpgradeWindow(bool with_effect_ = false) { m_cur_right_type = ENUM_RIGHT_WINDOW_TYPE.E_UPGRADE; this.m_detail_window.Visible = false; UIOfficerInfo data = this.GetOfficerData(this.m_currentPageType, this.m_choose_officer_id); this.m_upgrade_window.Refresh(data.m_data, PoliceUILogicAssist.GetOfficerServerInfo(data.m_data), with_effect_); this.m_upgrade_window.Visible = true; }
void OpenDetailWindow() { m_cur_right_type = ENUM_RIGHT_WINDOW_TYPE.E_DETAIL; this.m_upgrade_window.Visible = false; UIOfficerInfo data = this.GetOfficerData(this.m_currentPageType, this.m_choose_officer_id); this.m_detail_window.Refresh(data.m_data, PoliceUILogicAssist.GetOfficerServerInfo(data.m_data)); this.m_detail_window.Visible = true; }
void OnOpenUpgradeWindow() { if (this.m_upgrade_window.Visible) { UIOfficerInfo data = this.GetOfficerData(this.m_currentPageType, this.m_choose_officer_id); this.m_upgrade_window.Refresh(data.m_data, PoliceUILogicAssist.GetOfficerServerInfo(data.m_data)); return; } this.m_cur_tween_progress = ENUM_TWEEN_PROGRESS.E_DETAIL_TO_UPGRADE; this.m_right_window_tween.PlayForward(); }
void OnFinishRightWindowTween() { if (ENUM_TWEEN_PROGRESS.E_UPGRADE_TO_DETAIL == this.m_cur_tween_progress) { UIOfficerInfo data = this.GetOfficerData(this.m_currentPageType, this.m_choose_officer_id); this.m_detail_window.Refresh(data.m_data, PoliceUILogicAssist.GetOfficerServerInfo(data.m_data)); this.m_upgrade_window.Visible = true; this.m_right_window_tween.PlayBackward(); } else if (ENUM_TWEEN_PROGRESS.E_DETAIL_TO_UPGRADE == this.m_cur_tween_progress) { this.m_detail_window.Visible = true; UIOfficerInfo data = this.GetOfficerData(this.m_currentPageType, this.m_choose_officer_id); this.m_upgrade_window.Refresh(data.m_data, PoliceUILogicAssist.GetOfficerServerInfo(data.m_data)); this.m_right_window_tween.PlayBackward(); } this.m_cur_tween_progress = ENUM_TWEEN_PROGRESS.E_INVALID; }
private static int OfficerCompare(UIOfficerInfo a, UIOfficerInfo b) { if (a.m_data.id == b.m_data.id) { return(0); } //Debug.Log(string.Format("a的 id = {0}, lvl = {1}, quality = {2} ; b的 id = {3}, lvl = {4}, quality = {5}", a.m_data.id, a.m_lvl, a.m_data.quality, b.m_data.id, b.m_lvl, b.m_data.quality)); if (a.m_lvl > 0 && 0 == b.m_lvl) { //Debug.Log(string.Format("a{0} 在 b{1}前面",a.m_data.id,b.m_data.id)); return(-1); } else if (0 == a.m_lvl && b.m_lvl > 0) { //Debug.Log(string.Format("a{0} 在 b{1}后面", a.m_data.id, b.m_data.id)); return(1); } else { if (a.m_data.quality > b.m_data.quality) { //Debug.Log(string.Format("a{0} 在 b{1}前面", a.m_data.id, b.m_data.id)); return(-1); } else if (a.m_data.quality < b.m_data.quality) { //Debug.Log(string.Format("a{0} 在 b{1}后面", a.m_data.id, b.m_data.id)); return(1); } else { if (a.m_lvl > b.m_lvl) { //Debug.Log(string.Format("a{0} 在 b{1}前面", a.m_data.id, b.m_data.id)); return(-1); } else if (a.m_lvl < b.m_lvl) { //Debug.Log(string.Format("a{0} 在 b{1}后面", a.m_data.id, b.m_data.id)); return(1); } else { if (a.m_data.id < b.m_data.id) { //Debug.Log(string.Format("a{0} 在 b{1}前面", a.m_data.id, b.m_data.id)); return(-1); } else if (a.m_data.id > b.m_data.id) { //Debug.Log(string.Format("a{0} 在 b{1}后面", a.m_data.id, b.m_data.id)); return(1); } else { //Debug.Log(string.Format("a{0} 在 b{1}前面", a.m_data.id, b.m_data.id)); return(-1); } } } } }