Skip to content

Commit 6de727b

Browse files
committed
Working on scripting system more, cleaning up.
1 parent d4a725e commit 6de727b

4 files changed

Lines changed: 15 additions & 4 deletions

File tree

PawMapLoader/PawMapLoader.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@
599599
<Compile Include="Res\PawScript\Resolvers\FloatResolver.cs" />
600600
<Compile Include="Res\PawScript\Resolvers\MathResolver.cs" />
601601
<Compile Include="Res\PawScript\Resolvers\PointerResolver.cs" />
602+
<Compile Include="Res\PawScript\Resolvers\VectorResolver.cs" />
602603
<Compile Include="Res\PawScript\Validation\RestrictedValidation.cs" />
603604
<Compile Include="Res\PawScript\Validation\TypeValidation.cs" />
604605
<Compile Include="Res\Store.cs" />

PawMapLoader/Res/HarmonyPatches.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using Il2CppGame;
88
using Il2CppUtilities;
99
using MelonLoader;
10+
using PawMapLoader.Res.Components;
1011
using PawMapLoader.Res.Enum;
1112
using UnityEngine;
1213
using UnityEngine.SceneManagement;
@@ -81,20 +82,21 @@ public static void Prefix(BuildingsManager __instance)
8182
if (Store.FirePrevention.HasBlockConfig) return;
8283
if (Store.IsMapCustom)
8384
{
84-
MelonLogger.Msg("Finding SceneConfig");
8585
foreach (var go in SceneManager
8686
.GetSceneByName(ConfigManager.Instance.Level.Scene.SceneName).GetRootGameObjects())
8787
{
88+
if (go.name == "SceneObjects")
89+
{
90+
go.AddComponent<SceneRoot>();
91+
}
8892
if (go.name == "SceneConfig")
8993
{
90-
MelonLogger.Msg("| \"" + go.name + "\" is SceneConfig.");
9194
var cblock = new GameObject("CityBlock");
9295
cblock.transform.SetParent(go.transform);
9396
cblock.AddComponent<CityBlockGrid>();
9497
Store.FirePrevention.HasBlockConfig = true;
9598
break;
9699
}
97-
MelonLogger.Msg("| \"" + go.name + "\" is not SceneConfig");
98100
}
99101
}
100102
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
using System.Linq;
2+
using PawMapLoader.Res.Components;
13
using PawMapLoader.Res.PawScript.Json;
4+
using UnityEngine;
25

36
namespace PawMapLoader.Res.PawScript.Claws
47
{
@@ -7,7 +10,7 @@ public class Scene
710
public static void UnityGameObjectToMemory(PawScriptInstruction instruction, ref int instructionSetter,
811
Interpreter interpreter)
912
{
10-
13+
interpreter.WriteMemory(Resources.FindObjectsOfTypeAll<SceneRoot>().FirstOrDefault().transform.Find(instruction.Arguments[0]), int.TryParse(instruction.Arguments[1], out int b) ? b : 0 );
1114
}
1215
}
1316
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
namespace PawMapLoader.Res.PawScript.Resolvers
2+
{
3+
public class VectorResolver
4+
{}
5+
}

0 commit comments

Comments
 (0)