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

Public Types

enum  InputType {
  None , Default , Password , Item ,
  DistributionFilter
}
 

Public Member Functions

override void OnAfterInit ()
 
void AddButton (string text, Action onClick=null, bool close=true)
 
override void OnUpdateInput ()
 
void OnEnterInput ()
 
override void OnKill ()
 
- 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 ()
 

Static Public Member Functions

static Dialog CreateNarration (string idImage, string idText)
 
static Dialog Ok (string langDetail, Action action=null)
 
static Dialog Choice (string langDetail, Action< Dialog > action)
 
static Dialog YesNo (string langDetail, Action actionYes, Action actionNo=null, string langYes="yes", string langNo="no")
 
static Dialog List< TValue > (string langDetail, ICollection< TValue > items, Func< TValue, string > getString, Func< int, string, bool > onSelect, bool canCancel=false)
 
static void TryWarn (string lang, Action action, bool yes=true)
 
static void TryWarnSlaughter (Action action)
 
static void TryWarnCrime (Action action)
 
static void TryWarnMana (Action action)
 
static void TryWarnDisassemble (Action action)
 
static Dialog Gift (string langHeader, bool autoAdd, params Card[] cards)
 
static Dialog Gift (string langHeader, bool autoAdd, List< Card > list)
 
static Dialog Gift (string langHeader, bool autoAdd, List< GridItem > list)
 
static Dialog Recipe (List< RecipeSource > list)
 
static Dialog Confetti (string langTitle, string langDetail, string langConfetti="Grats!")
 
static Dialog ConfettiSimple (string langTitle, string langDetail, string langConfetti="Grats!")
 
static Dialog _Confetti (string idPrefab, string langTitle, string langDetail, string langConfetti="Grats!")
 
static Dialog Keymap (EInput.KeyMap keymap)
 
static Dialog InputName (string langDetail, string text, Action< bool, string > onClose, InputType inputType=InputType.Default)
 
- 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)
 

Public Attributes

Text textConfetti
 
Image image
 
UIText textDetail
 
UINote note
 
UIButtonList list
 
LayoutGroup layout
 
ScreenEffect effect
 
UIList listGrid
 
Transform spacer
 
List< GridItemgridItems = new List<GridItem>()
 
UIInputText input
 
InputType inputType
 
EInput.KeyMap keymap
 
bool isInputEnter
 
Action< bool, string > onEnterInput
 
- 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
 

Static Public Attributes

static bool warned
 
- 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" }
 

Private Member Functions

void Update ()
 

Additional Inherited Members

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

Member Enumeration Documentation

◆ InputType

Enumerator
None 
Default 
Password 
Item 
DistributionFilter 

Definition at line 8 of file Dialog.cs.

Member Function Documentation

◆ _Confetti()

static Dialog Dialog._Confetti ( string  idPrefab,
string  langTitle,
string  langDetail,
string  langConfetti = "Grats!" 
)
inlinestatic

Definition at line 506 of file Dialog.cs.

507 {
508 Dialog d = Layer.Create(idPrefab) as Dialog;
509 d.textConfetti.text = langConfetti.lang();
510 d.textDetail.SetText(langDetail.lang());
511 d.list.AddButton(null, Lang.Get("ok"), delegate
512 {
513 d.Close();
514 });
515 ELayer.ui.AddLayer(d);
516 return d;
517 }
Definition: Dialog.cs:7
UIButtonList list
Definition: Dialog.cs:25
UIText textDetail
Definition: Dialog.cs:21
Definition: ELayer.cs:4
static UI ui
Definition: ELayer.cs:21
Definition: Lang.cs:6
static string Get(string id)
Definition: Lang.cs:91
Definition: Layer.cs:9
static Layer Create(string path)
Definition: Layer.cs:299
void AddButton(object obj, string text, Action onClick, Action< UIButton > onInstantiate=null)
Definition: UIButtonList.cs:11
void SetText(string s)
Definition: UIText.cs:159

