Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
WidgetMinimap Class Reference
Inheritance diagram for WidgetMinimap:
Widget EMono IChangeResolution ISkinRoot

Classes

class  Extra
 

Public Member Functions

override object CreateExtra ()
 
override void OnActivate ()
 
void OnMoveZone ()
 
void Reload ()
 
void OnPointerDown (PointerEventData e)
 
void OnPointerUp (PointerEventData e)
 
void OnInitializePotentialDrag (PointerEventData ped)
 
void OnDrag (PointerEventData e)
 
override void OnSetContextMenu (UIContextMenu m)
 
void RefreshStyle ()
 
void OnUpdate ()
 
void RefreshMarkers ()
 
void EmitParticle (Card c, ParticleSystem ps, Color col)
 
- Public Member Functions inherited from Widget
void Test ()
 
bool IsInRightMode ()
 
void Activate ()
 
void RefreshOrder ()
 
virtual void OnActivate ()
 
virtual object CreateExtra ()
 
void Deactivate ()
 
virtual void OnDeactivate ()
 
void Close ()
 
void Reactivate ()
 
virtual void OnManagerActivate ()
 
virtual void OnManagerDeactivate ()
 
void SetAnchor (RectPosition p)
 
void SetPivot (RectPosition p)
 
virtual void OnChangePivot ()
 
void UpdateConfig ()
 
virtual void OnUpdateConfig ()
 
void ClampToScreen ()
 
virtual void OnChangeResolution ()
 
void OnChangePosition ()
 
virtual void OnChangeActionMode ()
 
virtual void OnFlip ()
 
bool IsAlignTop ()
 
Layer AddLayer (Layer l, Transform trans)
 
void RefreshTipPivotPosition ()
 
SkinSet GetSkin ()
 
SkinConfig GetSkinConfig ()
 
void SetSkin (int id, int v=0)
 
void TestSkin ()
 
virtual void ApplySkin ()
 
virtual void OnApplySkin ()
 
void InstantiateDeco (SkinDeco deco)
 
void AddDeco (SkinDeco deco)
 
void RemoveDeco (SkinDeco deco)
 
virtual bool CanShowContextMenu ()
 
void ShowContextMenu ()
 
void SetBaseContextMenu (UIContextMenu m)
 
virtual void OnSetContextMenu (UIContextMenu m)
 
void SetGridContextMenu (UIContextMenu m)
 
void SoundActivate ()
 
void OnChangeResolution ()
 
SkinSet GetSkin ()
 
SkinConfig GetSkinConfig ()
 

Static Public Member Functions

static void UpdateMap (List< Cell > newPoints)
 
static void UpdateMap (int x, int z)
 
static void UpdateMap ()
 
- Static Public Member Functions inherited from EMono
static int rnd (int a)
 

Public Attributes

float interval
 
float intervalPS
 
float psSize
 
RectTransform rectAll
 
RectTransform rectMap
 
Vector2 baseSize
 
UIButton buttonMaptool
 
UIMapPreview preview
 
Color colorAlly
 
Color colorEnemy
 
Color colorGuest
 
ParticleSystem psAlly
 
ParticleSystem psEnemy
 
Transform transBound
 
Vector2 posPs
 
Transform transCam
 
- Public Attributes inherited from Widget
Image imageBG
 
SoundData soundActivate
 
UIDragPanel dragPanel
 
RectTransform tipPivotLeft
 
RectTransform tipPivotRight
 

Static Public Attributes

static WidgetMinimap Instance
 
- Static Public Attributes inherited from EMono
static Core core
 

Properties

override Type SetSiblingAfter [get]
 
Extra extra [get]
 
int Size [get]
 
override bool AlwaysBottom [get]
 
- Properties inherited from Widget
string ID [get]
 
Config config [get]
 
SkinRoot skinRoot [get]
 
bool IsSealed [get]
 
virtual bool ShowStyleMenu [get]
 
virtual bool AlwaysTop [get]
 
virtual bool IsStaticPosition [get]
 
virtual bool AlwaysBottom [get]
 
virtual Type SetSiblingAfter [get]
 
virtual bool ShowInBuildMode [get]
 
virtual bool RightClickToClose [get]
 
virtual bool AllowRightClickToClose [get]
 
