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

Public Types

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

Public Member Functions

override void OnAfterInit ()
 
void AddButton (string text, Action onClick=null, bool close=true)
 
override bool OnBack ()
 
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, string text=null)
 
static void TryWarnSlaughter (Action action, Chara c)
 
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 
Chat 

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 514 of file Dialog.cs.

515 {
516 Dialog d = Layer.Create(idPrefab) as Dialog;
517 d.textConfetti.text = langConfetti.lang();
518 d.textDetail.SetText(langDetail.lang());
519 d.list.AddButton(null, Lang.Get("ok"), delegate
520 {
521 d.Close();
522 });
523 ELayer.ui.AddLayer(d);
524 return d;
525 }
Definition: Dialog.cs:7
UIButtonList list
Definition: Dialog.cs:26
UIText textDetail
Definition: Dialog.cs:22
Definition: ELayer.cs:4
static UI ui
Definition: ELayer.cs:21
Definition: Lang.cs:7
static string Get(string id)
Definition: Lang.cs:94
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:163

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 101 of file Dialog.cs.

102 {
103 list.AddButton(null, text, delegate
104 {
105 if (onClick != null)
106 {
107 onClick();
108 }
109 if (close)
110 {
111 Close();
112 }
113 });
114 }
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 243 of file Dialog.cs.

244 {
245 Dialog dialog = Layer.Create<Dialog>();
246 dialog.textDetail.SetText(langDetail.lang() + " ");
247 action(dialog);
248 ELayer.ui.AddLayer(dialog);
249 return dialog;
250 }

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 502 of file Dialog.cs.

503 {
504 ELayer.Sound.Play("confetti");
505 return _Confetti("DialogConfetti", langTitle, langDetail, langConfetti);
506 }
static Dialog _Confetti(string idPrefab, string langTitle, string langDetail, string langConfetti="Grats!")
Definition: Dialog.cs:514
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 508 of file Dialog.cs.

509 {
510 ELayer.Sound.Play("confettiSimple");
511 return _Confetti("DialogConfettiSimple", langTitle, langDetail, langConfetti);
512 }

References _Confetti(), and ELayer.Sound.

◆ CreateNarration()

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

Definition at line 220 of file Dialog.cs.

221 {
222 Dialog dialog = Layer.Create<Dialog>("DialogNarration");
223 dialog.image.SetActive(enable: true);
224 dialog.image.sprite = Resources.Load<Sprite>("Media/Graphics/Image/Dialog/" + idImage);
225 dialog.image.SetNativeSize();
227 return dialog;
228 }
static string TextNarration
Definition: CorePath.cs:63
Image image
Definition: Dialog.cs:20
Definition: IO.cs:11
static string LoadText(string _path)
Definition: IO.cs:489

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 433 of file Dialog.cs.

434 {
435 List<GridItem> list2 = new List<GridItem>();
436 foreach (Card item in list)
437 {
438 list2.Add(new GridItemCard
439 {
440 c = item
441 });
442 }
443 return Gift(langHeader, autoAdd, list2);
444 }
Definition: Card.cs:11
static Dialog Gift(string langHeader, bool autoAdd, params Card[] cards)
Definition: Dialog.cs:428

References Gift(), item, and list.

◆ Gift() [2/3]

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

Definition at line 446 of file Dialog.cs.

447 {
448 Dialog d = Layer.Create<Dialog>();
449 d.spacer.SetActive(enable: false);
450 d.note.AddHeader(langHeader.IsEmpty("headerGift").lang());
451 d.list.AddButton(null, Lang.Get("ok"), delegate
452 {
453 if (autoAdd)
454 {
455 foreach (GridItem item in list)
456 {
457 item.AutoAdd();
458 }
459 }
460 d.Close();
461 });
462 d.option.soundActivate = null;
463 d.option.canClose = false;
464 d.gridItems = list;
465 ELayer.Sound.Play("good");
466 ELayer.ui.AddLayer(d);
467 return d;
468 }
UINote note
Definition: Dialog.cs:24
Transform spacer
Definition: Dialog.cs:34
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 428 of file Dialog.cs.

429 {
430 return Gift(langHeader, autoAdd, new List<Card>(cards));
431 }

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 536 of file Dialog.cs.

