public bool IsParagonWindowOpen() { //[1F2D2530] Mouseover: 0x20098D9B0B396156, Name: Root.NormalLayer.Paragon_main.LayoutRoot.ParagonPointSelect.tab_1 var paragonCoreTab = UIElement.FromHash(0x20098D9B0B396156); return(paragonCoreTab != null && paragonCoreTab.IsVisible); }
/// <summary> /// UIElement validation check /// </summary> /// <param name="hash">UIElement hash to check</param> /// <param name="isEnabled">should be enabled</param> /// <param name="isVisible">should be visible</param> /// <param name="bisValid">should be a valid UIElement</param> /// <returns>true if all requirements are valid</returns> public static bool isValid(ulong hash, bool isEnabled = true, bool isVisible = true, bool bisValid = true) { try { if (!UIElement.IsValidElement(hash)) { return(false); } else { var element = UIElement.FromHash(hash); if ((isEnabled && !element.IsEnabled) || (!isEnabled && element.IsEnabled)) { return(false); } if ((isVisible && !element.IsVisible) || (!isVisible && element.IsVisible)) { return(false); } if ((bisValid && !element.IsValid) || (!bisValid && element.IsValid)) { return(false); } } } catch { return(false); } return(true); }
public static T GetControl <T>(ulong hash) where T : UXControl, new() { //return MemoryWrapper.Create<T>(UIMap[hash].BaseAddress); var el = UIElement.FromHash(hash); return(el.IsValid ? MemoryWrapper.Create <T>(el.BaseAddress) : default(T)); }
private bool ErrorHandling() { bool errorHandled = false; if (ErrorDialog.IsVisible) { // Check if Demonbuddy found errordialog if (!handlederror) { Send("CheckConnection", pause: true); handlederror = true; errorHandled = true; } else { handlederror = false; ErrorDialog.Click(); CheckForLoginScreen(); errorHandled = true; } } if (UIElementTester.isValid(_UIElement.errordialog_okbutton)) { // Demonbuddy failed to find error dialog use static hash to find the OK button Send("CheckConnection", pause: true); UIElement.FromHash(_UIElement.errordialog_okbutton).Click(); CheckForLoginScreen(); errorHandled = true; } handlederror = false; if (UIElementTester.isValid(_UIElement.loginscreen_username)) { // We are at loginscreen Send("CheckConnection", pause: true); errorHandled = true; } return(errorHandled); }
public static UXControl GetControl(ulong hash) { return(GetControl(UIElement.FromHash(hash).BaseAddress)); }
public static UXControl GetControl(UIElement el) { return(GetControl(el.BaseAddress)); }