Skip to content

Commit 3ae416f

Browse files
committed
v0.701 WIP3
1 parent 2a64f29 commit 3ae416f

File tree

6 files changed

+121
-48
lines changed

6 files changed

+121
-48
lines changed

Assembly-CSharp-Editor-firstpass.csproj

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -268,101 +268,104 @@
268268
<Reference Include="UnityEditor.WindowsStandalone.Extensions">
269269
<HintPath>C:/Program Files/Unity/Hub/Editor/2019.4.16f1/Editor/Data/PlaybackEngines/WindowsStandaloneSupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
270270
</Reference>
271+
<Reference Include="UnityEditor.Switch.Extensions">
272+
<HintPath>C:/Program Files/Unity/Hub/Editor/2019.4.16f1/Editor/Data/PlaybackEngines/Switch/UnityEditor.Switch.Extensions.dll</HintPath>
273+
</Reference>
271274
<Reference Include="SyntaxTree.VisualStudio.Unity.Bridge">
272275
<HintPath>C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/15.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
273276
</Reference>
274277
<Reference Include="DotNetOpenAuth">
275-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/DotNetOpenAuth.dll</HintPath>
278+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/DotNetOpenAuth.dll</HintPath>
276279
</Reference>
277280
<Reference Include="ICSharpCode.SharpZipLib">
278-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/ICSharpCode.SharpZipLib.dll</HintPath>
281+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/ICSharpCode.SharpZipLib.dll</HintPath>
279282
</Reference>
280283
<Reference Include="log4net">
281-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/Lib/log4net.dll</HintPath>
284+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/Lib/log4net.dll</HintPath>
282285
</Reference>
283286
<Reference Include="IKVM.AWT.WinForms">
284-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.AWT.WinForms.dll</HintPath>
287+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.AWT.WinForms.dll</HintPath>
285288
</Reference>
286289
<Reference Include="IKVM.OpenJDK.Beans">
287-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Beans.dll</HintPath>
290+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Beans.dll</HintPath>
288291
</Reference>
289292
<Reference Include="IKVM.OpenJDK.Charsets">
290-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Charsets.dll</HintPath>
293+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Charsets.dll</HintPath>
291294
</Reference>
292295
<Reference Include="IKVM.OpenJDK.Cldrdata">
293-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Cldrdata.dll</HintPath>
296+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Cldrdata.dll</HintPath>
294297
</Reference>
295298
<Reference Include="IKVM.OpenJDK.Corba">
296-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Corba.dll</HintPath>
299+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Corba.dll</HintPath>
297300
</Reference>
298301
<Reference Include="IKVM.OpenJDK.Core">
299-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Core.dll</HintPath>
302+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Core.dll</HintPath>
300303
</Reference>
301304
<Reference Include="IKVM.OpenJDK.Jdbc">
302-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Jdbc.dll</HintPath>
305+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Jdbc.dll</HintPath>
303306
</Reference>
304307
<Reference Include="IKVM.OpenJDK.Localedata">
305-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Localedata.dll</HintPath>
308+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Localedata.dll</HintPath>
306309
</Reference>
307310
<Reference Include="IKVM.OpenJDK.Management">
308-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Management.dll</HintPath>
311+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Management.dll</HintPath>
309312
</Reference>
310313
<Reference Include="IKVM.OpenJDK.Media">
311-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Media.dll</HintPath>
314+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Media.dll</HintPath>
312315
</Reference>
313316
<Reference Include="IKVM.OpenJDK.Misc">
314-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Misc.dll</HintPath>
317+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Misc.dll</HintPath>
315318
</Reference>
316319
<Reference Include="IKVM.OpenJDK.Naming">
317-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Naming.dll</HintPath>
320+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Naming.dll</HintPath>
318321
</Reference>
319322
<Reference Include="IKVM.OpenJDK.Nashorn">
320-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Nashorn.dll</HintPath>
323+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Nashorn.dll</HintPath>
321324
</Reference>
322325
<Reference Include="IKVM.OpenJDK.Remoting">
323-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Remoting.dll</HintPath>
326+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Remoting.dll</HintPath>
324327
</Reference>
325328
<Reference Include="IKVM.OpenJDK.Security">
326-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Security.dll</HintPath>
329+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Security.dll</HintPath>
327330
</Reference>
328331
<Reference Include="IKVM.OpenJDK.SwingAWT">
329-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.SwingAWT.dll</HintPath>
332+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.SwingAWT.dll</HintPath>
330333
</Reference>
331334
<Reference Include="IKVM.OpenJDK.Text">
332-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Text.dll</HintPath>
335+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Text.dll</HintPath>
333336
</Reference>
334337
<Reference Include="IKVM.OpenJDK.Util">
335-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Util.dll</HintPath>
338+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.Util.dll</HintPath>
336339
</Reference>
337340
<Reference Include="IKVM.OpenJDK.XML.API">
338-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.XML.API.dll</HintPath>
341+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.XML.API.dll</HintPath>
339342
</Reference>
340343
<Reference Include="IKVM.OpenJDK.XML.Bind">
341-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.XML.Bind.dll</HintPath>
344+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.XML.Bind.dll</HintPath>
342345
</Reference>
343346
<Reference Include="IKVM.OpenJDK.XML.Parse">
344-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.XML.Parse.dll</HintPath>
347+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.OpenJDK.XML.Parse.dll</HintPath>
345348
</Reference>
346349
<Reference Include="IKVM.Reflection">
347-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.Reflection.dll</HintPath>
350+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.Reflection.dll</HintPath>
348351
</Reference>
349352
<Reference Include="IKVM.Runtime">
350-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.Runtime.dll</HintPath>
353+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.Runtime.dll</HintPath>
351354
</Reference>
352355
<Reference Include="IKVM.Runtime.JNI">
353-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.Runtime.JNI.dll</HintPath>
356+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/IKVM.Runtime.JNI.dll</HintPath>
354357
</Reference>
355358
<Reference Include="NeroxisGen">
356-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/NeroxisGen.dll</HintPath>
359+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/Plugins/NeroxisMapGenerator/NeroxisGen.dll</HintPath>
357360
</Reference>
358361
<Reference Include="Ookii.Dialogs">
359-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll</HintPath>
362+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll</HintPath>
360363
</Reference>
361364
<Reference Include="System.Windows.Forms">
362-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Assets/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll</HintPath>
365+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Assets/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll</HintPath>
363366
</Reference>
364367
<Reference Include="nunit.framework">
365-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/PackageCache/[email protected]/net35/unity-custom/nunit.framework.dll</HintPath>
368+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/PackageCache/[email protected]/net35/unity-custom/nunit.framework.dll</HintPath>
366369
</Reference>
367370
<Reference Include="mscorlib">
368371
<HintPath>C:/Program Files/Unity/Hub/Editor/2019.4.16f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/mscorlib.dll</HintPath>
@@ -719,37 +722,37 @@
719722
<HintPath>C:/Program Files/Unity/Hub/Editor/2019.4.16f1/Editor/Data/MonoBleedingEdge/lib/mono/unityscript/Boo.Lang.dll</HintPath>
720723
</Reference>
721724
<Reference Include="UnityEditor.TestRunner">
722-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/UnityEditor.TestRunner.dll</HintPath>
725+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/UnityEditor.TestRunner.dll</HintPath>
723726
</Reference>
724727
<Reference Include="UnityEngine.TestRunner">
725-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/UnityEngine.TestRunner.dll</HintPath>
728+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/UnityEngine.TestRunner.dll</HintPath>
726729
</Reference>
727730
<Reference Include="Unity.Timeline.Editor">
728-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/Unity.Timeline.Editor.dll</HintPath>
731+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/Unity.Timeline.Editor.dll</HintPath>
729732
</Reference>
730733
<Reference Include="Unity.VSCode.Editor">
731-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/Unity.VSCode.Editor.dll</HintPath>
734+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/Unity.VSCode.Editor.dll</HintPath>
732735
</Reference>
733736
<Reference Include="UnityEngine.UI">
734-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/UnityEngine.UI.dll</HintPath>
737+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/UnityEngine.UI.dll</HintPath>
735738
</Reference>
736739
<Reference Include="Unity.Timeline">
737-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/Unity.Timeline.dll</HintPath>
740+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/Unity.Timeline.dll</HintPath>
738741
</Reference>
739742
<Reference Include="Unity.CollabProxy.Editor">
740-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/Unity.CollabProxy.Editor.dll</HintPath>
743+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/Unity.CollabProxy.Editor.dll</HintPath>
741744
</Reference>
742745
<Reference Include="Unity.Rider.Editor">
743-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/Unity.Rider.Editor.dll</HintPath>
746+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/Unity.Rider.Editor.dll</HintPath>
744747
</Reference>
745748
<Reference Include="Unity.2D.Sprite.Editor">
746-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/Unity.2D.Sprite.Editor.dll</HintPath>
749+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/Unity.2D.Sprite.Editor.dll</HintPath>
747750
</Reference>
748751
<Reference Include="Unity.2D.Tilemap.Editor">
749-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/Unity.2D.Tilemap.Editor.dll</HintPath>
752+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/Unity.2D.Tilemap.Editor.dll</HintPath>
750753
</Reference>
751754
<Reference Include="UnityEditor.UI">
752-
<HintPath>M:/Projekty/GithubDesktop/FAForeverMapEditor/Library/ScriptAssemblies/UnityEditor.UI.dll</HintPath>
755+
<HintPath>C:/Users/Pawel/Documents/GitHub/FAForeverMapEditor/Library/ScriptAssemblies/UnityEditor.UI.dll</HintPath>
753756
</Reference>
754757
</ItemGroup>
755758
<ItemGroup>