537 {
538 Dialog d = Layer.Create<Dialog>("DialogInput");
539 d.inputType = inputType;
540 d.langHint = langDetail;
541 d.note.AddText(langDetail.lang()).text1.alignment = TextAnchor.MiddleCenter;
542 switch (inputType)
543 {
544 case InputType.Chat:
545 d.input.field.characterLimit = 500;
546 break;
547 case InputType.DistributionFilter:
548 d.input.field.characterLimit = 100;
549 break;
550 case InputType.Item:
551 d.input.field.characterLimit = 30;
552 break;
553 case InputType.Password:
554 d.input.field.characterLimit = 8;
555 d.input.field.contentType = InputField.ContentType.Alphanumeric;
556 break;
557 }
558 d.input.Text = text;
559 d.onEnterInput = onClose;
560 d.list.AddButton(null, Lang.Get("ok"), delegate
561 {
562 onClose(arg1: false, d.input.Text);
563 d.Close();
564 });
565 d.list.AddButton(null, Lang.Get("cancel"), delegate
566 {
567 onClose(arg1: true, "");
568 d.Close();
569 });
570 ELayer.ui.AddLayer(d);
571 return d;
572 }
InputType inputType
Definition: Dialog.cs:40
UIInputText input
Definition: Dialog.cs:38
InputType
Definition: Dialog.cs:9
string Text
Definition: UIInputText.cs:49
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 AM_Adv._OnUpdateInput(), ActPlan._Update(), UICharaMaker.EditName(), BaseArea.ListInteractions(), BaseListPeople.OnClick(), HotAction.OnShowContextMenu(), Scene.OnUpdate(), TraitDetector.OnUse(), ContentConfigOther.OpenBackerCodeInput(), ActEffect.Proc(), LayerLoadGame.RefreshInfo(), UIInventory.RefreshMenu(), TraitCoreZone.TrySetAct(), TraitNote.TrySetAct(), TraitTeleporter.TrySetAct(), and TraitWaystone.TrySetAct().

◆ Keymap()

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

Definition at line 527 of file Dialog.cs.

528 {
529 Dialog dialog = Layer.Create<Dialog>("DialogKeymap");
530 dialog.textDetail.SetText("dialog_keymap".lang(("key_" + keymap.action).lang()));
531 dialog.keymap = keymap;
532 ELayer.ui.AddLayer(dialog);
533 return dialog;
534 }
EInput.KeyMap keymap
Definition: Dialog.cs:43
static EAction action
Definition: EInput.cs:270

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 276 of file Dialog.cs.

277 {
278 Dialog d = Layer.Create<Dialog>();
279 d.textDetail.SetText(langDetail.lang() + " ");
280 int num = 0;
281 foreach (TValue item in items)
282 {
283 int _i = num;
284 d.list.AddButton(null, getString(item).lang(), delegate
285 {
286 if (onSelect(_i, getString(item)))
287 {
288 d.Close();
289 }
290 });
291 num++;
292 }
293 d.option.canClose = canCancel;
294 ELayer.ui.AddLayer(d);
295 return d;
296 }

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

◆ Ok()

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

Definition at line 230 of file Dialog.cs.

231 {
232 Dialog dialog = Layer.Create<Dialog>();
233 dialog.textDetail.SetText(langDetail.lang() + " ");
234 dialog.list.AddButton(null, Lang.Get("ok"), dialog.Close);
235 if (action != null)
236 {
237 dialog.SetOnKill(action);
238 }
239 ELayer.ui.AddLayer(dialog);
240 return dialog;
241 }
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 52 of file Dialog.cs.

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

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.

◆ OnBack()

override bool Dialog.OnBack ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 124 of file Dialog.cs.

125 {
127 {
128 return false;
129 }
130 return base.OnBack();
131 }
bool usedKey
Definition: ButtonState.cs:55
bool pressing
Definition: ButtonState.cs:35
static ButtonState rightMouse
Definition: EInput.cs:362

References keymap, ButtonState.pressing, EInput.rightMouse, and ButtonState.usedKey.

◆ OnEnterInput()

void Dialog.OnEnterInput ( )
inline

Definition at line 200 of file Dialog.cs.

201 {
202 isInputEnter = true;
203 Close();
204 }
bool isInputEnter
Definition: Dialog.cs:46

References Layer.Close(), and isInputEnter.

◆ OnKill()

override void Dialog.OnKill ( )
inlinevirtual

Reimplemented from Layer.

Definition at line 206 of file Dialog.cs.

207 {
208 ELayer.ui.hud.textMouseHintRight.transform.parent.SetActive(enable: true);
209 if ((bool)input && onEnterInput != null)
210 {
212 }
213 if ((bool)input)
214 {
215 input.field.DeactivateInputField();
216 }
218 }
Action< bool, string > onEnterInput
Definition: Dialog.cs:48
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 133 of file Dialog.cs.

134 {
135 if ((bool)input && option.canClose && (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter)) && keymap == null)
136 {
137 isInputEnter = true;
138 Close();
139 return;
140 }
141 if (!input.gameObject.activeInHierarchy && this.list != null)
142 {
143 foreach (UIList.ButtonPair button in this.list.buttons)
144 {
145 UIButton uIButton = button.component as UIButton;
146 if ((bool)uIButton && uIButton.interactable && !EInput.waitReleaseAnyKey && (bool)uIButton.keyText && !uIButton.keyText.text.IsEmpty() && uIButton.keyText.text == Input.inputString)
147 {
148 uIButton.onClick.Invoke();
149 return;
150 }
151 }
152 }
153 if (keymap != null)
154 {
155 List<KeyCode> list = new List<KeyCode>
156 {
157 KeyCode.Mouse0,
158 KeyCode.Mouse1,
159 KeyCode.Mouse2,
160 KeyCode.Mouse3,
161 KeyCode.Mouse4,
162 KeyCode.Escape,
163 KeyCode.LeftShift,
164 KeyCode.Delete
165 };
166 if (Input.GetKeyDown(KeyCode.Delete))
167 {
168 if (keymap.required)
169 {
170 SE.Beep();
171 return;
172 }
173 SE.Tab();
174 keymap.key = KeyCode.None;
175 Close();
176 return;
177 }
178 foreach (KeyCode value in Enum.GetValues(typeof(KeyCode)))
179 {
180 if (list.Contains(value) || !Input.GetKey(value))
181 {
182 continue;
183 }
184 foreach (EInput.KeyMap item in ELayer.core.config.input.keys.List())
185 {
186 if (item.key == value && item.GetGroup() == keymap.GetGroup())
187 {
188 item.key = keymap.key;
189 }
190 }
191 keymap.key = value;
192 SE.Tab();
193 Close();
194 return;
195 }
196 }
197 base.OnUpdateInput();
198 }
EInput.KeyMapManager keys
Definition: CoreConfig.cs:260
InputSetting input
Definition: CoreConfig.cs:615
CoreConfig config
Definition: Core.cs:70
static bool waitReleaseAnyKey
Definition: EInput.cs:328
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 470 of file Dialog.cs.

471 {
472 Dialog d = Layer.Create<Dialog>();
473 d.spacer.SetActive(enable: false);
474 d.note.AddHeader("giftRecipe".lang());
475 d.list.AddButton(null, Lang.Get("ok"), delegate
476 {
477 d.Close();
478 });
479 d.option.soundActivate = null;
480 for (int i = 0; i < list.Count; i++)
481 {
482 RecipeSource recipeSource = list[i];
483 List<Recipe.Ingredient> ingredients = recipeSource.GetIngredients();
484 if (ingredients.Count > 0 && ELayer.sources.cards.map.ContainsKey(ingredients[0].id))
485 {
486 ELayer.sources.cards.map[ingredients[0].id].GetName();
487 }
488 d.note.AddText("・" + recipeSource.Name.ToTitleCase());
489 if (i >= 9 && list.Count > 10)
490 {
491 d.note.Space(6);
492 d.note.AddText("moreRecipes".lang((list.Count - 10).ToString() ?? ""));
493 break;
494 }
495 }
496 d.SetOnKill(SE.Click);
497 ELayer.Sound.Play("idea");
498 ELayer.ui.AddLayer(d);
499 return d;
500 }
static SourceManager sources
Definition: ELayer.cs:37
List< Recipe.Ingredient > GetIngredients()
Definition: Recipe.cs:7
Dictionary< string, CardRow > map
Definition: SourceCard.cs:9
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,
string  text = null 
)
inlinestatic