- Properties inherited from EMono
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SoundManager Sound [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static CoreDebug debug [get]
 

Private Attributes

Point pos = new Point()
 
Point point = new Point()
 
int count
 

Additional Inherited Members

- Public Types inherited from Widget
enum  WidgetType { Default , ZoomMenu }
 
enum  State { Active , Inactive }
 
- Protected Member Functions inherited from Widget
void ClampToScreenEnsured (Component c, Vector2 anchoredPos)
 
void ClampToScreen (RectTransform rect, float margin=10f)
 
- Protected Attributes inherited from Widget
bool flip
 

Detailed Description

Definition at line 6 of file WidgetMinimap.cs.

Member Function Documentation

◆ CreateExtra()

override object WidgetMinimap.CreateExtra ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 71 of file WidgetMinimap.cs.

72 {
73 return new Extra();
74 }

◆ EmitParticle()

void WidgetMinimap.EmitParticle ( Card  c,
ParticleSystem  ps,
Color  col 
)
inline

Definition at line 256 of file WidgetMinimap.cs.

257 {
258 int num = c.pos.x;
259 int num2 = c.pos.z;
260 float z = (c.IsPCFactionOrMinion ? 9f : (10f + 0.01f * (float)(c.pos.z * 200 + c.pos.x)));
262 {
263 num -= EMono._map.bounds.x - preview.offsetX;
264 num2 -= EMono._map.bounds.z - preview.offsetZ;
265 }
266 float x = (float)num / (float)Size - 0.5f;
267 float y = (float)num2 / (float)Size - 0.5f;
268 count++;
269 ParticleSystem.EmitParams emitParams = default(ParticleSystem.EmitParams);
270 emitParams.position = new Vector3(x, y, z);
271 emitParams.startSize = psSize;
272 emitParams.startLifetime = intervalPS;
273 emitParams.startColor = col;
274 ParticleSystem.EmitParams emitParams2 = emitParams;
275 psAlly.Emit(emitParams2, 1);
276 }
Point pos
Definition: Card.cs:55
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
bool limitBounds
Definition: UIMapPreview.cs:84
UIMapPreview preview
ParticleSystem psAlly

References count, intervalPS, UIMapPreview.limitBounds, UIMapPreview.offsetX, UIMapPreview.offsetZ, Card.pos, preview, psAlly, psSize, Size, Point.x, and Point.z.

Referenced by RefreshMarkers().

◆ OnActivate()

override void WidgetMinimap.OnActivate ( )
inlinevirtual

Reimplemented from Widget.

Definition at line 76 of file WidgetMinimap.cs.

77 {
78 Instance = this;
79 preview.limitBounds = extra.limitBounds;
80 preview.monoColor = extra.monoColor;
82 InvokeRepeating("RefreshMarkers", 0f, interval);
85 {
86 id = "mapTool"
87 });
88 }
Definition: EMono.cs:4
static Map _map
Definition: EMono.cs:17
void SetItem(Item i)
Definition: UIButton.cs:259
void SetMap(Map _map)
UIButton buttonMaptool
static WidgetMinimap Instance
void RefreshStyle()

References EMono._map, buttonMaptool, extra, Instance, interval, WidgetMinimap.Extra.limitBounds, WidgetMinimap.Extra.monoColor, preview, RefreshStyle(), UIButton.SetItem(), and UIMapPreview.SetMap().

◆ OnDrag()

void WidgetMinimap.OnDrag ( PointerEventData  e)
inline

Definition at line 177 of file WidgetMinimap.cs.

178 {
179 }

◆ OnInitializePotentialDrag()

void WidgetMinimap.OnInitializePotentialDrag ( PointerEventData  ped)
inline

Definition at line 172 of file WidgetMinimap.cs.

173 {
174 ped.useDragThreshold = false;
175 }

◆ OnMoveZone()

void WidgetMinimap.OnMoveZone ( )
inline

Definition at line 115 of file WidgetMinimap.cs.

116 {
118 RefreshStyle();
119 }

References EMono._map, preview, RefreshStyle(), and UIMapPreview.SetMap().

Referenced by Player.MoveZone().

◆ OnPointerDown()

void WidgetMinimap.OnPointerDown ( PointerEventData  e)
inline

Definition at line 126 of file WidgetMinimap.cs.

