Skip to content

Commit

Permalink
Merge pull request #84 from ZiwKerman/v2.0-overhaul
Browse files Browse the repository at this point in the history
More Bugfixes.
  • Loading branch information
ZiwKerman committed Apr 17, 2016
2 parents f4e9f28 + b4b9b23 commit 186bec0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
7 changes: 4 additions & 3 deletions InfernalRobotics/InfernalRobotics/Command/ServoController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,10 @@ private void OnPartRemove(GameEvents.HostTargetAction<Part, Part> hostTarget)
Logger.Log("[ServoController] OnPartRemove finished successfully", Logger.Level.Debug);
}

private void RebuildServoGroupsEditor()
private void RebuildServoGroupsEditor(ShipConstruct ship = null)
{
ShipConstruct ship = EditorLogic.fetch.ship;
if(ship==null)
ship = EditorLogic.fetch.ship;

ServoGroups = null;

Expand Down Expand Up @@ -201,7 +202,7 @@ private void RebuildServoGroupsEditor()

private void OnEditorShipModified(ShipConstruct ship)
{
RebuildServoGroupsEditor();
RebuildServoGroupsEditor(ship);

Gui.WindowManager.guiRebuildPending = true; //this should force an UI rebuild on first update

Expand Down
4 changes: 1 addition & 3 deletions InfernalRobotics/InfernalRobotics/Gui/ServoDropHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ public void OnDrop(PointerEventData eventData)
}

var newGroupIndex = dragHandler.dropZone.parent.GetSiblingIndex();

ServoController.Instance.ServoGroups[oldGroupIndex].Servos.Remove(s);
ServoController.Instance.ServoGroups[newGroupIndex].Servos.Insert(insertAt, s);
ServoController.MoveServo(ServoController.Instance.ServoGroups[oldGroupIndex], ServoController.Instance.ServoGroups[newGroupIndex], s);
break;
}
}
Expand Down
3 changes: 2 additions & 1 deletion InfernalRobotics/InfernalRobotics/Gui/UIAssetsLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ public IEnumerator LoadBundle(string location)

}


IRAssetBundle.Unload(false);
www.Dispose();
}
}

Expand Down
2 changes: 1 addition & 1 deletion InfernalRobotics/InfernalRobotics/Gui/WindowManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@ public void Update()
if (!ServoController.APIReady || !UIAssetsLoader.controlWindowPrefabReady)
{
GUIEnabled = false;
appLauncherButton.SetFalse();
appLauncherButton?.SetFalse();
return;
}

Expand Down

0 comments on commit 186bec0

Please sign in to comment.