References UIButtonList.AddButton(), Layer.Create(), Lang.Get(), list, UIText.SetText(), textDetail, and ELayer.ui.

Referenced by Confetti(), and ConfettiSimple().

◆ AddButton()

void Dialog.AddButton ( string  text,
Action  onClick = null,
bool  close = true 
)
inline

Definition at line 100 of file Dialog.cs.

101 {
102 list.AddButton(null, text, delegate
103 {
104 if (onClick != null)
105 {
106 onClick();
107 }
108 if (close)
109 {
110 Close();
111 }
112 });
113 }
virtual void Close()
Definition: Layer.cs:463

References UIButtonList.AddButton(), Layer.Close(), and list.

Referenced by ListPeopleCallReserve.OnInstantiate().

◆ Choice()

static Dialog Dialog.Choice ( string  langDetail,
Action< Dialog action 
)
inlinestatic

Definition at line 235 of file Dialog.cs.

236 {
237 Dialog dialog = Layer.Create<Dialog>();
238 dialog.textDetail.SetText(langDetail.lang() + " ");
239 action(dialog);
240 ELayer.ui.AddLayer(dialog);
241 return dialog;
242 }

References Layer.Create(), UIText.SetText(), textDetail, and ELayer.ui.

Referenced by ListPeopleCallReserve.OnInstantiate().

◆ Confetti()

static Dialog Dialog.Confetti ( string  langTitle,
string  langDetail,
string  langConfetti = "Grats!" 
)
inlinestatic

Definition at line 494 of file Dialog.cs.

495 {
496 ELayer.Sound.Play("confetti");
497 return _Confetti("DialogConfetti", langTitle, langDetail, langConfetti);
498 }
static Dialog _Confetti(string idPrefab, string langTitle, string langDetail, string langConfetti="Grats!")
Definition: Dialog.cs:506
static SoundManager Sound
Definition: ELayer.cs:41

References _Confetti(), and ELayer.Sound.

◆ ConfettiSimple()

static Dialog Dialog.ConfettiSimple ( string  langTitle,
string  langDetail,
string  langConfetti = "Grats!" 
)
inlinestatic

Definition at line 500 of file Dialog.cs.

501 {
502 ELayer.Sound.Play("confettiSimple");
503 return _Confetti("DialogConfettiSimple", langTitle, langDetail, langConfetti);
504 }

References _Confetti(), and ELayer.Sound.

◆ CreateNarration()

static Dialog Dialog.CreateNarration ( string  idImage,
string  idText 
)
inlinestatic

Definition at line 212 of file Dialog.cs.

213 {
214 Dialog dialog = Layer.Create<Dialog>("DialogNarration");
215 dialog.image.SetActive(enable: true);
216 dialog.image.sprite = Resources.Load<Sprite>("Media/Graphics/Image/Dialog/" + idImage);
217 dialog.image.SetNativeSize();
219 return dialog;
220 }
static string TextNarration
Definition: CorePath.cs:63
Image image
Definition: Dialog.cs:19
Definition: IO.cs:11
static string LoadText(string _path)
Definition: IO.cs:484

References Layer.Create(), image, UIText.SetText(), textDetail, and CorePath.CorePackage.TextNarration.

Referenced by LayerNewZone.Embark().

◆ Gift() [1/3]

static Dialog Dialog.Gift ( string  langHeader,
bool  autoAdd,
List< Card list 
)
inlinestatic

Definition at line 425 of file Dialog.cs.

426 {
427 List<GridItem> list2 = new List<GridItem>();
428 foreach (Card item in list)
429 {
430 list2.Add(new GridItemCard
431 {
432 c = item
433 });
434 }
435 return Gift(langHeader, autoAdd, list2);
436 }
Definition: Card.cs:11
static Dialog Gift(string langHeader, bool autoAdd, params Card[] cards)
Definition: Dialog.cs:420

References Gift(), item, and list.

◆ Gift() [2/3]

static Dialog Dialog.Gift ( string  langHeader,
bool  autoAdd,
List< GridItem list 
)
inlinestatic