127 {
128 if (!EMono.pc.HasNoGoal || EMono.game.activeZone.IsRegion || EMono.ui.IsActive)
129 {
130 SE.BeepSmall();
131 return;
132 }
133 Vector2 size = rectMap.rect.size;
134 RectTransformUtility.ScreenPointToLocalPointInRectangle(rectMap, e.position, e.pressEventCamera, out var localPoint);
135 if (localPoint.x < 0f)
136 {
137 localPoint.x = 0f;
138 }
139 else if (localPoint.x >= size.x)
140 {
141 localPoint.x = size.x;
142 }
143 if (localPoint.y < 0f)
144 {
145 localPoint.y = 0f;
146 }
147 else if (localPoint.y >= size.y)
148 {
149 localPoint.y = size.y;
150 }
151 pos.Set((int)((float)Size * localPoint.x / size.x), (int)((float)Size * localPoint.y / size.y));
152 pos.Clamp();
154 {
155 pos.x += EMono._map.bounds.x - preview.offsetX;
156 pos.z += EMono._map.bounds.z - preview.offsetZ;
157 }
159 {
160 SE.BeepSmall();
161 }
162 else
163 {
165 }
166 }
bool isSeen
Definition: Cell.cs:282
bool outOfBounds
Definition: Cell.cs:414
void SetAIImmediate(AIAct g)
Definition: Chara.cs:8077
bool HasNoGoal
Definition: Chara.cs:821
static Chara pc
Definition: EMono.cs:13
static Game game
Definition: EMono.cs:7
static UI ui
Definition: EMono.cs:15
Zone activeZone
Definition: Game.cs:245
Point Set(int _x, int _z)
Definition: Point.cs:479
Point Clamp(bool useBounds=false)
Definition: Point.cs:972
Cell cell
Definition: Point.cs:51
virtual bool IsRegion
Definition: Spatial.cs:501
RectTransform rectMap

References Game.activeZone, Point.cell, Point.Clamp(), EMono.game, Chara.HasNoGoal, Spatial.IsRegion, Cell.isSeen, UIMapPreview.limitBounds, UIMapPreview.offsetX, UIMapPreview.offsetZ, Cell.outOfBounds, EMono.pc, pos, preview, rectMap, Point.Set(), Chara.SetAIImmediate(), Size, and EMono.ui.

◆ OnPointerUp()

void WidgetMinimap.OnPointerUp ( PointerEventData  e)
inline

Definition at line 168 of file WidgetMinimap.cs.

169 {
170 }

◆ OnSetContextMenu()

override void WidgetMinimap.OnSetContextMenu ( UIContextMenu  m)
inlinevirtual

Reimplemented from Widget.

Definition at line 181 of file WidgetMinimap.cs.

182 {
183 UIContextMenu uIContextMenu = m.AddChild("setting");
184 uIContextMenu.AddSlider("size", (float a) => extra.scale.ToString() ?? "", extra.scale, delegate(float a)
185 {
186 extra.scale = (int)a;
187 RefreshStyle();
188 }, 5f, 20f, isInt: true);
189 uIContextMenu.AddSlider("width", (float a) => 100 + extra.width + "%", extra.width, delegate(float a)
190 {
191 extra.width = (int)a;
192 RefreshStyle();
193 }, -25f, 25f, isInt: true);
194 uIContextMenu.AddSlider("alpha", (float a) => extra.alpha.ToString() ?? "", extra.alpha, delegate(float a)
195 {
196 extra.alpha = (int)a;
197 RefreshStyle();
198 }, 0f, 255f, isInt: true);
199 uIContextMenu.AddToggle("rotation", extra.rotate, delegate(bool a)
200 {
201 extra.rotate = a;
202 RefreshStyle();
203 });
204 uIContextMenu.AddToggle("monoColor", extra.monoColor, delegate(bool a)
205 {
206 extra.monoColor = (preview.monoColor = a);
208 RefreshStyle();
209 });
211 }
UIContextMenuItem AddToggle(string idLang="", bool isOn=false, UnityAction< bool > action=null)
UIContextMenuItem AddSlider(string text, Func< float, string > textFunc, float value, Action< float > action, float min=0f, float max=1f, bool isInt=false, bool hideOther=true, bool useInput=false)
UIContextMenu AddChild(string idLang, TextAnchor anchor)
void SetBaseContextMenu(UIContextMenu m)
Definition: Widget.cs:608

References EMono._map, UIContextMenu.AddChild(), UIContextMenu.AddSlider(), UIContextMenu.AddToggle(), WidgetMinimap.Extra.alpha, extra, WidgetMinimap.Extra.monoColor, preview, RefreshStyle(), WidgetMinimap.Extra.rotate, WidgetMinimap.Extra.scale, Widget.SetBaseContextMenu(), UIMapPreview.SetMap(), and WidgetMinimap.Extra.width.

