-
-
Notifications
You must be signed in to change notification settings - Fork 3
Build 99.7 compatibility #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| namespace Mapify.Patches | ||
| { | ||
| /// <summary> | ||
| /// Something keeps setting the shop scanner inactive. This patch prevents that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should find what's causing this, not add some weird hacky workaround. You should be able to see what's happening by inspecting the stacktrace from the OnEnable/OnDisable methods of something attached to an item.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the stracktrace suggestion, but I still can't figure it out.
private void OnDisable()
{
var trace = new System.Diagnostics.StackTrace();
Mapify.LogDebug($"ForceActive.OnDisable");
Mapify.LogDebug(trace.ToString());
}
The only thing triggering this is PlayerDistanceMultipleGameObjectsOptimizer when I walk away from the shop. This is expected.
But if I start the game while already at the shop, nothing triggers OnDisable and the scanner is still inactive.
Even if I set the scanner to active in StoreSetup or ItemLocationForcer_Awake_Patch the scanner is inactive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the Forceactive class to Reactivate, which sets the target object to active once and then destroys itself.
Can you allow this one hack? Because this PR is blocking all the others 😬
|
|
||
| namespace Mapify.Patches | ||
| { | ||
| [HarmonyPatch(typeof(GlobalShopController), nameof(GlobalShopController.InitializeShopData))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to be doing this for everyone every time? I assume you use this to know what items to add to the enum, so it should probably be behind an #if DEBUG directive or something similar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add a #if DEBUG.
Mapify/AssetCopiers/AssetCopier.cs
Outdated
| } | ||
|
|
||
| Mapify.LogError($"Failed to instantiate asset {asset}"); | ||
| var nothing = new GameObject(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of this. What's the case where this can even happen? If something isn't in prefabs we have bigger problems, an incompatible map, or a bug somewhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
Mapify/Utils/UnityUtils.cs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we only using InstantiateDisabled with GameObjects from this? It seems quite overkill and could probably be simplified down to something like
GameObject InstantiateDisabled(GameObject prefab)
{
var wasActive = prefab.activeSelf;
prefab.SetActive(false);
var go = Instantiate(prefab);
prefab.SetActive(wasActive);
return go;
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
No description provided.