private static void tryAutoGamble() { try { isGambling = true; UIReference lastClickedUIReference = tryGetLastClickedUIReference(); int gambleCosts = tryGetBloodShardCosts(lastClickedUIReference); UIRect shopItemRect = A_Tools.T_D3UI.UIElement.getRect(lastClickedUIReference.x008_Name); while ( tryGetLastClickedUIReference().x008_Name.ToLower().Contains("shop_item_region") && A_Tools.T_D3UI.UIElement.isVisible(A_Enums.UIElements.ShopDialogMainPage) && get_BloodShardAmount() >= gambleCosts && !tryCheckInventoryFull() && tryCheckEnoughShards() && A_Collection.D3Client.Window.isForeground ) { A_Tools.InputSimulator.IS_Mouse.RightCLick(((int)shopItemRect.Left + ((int)shopItemRect.Width * 10 / 100)), ((int)shopItemRect.Top + ((int)shopItemRect.Height * 10 / 100)), ((int)shopItemRect.Right - ((int)shopItemRect.Width * 10 / 100)), ((int)shopItemRect.Bottom - ((int)shopItemRect.Height * 10 / 100))); System.Threading.Thread.Sleep(100); } isGambling = false; } catch { isGambling = false; } }
void Start() { canCast = true; canRotate = true; gameControllerScript = gameController.GetComponent <GameController>(); UIReferenceScript = gameControllerScript.UIReference.GetComponent <UIReference>(); initialRotation = transform.eulerAngles; initialPosition = transform.position; casterStartPosition = caster.transform.localPosition; }
private static UIReference tryGetMouseCaptureUIReference() { try { //return ObjectManager.Instance.x9EC_Ptr_10000Bytes_UI.Dereference().x0008_MouseCapture; UIReference uiref = UIManager.Instance.x0008_MouseCapture; //Console.WriteLine(uiref.x008_Name); return(uiref); } catch { return(null); } }
public void SetSize(Vector2?im) { SpriteSize = im; if (UIReference != null) { if (SpriteSize.HasValue) { UIReference.rectTransform.sizeDelta = SpriteSize.Value; } else { UIReference.SetNativeSize(); } } }
private UIReference GetReference(UIStates state) { UIReference foundReference = new UIReference(); var l = _references.Length; for (int i = 0; i < l; i++) { if (_references[i].state == state) { foundReference = _references[i]; break; } } return(foundReference); }
private void DisplayReference(UIReference reference, Transform worldTransform, Vector2 offset) { int distance; distance = (int)Vector3.Distance(playerTransform.position, worldTransform.position); if (distance > 2) { reference.gameObject.SetActive(true); Vector2 screenPos = mainCamera.WorldToScreenPoint(worldTransform.position); screenPos.x = Mathf.Clamp(screenPos.x, minPixelCoordX, maxPixelCoordX); screenPos.y = Mathf.Clamp(screenPos.y, minPixelCoordY, maxPixelCoordY); // Check if ball is behind us if (Vector3.Dot(worldTransform.position - mainCamera.transform.position, mainCamera.transform.forward) < 0) { // Account for opposite X if (screenPos.x < Screen.width / 2) { screenPos.x = maxPixelCoordX; } else { screenPos.x = minPixelCoordX; } // Account for opposite Y if (screenPos.y < Screen.height / 2) { screenPos.y = maxPixelCoordY; } else { screenPos.y = minPixelCoordY; } } reference.GetComponent <RectTransform>().position = screenPos + offset; reference.SetDistanceText(distance); } else { reference.gameObject.SetActive(false); } }
public void SetSprite(Sprite s) { Sprite = s; if (UIReference != null) { UIReference.color = OriginalColor; UIReference.sprite = s; if (SpriteSize.HasValue) { UIReference.rectTransform.sizeDelta = SpriteSize.Value; } else { UIReference.SetNativeSize(); } } }
private static int tryGetBloodShardCosts(UIReference lastClickedElement) { try { int bloodShardCosts = 10000; var text = UXHelper.GetControl <UXLabel>(lastClickedElement.x008_Name + ".text_cost").xA20_Text_StructStart_Min84Bytes; var shardstring = Regex.Match(text, @"\d+").Groups[0].Value; if (int.TryParse(shardstring, out bloodShardCosts)) { return(bloodShardCosts); } return(bloodShardCosts); } catch { return(10000); } }
public static T GetControl <T>(UIReference handle) where T : UXControl { return(GetIfNotNull( GetControlPointer(handle), ptr => ptr.Cast <T>().Dereference().EnsureValidType())); }
public static UXControl GetControl(UIReference handle) { return(GetControlFromPointer(GetControlPointer(handle))); }
public static Ptr GetControlPointer(UIReference handle) { return(GetIfNotNull(GetUIMap(), map => map[handle])); }
public void PrepareTeammateTransform(Transform teammate) { teammateTransform = teammate; teammateReference = Instantiate(teammatePrefab, transform); }