◆ OnUpdate()

void WidgetMinimap.OnUpdate ( )
inline

Definition at line 220 of file WidgetMinimap.cs.

221 {
224 {
225 point.x -= EMono._map.bounds.x - preview.offsetX;
226 point.z -= EMono._map.bounds.z - preview.offsetZ;
227 }
228 float x = (float)(point.x / Size) - 0.5f;
229 float y = (float)(point.z / Size) - 0.5f;
230 transBound.localScale = new Vector3(Mathf.Min((float)EMono.screen.width / (float)Size * 1.5f, 1f), Mathf.Min((float)EMono.screen.height / (float)Size / 2f, 1f), 1f);
231 transBound.localPosition = new Vector3(x, y, 50f);
232 transCam.localScale = new Vector3(1f / EMono.core.uiScale, 1f / EMono.core.uiScale, 1f);
233 }
override float uiScale
Definition: Core.cs:95
static Core core
Definition: EMono.cs:5
static BaseGameScreen screen
Definition: EMono.cs:29

References EMono.core, BaseGameScreen.height, UIMapPreview.limitBounds, UIMapPreview.offsetX, UIMapPreview.offsetZ, point, BaseGameScreen.position, preview, EMono.screen, Point.Set(), Size, Core.uiScale, BaseGameScreen.width, Point.x, and Point.z.

Referenced by BaseGameScreen.RefreshPosition(), and GameScreenElona.RefreshPosition().

◆ RefreshMarkers()

void WidgetMinimap.RefreshMarkers ( )
inline

Definition at line 235 of file WidgetMinimap.cs.

236 {
237 if (!base.gameObject.activeInHierarchy)
238 {
239 return;
240 }
241 psAlly.Clear();
244 {
245 return;
246 }
247 foreach (Chara chara in EMono._map.charas)
248 {
249 if (chara.IsHostile())
250 {
252 }
253 }
254 }
Definition: Chara.cs:10
bool IsHostile()
Definition: Chara.cs:5884
static Zone _zone
Definition: EMono.cs:19
List< Chara > charas
Definition: Map.cs:81
void EmitParticle(Card c, ParticleSystem ps, Color col)
ParticleSystem psEnemy
bool ShowEnemyOnMinimap
Definition: Zone.cs:325

References EMono._map, EMono._zone, Map.charas, colorAlly, colorEnemy, EmitParticle(), Chara.IsHostile(), EMono.pc, psAlly, psEnemy, and Zone.ShowEnemyOnMinimap.

◆ RefreshStyle()

void WidgetMinimap.RefreshStyle ( )
inline

Definition at line 213 of file WidgetMinimap.cs.

214 {
215 rectAll.localEulerAngles = ((extra.rotate && !EMono._zone.IsRegion) ? new Vector3(60f, 0f, -45f) : Vector3.zero);
216 preview.matMap.SetColor("_Color", new Color(1f, 1f, 1f, (float)extra.alpha / 255f));
217 this.Rect().sizeDelta = new Vector2(0.1f * baseSize.x * (float)(10 + extra.scale) * (float)(100 + extra.width) * 0.01f, 0.1f * baseSize.y * (float)(10 + extra.scale));
218 }
Material matMap
Definition: UIMapPreview.cs:53
Vector2 baseSize

References EMono._zone, baseSize, Color, extra, Spatial.IsRegion, UIMapPreview.matMap, preview, WidgetMinimap.Extra.scale, and WidgetMinimap.Extra.width.

Referenced by OnActivate(), OnMoveZone(), and OnSetContextMenu().

◆ Reload()

void WidgetMinimap.Reload ( )
inline

Definition at line 121 of file WidgetMinimap.cs.

122 {
124 }

References UIMapPreview.map, preview, and UIMapPreview.SetMap().

◆ UpdateMap() [1/3]

static void WidgetMinimap.UpdateMap ( )
inlinestatic

Definition at line 107 of file WidgetMinimap.cs.

108 {
110 {
112 }
113 }
Zone zone
Definition: Map.cs:87
bool IsActiveZone
Definition: Zone.cs:486

References EMono._map, Instance, Zone.IsActiveZone, UIMapPreview.map, preview, UIMapPreview.SetMap(), and Map.zone.

