Skip to content

Commit

Permalink
v0.701 WIP3
Browse files Browse the repository at this point in the history
  • Loading branch information
ozonexo3 committed Jan 15, 2021
1 parent 2a64f29 commit 3ae416f
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 48 deletions.
87 changes: 45 additions & 42 deletions Assembly-CSharp-Editor-firstpass.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -268,101 +268,104 @@
<Reference Include="UnityEditor.WindowsStandalone.Extensions">
<HintPath>C:/Program Files/Unity/Hub/Editor/2019.4.16f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.Switch.Extensions">
<HintPath>C:/Program Files/Unity/Hub/Editor/2019.4.16f1/Editor/Data/PlaybackEngines/Switch/UnityEditor.Switch.Extensions.dll</HintPath>
</Reference>
<Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
<HintPath>C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/15.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
</Reference>
<Reference Include="DotNetOpenAuth">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/DotNetOpenAuth.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/DotNetOpenAuth.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/ICSharpCode.SharpZipLib.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="log4net">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/Lib/log4net.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/Lib/log4net.dll</HintPath>
</Reference>
<Reference Include="IKVM.AWT.WinForms">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.AWT.WinForms.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.AWT.WinForms.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.Beans">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Beans.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Beans.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.Charsets">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Charsets.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Charsets.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.Cldrdata">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Cldrdata.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Cldrdata.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.Corba">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Corba.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Corba.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.Core">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Core.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Core.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.Jdbc">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Jdbc.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Jdbc.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.Localedata">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Localedata.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Localedata.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.Management">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Management.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Management.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.Media">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Media.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Media.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.Misc">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Misc.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Misc.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.Naming">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Naming.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Naming.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.Nashorn">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Nashorn.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Nashorn.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.Remoting">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Remoting.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Remoting.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.Security">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Security.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Security.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.SwingAWT">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.SwingAWT.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.SwingAWT.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.Text">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Text.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Text.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.Util">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Util.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Util.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.XML.API">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.XML.API.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.XML.API.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.XML.Bind">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.XML.Bind.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.XML.Bind.dll</HintPath>
</Reference>
<Reference Include="IKVM.OpenJDK.XML.Parse">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.XML.Parse.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.XML.Parse.dll</HintPath>
</Reference>
<Reference Include="IKVM.Reflection">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.Reflection.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.Reflection.dll</HintPath>
</Reference>
<Reference Include="IKVM.Runtime">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.Runtime.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.Runtime.dll</HintPath>
</Reference>
<Reference Include="IKVM.Runtime.JNI">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.Runtime.JNI.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.Runtime.JNI.dll</HintPath>
</Reference>
<Reference Include="NeroxisGen">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/NeroxisGen.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/NeroxisGen.dll</HintPath>
</Reference>
<Reference Include="Ookii.Dialogs">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/PackageCache/[email protected]/net35/unity-custom/nunit.framework.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/PackageCache/[email protected]/net35/unity-custom/nunit.framework.dll</HintPath>
</Reference>
<Reference Include="mscorlib">
<HintPath>C:/Program Files/Unity/Hub/Editor/2019.4.16f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/mscorlib.dll</HintPath>
Expand Down Expand Up @@ -719,37 +722,37 @@
<HintPath>C:/Program Files/Unity/Hub/Editor/2019.4.16f1/Editor/Data/MonoBleedingEdge/lib/mono/unityscript/Boo.Lang.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.TestRunner">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/UnityEditor.TestRunner.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/UnityEditor.TestRunner.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.TestRunner">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/UnityEngine.TestRunner.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/UnityEngine.TestRunner.dll</HintPath>
</Reference>
<Reference Include="Unity.Timeline.Editor">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/Unity.Timeline.Editor.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/Unity.Timeline.Editor.dll</HintPath>
</Reference>
<Reference Include="Unity.VSCode.Editor">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/Unity.VSCode.Editor.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/Unity.VSCode.Editor.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/UnityEngine.UI.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="Unity.Timeline">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/Unity.Timeline.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/Unity.Timeline.dll</HintPath>
</Reference>
<Reference Include="Unity.CollabProxy.Editor">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/Unity.CollabProxy.Editor.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/Unity.CollabProxy.Editor.dll</HintPath>
</Reference>
<Reference Include="Unity.Rider.Editor">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/Unity.Rider.Editor.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/Unity.Rider.Editor.dll</HintPath>
</Reference>
<Reference Include="Unity.2D.Sprite.Editor">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/Unity.2D.Sprite.Editor.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/Unity.2D.Sprite.Editor.dll</HintPath>
</Reference>
<Reference Include="Unity.2D.Tilemap.Editor">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/Unity.2D.Tilemap.Editor.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/Unity.2D.Tilemap.Editor.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.UI">
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/UnityEditor.UI.dll</HintPath>
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/UnityEditor.UI.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scripts/Ozone SCMAP Code/Lua/SaveLua_Army.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public void UpdateGroupArmy(Army SourceOwner)
}