Definition at line 438 of file Dialog.cs.

439 {
440 Dialog d = Layer.Create<Dialog>();
441 d.spacer.SetActive(enable: false);
442 d.note.AddHeader(langHeader.IsEmpty("headerGift").lang());
443 d.list.AddButton(null, Lang.Get("ok"), delegate
444 {
445 if (autoAdd)
446 {
447 foreach (GridItem item in list)
448 {
449 item.AutoAdd();
450 }
451 }
452 d.Close();
453 });
454 d.option.soundActivate = null;
455 d.option.canClose = false;
456 d.gridItems = list;
457 ELayer.Sound.Play("good");
458 ELayer.ui.AddLayer(d);
459 return d;
460 }
UINote note
Definition: Dialog.cs:23
Transform spacer
Definition: Dialog.cs:33
UIItem AddHeader(string text, Sprite sprite=null)
Definition: UINote.cs:79

References UIButtonList.AddButton(), UINote.AddHeader(), Layer.Close(), Layer.Create(), Lang.Get(), item, list, note, ELayer.Sound, spacer, and ELayer.ui.

◆ Gift() [3/3]

static Dialog Dialog.Gift ( string  langHeader,
bool  autoAdd,
params Card[]  cards 
)
inlinestatic

Definition at line 420 of file Dialog.cs.

421 {
422 return Gift(langHeader, autoAdd, new List<Card>(cards));
423 }

References Gift().

Referenced by Gift(), DramaOutcome.nerun_gift(), DramaOutcome.nerun_gift2(), and DramaOutcome.nerun_gift3().

◆ InputName()

static Dialog Dialog.InputName ( string  langDetail,
string  text,
Action< bool, string >  onClose,
InputType  inputType = InputType::Default 
)
inlinestatic

Definition at line 528 of file Dialog.cs.

529 {
530 Dialog d = Layer.Create<Dialog>("DialogInput");
531 d.inputType = inputType;
532 d.langHint = langDetail;
533 d.note.AddText(langDetail.lang()).text1.alignment = TextAnchor.MiddleCenter;
534 switch (inputType)
535 {
536 case InputType.DistributionFilter:
537 d.input.field.characterLimit = 100;
538 break;
539 case InputType.Item:
540 d.input.field.characterLimit = 30;
541 break;
542 case InputType.Password:
543 d.input.field.characterLimit = 8;
544 d.input.field.contentType = InputField.ContentType.Alphanumeric;
545 break;
546 }
547 d.input.Text = text;
548 d.onEnterInput = onClose;
549 d.list.AddButton(null, Lang.Get("ok"), delegate
550 {
551 onClose(arg1: false, d.input.Text);
552 d.Close();
553 });
554 d.list.AddButton(null, Lang.Get("cancel"), delegate
555 {
556 onClose(arg1: true, "");
557 d.Close();
558 });
559 ELayer.ui.AddLayer(d);
560 return d;
561 }
InputType inputType
Definition: Dialog.cs:39
UIInputText input
Definition: Dialog.cs:37
InputType
Definition: Dialog.cs:9
string Text
Definition: UIInputText.cs:47
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113

References UIButtonList.AddButton(), UINote.AddText(), Layer.Close(), Layer.Create(), Lang.Get(), input, inputType, list, note, UIInputText.Text, and ELayer.ui.

Referenced by ActPlan._Update(), UICharaMaker.EditName(), BaseArea.ListInteractions(), BaseListPeople.OnClick(), HotAction.OnShowContextMenu(), Scene.OnUpdate(), TraitDetector.OnUse(), ContentConfigOther.OpenBackerCodeInput(), UIInventory.RefreshMenu(), TraitCoreZone.TrySetAct(), TraitNote.TrySetAct(), and TraitTeleporter.TrySetAct().

◆ Keymap()

static Dialog Dialog.Keymap ( EInput::KeyMap  keymap)
inlinestatic

Definition at line 519 of file Dialog.cs.