Assets/Scripts/Ozone SCMAP Code/Lua/SaveLua_Army.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public void UpdateGroupArmy(Army SourceOwner)
352352
}
353353

354354

355-
public void GetAllUnitInstances(ref List<UnitInstance> AllUnits)
355+
public void GetAllUnitInstances(ref List<UnitInstance> AllUnits, bool recursive = true)
356356
{
357357
if (Units.Count > 0)
358358
{
@@ -365,7 +365,7 @@ public void GetAllUnitInstances(ref List<UnitInstance> AllUnits)
365365
ListEnum.Dispose();
366366
}
367367

368-
if(UnitGroups.Count > 0)
368+
if(recursive && UnitGroups.Count > 0)
369369
{
370370
var ListEnum = UnitGroups.GetEnumerator();
371371
while (ListEnum.MoveNext())

Assets/Scripts/Selection/SelectionManager_Controls.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,27 @@ public void SelectObjects(List<GameObject> ToSelect)
348348
FinishSelectionChange();
349349
}
350350

351+
/// <summary>
352+
/// Execute selection action depend on the user input. Can add, remove or change selection
353+
/// </summary>
354+
/// <param name="ToSelect"></param>
355+
public void SelectObjectsInput(GameObject[] ToSelect)
356+
{
357+
358+
Undo.Current.RegisterSelectionChange();
359+
if (IsSelectionRemove())
360+
{
361+
SelectObjectsRemove(ToSelect);
362+
}
363+
else if (IsSelectionAdd())
364+
{
365+
SelectObjectsAdd(ToSelect);
366+
}
367+
else
368+
{
369+
SelectObjects(ToSelect);
370+
}
371+
}
351372

352373
public void SelectObjectsRemove(GameObject[] ToSelect)
353374
{
@@ -378,6 +399,23 @@ public void SelectObjectAdd(GameObject Obj)
378399
}
379400
}
380401
}
402+
403+
public void SelectObjectsAdd(GameObject[] ToSelect)
404+
{
405+
bool AnyChanged = false;
406+
for (int i = 0; i < ToSelect.Length; i++)
407+
{
408+
int ObjectId = GetIdOfObject(ToSelect[i]);
409+
if (!Selection.Ids.Contains(ObjectId))
410+
{
411+
Selection.Ids.Add(ObjectId);
412+
AnyChanged = true;
413+
}
414+
}
415+
416+
if (AnyChanged)
417+
FinishSelectionChange();
418+
}
381419
#endregion
382420

