Skip to content

Commit

Permalink
Fix issue with contracts getting deselected in MC. Fixes #561.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrossignol committed Aug 26, 2016
1 parent 86e3d00 commit 93ede18
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Contract Configurator 1.18.0
- Cycle through new contracts to generate in a random order to prevent certain contracts from getting preference.
- Fixed issue where contract expiries were never getting set (thanks DarkonZ).
- Fixed issue with some parameters combined with the All parameter causing incorrect contract failure (thanks tomf).
- Fixed issue with selected contract in mission control getting unselected when a new contract is generated (thanks AccidentalDisassembly).

Contract Configurator 1.17.0
- Mission Control remembers the last visited tab when you open it, and takes you there.
Expand Down
Binary file modified GameData/ContractConfigurator/CC_RemoteTech.dll
Binary file not shown.
Binary file modified GameData/ContractConfigurator/ContractConfigurator.dll
Binary file not shown.
Binary file modified GameData/ContractConfigurator/KerKonConConExt.dll
Binary file not shown.
28 changes: 24 additions & 4 deletions source/ContractConfigurator/MissionControlUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -449,15 +449,16 @@ protected void OnContractOffered(Contract c)
// Check we're in the right mode
if (!displayModeAll || MissionControl.Instance.displayMode != MissionControl.DisplayMode.Available)
{
MissionControl.Instance.ClearInfoPanel();
MissionControl.Instance.panelView.gameObject.SetActive(false);
if (MissionControl.Instance.displayMode != MissionControl.DisplayMode.Available)
{
MissionControl.Instance.ClearInfoPanel();
MissionControl.Instance.panelView.gameObject.SetActive(false);
MissionControl.Instance.RebuildContractList();
}
else
{
OnClickAvailable(true);
OnSelectContract(selectedButton, UIRadioButton.CallType.USER, null);
}
return;
}
Expand Down Expand Up @@ -611,15 +612,28 @@ protected void HandleRemovedContract(Contract c)
// Check we're in the right mode
if (!displayModeAll || MissionControl.Instance.displayMode != MissionControl.DisplayMode.Available)
{
MissionControl.Instance.ClearInfoPanel();
MissionControl.Instance.panelView.gameObject.SetActive(false);
if (MissionControl.Instance.displayMode != MissionControl.DisplayMode.Available)
{
MissionControl.Instance.ClearInfoPanel();
MissionControl.Instance.panelView.gameObject.SetActive(false);
MissionControl.Instance.RebuildContractList();
}
else
{
OnClickAvailable(true);

// Our contract was removed
if (MissionControl.Instance.selectedMission != null && MissionControl.Instance.selectedMission.contract == c)
{
MissionControl.Instance.ClearInfoPanel();
MissionControl.Instance.panelView.gameObject.SetActive(false);
selectedButton.SetState(UIRadioButton.State.False, UIRadioButton.CallType.APPLICATION, null);
selectedButton = null;
}
else
{
OnSelectContract(selectedButton, UIRadioButton.CallType.USER, null);
}
}
return;
}
Expand Down Expand Up @@ -762,6 +776,11 @@ public void OnClickAvailable(bool selected)
mcListItem.radioButton.onTrueBtn.AddListener(new UnityAction<UIRadioButton, UIRadioButton.CallType, PointerEventData>(OnSelectContract));
mcListItem.Setup(contract, "<color=#fefa87>" + contract.Title + "</color>");
MissionControl.Instance.scrollListContracts.AddItem(mcListItem.container, true);

if (MissionControl.Instance.selectedMission != null && MissionControl.Instance.selectedMission.contract == contract)
{
mcListItem.radioButton.SetState(UIRadioButton.State.True, UIRadioButton.CallType.APPLICATION, null, false);
}
}

ContractConfiguratorSettings.Instance.lastMCButton = ContractConfiguratorSettings.MissionControlButton.Available;
Expand Down Expand Up @@ -1628,6 +1647,7 @@ private void OnClickAccept()
{
MissionControl.Instance.ClearInfoPanel();
MissionControl.Instance.panelView.gameObject.SetActive(false);

if (MissionControl.Instance.displayMode != MissionControl.DisplayMode.Available)
{
MissionControl.Instance.RebuildContractList();
Expand Down

0 comments on commit 93ede18

Please sign in to comment.