Definition at line 298 of file Dialog.cs.

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

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 384 of file Dialog.cs.

385 {
387 {
388 warned = true;
389 action();
390 warned = false;
391 ActPlan.warning = false;
392 }
393 else
394 {
395 TryWarn("warn_crime", action);
396 }
397 }
new GameConfig game
Definition: CoreConfig.cs:609
static void TryWarn(string lang, Action action, bool yes=true, string text=null)
Definition: Dialog.cs:298

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 414 of file Dialog.cs.

415 {
417 {
418 warned = true;
419 action();
420 warned = false;
421 }
422 else
423 {
424 TryWarn("warn_disassemble", action);
425 }
426 }

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 399 of file Dialog.cs.

400 {
402 {
403 warned = true;
404 action();
405 warned = false;
406 ActPlan.warning = false;
407 }
408 else
409 {
410 TryWarn("warn_mana", action);
411 }
412 }

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,
Chara  c 
)
inlinestatic

Definition at line 369 of file Dialog.cs.

370 {
372 {
373 warned = true;
374 action();
375 warned = false;
376 ActPlan.warning = false;
377 }
378 else
379 {
380 TryWarn("warn_slaughter", action, yes: true, "warn_slaughter".lang(c.Name));
381 }
382 }
string Name
Definition: Card.cs:2177

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

Referenced by TraitToolButcher.TrySetHeldAct().

◆ Update()

void Dialog.Update ( )
inlineprivate

Definition at line 116 of file Dialog.cs.

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

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 252 of file Dialog.cs.

253 {
254 Dialog d = Layer.Create<Dialog>();
255 d.textDetail.SetText(langDetail.lang() + " ");
256 d.list.AddButton(null, Lang.Get(langYes), delegate
257 {
258 if (actionYes != null)
259 {
260 actionYes();
261 }
262 d.Close();
263 });
264 d.list.AddButton(null, Lang.Get(langNo), delegate
265 {
266 if (actionNo != null)
267 {
268 actionNo();
269 }
270 d.Close();
271 });
272 ELayer.ui.AddLayer(d);
273 return d;
274 }

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(), AM_Copy.RefreshMenu(), ContentConfigOther.ResetWindows(), ContentQuest.SelectQuest(), LayerFeedback.Submit(), and TraitCoreZone.TrySetAct().

Member Data Documentation

◆ effect

ScreenEffect Dialog.effect

Definition at line 30 of file Dialog.cs.

◆ gridItems

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

Definition at line 36 of file Dialog.cs.

Referenced by OnAfterInit().

◆ image

Image Dialog.image

Definition at line 20 of file Dialog.cs.

Referenced by CreateNarration().

◆ input

UIInputText Dialog.input

Definition at line 38 of file Dialog.cs.

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

◆ inputType

InputType Dialog.inputType

Definition at line 40 of file Dialog.cs.

Referenced by InputName().

◆ isInputEnter

bool Dialog.isInputEnter

Definition at line 46 of file Dialog.cs.

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

◆ keymap

EInput.KeyMap Dialog.keymap

Definition at line 43 of file Dialog.cs.

Referenced by Keymap(), OnBack(), and OnUpdateInput().

◆ layout

LayoutGroup Dialog.layout

Definition at line 28 of file Dialog.cs.

◆ list

◆ listGrid

UIList Dialog.listGrid

Definition at line 32 of file Dialog.cs.

Referenced by OnAfterInit().

◆ note

UINote Dialog.note

Definition at line 24 of file Dialog.cs.

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

◆ onEnterInput

Action<bool, string> Dialog.onEnterInput

Definition at line 48 of file Dialog.cs.

Referenced by OnKill().

◆ spacer

Transform Dialog.spacer

Definition at line 34 of file Dialog.cs.

Referenced by Gift(), and Recipe().

◆ textConfetti

Text Dialog.textConfetti

Definition at line 18 of file Dialog.cs.

◆ textDetail

UIText Dialog.textDetail

◆ warned


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