383421

Assets/Scripts/UI/Lists/UnitListObject.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class UnitListObject : MonoBehaviour {
3232
public System.Action<UnitListObject> AddAction;
3333
public System.Action<UnitListObject> RemoveAction;
3434
public System.Action<UnitListObject, bool> SelectAction;
35+
public System.Action<UnitListObject, bool> DoubleClickAction;
3536
public System.Action<UnitListObject> RenameAction;
3637
public System.Action<UnitListObject> ExpandAction;
3738

@@ -122,8 +123,17 @@ public void RemoveGroup()
122123

123124
public void OnGroupClick()
124125
{
125-
SelectAction(this, false);
126+
if (Time.realtimeSinceStartup - LastClickTime < DoubleClickTime) // Double click
127+
{
128+
//SelectAction(this, false);
129+
DoubleClickAction(this, true);
130+
}
131+
else // Single click
132+
{
133+
SelectAction(this, false);
134+
}
126135

136+
LastClickTime = Time.realtimeSinceStartup;
127137
}
128138

129139
public void OnExpandClick()

Assets/Scripts/UI/Tools/Units/UnitSource.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ public class UnitSource : MonoBehaviour
2121
BoundingSphere[] SpheresArray;
2222
HashSet<UnitInstance> Lod;
2323

24-
public Material strategicIconMaterial;
25-
2624
List<int> ForceUpdate = new List<int>();
2725
void BakeInstances()
2826
{
@@ -290,7 +288,7 @@ public static void DrawAllIcons(Camera current)
290288
GL.PushMatrix();
291289
GL.LoadPixelMatrix(Mathf.RoundToInt(CameraRect.x), Mathf.RoundToInt(CameraRect.x + CameraRect.width), Mathf.RoundToInt(CameraRect.y), Mathf.RoundToInt(CameraRect.y + CameraRect.height));
292290

293-
for (int i = 0; i < GetGamedataFile.LoadedUnitsStrategicDrawOrder.Length; i++)
291+
for (int i = GetGamedataFile.LoadedUnitsStrategicDrawOrder.Length - 1; i >= 0; i--)
294292
{
295293
if (GetGamedataFile.LoadedUnitObjects.TryGetValue(GetGamedataFile.LoadedUnitsStrategicDrawOrder[i], out UnitSource value))
296294
{

Assets/Scripts/UI/Tools/Units/UnitsInfo_Groups.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public void CreateGroup(MapLua.SaveLua.Army Army, MapLua.SaveLua.Army.UnitsGroup
9898
ulo.AddAction = AddNewGroup;
9999
ulo.RemoveAction = RemoveGroup;
100100
ulo.SelectAction = SelectGroup;
101+
ulo.DoubleClickAction = SelectGroupUnits;
101102
ulo.RenameAction = RenameStart;
102103
ulo.ExpandAction = ExpandAction;
103104
ulo.SetGroup(Army, Grp, Parent, Root);
@@ -441,6 +442,29 @@ static void ClearGrpSelection()
441442

442443
return ToReturn;
443444
}
445+
446+
public void SelectGroupUnits(UnitListObject ulo, bool recursive = true)
447+
{
448+
List<UnitInstance> allUnits = new List<UnitInstance>();
449+
ulo.Source.GetAllUnitInstances(ref allUnits);
450+
451+
int unitsCount = allUnits.Count;
452+
453+
if(unitsCount == 0)
454+
{
455+
SelectionManager.Current.CleanSelection();
456+
return;
457+
}
458+
459+
GameObject[] allUnitsGameObjects = new GameObject[unitsCount];
460+
for (int i = 0; i < unitsCount; i++)
461+
{
462+
allUnitsGameObjects[i] = allUnits[i].gameObject;
463+
}
464+
465+
SelectionManager.Current.SelectObjectsInput(allUnitsGameObjects);
466+
467+
}
444468
#endregion
445469

446470
}

0 commit comments

Comments
 (0)