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

Public Member Functions

void Activate (Chara _chara, PCCData _pcc=null, Action< Color > _action=null)
 
void RefreshButtons ()
 
void OnClickClear ()
 
void RefreshHairColor ()
 
void RefreshList ()
 
- 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

Portrait portrait
 
Chara chara
 
UISlider sliderPortrait
 
UIColorPicker uiPicker
 
UIDynamicList list
 
PCCData pcc
 
UIButton buttonGender
 
UIButton buttonUnique
 
Color hairColor
 
Action< Coloraction
 
- 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 Attributes

bool hasColorChanged
 
bool gender = true
 
bool unique
 

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 LayerEditPortrait.cs.

Member Function Documentation

◆ Activate()

void LayerEditPortrait.Activate ( Chara  _chara,
PCCData  _pcc = null,
Action< Color _action = null 
)
inline

Definition at line 34 of file LayerEditPortrait.cs.

35 {
36 chara = _chara;
37 pcc = _pcc;
38 action = _action;
39 if (action == null)
40 {
41 action = delegate
42 {
43 };
44 }
46 if (chara.GetInt(105) == 0)
47 {
49 }
50 else
51 {
53 }
54 if (pcc != null)
55 {
56 hairColor = pcc.GetHairColor();
57 }
59 {
60 ColorUtility.TryParseHtmlString("#" + ColorUtility.ToHtmlStringRGBA(_c), out var color);
61 if (pcc == null)
62 {
63 chara.SetInt(105, IntColor.ToInt(color));
64 }
65 else
66 {
67 pcc.SetColor("hair", color);
68 }
70 action(color);
71 hairColor = color;
72 hasColorChanged = true;
73 });
75 InvokeRepeating("RefreshHairColor", 0f, 0.1f);
76 buttonGender = windows[0].AddBottomButton("portrait_gender", delegate
77 {
78 gender = !gender;
80 list.List();
81 });
82 buttonUnique = windows[0].AddBottomButton("portrait_unique", delegate
83 {
84 unique = !unique;
86 list.List();
87 });
89 }
PickerState
Definition: PickerState.cs:2
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
static int ToInt(ref Color c)
Definition: IntColor.cs:24
static Color32 FromInt(int i)
Definition: IntColor.cs:15
Action< Color > action
UIDynamicList list
UIColorPicker uiPicker
List< Window > windows
Definition: Layer.cs:116
Color GetRandomHairColor(Chara c)
Definition: Portrait.cs:205
void SetChara(Chara c, PCCData pccData=null)
Definition: Portrait.cs:138
void SetColor(Color _startColor, Color _resetColor, Action< PickerState, Color > _onChangeColor)
override void List()

References action, buttonGender, buttonUnique, chara, Color, IntColor.FromInt(), gender, BaseCard.GetInt(), Portrait.GetRandomHairColor(), hairColor, hasColorChanged, if(), list, UIDynamicList.List(), pcc, portrait, RefreshButtons(), RefreshList(), Portrait.SetChara(), UIColorPicker.SetColor(), BaseCard.SetInt(), IntColor.ToInt(), uiPicker, unique, and Layer.windows.

◆ OnClickClear()

void LayerEditPortrait.OnClickClear ( )
inline

Definition at line 99 of file LayerEditPortrait.cs.

100 {
101 SE.Trash();
102 chara.c_idPortrait = null;
105 }

References action, chara, hairColor, pcc, portrait, and Portrait.SetChara().

◆ RefreshButtons()

void LayerEditPortrait.RefreshButtons ( )
inline

Definition at line 91 of file LayerEditPortrait.cs.

92 {
93 buttonGender.mainText.SetText("portrait_gender".lang() + " (" + (gender ? "On" : "Off") + ")");
94 buttonUnique.mainText.SetText("portrait_unique".lang() + " (" + (unique ? "On" : "Off") + ")");
95 buttonGender.RebuildLayout();
96 buttonUnique.RebuildLayout();
97 }
UIText mainText
Definition: UIButton.cs:102
void SetText(string s)
Definition: UIText.cs:159

References buttonGender, buttonUnique, gender, UIButton.mainText, UIText.SetText(), and unique.

Referenced by Activate().

◆ RefreshHairColor()

void LayerEditPortrait.RefreshHairColor ( )
inline

Definition at line 107 of file LayerEditPortrait.cs.

108 {
109 if (hasColorChanged)
110 {
111 list.Redraw();
112 hasColorChanged = false;
113 }
114 }
override void Redraw()

References hasColorChanged, list, and UIDynamicList.Redraw().

◆ RefreshList()

