protected void OnSelectContract(UIRadioButton button, UIRadioButton.CallType callType, PointerEventData data) { LoggingUtil.LogVerbose(this, "OnSelectContract"); if (callType != UIRadioButton.CallType.USER || button == null) { return; } ContractContainer cc = (ContractContainer)button.GetComponent<KSP.UI.UIListItem>().Data; // Check requirements before displaying the contract if (cc.contract != null) { cc.contract.MeetRequirements(); } // Mark as read if (cc.contract != null) { cc.contract.SetViewed(Contract.Viewed.Read); SetContractTitle(cc.mcListItem, cc); SetupParentGroups(cc); } MissionControl.Instance.panelView.gameObject.SetActive(true); MissionControl.Instance.logoRenderer.gameObject.SetActive(true); selectedButton = button; Contract.ContractPrestige? prestige = null; if (cc.contract != null) { MissionControl.Instance.selectedMission = cc.missionSelection; MissionControl.Instance.UpdateInfoPanelContract(cc.contract); prestige = cc.contract.Prestige; MissionControl.Instance.btnAccept.interactable = ContractConfigurator.CanAccept(cc.contract) && ContractSystem.Instance.GetActiveContractCount() < maxActive; } else { UpdateInfoPanelContractType(cc.contractType); prestige = GetPrestige(cc.contractType); } if (prestige == Contracts.Contract.ContractPrestige.Exceptional) { MissionControl.Instance.UpdateInstructor(MissionControl.Instance.avatarController.animTrigger_selectHard, MissionControl.Instance.avatarController.animLoop_excited); } else if (prestige == Contracts.Contract.ContractPrestige.Significant) { MissionControl.Instance.UpdateInstructor(MissionControl.Instance.avatarController.animTrigger_selectNormal, MissionControl.Instance.avatarController.animLoop_default); } else { MissionControl.Instance.UpdateInstructor(MissionControl.Instance.avatarController.animTrigger_selectEasy, MissionControl.Instance.avatarController.animLoop_default); } }
protected void OnSelectGroup(UIRadioButton button, UIRadioButton.CallType callType, PointerEventData data) { LoggingUtil.LogVerbose(this, "OnSelectGroup"); if (callType != UIRadioButton.CallType.USER) { return; } GroupContainer groupContainer = (GroupContainer)button.GetComponent<KSP.UI.UIListItem>().Data; if (groupContainer.agent != null) { MissionControl.Instance.panelView.gameObject.SetActive(true); MissionControl.Instance.logoRenderer.gameObject.SetActive(true); MissionControl.Instance.UpdateInfoPanelAgent(groupContainer.agent); MissionControl.Instance.btnAgentBack.gameObject.SetActive(false); MissionControl.Instance.textDateInfo.text = ""; } else { MissionControl.Instance.panelView.gameObject.SetActive(false); MissionControl.Instance.logoRenderer.gameObject.SetActive(false); } groupContainer.Toggle(); // Mark the contracts as unread without changing their display state foreach (ContractContainer contractContainer in groupContainer.childContracts) { if (contractContainer.contract != null && contractContainer.contract.ContractViewed == Contract.Viewed.Unseen) { contractContainer.contract.SetViewed(Contract.Viewed.Seen); } } SetupGroupItem(groupContainer); SetupParentGroups(groupContainer); }
protected void OnDeselectGroup(UIRadioButton button, UIRadioButton.CallType callType, PointerEventData data) { LoggingUtil.LogVerbose(this, "OnDeselectGroup"); if (callType != UIRadioButton.CallType.USER) { return; } MissionControl.Instance.panelView.gameObject.SetActive(false); MissionControl.Instance.ClearInfoPanel(); GroupContainer groupContainer = (GroupContainer)button.GetComponent<KSP.UI.UIListItem>().Data; groupContainer.Toggle(); }