Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
AM_Region.cs
Go to the documentation of this file.
1using System;
2using UnityEngine;
3
4public class AM_Region : AM_Adv
5{
7
8 public override float TargetZoom => 0.01f * (float)EClass.game.config.regionZoom;
9
10 public override void OnRenderTile(Point point, HitResult result, int dir)
11 {
12 EClass.screen.tileSelector.OnRenderTile(point, result, base.ShouldHideTile);
13 }
14
15 public override void RefreshArrow()
16 {
19 float num;
20 if (cursorMove || EClass.pc.pos.Distance(base.hit) > 1)
21 {
22 num = Util.GetAngle(posArrow.x - posOrigin.x, posArrow.y - posOrigin.y) + 90f + 22.5f;
23 }
24 else
25 {
26 num = Util.GetAngle(EClass.pc.pos.x - base.hit.x, EClass.pc.pos.z - base.hit.z) - 45f - 22.5f;
27 if (num < 0f)
28 {
29 num = 360f + num;
30 }
31 }
32 if ((bool)WidgetUnityChan.Instance)
33 {
35 }
36 if (clickPos != Vector3.zero)
37 {
38 if (Vector3.Distance(Input.mousePosition, clickPos) < EClass.core.config.game.angleMargin)
39 {
40 return;
41 }
42 clickPos = Vector3.zero;
43 }
44 vArrow = Vector2.zero;
45 int _angle = 0;
46 Action<int, int, int, int> action = delegate(int x, int y, int i, int a)
47 {
48 vArrow.x = x;
49 vArrow.y = y;
50 arrowIndex = i;
51 _angle = -a;
52 };
53 if (num < 45f || num >= 360f)
54 {
55 action(-1, 0, 0, 0);
56 }
57 else if (num < 90f)
58 {
59 action(-1, 1, 1, 35);
60 }
61 else if (num < 135f)
62 {
63 action(0, 1, 2, 90);
64 }
65 else if (num < 180f)
66 {
67 action(1, 1, 3, 145);
68 }
69 else if (num < 225f)
70 {
71 action(1, 0, 4, 180);
72 }
73 else if (num < 270f)
74 {
75 action(1, -1, 5, 215);
76 }
77 else if (num < 315f)
78 {
79 action(0, -1, 6, 270);
80 }
81 else
82 {
83 action(-1, -1, 7, 325);
84 }
85 }
86}
HitResult
Definition: HitResult.cs:2
Definition: AM_Adv.cs:6
Vector3 clickPos
Definition: AM_Adv.cs:168
Vector2 vArrow
Definition: AM_Adv.cs:123
bool cursorMove
Definition: AM_Adv.cs:115
Vector3 posOrigin
Definition: AM_Adv.cs:119
int arrowIndex
Definition: AM_Adv.cs:111
Vector3 posArrow
Definition: AM_Adv.cs:121
override float TargetZoom
Definition: AM_Region.cs:8
override void OnRenderTile(Point point, HitResult result, int dir)
Definition: AM_Region.cs:10
Point posHighlight
Definition: AM_Region.cs:6
override void RefreshArrow()
Definition: AM_Region.cs:15
BaseTileSelector tileSelector
virtual void OnRenderTile(Point point, HitResult result, bool shouldHide)
Point pos
Definition: Card.cs:55
new GameConfig game
Definition: CoreConfig.cs:596
CoreConfig config
Definition: Core.cs:70
static Vector3 position
Definition: CursorSystem.cs:22
static Vector3 posOrigin
Definition: CursorSystem.cs:24
Definition: EClass.cs:5
static Game game
Definition: EClass.cs:8
static Core core
Definition: EClass.cs:6
static BaseGameScreen screen
Definition: EClass.cs:32
static Chara pc
Definition: EClass.cs:14
int regionZoom
Definition: Game.cs:69
Config config
Definition: Game.cs:215
Definition: Point.cs:9
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
int Distance(Point p)
Definition: Point.cs:953
void Refresh(float angle)
static WidgetUnityChan Instance