Skip to content

Commit

Permalink
Merge pull request #55 from ZiwKerman/V1.0-overhaul
Browse files Browse the repository at this point in the history
KSP 1.2 update
  • Loading branch information
ZiwKerman authored Oct 19, 2016
2 parents 7532ff3 + 3d13085 commit b259e57
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 27 deletions.
6 changes: 3 additions & 3 deletions IRSequencer.version
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"VERSION": {
"MAJOR": 1,
"MINOR": 0,
"PATCH": 0
"PATCH": 1
},
"KSP_VERSION": {
"MAJOR": 1,
"MINOR": 1,
"PATCH": 3
"MINOR": 2,
"PATCH": 0
}
}
6 changes: 3 additions & 3 deletions IRSequencer/IRSequencer/Gui/CommandDragHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ public virtual void OnBeginDrag(PointerEventData eventData)

//don't forget to remove Repeat placeholders from dropzone
dropZone = draggedItem.transform.parent;
var repeatPlaceholder = dropZone.gameObject.GetChild("RepeatCommandPlaceholder").transform;
var repeatPlaceholder = dropZone.gameObject.GetChild("RepeatCommandPlaceholder");
if (repeatPlaceholder)
{
repeatPlaceholder.SetAsLastSibling();
repeatPlaceholder.gameObject.SetActive(false);
repeatPlaceholder.transform.SetAsLastSibling();
repeatPlaceholder.SetActive(false);
}

startingSiblingIndex = draggedItem.transform.GetSiblingIndex();
Expand Down
8 changes: 4 additions & 4 deletions IRSequencer/IRSequencer/Gui/CommandDropHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ public void onCommandDrop(CommandDragHandler dragHandler)

var bc = dragHandler.linkedCommand;

var repeatPlaceholder = dragHandler.dropZone.gameObject.GetChild("RepeatCommandPlaceholder").transform;
var repeatPlaceholder = dragHandler.dropZone.gameObject.GetChild("RepeatCommandPlaceholder");

int insertAt = dragHandler.placeholder.transform.GetSiblingIndex();

//repeat placeholder is supposed to be last sibling, we need to ignore it
if (insertAt >= repeatPlaceholder.GetSiblingIndex())
if (repeatPlaceholder && insertAt >= repeatPlaceholder.transform.GetSiblingIndex())
insertAt--;

if (bc == null)
Expand All @@ -66,8 +66,8 @@ public void onCommandDrop(CommandDragHandler dragHandler)
//need to reposition command's placeholder
if (repeatPlaceholder)
{
repeatPlaceholder.SetSiblingIndex(c.gotoIndex);
repeatPlaceholder.gameObject.SetActive(true);
repeatPlaceholder.transform.SetSiblingIndex(c.gotoIndex);
repeatPlaceholder.SetActive(true);
}

}
Expand Down
7 changes: 2 additions & 5 deletions IRSequencer/IRSequencer/Gui/SequencerGUI.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using UnityEngine;
using KSP.IO;
using IRSequencer.API;
using IRSequencer.Utility;
using IRSequencer.Core;
Expand Down Expand Up @@ -2010,7 +2007,7 @@ internal void KeyboardLock(Boolean apply)

public void LoadConfigXml()
{
PluginConfiguration config = PluginConfiguration.CreateForType<SequencerGUI>();
KSP.IO.PluginConfiguration config = KSP.IO.PluginConfiguration.CreateForType<SequencerGUI>();
config.load();

SequencerWindowPosition = config.GetValue<Vector3>("SequencerWindowPosition");
Expand Down Expand Up @@ -2039,7 +2036,7 @@ public void SaveConfigXml()
SequencerSettingsWindowPosition = _settingsWindow.transform.position;
}

PluginConfiguration config = PluginConfiguration.CreateForType<SequencerGUI>();
KSP.IO.PluginConfiguration config = KSP.IO.PluginConfiguration.CreateForType<SequencerGUI>();
config.SetValue("SequencerWindowPosition", SequencerWindowPosition);
config.SetValue("SequencerEditorWindowPosition", SequencerEditorWindowPosition);
config.SetValue("SequencerEditorWindowSize", SequencerEditorWindowSize);
Expand Down
12 changes: 0 additions & 12 deletions IRSequencer/IRSequencer/IRSequencer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,18 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Assembly-CSharp">
<HintPath>..\..\..\KSP_LIB\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\..\..\KSP_LIB\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="KSPUtil">
<HintPath>..\..\..\KSP_LIB\KSPUtil.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\..\KSP_LIB\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="Vectrosity">
<HintPath>..\..\..\KSP_LIB\Vectrosity.dll</HintPath>
</Reference>
<Reference Include="KSPCore">
<HintPath>..\..\..\KSP_LIB\KSPCore.dll</HintPath>
</Reference>
<Reference Include="KSPAssets">
<HintPath>..\..\..\KSP_LIB\KSPAssets.dll</HintPath>
</Reference>
Expand Down
Binary file not shown.

0 comments on commit b259e57

Please sign in to comment.