2using System.Collections.Generic;
35 public List<GridItem>
gridItems =
new List<GridItem>();
53 ELayer.
ui.hud.textMouseHintRight.transform.parent.SetActive(enable:
false);
58 GridLayoutGroup obj = listGrid.layoutItems as GridLayoutGroup;
59 obj.constraint = GridLayoutGroup.Constraint.FixedColumnCount;
60 obj.constraintCount = 8;
83 this.RebuildLayout(recursive:
true);
84 GraphicRaycaster g =
windows[0].GetComponent<GraphicRaycaster>();
86 TweenUtil.Delay(0.3f, delegate
100 public void AddButton(
string text, Action onClick =
null,
bool close =
true)
125 if ((
bool)
input &&
option.
canClose && (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter)))
131 if (!
input.gameObject.activeInHierarchy &&
this.list !=
null)
138 uIButton.onClick.Invoke();
145 List<KeyCode>
list =
new List<KeyCode>
158 if (Input.GetKeyDown(KeyCode.Delete))
166 keymap.key = KeyCode.None;
170 foreach (KeyCode value
in Enum.GetValues(typeof(KeyCode)))
172 if (
list.Contains(value) || !Input.GetKey(value))
189 base.OnUpdateInput();
200 ELayer.
ui.hud.textMouseHintRight.transform.parent.SetActive(enable:
true);
215 dialog.
image.SetActive(enable:
true);
216 dialog.image.sprite = Resources.Load<Sprite>(
"Media/Graphics/Image/Dialog/" + idImage);
217 dialog.
image.SetNativeSize();
222 public static Dialog Ok(
string langDetail, Action action =
null)
244 public static Dialog YesNo(
string langDetail, Action actionYes, Action actionNo =
null,
string langYes =
"yes",
string langNo =
"no")
250 if (actionYes !=
null)
258 if (actionNo !=
null)
268 public static Dialog List<TValue>(
string langDetail, ICollection<TValue> items, Func<TValue, string> getString, Func<int, string, bool> onSelect,
bool canCancel =
false)
273 foreach (TValue
item in items)
276 d.list.AddButton(
null, getString(
item).lang(), delegate
278 if (onSelect(_i, getString(
item)))
285 d.option.canClose = canCancel;
290 public static void TryWarn(
string lang, Action action,
bool yes =
true)
298 ActPlan.warning =
false;
313 ELayer.core.config.game.ignoreWarnCrime =
true;
316 ELayer.core.config.game.ignoreWarnMana =
true;
318 case "warn_disassemble":
319 ELayer.core.config.game.ignoreWarnDisassemble =
true;
321 case "warn_slaughter":
322 ELayer.core.config.game.ignoreWarnSlaughter =
true;
338 if (!(text ==
"warn_parallels"))
340 if (text ==
"warn_linuxMod")
342 ELayer.core.config.ignoreLinuxModWarning =
true;
347 ELayer.core.config.ignoreParallelsWarning =
true;
368 ActPlan.warning =
false;
372 TryWarn(
"warn_slaughter", action);
383 ActPlan.warning =
false;
398 ActPlan.warning =
false;
416 TryWarn(
"warn_disassemble", action);
422 return Gift(langHeader, autoAdd,
new List<Card>(cards));
427 List<GridItem> list2 =
new List<GridItem>();
435 return Gift(langHeader, autoAdd, list2);
441 d.
spacer.SetActive(enable:
false);
454 d.option.soundActivate =
null;
455 d.option.canClose =
false;
465 d.
spacer.SetActive(enable:
false);
471 d.option.soundActivate =
null;
472 for (
int i = 0; i <
list.Count; i++)
481 if (i >= 9 &&
list.Count > 10)
484 d.
note.
AddText(
"moreRecipes".lang((
list.Count - 10).ToString() ??
""));
494 public static Dialog Confetti(
string langTitle,
string langDetail,
string langConfetti =
"Grats!")
497 return _Confetti(
"DialogConfetti", langTitle, langDetail, langConfetti);
503 return _Confetti(
"DialogConfettiSimple", langTitle, langDetail, langConfetti);
506 public static Dialog _Confetti(
string idPrefab,
string langTitle,
string langDetail,
string langConfetti =
"Grats!")
509 d.textConfetti.text = langConfetti.lang();
532 d.langHint = langDetail;
533 d.
note.
AddText(langDetail.lang()).text1.alignment = TextAnchor.MiddleCenter;
537 d.input.field.characterLimit = 100;
540 d.input.field.characterLimit = 30;
543 d.input.field.characterLimit = 8;
544 d.input.field.contentType = InputField.ContentType.Alphanumeric;
548 d.onEnterInput = onClose;
556 onClose(arg1:
true,
"");
List< Action > actionsNextFrame
bool ignoreWarnDisassemble
static string TextNarration
static Dialog Keymap(EInput.KeyMap keymap)
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)
Action< bool, string > onEnterInput
void AddButton(string text, Action onClick=null, bool close=true)
override void OnAfterInit()
static Dialog YesNo(string langDetail, Action actionYes, Action actionNo=null, string langYes="yes", string langNo="no")
static Dialog Choice(string langDetail, Action< Dialog > action)
static Dialog Gift(string langHeader, bool autoAdd, List< Card > list)
static Dialog InputName(string langDetail, string text, Action< bool, string > onClose, InputType inputType=InputType.Default)
static void TryWarnSlaughter(Action action)
static void TryWarnDisassemble(Action action)
static Dialog Ok(string langDetail, Action action=null)
static Dialog Gift(string langHeader, bool autoAdd, List< GridItem > list)
override void OnUpdateInput()
static Dialog ConfettiSimple(string langTitle, string langDetail, string langConfetti="Grats!")
static void TryWarnCrime(Action action)
static void TryWarnMana(Action action)
static Dialog CreateNarration(string idImage, string idText)
List< GridItem > gridItems
static Dialog _Confetti(string idPrefab, string langTitle, string langDetail, string langConfetti="Grats!")
static Dialog Confetti(string langTitle, string langDetail, string langConfetti="Grats!")
static Dialog Gift(string langHeader, bool autoAdd, params Card[] cards)
static Dialog Recipe(List< RecipeSource > list)
static SourceManager sources
static SoundManager Sound
virtual void OnClick(ButtonGrid b)
static string Get(string id)
static Layer Create(string path)
Layer SetOnKill(Action action)
List< Recipe.Ingredient > GetIngredients()
Dictionary< string, CardRow > map
override void Refresh(bool highlightLast=false)
override void Add(object item)
virtual void Refresh(bool highlightLast=false)
UIItem AddHeader(string text, Sprite sprite=null)
UIItem AddText(string text, FontColor color=FontColor.DontChange)
void Space(int sizeY=0, int sizeX=1)