void LayerEditPortrait.RefreshList ( )
inline

Definition at line 116 of file LayerEditPortrait.cs.

117 {
118 list.Clear();
119 list.callbacks = new UIList.Callback<ModItem<Sprite>, Portrait>
120 {
121 onClick = delegate(ModItem<Sprite> a, Portrait b)
122 {
123 list.Select(a);
124 SE.Click();
125 chara.c_idPortrait = a.id;
128 },
129 onRedraw = delegate(ModItem<Sprite> a, Portrait b, int i)
130 {
131 b.mainText.SetText(a.id);
133 b.tooltip.lang = a.id;
134 },
135 onList = delegate
136 {
137 int num = (gender ? chara.bio.gender : 0);
138 IEnumerable<ModItem<Sprite>> enumerable = Portrait.ListPortraits(num, "c").Concat(Portrait.ListPortraits(num, "guard")).Concat(Portrait.ListPortraits(num, "special"))
139 .Concat(Portrait.ListPortraits(num, "foxfolk"));
140 if (unique)
141 {
142 enumerable = enumerable.Concat(Portrait.ListPortraits(0, "UN"));
143 }
144 foreach (ModItem<Sprite> item in enumerable.ToList())
145 {
146 list.Add(item);
147 }
148 }
149 };
150 list.List();
152 }
string c_idPortrait
Definition: Card.cs:1409
string id
Definition: ModItem.cs:10
static List< ModItem< Sprite > > ListPortraits(string idDict)
Definition: Portrait.cs:59
void SetPortrait(string id, Color colorOverlay=default(Color), bool applyColorMod=true)
Definition: Portrait.cs:213
override void Add(object o)
bool Select(object o, bool invoke=false)
override void Clear()
Definition: UIList.cs:9

References action, UIDynamicList.Add(), Card.c_idPortrait, chara, UIDynamicList.Clear(), gender, hairColor, ModItem< T >.id, item, list, UIDynamicList.List(), Portrait.ListPortraits(), UIButton.mainText, pcc, portrait, UIDynamicList.Select(), Portrait.SetChara(), Portrait.SetPortrait(), UIText.SetText(), and unique.

Referenced by Activate().

Member Data Documentation

◆ action

Action<Color> LayerEditPortrait.action

Definition at line 26 of file LayerEditPortrait.cs.

Referenced by Activate(), OnClickClear(), and RefreshList().

◆ buttonGender

UIButton LayerEditPortrait.buttonGender

Definition at line 20 of file LayerEditPortrait.cs.

Referenced by Activate(), and RefreshButtons().

◆ buttonUnique

UIButton LayerEditPortrait.buttonUnique

Definition at line 22 of file LayerEditPortrait.cs.

Referenced by Activate(), and RefreshButtons().

◆ chara

Chara LayerEditPortrait.chara

Definition at line 10 of file LayerEditPortrait.cs.

Referenced by Activate(), OnClickClear(), and RefreshList().

◆ gender

bool LayerEditPortrait.gender = true
private

Definition at line 30 of file LayerEditPortrait.cs.

Referenced by Activate(), RefreshButtons(), and RefreshList().

◆ hairColor

Color LayerEditPortrait.hairColor

Definition at line 24 of file LayerEditPortrait.cs.

Referenced by Activate(), OnClickClear(), and RefreshList().

◆ hasColorChanged

bool LayerEditPortrait.hasColorChanged
private

Definition at line 28 of file LayerEditPortrait.cs.

Referenced by Activate(), and RefreshHairColor().

◆ list

UIDynamicList LayerEditPortrait.list

Definition at line 16 of file LayerEditPortrait.cs.

Referenced by Activate(), RefreshHairColor(), and RefreshList().

◆ pcc

PCCData LayerEditPortrait.pcc

Definition at line 18 of file LayerEditPortrait.cs.

Referenced by Activate(), OnClickClear(), and RefreshList().

◆ portrait

Portrait LayerEditPortrait.portrait

Definition at line 8 of file LayerEditPortrait.cs.

Referenced by Activate(), OnClickClear(), and RefreshList().

◆ sliderPortrait

UISlider LayerEditPortrait.sliderPortrait

Definition at line 12 of file LayerEditPortrait.cs.

◆ uiPicker

UIColorPicker LayerEditPortrait.uiPicker

Definition at line 14 of file LayerEditPortrait.cs.

Referenced by Activate().

◆ unique

bool LayerEditPortrait.unique
private

Definition at line 32 of file LayerEditPortrait.cs.

Referenced by Activate(), RefreshButtons(), and RefreshList().


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