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

Public Member Functions

override void OnInit ()
 
void SetCanvas (TraitCanvas c)
 
- 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

PixelPaint paint
 
GridLayoutGroup layoutColors
 
ColorPicker picker
 
Action onApply
 
- 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
 

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 6 of file LayerPixelPaint.cs.

Member Function Documentation

◆ OnInit()

override void LayerPixelPaint.OnInit ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 16 of file LayerPixelPaint.cs.

17 {
18 UIItem t = layoutColors.CreateMold<UIItem>();
19 for (int i = 0; i < 8; i++)
20 {
22 int _i = i;
23 item.button1.icon.color = IntColor.FromInt(ELayer.core.config.colors[_i]);
24 item.button1.SetOnClick(delegate
25 {
26 picker.SelectColor(item.button1.icon.color);
27 });
28 item.button2.SetOnClick(delegate
29 {
30 item.button1.icon.color = picker.SelectedColor;
32 SE.Tab();
33 });
34 }
35 layoutColors.RebuildLayout();
36 windows[0].AddBottomButton("apply", delegate
37 {
38 onApply?.Invoke();
39 });
40 windows[0].AddBottomButton("cancel", delegate
41 {
42 Close();
43 });
44 paint.Init();
45 }
int[] colors
Definition: CoreConfig.cs:616
CoreConfig config
Definition: Core.cs:70
Definition: ELayer.cs:4
static Core core
Definition: ELayer.cs:7
void SelectColor(Color newColor)
Definition: ColorPicker.cs:218
static int ToInt(ref Color c)
Definition: IntColor.cs:24
static Color32 FromInt(int i)
Definition: IntColor.cs:15
PixelPaint paint
GridLayoutGroup layoutColors
ColorPicker picker
List< Window > windows
Definition: Layer.cs:116
virtual void Close()
Definition: Layer.cs:463
void Init()
Definition: PixelPaint.cs:92
Definition: UIItem.cs:5
Definition: Util.cs:10
static Transform Instantiate(string path, Component parent=null)
Definition: Util.cs:67

References Layer.Close(), CoreConfig.colors, Core.config, ELayer.core, IntColor.FromInt(), PixelPaint.Init(), item, layoutColors, onApply, paint, picker, Empyrean.ColorPicker.ColorPicker.SelectColor(), Empyrean.ColorPicker.ColorPicker.SelectedColor, IntColor.ToInt(), Util, and Layer.windows.

◆ SetCanvas()

void LayerPixelPaint.SetCanvas ( TraitCanvas  c)
inline

Definition at line 47 of file LayerPixelPaint.cs.

48 {
49 onApply = delegate
50 {
51 c.owner.PlaySound(c.owner.material.GetSoundImpact());
53 Thing thing = c.owner.Split(1);
54 thing.c_textureData = paint.tex.EncodeToPNG();
55 thing.isModified = true;
56 thing.ClearPaintSprite();
57 thing.GetPaintSprite();
58 thing.renderer.RefreshSprite();
59 Close();
60 };
61 if (c.owner.c_textureData != null)
62 {
63 paint.tex.LoadImage(c.owner.c_textureData);
64 }
65 paint.imageMask.texture = c.owner.GetSprite().texture;
66 paint.imageMask.SetNativeSize();
67 paint.imagePreview.SetNativeSize();
68 }
AnimeID
Definition: AnimeID.cs:2
void PlayAnime(AnimeID id, bool force)
void RefreshSprite()
Thing Split(int a)
Definition: Card.cs:3231
SourceMaterial.Row material
Definition: Card.cs:1927
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:5404
Sprite GetPaintSprite()
Definition: Card.cs:6280
virtual Sprite GetSprite(int dir=0)
Definition: Card.cs:5341
byte[] c_textureData
Definition: Card.cs:1805
CardRenderer renderer
Definition: Card.cs:57
void ClearPaintSprite()
Definition: Card.cs:6270
RawImage imagePreview
Definition: PixelPaint.cs:11
Texture2D tex
Definition: PixelPaint.cs:23
RawImage imageMask
Definition: PixelPaint.cs:13
Definition: Thing.cs:8
Card owner
Definition: Trait.cs:26

References Card.c_textureData, Card.ClearPaintSprite(), Layer.Close(), Card.GetPaintSprite(), Card.GetSprite(), PixelPaint.imageMask, PixelPaint.imagePreview, Card.material, onApply, Trait.owner, paint, CardRenderer.PlayAnime(), Card.PlaySound(), CardRenderer.RefreshSprite(), Card.renderer, Card.Split(), and PixelPaint.tex.

Member Data Documentation

◆ layoutColors

GridLayoutGroup LayerPixelPaint.layoutColors

Definition at line 10 of file LayerPixelPaint.cs.

Referenced by OnInit().

◆ onApply

Action LayerPixelPaint.onApply

Definition at line 14 of file LayerPixelPaint.cs.

Referenced by OnInit(), and SetCanvas().

◆ paint

PixelPaint LayerPixelPaint.paint

Definition at line 8 of file LayerPixelPaint.cs.

Referenced by OnInit(), and SetCanvas().

◆ picker

ColorPicker LayerPixelPaint.picker

Definition at line 12 of file LayerPixelPaint.cs.

Referenced by OnInit().


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