Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
LayerTextureViewer Class Reference
Inheritance diagram for LayerTextureViewer:
ELayer Layer IUISkin

Public Member Functions

override void OnInit ()
 
override void OnSwitchContent (Window window)
 
void RefreshPage ()
 
void SetPos (Component r, int x, int y, float size=0f, Vector2 posFix=default(Vector2))
 
- Public Member Functions inherited from ELayer
override void OnBeforeAddLayer ()
 
void InitInspector ()
 
sealed override void Init ()
 
override void OnAfterAddLayer ()
 
void TryShowHelp ()
 
void AddLayerToUI (string id)
 
void TryShowHint (string _langHint=null)
 
void TalkHomeMemeber (string id)
 
void TalkMaid (string id)
 
override void OnRightClick ()
 
- Public Member Functions inherited from Layer
virtual string GetTextHeader (Window window)
 
virtual bool HeaderIsListOf (int id)
 
virtual void Init ()
 
virtual void OnInit ()
 
virtual void OnAfterInit ()
 
virtual void ApplySkin ()
 
void ShowScreenLock (string id)
 
void UpdateInput ()
 
virtual void OnUpdateInput ()
 
virtual void OnRightClick ()
 
virtual bool OnBack ()
 
virtual void OnChangeLayer ()
 
virtual void OnCreate ()
 
void _AddLayer (string id)
 
Layer AddLayer (string id)
 
AddLayer< T > ()
 
AddLayer< T > (string id)
 
AddLayerDontCloseOthers< T > ()
 
Layer AddLayerDontCloseOthers (Layer l)
 
GetOrAddLayer< T > ()
 
virtual void OnBeforeAddLayer ()
 
virtual void OnAfterAddLayer ()
 
Layer AddLayer (Layer l)
 
void ToggleLayer (string id)
 
ToggleLayer< T > (string id=null)
 
void WaitAndClose ()
 
void OnClickClose ()
 
virtual void Close ()
 
void CloseLayers ()
 
void RemoveLayers (bool removeImportant=false)
 
bool RemoveLayer< T > ()
 
void RemoveLayer (Layer l)
 
virtual void OnKill ()
 
Layer SetOnKill (Action action)
 
void DisableClose ()
 
void Delay (float duration=0.05f)
 
Layer SetDelay (float d)
 
Layer GetLayer (string id)
 
GetLayer< T > (bool fromTop=false)
 
Layer GetTopLayer ()
 
void SwitchContent (int idWindow, int i)
 
virtual void OnSwitchContent (Window window)
 
Layer SetTitles (string langList, string idHeaderRow=null)
 
bool IsBlockWidgetClick ()
 
bool IsHideHud ()
 
bool IsAllowGeneralInput ()
 
bool IsUseBlur ()
 
bool IsPointerOnLayer ()
 
void ApplySkin ()
 

Public Attributes

RawImage imageTex
 
Image highlight
 
Image moldMarker
 
TextureData data
 
UIScrollView view
 
Scrollbar scrollbarH
 
Scrollbar scrollvarV
 
UIText textHint
 
Transform transMask
 
float scale
 
float highlightSize
 
List< Image > markers = new List<Image>()
 
Vector2 markerFix
 
Color colorUser
 
Color colorMod
 
Color colorLocal
 
int sizeX
 
int sizeY
 
bool fixZoom
 
bool snow
 
Vector2 test
 
- Public Attributes inherited from Layer
Option option
 
UnityEvent onKill
 
Anime animeIn
 
Anime animeOut
 
bool closeOthers
 
bool defaultActionMode = true
 
Button screenLock
 
Layer parent
 
string idLayer
 
List< Layerlayers = new List<Layer>()
 
Vector2 lastParentPos
 
List< Windowwindows = new List<Window>()
 
string langHint
 

Private Member Functions

void Update ()
 

Private Attributes

bool zoom
 

Additional Inherited Members

- Static Public Member Functions inherited from ELayer
static int rnd (int a)
 
- Static Public Member Functions inherited from Layer
static T Create< T > ()
 
static T Create< T > (string path)
 
static Layer Create (string path)
 
- Static Public Attributes inherited from Layer
static int skipInput
 
static bool closeOnRightClick
 
static bool rightClicked
 
static bool cancelKeyDown
 
static bool ignoreSounds
 
static Transform blurStopInstance
 
static string[] searchPath = new string[3] { "Layer", "Layer/Dialog", "Layer/LayerHome" }
 
- Protected Member Functions inherited from ELayer
sealed override void _Close ()
 
sealed override void Kill ()
 
- Protected Member Functions inherited from Layer
virtual void Awake ()
 
