fix: Update button container path to reflect correct hierarchy and improve logging
This commit is contained in:
16
Main.cs
16
Main.cs
@@ -209,21 +209,11 @@ namespace KCM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try different paths to find the button container
|
// Correct path based on debug output: MainMenuUI -> MainMenu -> TopLevel -> Body -> ButtonContainer -> New
|
||||||
var buttonContainer = Constants.MainMenuUI_T.Find("TopLevelUICanvas/TopLevel/Body/ButtonContainer/New");
|
var buttonContainer = Constants.MainMenuUI_T.Find("MainMenu/TopLevel/Body/ButtonContainer/New");
|
||||||
if (buttonContainer == null)
|
if (buttonContainer == null)
|
||||||
{
|
{
|
||||||
// Try without TopLevelUICanvas prefix
|
Main.helper.Log("Button container not found at MainMenu/TopLevel/Body/ButtonContainer/New");
|
||||||
buttonContainer = Constants.MainMenuUI_T.Find("TopLevel/Body/ButtonContainer/New");
|
|
||||||
}
|
|
||||||
if (buttonContainer == null)
|
|
||||||
{
|
|
||||||
// Try direct path
|
|
||||||
buttonContainer = Constants.MainMenuUI_T.Find("Body/ButtonContainer/New");
|
|
||||||
}
|
|
||||||
if (buttonContainer == null)
|
|
||||||
{
|
|
||||||
Main.helper.Log("Button container not found in any path");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Main.helper.Log($"Found button container at: {buttonContainer.name}");
|
Main.helper.Log($"Found button container at: {buttonContainer.name}");
|
||||||
|
|||||||
Reference in New Issue
Block a user