520 {
521 Dialog dialog = Layer.Create<Dialog>("DialogKeymap");
522 dialog.textDetail.SetText("dialog_keymap".lang(("key_" + keymap.action).lang()));
523 dialog.keymap = keymap;
524 ELayer.ui.AddLayer(dialog);
525 return dialog;
526 }
EInput.KeyMap keymap
Definition: Dialog.cs:42
static EAction action
Definition: EInput.cs:259

References EInput.action, Layer.Create(), keymap, UIText.SetText(), textDetail, and ELayer.ui.

Referenced by ContentConfigInput.OnInstantiate().

◆ List< TValue >()

static Dialog Dialog.List< TValue > ( string  langDetail,
ICollection< TValue >  items,
Func< TValue, string >  getString,
Func< int, string, bool >  onSelect,
bool  canCancel = false 
)
inlinestatic

Definition at line 268 of file Dialog.cs.

269 {
270 Dialog d = Layer.Create<Dialog>();
271 d.textDetail.SetText(langDetail.lang() + " ");
272 int num = 0;
273 foreach (TValue item in items)
274 {
275 int _i = num;
276 d.list.AddButton(null, getString(item).lang(), delegate
277 {
278 if (onSelect(_i, getString(item)))
279 {
280 d.Close();
281 }
282 });
283 num++;
284 }
285 d.option.canClose = canCancel;
286 ELayer.ui.AddLayer(d);
287 return d;
288 }

References Layer.Create(), item, UIText.SetText(), textDetail, and ELayer.ui.

◆ Ok()

static Dialog Dialog.Ok ( string  langDetail,
Action  action = null 
)
inlinestatic

Definition at line 222 of file Dialog.cs.

223 {
224 Dialog dialog = Layer.Create<Dialog>();
225 dialog.textDetail.SetText(langDetail.lang() + " ");
226 dialog.list.AddButton(null, Lang.Get("ok"), dialog.Close);
227 if (action != null)
228 {
229 dialog.SetOnKill(action);
230 }
231 ELayer.ui.AddLayer(dialog);
232 return dialog;
233 }
Layer SetOnKill(Action action)
Definition: Layer.cs:579

References UIButtonList.AddButton(), Layer.Close(), Layer.Create(), Lang.Get(), list, Layer.SetOnKill(), UIText.SetText(), textDetail, and ELayer.ui.

Referenced by Steam.CreateUserContent2(), LayerConfig.Refresh(), and UI.ToggleFeedback().

◆ OnAfterInit()

override void Dialog.OnAfterInit ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 51 of file Dialog.cs.

52 {
53 ELayer.ui.hud.textMouseHintRight.transform.parent.SetActive(enable: false);
54 textDetail.SetActive(!textDetail.text.IsEmpty());
55 listGrid.SetActive(gridItems.Count > 0);
56 if (gridItems.Count >= 8)
57 {
58 GridLayoutGroup obj = listGrid.layoutItems as GridLayoutGroup;
59 obj.constraint = GridLayoutGroup.Constraint.FixedColumnCount;
60 obj.constraintCount = 8;
61 }
62 if (gridItems.Count > 0)
63 {
65 listGrid.callbacks = new UIList.Callback<GridItem, ButtonGrid>
66 {
67 onInstantiate = delegate(GridItem a, ButtonGrid b)
68 {
69 b.SetItem(a);
70 },
71 onClick = delegate(GridItem a, ButtonGrid b)
72 {
73 a.OnClick(b);
74 }
75 };
76 foreach (GridItem gridItem in gridItems)
77 {
78 listGrid.Add(gridItem);
79 }
81 }
82 list.Refresh();
83 this.RebuildLayout(recursive: true);
84 GraphicRaycaster g = windows[0].GetComponent<GraphicRaycaster>();
85 g.enabled = false;
86 TweenUtil.Delay(0.3f, delegate
87 {
88 if ((bool)g)
89 {
90 g.enabled = true;
91 }
92 });
93 if ((bool)input)
94 {
95 input.Focus();
96 }
98 }
void SetItem(GridItem i)
Definition: ButtonGrid.cs:398
UIList listGrid
Definition: Dialog.cs:31
List< GridItem > gridItems
Definition: Dialog.cs:35
Definition: EInput.cs:8
static void WaitReleaseKey()
Definition: EInput.cs:650
virtual void OnClick(ButtonGrid b)
Definition: GridItem.cs:8
List< Window > windows
Definition: Layer.cs:116
void Focus()
Definition: UIInputText.cs:128
override void Refresh(bool highlightLast=false)
Definition: UIListEx.cs:17
Definition: UIList.cs:9
override void Clear()
Definition: UIList.cs:349
override void Add(object item)
Definition: UIList.cs:302
virtual void Refresh(bool highlightLast=false)
Definition: UIList.cs:424

References UIList.Add(), UIList.Clear(), UIInputText.Focus(), gridItems, input, list, listGrid, GridItem.OnClick(), UIList.Refresh(), UIListEx< T >.Refresh(), ButtonGrid.SetItem(), textDetail, ELayer.ui, EInput.WaitReleaseKey(), and Layer.windows.

◆ OnEnterInput()

void Dialog.OnEnterInput ( )
inline

Definition at line 192 of file Dialog.cs.

193 {
194 isInputEnter = true;
195 Close();
196 }
bool isInputEnter
Definition: Dialog.cs:45

References Layer.Close(), and isInputEnter.

◆ OnKill()

override void Dialog.OnKill ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 198 of file Dialog.cs.

199 {
200 ELayer.ui.hud.textMouseHintRight.transform.parent.SetActive(enable: true);
201 if ((bool)input && onEnterInput != null)
202 {
204 }
205 if ((bool)input)
206 {
207 input.field.DeactivateInputField();
208 }
210 }
Action< bool, string > onEnterInput
Definition: Dialog.cs:47
InputField field
Definition: UIInputText.cs:15

References UIInputText.field, input, isInputEnter, onEnterInput, UIInputText.Text, ELayer.ui, and EInput.WaitReleaseKey().

◆ OnUpdateInput()

override void Dialog.OnUpdateInput ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 123 of file Dialog.cs.

124 {
125 if ((bool)input && option.canClose && (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter)))
126 {
127 isInputEnter = true;
128 Close();
129 return;
130 }
131 if (!input.gameObject.activeInHierarchy && this.list != null)
132 {
133 foreach (UIList.ButtonPair button in this.list.buttons)
134 {
135 UIButton uIButton = button.component as UIButton;
136 if ((bool)uIButton && uIButton.interactable && !EInput.waitReleaseAnyKey && (bool)uIButton.keyText && !uIButton.keyText.text.IsEmpty() && uIButton.keyText.text == Input.inputString)
137 {
138 uIButton.onClick.Invoke();
139 return;
140 }
141 }
142 }
143 if (keymap != null)
144 {
145 List<KeyCode> list = new List<KeyCode>
146 {
147 KeyCode.Mouse0,
148 KeyCode.Mouse1,
149 KeyCode.Mouse2,
150 KeyCode.Mouse3,
151 KeyCode.Mouse4,
152 KeyCode.Escape,
153 KeyCode.Return,
154 KeyCode.LeftShift,
155 KeyCode.Delete,
156 KeyCode.Backspace
157 };
158 if (Input.GetKeyDown(KeyCode.Delete))
159 {
160 if (keymap.required)
161 {
162 SE.Beep();
163 return;
164 }
165 SE.Tab();
166 keymap.key = KeyCode.None;
167 Close();
168 return;
169 }
170 foreach (KeyCode value in Enum.GetValues(typeof(KeyCode)))
171 {
172 if (list.Contains(value) || !Input.GetKey(value))
173 {
174 continue;
175 }
176 foreach (EInput.KeyMap item in ELayer.core.config.input.keys.List())
177 {
178 if (item.key == value && item.GetGroup() == keymap.GetGroup())
179 {
180 item.key = keymap.key;
181 }
182 }
183 keymap.key = value;
184 SE.Tab();
185 Close();
186 return;
187 }
188 }
189 base.OnUpdateInput();
190 }
EInput.KeyMapManager keys
Definition: CoreConfig.cs:259
InputSetting input
Definition: CoreConfig.cs:602
CoreConfig config
Definition: Core.cs:70
static bool waitReleaseAnyKey
Definition: EInput.cs:317
static Core core
Definition: ELayer.cs:7
bool canClose
Definition: Layer.cs:29
Option option
Definition: Layer.cs:84
UIText keyText
Definition: UIButton.cs:108

References Layer.Option.canClose, Layer.Close(), Core.config, ELayer.core, CoreConfig.input, input, isInputEnter, item, keymap, CoreConfig.InputSetting.keys, UIButton.keyText, list, Layer.option, and EInput.waitReleaseAnyKey.

◆ Recipe()

static Dialog Dialog.Recipe ( List< RecipeSource list)
inlinestatic

Definition at line 462 of file Dialog.cs.

463 {
464 Dialog d = Layer.Create<Dialog>();
465 d.spacer.SetActive(enable: false);
466 d.note.AddHeader("giftRecipe".lang());
467 d.list.AddButton(null, Lang.Get("ok"), delegate
468 {
469 d.Close();
470 });
471 d.option.soundActivate = null;
472 for (int i = 0; i < list.Count; i++)
473 {
474 RecipeSource recipeSource = list[i];
475 List<Recipe.Ingredient> ingredients = recipeSource.GetIngredients();
476 if (ingredients.Count > 0 && ELayer.sources.cards.map.ContainsKey(ingredients[0].id))
477 {
478 ELayer.sources.cards.map[ingredients[0].id].GetName();
479 }
480 d.note.AddText("・" + recipeSource.Name.ToTitleCase());
481 if (i >= 9 && list.Count > 10)
482 {
483 d.note.Space(6);
484 d.note.AddText("moreRecipes".lang((list.Count - 10).ToString() ?? ""));
485 break;
486 }
487 }
488 d.SetOnKill(SE.Click);
489 ELayer.Sound.Play("idea");
490 ELayer.ui.AddLayer(d);
491 return d;
492 }
static SourceManager sources
Definition: ELayer.cs:37
List< Recipe.Ingredient > GetIngredients()
Definition: Recipe.cs:7
Dictionary< string, CardRow > map
Definition: SourceCard.cs:8
SourceCard cards
void Space(int sizeY=0, int sizeX=1)
Definition: UINote.cs:62

References UIButtonList.AddButton(), UINote.AddHeader(), UINote.AddText(), SourceManager.cards, Layer.Close(), Layer.Create(), Lang.Get(), RecipeSource.GetIngredients(), list, SourceCard.map, RecipeSource.Name, note, Layer.SetOnKill(), ELayer.Sound, ELayer.sources, UINote.Space(), spacer, and ELayer.ui.

◆ TryWarn()

static void Dialog.TryWarn ( string  lang,
Action  action,
bool  yes = true 
)
inlinestatic

Definition at line 290 of file Dialog.cs.