◆ UpdateMap() [2/3]

static void WidgetMinimap.UpdateMap ( int  x,
int  z 
)
inlinestatic

Definition at line 99 of file WidgetMinimap.cs.

100 {
102 {
104 }
105 }
void UpdateMap(int x, int z)

References Instance, Zone.IsActiveZone, UIMapPreview.map, preview, UIMapPreview.UpdateMap(), and Map.zone.

◆ UpdateMap() [3/3]

static void WidgetMinimap.UpdateMap ( List< Cell newPoints)
inlinestatic

Definition at line 90 of file WidgetMinimap.cs.

91 {
93 {
94 Instance.preview.UpdateMap(newPoints);
95 }
96 newPoints.Clear();
97 }

References Instance, Zone.IsActiveZone, UIMapPreview.map, preview, UIMapPreview.UpdateMap(), and Map.zone.

Referenced by Fov.Perform(), Map.RevealAll(), and Map.SetSeen().

Member Data Documentation

◆ baseSize

Vector2 WidgetMinimap.baseSize

Definition at line 35 of file WidgetMinimap.cs.

Referenced by RefreshStyle().

◆ buttonMaptool

UIButton WidgetMinimap.buttonMaptool

Definition at line 39 of file WidgetMinimap.cs.

Referenced by OnActivate().

◆ colorAlly

Color WidgetMinimap.colorAlly

Definition at line 43 of file WidgetMinimap.cs.

Referenced by RefreshMarkers().

◆ colorEnemy

Color WidgetMinimap.colorEnemy

Definition at line 45 of file WidgetMinimap.cs.

Referenced by RefreshMarkers().

◆ colorGuest

Color WidgetMinimap.colorGuest

Definition at line 47 of file WidgetMinimap.cs.

◆ count

int WidgetMinimap.count
private

Definition at line 61 of file WidgetMinimap.cs.

Referenced by EmitParticle().

◆ Instance

◆ interval

float WidgetMinimap.interval

Definition at line 25 of file WidgetMinimap.cs.

Referenced by OnActivate().

◆ intervalPS

float WidgetMinimap.intervalPS

Definition at line 27 of file WidgetMinimap.cs.

Referenced by EmitParticle().

◆ point

Point WidgetMinimap.point = new Point()
private

Definition at line 59 of file WidgetMinimap.cs.

Referenced by OnUpdate().

◆ pos

Point WidgetMinimap.pos = new Point()
private

Definition at line 37 of file WidgetMinimap.cs.

Referenced by OnPointerDown().

◆ posPs

Vector2 WidgetMinimap.posPs

Definition at line 55 of file WidgetMinimap.cs.

◆ preview

◆ psAlly

ParticleSystem WidgetMinimap.psAlly

Definition at line 49 of file WidgetMinimap.cs.

Referenced by EmitParticle(), and RefreshMarkers().

◆ psEnemy

ParticleSystem WidgetMinimap.psEnemy

Definition at line 51 of file WidgetMinimap.cs.

Referenced by RefreshMarkers().

◆ psSize

float WidgetMinimap.psSize

Definition at line 29 of file WidgetMinimap.cs.

Referenced by EmitParticle().

◆ rectAll

RectTransform WidgetMinimap.rectAll

Definition at line 31 of file WidgetMinimap.cs.

◆ rectMap

RectTransform WidgetMinimap.rectMap

Definition at line 33 of file WidgetMinimap.cs.

Referenced by OnPointerDown().

◆ transBound

Transform WidgetMinimap.transBound

Definition at line 53 of file WidgetMinimap.cs.

◆ transCam

Transform WidgetMinimap.transCam

Definition at line 57 of file WidgetMinimap.cs.

Property Documentation

◆ AlwaysBottom

override bool WidgetMinimap.AlwaysBottom
get

Definition at line 69 of file WidgetMinimap.cs.

◆ extra

Extra WidgetMinimap.extra
get

Definition at line 65 of file WidgetMinimap.cs.

Referenced by OnActivate(), OnSetContextMenu(), and RefreshStyle().

◆ SetSiblingAfter

override Type WidgetMinimap.SetSiblingAfter
get

Definition at line 63 of file WidgetMinimap.cs.

◆ Size

int WidgetMinimap.Size
get

Definition at line 67 of file WidgetMinimap.cs.

Referenced by EmitParticle(), OnPointerDown(), and OnUpdate().


The documentation for this class was generated from the following file: