protected void Init(int count, int depth, Menu_Base container = null, int?cols = null, int?rows = null) { CONTAINER = container ?? new IGMDataItem.Empty(); if (count <= 0 || depth <= 0) { if (CONTAINER.Pos == Rectangle.Empty) { Debug.WriteLine($"{this}:: count {count} or depth {depth}, is invalid must be >= 1, or a CONTAINER {CONTAINER} and CONTAINER.Pos { Pos.ToString() } must be set instead, Skipping Init()"); return; } } else { SIZE = new Rectangle[count]; ITEM = new Menu_Base[count, depth]; CURSOR = new Point[count]; Count = (byte)count; Depth = (byte)depth; BLANKS = new bool[count]; Descriptions = new Dictionary <int, FF8String>(count); this.Cols = cols ?? 1; this.Rows = rows ?? 1; } Init(); Refresh(); Update(); }
public override void Refresh() { if (Source == null || skipRefresh) { skipRefresh = false; return; } int total = Rows * Cols; DefaultPages = Source.Count() / total; if (DefaultPages <= Page) { Page = DefaultPages - 1; } int skip = Page * total; int p = 0; foreach (DataType i in Source) { if (skip > 0) { skip--; continue; } if (p >= total) { break; } Contents[p] = i; Menu_Base menu_Base = ITEM[p, 0]; menu_Base.Show(); IGMDataItem.Text text = (IGMDataItem.Text)menu_Base; text.Data = new FF8String(i.ToString()); BLANKS[p] = false; p++; } for (; p < total; p++) { Contents[p] = default; BLANKS[p] = true; ITEM[p, 0].Hide(); } base.Refresh(); }
public override bool ITEMInputs(Menu_Base i, int pos = 0) { var ret = false; if (InputsModeTest(pos)) { var lastmode = (Mode)Junction.GetMode(); ret = base.ITEMInputs(i, pos); if (ret) { if (!Junction.GetMode().Equals(lastmode)) { Show(); } } } return(ret); }
public override void ITEMShow(Menu_Base i, int pos = 0) { if (Junction != null) { pos = cnv(pos); switch (Junction.GetMode()) { default: if (pos < 1) { base.ITEMShow(i, pos); } else { base.ITEMHide(i, pos); } break; case Mode.Mag_Pool_Stat: case Mode.Mag_Stat: if (pos < 3) { base.ITEMShow(i, pos); } else { base.ITEMHide(i, pos); } break; case Mode.Mag_EL_A: case Mode.Mag_Pool_EL_A: if (pos > 0 && pos < 5) { base.ITEMShow(i, pos); } else { base.ITEMHide(i, pos); } break; case Mode.Mag_EL_D: case Mode.Mag_Pool_EL_D: if (pos > 0 && pos < 4 || pos == 5) { base.ITEMShow(i, pos); } else { base.ITEMHide(i, pos); } break; case Mode.Mag_ST_A: case Mode.Mag_Pool_ST_A: if (pos > 0 && pos < 3 || pos == 6 || pos == 7) { base.ITEMShow(i, pos); } else { base.ITEMHide(i, pos); } break; case Mode.Mag_ST_D: case Mode.Mag_Pool_ST_D: if (pos > 0 && pos < 3 || pos == 6 || pos == 8) { base.ITEMShow(i, pos); } else { base.ITEMHide(i, pos); } break; } } }
public Base(int count = 0, int depth = 0, Menu_Base container = null, int?cols = null, int?rows = null, Damageable damageable = null, sbyte?partypos = null) { Init(damageable, partypos); Init(count, depth, container, cols, rows); }
public virtual bool ITEMUpdate(Menu_Base i, int pos = 0) => i.Update();
public virtual void ITEMShow(Menu_Base i, int pos = 0) => i.Show();
public virtual bool ITEMInputs(Menu_Base i, int pos = 0) => i.Inputs();
public virtual void ITEMHide(Menu_Base i, int pos = 0) => i.Hide();
public Base(int count, int depth, Menu_Base container = null, int?rows = null, int?pages = null, Damageable damageable = null) : base(count + 2, depth, container, 1, rows, damageable) => DefaultPages = pages ?? 1;