public void GetAllUnitInstances(ref List<UnitInstance> AllUnits)
public void GetAllUnitInstances(ref List<UnitInstance> AllUnits, bool recursive = true)
{
if (Units.Count > 0)
{
Expand All @@ -365,7 +365,7 @@ public void GetAllUnitInstances(ref List<UnitInstance> AllUnits)
ListEnum.Dispose();
}

if(UnitGroups.Count > 0)
if(recursive && UnitGroups.Count > 0)
{
var ListEnum = UnitGroups.GetEnumerator();
while (ListEnum.MoveNext())
Expand Down
38 changes: 38 additions & 0 deletions Assets/Scripts/Selection/SelectionManager_Controls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,27 @@ public void SelectObjects(List<GameObject> ToSelect)
FinishSelectionChange();
}

/// <summary>
/// Execute selection action depend on the user input. Can add, remove or change selection
/// </summary>
/// <param name="ToSelect"></param>
public void SelectObjectsInput(GameObject[] ToSelect)
{

Undo.Current.RegisterSelectionChange();
if (IsSelectionRemove())
{
SelectObjectsRemove(ToSelect);
}
else if (IsSelectionAdd())
{
SelectObjectsAdd(ToSelect);
}
else
{
SelectObjects(ToSelect);
}
}

public void SelectObjectsRemove(GameObject[] ToSelect)
{
Expand Down Expand Up @@ -378,6 +399,23 @@ public void SelectObjectAdd(GameObject Obj)
}
}
}

public void SelectObjectsAdd(GameObject[] ToSelect)
{
bool AnyChanged = false;
for (int i = 0; i < ToSelect.Length; i++)
{
int ObjectId = GetIdOfObject(ToSelect[i]);
if (!Selection.Ids.Contains(ObjectId))
{
Selection.Ids.Add(ObjectId);
AnyChanged = true;
}
}

if (AnyChanged)
FinishSelectionChange();
}
#endregion


Expand Down
12 changes: 11 additions & 1 deletion Assets/Scripts/UI/Lists/UnitListObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class UnitListObject : MonoBehaviour {
public System.Action<UnitListObject> AddAction;
public System.Action<UnitListObject> RemoveAction;
public System.Action<UnitListObject, bool> SelectAction;
public System.Action<UnitListObject, bool> DoubleClickAction;
public System.Action<UnitListObject> RenameAction;
public System.Action<UnitListObject> ExpandAction;

Expand Down Expand Up @@ -122,8 +123,17 @@ public void RemoveGroup()

public void OnGroupClick()
{
SelectAction(this, false);
if (Time.realtimeSinceStartup - LastClickTime < DoubleClickTime) // Double click
{
//SelectAction(this, false);
DoubleClickAction(this, true);
}
else // Single click
{
SelectAction(this, false);
}

LastClickTime = Time.realtimeSinceStartup;
}

public void OnExpandClick()
Expand Down
4 changes: 1 addition & 3 deletions Assets/Scripts/UI/Tools/Units/UnitSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ public class UnitSource : MonoBehaviour
BoundingSphere[] SpheresArray;
HashSet<UnitInstance> Lod;

public Material strategicIconMaterial;

List<int> ForceUpdate = new List<int>();
void BakeInstances()
{
Expand Down Expand Up @@ -290,7 +288,7 @@ public static void DrawAllIcons(Camera current)
GL.PushMatrix();
GL.LoadPixelMatrix(Mathf.RoundToInt(CameraRect.x), Mathf.RoundToInt(CameraRect.x + CameraRect.width), Mathf.RoundToInt(CameraRect.y), Mathf.RoundToInt(CameraRect.y + CameraRect.height));

for (int i = 0; i < GetGamedataFile.LoadedUnitsStrategicDrawOrder.Length; i++)
for (int i = GetGamedataFile.LoadedUnitsStrategicDrawOrder.Length - 1; i >= 0; i--)
{
if (GetGamedataFile.LoadedUnitObjects.TryGetValue(GetGamedataFile.LoadedUnitsStrategicDrawOrder[i], out UnitSource value))
{
Expand Down
24 changes: 24 additions & 0 deletions Assets/Scripts/UI/Tools/Units/UnitsInfo_Groups.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public void CreateGroup(MapLua.SaveLua.Army Army, MapLua.SaveLua.Army.UnitsGroup
ulo.AddAction = AddNewGroup;
ulo.RemoveAction = RemoveGroup;
ulo.SelectAction = SelectGroup;
ulo.DoubleClickAction = SelectGroupUnits;
ulo.RenameAction = RenameStart;
ulo.ExpandAction = ExpandAction;
ulo.SetGroup(Army, Grp, Parent, Root);
Expand Down Expand Up @@ -441,6 +442,29 @@ static void ClearGrpSelection()

return ToReturn;
}

public void SelectGroupUnits(UnitListObject ulo, bool recursive = true)
{
List<UnitInstance> allUnits = new List<UnitInstance>();
ulo.Source.GetAllUnitInstances(ref allUnits);

int unitsCount = allUnits.Count;

if(unitsCount == 0)
{
SelectionManager.Current.CleanSelection();
return;
}

GameObject[] allUnitsGameObjects = new GameObject[unitsCount];
for (int i = 0; i < unitsCount; i++)
{
allUnitsGameObjects[i] = allUnits[i].gameObject;
}

SelectionManager.Current.SelectObjectsInput(allUnitsGameObjects);

}
#endregion

}
Expand Down

0 comments on commit 3ae416f

Please sign in to comment.