291 {
292 Dialog d = Layer.Create<Dialog>();
293 d.textDetail.SetText(lang.lang() + " ");
294 d.SetOnKill(delegate
295 {
296 ELayer.core.actionsNextFrame.Add(delegate
297 {
298 ActPlan.warning = false;
299 });
300 });
301 d.list.AddButton(null, Lang.Get("yes"), delegate
302 {
303 d.Close();
304 Commit();
305 });
306 if (yes)
307 {
308 d.list.AddButton(null, Lang.Get("yes_dontask"), delegate
309 {
310 switch (lang)
311 {
312 case "warn_crime":
313 ELayer.core.config.game.ignoreWarnCrime = true;
314 break;
315 case "warn_mana":
316 ELayer.core.config.game.ignoreWarnMana = true;
317 break;
318 case "warn_disassemble":
319 ELayer.core.config.game.ignoreWarnDisassemble = true;
320 break;
321 case "warn_slaughter":
322 ELayer.core.config.game.ignoreWarnSlaughter = true;
323 break;
324 }
325 d.Close();
326 Commit();
327 });
328 }
329 d.list.AddButton(null, Lang.Get("no"), delegate
330 {
331 d.Close();
332 });
333 if (!yes)
334 {
335 d.list.AddButton(null, Lang.Get("no_dontask"), delegate
336 {
337 string text = lang;
338 if (!(text == "warn_parallels"))
339 {
340 if (text == "warn_linuxMod")
341 {
342 ELayer.core.config.ignoreLinuxModWarning = true;
343 }
344 }
345 else
346 {
347 ELayer.core.config.ignoreParallelsWarning = true;
348 }
349 d.Close();
350 });
351 }
352 ELayer.ui.AddLayer(d);
353 void Commit()
354 {
355 warned = true;
356 action();
357 warned = false;
358 }
359 }
List< Action > actionsNextFrame
Definition: BaseCore.cs:31
static bool warned
Definition: Dialog.cs:49

References BaseCore.actionsNextFrame, UIButtonList.AddButton(), Layer.Close(), ELayer.core, Layer.Create(), Lang.Get(), list, Layer.SetOnKill(), UIText.SetText(), textDetail, ELayer.ui, and warned.

Referenced by TryWarnCrime(), TryWarnDisassemble(), Scene.TryWarnLinuxMod(), Scene.TryWarnMacScreen(), TryWarnMana(), and TryWarnSlaughter().

◆ TryWarnCrime()

static void Dialog.TryWarnCrime ( Action  action)
inlinestatic

Definition at line 376 of file Dialog.cs.

377 {
379 {
380 warned = true;
381 action();
382 warned = false;
383 ActPlan.warning = false;
384 }
385 else
386 {
387 TryWarn("warn_crime", action);
388 }
389 }
new GameConfig game
Definition: CoreConfig.cs:596
static void TryWarn(string lang, Action action, bool yes=true)
Definition: Dialog.cs:290

References Core.config, ELayer.core, CoreConfig.game, CoreConfig.GameConfig.ignoreWarnCrime, TryWarn(), CoreConfig.GameConfig.warnCrime, and warned.

Referenced by ActPlan.Item.Perform().

◆ TryWarnDisassemble()

static void Dialog.TryWarnDisassemble ( Action  action)
inlinestatic

Definition at line 406 of file Dialog.cs.

407 {
409 {
410 warned = true;
411 action();
412 warned = false;
413 }
414 else
415 {
416 TryWarn("warn_disassemble", action);
417 }
418 }

References Core.config, ELayer.core, CoreConfig.game, CoreConfig.GameConfig.ignoreWarnDisassemble, TryWarn(), CoreConfig.GameConfig.warnDisassemble, and warned.

Referenced by ActPlan.Item.Perform().

◆ TryWarnMana()

static void Dialog.TryWarnMana ( Action  action)
inlinestatic

Definition at line 391 of file Dialog.cs.

392 {
394 {
395 warned = true;
396 action();
397 warned = false;
398 ActPlan.warning = false;
399 }
400 else
401 {
402 TryWarn("warn_mana", action);
403 }
404 }

References Core.config, ELayer.core, CoreConfig.game, CoreConfig.GameConfig.ignoreWarnMana, TryWarn(), warned, and CoreConfig.GameConfig.warnMana.

Referenced by ActRanged.Perform(), and Chara.UseAbility().

◆ TryWarnSlaughter()

static void Dialog.TryWarnSlaughter ( Action  action)
inlinestatic

Definition at line 361 of file Dialog.cs.

362 {
364 {
365 warned = true;
366 action();
367 warned = false;
368 ActPlan.warning = false;
369 }
370 else
371 {
372 TryWarn("warn_slaughter", action);
373 }
374 }

References Core.config, ELayer.core, CoreConfig.game, CoreConfig.GameConfig.ignoreWarnSlaughter, TryWarn(), and warned.