virtual void _Close ()
 
virtual void Kill ()
 
- Protected Attributes inherited from Layer
RectTransform _rect
 
bool isDestroyed
 
- Properties inherited from ELayer
static Core core [get]
 
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static FactionBranch Branch [get]
 
static Faction Home [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static CoreConfig config [get]
 
static GameSetting setting [get]
 
static ColorProfile Colors [get]
 
static SourceManager sources [get]
 
static World world [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 
bool IsFloat [get]
 
virtual string IdHelp [get]
 
- Properties inherited from Layer
Layer TopLayer [get]
 
string uid [get]
 
virtual RectTransform rectLayers [get]
 
virtual bool blockWidgetClick [get]
 

Detailed Description

Definition at line 5 of file LayerTextureViewer.cs.

Member Function Documentation

◆ OnInit()

override void LayerTextureViewer.OnInit ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 51 of file LayerTextureViewer.cs.

52 {
53 windows[0].AddBottomSpace();
54 windows[0].AddBottomButton("openUser", delegate
55 {
56 Util.ShowExplorer(CorePath.user + "Texture Replace/dummy.txt");
57 });
58 windows[0].AddBottomButton("toggleSnowTexture", delegate
59 {
60 SE.Tab();
61 snow = !snow;
63 });
64 }
static string user
Definition: CorePath.cs:160
override void OnSwitchContent(Window window)
List< Window > windows
Definition: Layer.cs:116
Definition: Util.cs:10
static void ShowExplorer(string itemPath, bool selectFirstFile=false)
Definition: Util.cs:228

References OnSwitchContent(), snow, CorePath.user, Util, and Layer.windows.

◆ OnSwitchContent()

override void LayerTextureViewer.OnSwitchContent ( Window  window)
inlinevirtual

Reimplemented from Layer.

Definition at line 66 of file LayerTextureViewer.cs.

67 {
68 data = ELayer.core.textures.texMap.TryGetValue(window.CurrentTab.idLang + (snow ? "Snow" : "")) ?? ELayer.core.textures.texMap[window.CurrentTab.idLang];
70 scrollbarH.value = 0f;
71 scrollvarV.value = 1f;
72 }
TextureManager textures
Definition: Core.cs:45
Definition: ELayer.cs:4
static Core core
Definition: ELayer.cs:7
Dictionary< string, TextureData > texMap
Setting.Tab CurrentTab
Definition: Window.cs:787

References ELayer.core, Window.CurrentTab, data, RefreshPage(), snow, TextureManager.texMap, and Core.textures.

Referenced by OnInit().

◆ RefreshPage()

void LayerTextureViewer.RefreshPage ( )
inline

Definition at line 74 of file LayerTextureViewer.cs.

75 {
76 scale = 0.5f;
77 switch (data.id)
78 {
79 case "objS":
80 case "objSS":
81 case "objSSnow":
82 case "objSSSnow":
83 scale = 1f;
84 break;
85 }
86 if (zoom)
87 {
88 scale *= 2f;
89 }
90 if (fixZoom)
91 {
92 scale /= ELayer.ui.canvasScaler.scaleFactor;
93 }
94 imageTex.texture = null;
95 imageTex.texture = data.tex;
96 imageTex.rectTransform.sizeDelta = new Vector2((float)data.tex.width * scale, (float)data.tex.height * scale);
97 imageTex.RebuildLayoutTo<Layer>();
98 foreach (Image marker in markers)
99 {
100 Object.Destroy(marker.gameObject);
101 }
102 markers.Clear();
103 foreach (TextureReplace value in data.dictReplace.Values)
104 {
105 Image image = Util.Instantiate(moldMarker, imageTex.transform.parent);
106 image.rectTransform.sizeDelta = new Vector2(((float)Mathf.Max(value.w, data.tileW) + highlightSize * 2f) * scale, ((float)Mathf.Max(value.h, data.tileH) + highlightSize * 2f) * scale);
107 SetPos(image, value.index % 100, value.index / 100 * -1, highlightSize, markerFix);
108 image.color = ((value.source == TextureReplace.Source.Local) ? colorLocal : ((value.source == TextureReplace.Source.User) ? colorUser : colorMod));
109 markers.Add(image);
110 }
111 }
static UI ui
Definition: ELayer.cs:21
void SetPos(Component r, int x, int y, float size=0f, Vector2 posFix=default(Vector2))
Definition: Layer.cs:9
Texture2D tex
Definition: TextureData.cs:39
Dictionary< int, TextureReplace > dictReplace
Definition: TextureData.cs:57
string id
Definition: TextureData.cs:33
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67

References colorLocal, colorMod, colorUser, data, TextureData.dictReplace, fixZoom, TextureReplace.h, highlightSize, TextureData.id, imageTex, TextureReplace.index, markerFix, markers, moldMarker, scale, SetPos(), TextureReplace.source, TextureData.tex, TextureData.tileH, TextureData.tileW, ELayer.ui, Util, TextureReplace.w, and zoom.

Referenced by OnSwitchContent(), and Update().

◆ SetPos()

void LayerTextureViewer.SetPos ( Component  r,
int  x,
int  y,
float  size = 0f,
Vector2  posFix = default(Vector2) 
)
inline

Definition at line 113 of file LayerTextureViewer.cs.

114 {
115 r.Rect().anchoredPosition = new Vector2((float)(x * data.tileW) * scale * test.x - highlightSize * scale, (float)(y * data.tileH) * scale * test.y + highlightSize * scale) + posFix;
116 }

References data, highlightSize, scale, test, TextureData.tileH, and TextureData.tileW.

Referenced by RefreshPage(), and Update().

◆ Update()

void LayerTextureViewer.Update ( )
inlineprivate

Definition at line 118 of file LayerTextureViewer.cs.

119 {
120 _ = imageTex.rectTransform;
121 RectTransformUtility.ScreenPointToLocalPointInRectangle(imageTex.rectTransform, Input.mousePosition, ELayer.ui.canvas.worldCamera, out var localPoint);
122 int num = (int)localPoint.x / (int)((float)data.tileW * scale);
123 int num2 = (int)localPoint.y / (int)((float)data.tileH * scale);
124 if (EInput.axis != Vector2.zero)
125 {
126 sizeX = Mathf.Clamp(sizeX + (int)EInput.axis.x, 1, 5);
127 sizeY = Mathf.Clamp(sizeY + (int)EInput.axis.y * -1, 1, 5);
128 EInput.requireAxisReset = true;
129 }
131 {
132 SE.Tab();
133 zoom = !zoom;
134 RefreshPage();
135 }
137 highlight.SetActive(flag);
138 if (!flag)
139 {
140 return;
141 }
142 highlight.rectTransform.sizeDelta = new Vector2(((float)(data.tileW * sizeX) + highlightSize * 2f) * scale, ((float)(data.tileH * sizeY) + highlightSize * 2f) * scale);
143 SetPos(highlight, num, num2, highlightSize);
144 string text = data.id + "_";
145 int index = Mathf.Abs(num2) * 100 + num;
146 text += index;
147 textHint.text = text + ((sizeX == 1 && sizeY == 1) ? "" : ("(" + sizeX + "x" + sizeY + ")"));
149 {
150 return;
151 }
152 UIContextMenu uIContextMenu = ELayer.ui.CreateContextMenuInteraction();
153 TextureReplace replace = data.dictReplace.TryGetValue(index);
154 if (replace != null)
155 {
156 uIContextMenu.AddButton("open_replace", delegate
157 {
158 Util.Run(replace.file.FullName);
159 });
160 if (replace.source != TextureReplace.Source.Mod)
161 {
162 uIContextMenu.AddButton("delete_replace", delegate
163 {
164 try
165 {
166 data.DeleteReplace(replace);
168 }
169 catch
170 {
171 }
172 SE.Trash();
173 RefreshPage();
174 });
175 }
176 }
177 else
178 {
179 uIContextMenu.AddButton("create_replace", delegate
180 {
181 data.CreateReplace(index, CorePath.user + "Texture Replace/", TextureReplace.Source.User, sizeX, sizeY);
182 SE.Change();
183 RefreshPage();
184 });
185 }
186 if (ELayer._zone.isMapSaved && (replace == null || replace.source != TextureReplace.Source.Local))
187 {
188 uIContextMenu.AddButton("create_replaceLocal", delegate
189 {
190 string text2 = ELayer._zone.pathSave + "Texture Replace";
191 IO.CreateDirectory(text2);
192 data.CreateReplace(index, text2 + "/", TextureReplace.Source.Local, sizeX, sizeY);
193 SE.Change();
194 RefreshPage();
195 });
196 }
197 uIContextMenu.Show();
198 }
bool clicked
Definition: ButtonState.cs:37
Definition: EInput.cs:8
static ButtonState middleMouse
Definition: EInput.cs:353
static Vector2 axis
Definition: EInput.cs:331
static ButtonState leftMouse
Definition: EInput.cs:349
static Zone _zone
Definition: ELayer.cs:25
Definition: IO.cs:11
static void CreateDirectory(string path)
Definition: IO.cs:333
static bool IsPointerOver(Component c)
bool isMapSaved
Definition: Spatial.cs:358
void ForceRefresh()
Definition: TextureData.cs:98
void CreateReplace(int index, string path, TextureReplace.Source source, int sizeX, int sizeY)
Definition: TextureData.cs:174
void DeleteReplace(TextureReplace r)
Definition: TextureData.cs:214
void Show(UIItem i)
void AddButton(Func< string > funcText, UnityAction action=null)
static void Run(string itemPath)
Definition: Util.cs:242

References ELayer._zone, UIContextMenu.AddButton(), EInput.axis, ButtonState.clicked, TextureData.CreateReplace(), data, TextureData.DeleteReplace(), TextureData.dictReplace, TextureReplace.file, TextureData.ForceRefresh(), highlight, highlightSize, imageTex, Spatial.isMapSaved, InputModuleEX.IsPointerOver(), EInput.leftMouse, EInput.middleMouse, RefreshPage(), scale, SetPos(), UIContextMenu.Show(), sizeX, sizeY, TextureReplace.source, TextureData.tileH, TextureData.tileW, transMask, ELayer.ui, CorePath.user, Util, and zoom.

Member Data Documentation

◆ colorLocal

Color LayerTextureViewer.colorLocal

Definition at line 37 of file LayerTextureViewer.cs.

Referenced by RefreshPage().

◆ colorMod

Color LayerTextureViewer.colorMod

Definition at line 35 of file LayerTextureViewer.cs.

Referenced by RefreshPage().

◆ colorUser

Color LayerTextureViewer.colorUser

Definition at line 33 of file LayerTextureViewer.cs.

Referenced by RefreshPage().

◆ data

TextureData LayerTextureViewer.data

Definition at line 13 of file LayerTextureViewer.cs.

Referenced by OnSwitchContent(), RefreshPage(), SetPos(), and Update().

◆ fixZoom

bool LayerTextureViewer.fixZoom

Definition at line 43 of file LayerTextureViewer.cs.

Referenced by RefreshPage().

◆ highlight

Image LayerTextureViewer.highlight

Definition at line 9 of file LayerTextureViewer.cs.

Referenced by Update().

◆ highlightSize

float LayerTextureViewer.highlightSize

Definition at line 27 of file LayerTextureViewer.cs.

Referenced by RefreshPage(), SetPos(), and Update().

◆ imageTex

RawImage LayerTextureViewer.imageTex

Definition at line 7 of file LayerTextureViewer.cs.

Referenced by RefreshPage(), and Update().

◆ markerFix

Vector2 LayerTextureViewer.markerFix

Definition at line 31 of file LayerTextureViewer.cs.

Referenced by RefreshPage().

◆ markers

List<Image> LayerTextureViewer.markers = new List<Image>()

Definition at line 29 of file LayerTextureViewer.cs.

Referenced by RefreshPage().

◆ moldMarker

Image LayerTextureViewer.moldMarker

Definition at line 11 of file LayerTextureViewer.cs.

Referenced by RefreshPage().

◆ scale

float LayerTextureViewer.scale

Definition at line 25 of file LayerTextureViewer.cs.

Referenced by RefreshPage(), SetPos(), and Update().

◆ scrollbarH

Scrollbar LayerTextureViewer.scrollbarH

Definition at line 17 of file LayerTextureViewer.cs.

◆ scrollvarV

Scrollbar LayerTextureViewer.scrollvarV

Definition at line 19 of file LayerTextureViewer.cs.

◆ sizeX

int LayerTextureViewer.sizeX

Definition at line 39 of file LayerTextureViewer.cs.

Referenced by Update().

◆ sizeY

int LayerTextureViewer.sizeY

Definition at line 41 of file LayerTextureViewer.cs.

Referenced by Update().

◆ snow

bool LayerTextureViewer.snow

Definition at line 45 of file LayerTextureViewer.cs.

Referenced by OnInit(), and OnSwitchContent().

◆ test

Vector2 LayerTextureViewer.test

Definition at line 47 of file LayerTextureViewer.cs.

Referenced by SetPos().

◆ textHint

UIText LayerTextureViewer.textHint

Definition at line 21 of file LayerTextureViewer.cs.

◆ transMask

Transform LayerTextureViewer.transMask

Definition at line 23 of file LayerTextureViewer.cs.

Referenced by Update().

◆ view

UIScrollView LayerTextureViewer.view

Definition at line 15 of file LayerTextureViewer.cs.

◆ zoom

bool LayerTextureViewer.zoom
private

Definition at line 49 of file LayerTextureViewer.cs.

Referenced by RefreshPage(), and Update().


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