Skip to content

Commit 4be1b90

Browse files
committed
Bugfix: Make code compatible with 0.50.5
1 parent bf7a4d8 commit 4be1b90

15 files changed

Lines changed: 40 additions & 38 deletions

NeoModLoader.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@
7272
<HintPath>assembly-dependencies\Assembly-CSharp-Publicized.dll</HintPath>
7373
</Reference>
7474
<Reference Include="Assembly-CSharp-firstpass">
75-
<HintPath>assembly-dependencies\Assembly-CSharp-firstpass.dll</HintPath>
75+
<HintPath>assembly-dependencies\Assembly-CSharp-firstpass.dll</HintPath>
76+
</Reference>
77+
<Reference Include="strings">
78+
<HintPath>assembly-dependencies\strings.dll</HintPath>
7679
</Reference>
7780
<Reference Include="Newtonsoft.Json">
7881
<HintPath>assembly-dependencies\Newtonsoft.Json.dll</HintPath>

WorldBoxMod.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ private void Update()
152152
}, "Post-Init Mod " + mod.GetDeclaration().Name);
153153
}
154154
}, "Load Mods");
155-
SmoothLoader.add(ResourcesPatch.PatchSomeResources, "Patch part of Resources into game");
156155

157156
SmoothLoader.add(() =>
158157
{
-168 KB
Binary file not shown.

assembly-dependencies/strings.dll

268 KB
Binary file not shown.

general/PowerButtonCreator.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,22 @@ public static PowersTab GetTab(string pId)
287287
/// <summary>
288288
/// Add a button to a tab
289289
/// </summary>
290-
public static void AddButtonToTab(PowerButton button, PowersTab tab, Vector2 position)
290+
[Obsolete("Specifying a position vector has become useless in 0.50.5, tab order is now determined by sibling index.")]
291+
public static void AddButtonToTab(PowerButton button, PowersTab tab, Vector2 position, int? siblingIndex = null)
292+
{
293+
// WorldBox has seemingly switched to a new tab system that overwrites localPosition and orders by sibling order
294+
AddButtonToTab(button, tab, siblingIndex);
295+
}
296+
297+
/// <summary>
298+
/// Add a button to a tab
299+
/// </summary>
300+
public static void AddButtonToTab(PowerButton button, PowersTab tab, int? siblingIndex = null)
291301
{
292302
Transform transform;
293303
(transform = button.transform).SetParent(tab.transform);
294-
transform.localPosition = position;
295304
transform.localScale = Vector3.one;
296-
tab.powerButtons.Add(button);
305+
if (siblingIndex.HasValue) transform.SetSiblingIndex(siblingIndex.Value);
306+
tab._power_buttons.Add(button);
297307
}
298308
}

general/PowerTabNames.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,31 @@ public static class PowerTabNames
77
/// <summary>
88
/// Object Name of the default tab in vanilla game
99
/// </summary>
10-
public const string Main = "Tab_Main";
10+
public const string Main = "main";
1111
/// <summary>
1212
/// Object Name of the first tab in vanilla game
1313
/// </summary>
14-
public const string Drawing = "Tab_Drawing";
14+
public const string Drawing = "creation";
1515
/// <summary>
1616
/// Object Name of the second tab in vanilla game
1717
/// </summary>
18-
public const string Kingdoms = "Tab_Kingdoms";
18+
public const string Kingdoms = "noosphere";
1919
/// <summary>
2020
/// Object Name of the third tab in vanilla game
2121
/// </summary>
22-
public const string Creatures = "Tab_Creatures";
22+
public const string Creatures = "units";
2323
/// <summary>
2424
/// Object Name of the forth tab in vanilla game
2525
/// </summary>
26-
public const string Nature = "Tab_Nature";
26+
public const string Nature = "nature";
2727
/// <summary>
2828
/// Object Name of the fifth tab in vanilla game
2929
/// </summary>
30-
public const string Bombs = "Tab_Bombs";
30+
public const string Bombs = "destruction";
3131
/// <summary>
3232
/// Object Name of the sixth tab in vanilla game
3333
/// </summary>
34-
public const string Other = "Tab_Other";
34+
public const string Other = "other";
3535
/// <summary>
3636
/// Return a list of all tab names
3737
/// </summary>

general/ui/tab/TabManager.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,19 +419,19 @@ public static PowersTab CreateTab(string name, string pTitleKey, string pDescKey
419419
GameObject.Destroy(tab.transform.GetChild(i).gameObject);
420420
}
421421

422-
tab.powerButtons.Clear();
422+
tab._power_buttons.Clear();
423423
// Add default powerButtons
424424
foreach (PowerButton power_button in tab.GetComponentsInChildren<PowerButton>())
425425
{
426426
if (!(power_button == null) && !(power_button.rect_transform == null))
427427
{
428-
tab.powerButtons.Add(power_button);
428+
tab._power_buttons.Add(power_button);
429429
}
430430
}
431431

432-
foreach (PowerButton power_button in tab.powerButtons)
432+
foreach (PowerButton power_button in tab._power_buttons)
433433
{
434-
power_button.findNeighbours(tab.powerButtons);
434+
power_button.findNeighbours(tab._power_buttons);
435435
}
436436

437437
_addDragEventTo(tab_entry_button, tab.name);

general/ui/tab/WrappedPowersTab.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,18 +175,18 @@ public void UpdateLayout()
175175
}
176176
}
177177

178-
Tab.powerButtons.Clear();
178+
Tab._power_buttons.Clear();
179179
foreach (PowerButton power_button in Tab.GetComponentsInChildren<PowerButton>())
180180
{
181181
if (!(power_button == null) && !(power_button.rect_transform == null))
182182
{
183-
Tab.powerButtons.Add(power_button);
183+
Tab._power_buttons.Add(power_button);
184184
}
185185
}
186186

187-
foreach (PowerButton power_button in Tab.powerButtons)
187+
foreach (PowerButton power_button in Tab._power_buttons)
188188
{
189-
power_button.findNeighbours(Tab.powerButtons);
189+
power_button.findNeighbours(Tab._power_buttons);
190190
}
191191
}
192192

-168 KB
Binary file not shown.

services/ModCompileLoadService.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,6 @@ public static bool TryCompileAndLoadModAtRuntime(ModDeclare mod_declare)
637637
Builder.AddBuilders(builders);
638638
Builder.AddBuilders(builders2);
639639
Builder.BuildAll();
640-
ResourcesPatch.PatchSomeResources();
641640
return true;
642641
}
643642

0 commit comments

Comments
 (0)