Referenced by TraitToolButcher.TrySetHeldAct().

◆ Update()

void Dialog.Update ( )
inlineprivate

Definition at line 115 of file Dialog.cs.

116 {
117 if ((bool)input && option.canClose && Input.GetKeyDown(KeyCode.Escape))
118 {
119 Close();
120 }
121 }

References Layer.Option.canClose, Layer.Close(), input, and Layer.option.

◆ YesNo()

static Dialog Dialog.YesNo ( string  langDetail,
Action  actionYes,
Action  actionNo = null,
string  langYes = "yes",
string  langNo = "no" 
)
inlinestatic

Definition at line 244 of file Dialog.cs.

245 {
246 Dialog d = Layer.Create<Dialog>();
247 d.textDetail.SetText(langDetail.lang() + " ");
248 d.list.AddButton(null, Lang.Get(langYes), delegate
249 {
250 if (actionYes != null)
251 {
252 actionYes();
253 }
254 d.Close();
255 });
256 d.list.AddButton(null, Lang.Get(langNo), delegate
257 {
258 if (actionNo != null)
259 {
260 actionNo();
261 }
262 d.Close();
263 });
264 ELayer.ui.AddLayer(d);
265 return d;
266 }

References UIButtonList.AddButton(), Layer.Close(), Layer.Create(), Lang.Get(), list, UIText.SetText(), textDetail, and ELayer.ui.

Referenced by Player.ExitBorder(), Game.GotoTitle(), TraitNewZone.MoveZone(), LayerConfig.OnInit(), LayerMod.OnInit(), TraitDeed.OnRead(), TraitDeedRelocate.OnRead(), WidgetHotbar.OnSetContextMenu(), TraitRope.OnUse(), Game.Quit(), LayerHome.RefreshFeat(), LayerLoadGame.RefreshInfo(), AM_Copy.RefreshMenu(), ContentConfigOther.ResetWindows(), ContentQuest.SelectQuest(), LayerFeedback.Submit(), and TraitCoreZone.TrySetAct().

Member Data Documentation

◆ effect

ScreenEffect Dialog.effect

Definition at line 29 of file Dialog.cs.

◆ gridItems

List<GridItem> Dialog.gridItems = new List<GridItem>()

Definition at line 35 of file Dialog.cs.

Referenced by OnAfterInit().

◆ image

Image Dialog.image

Definition at line 19 of file Dialog.cs.

Referenced by CreateNarration().

◆ input

UIInputText Dialog.input

Definition at line 37 of file Dialog.cs.

Referenced by InputName(), OnAfterInit(), OnKill(), OnUpdateInput(), and Update().

◆ inputType

InputType Dialog.inputType

Definition at line 39 of file Dialog.cs.

Referenced by InputName().

◆ isInputEnter

bool Dialog.isInputEnter

Definition at line 45 of file Dialog.cs.

Referenced by OnEnterInput(), OnKill(), and OnUpdateInput().

◆ keymap

EInput.KeyMap Dialog.keymap

Definition at line 42 of file Dialog.cs.

Referenced by Keymap(), and OnUpdateInput().

◆ layout

LayoutGroup Dialog.layout

Definition at line 27 of file Dialog.cs.

◆ list

◆ listGrid

UIList Dialog.listGrid

Definition at line 31 of file Dialog.cs.

Referenced by OnAfterInit().

◆ note

UINote Dialog.note

Definition at line 23 of file Dialog.cs.

Referenced by Gift(), InputName(), LayerGacha.PlayGacha(), and Recipe().

◆ onEnterInput

Action<bool, string> Dialog.onEnterInput

Definition at line 47 of file Dialog.cs.

Referenced by OnKill().

◆ spacer

Transform Dialog.spacer

Definition at line 33 of file Dialog.cs.

Referenced by Gift(), and Recipe().

◆ textConfetti

Text Dialog.textConfetti

Definition at line 17 of file Dialog.cs.

◆ textDetail

UIText Dialog.textDetail

◆ warned


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