Example #1
0
            public override void OnUpdate()
            {
                WorldSide localSide = World_AIW2.Instance.GetLocalPlayerSide();

                if (localSide == null)
                {
                    return;
                }
                ArcenUI_ButtonSet             elementAsType    = (ArcenUI_ButtonSet)Element;
                Window_InGameTargetSorterMenu windowController = (Window_InGameTargetSorterMenu)Element.Window.Controller;

                if (windowController.TimeOfLastRefresh < Engine_AIW2.Instance.TimeOfLastControlGroupChange)
                {
                    windowController.NeedRefresh = true;
                }

                if (windowController.LastControlGroupID != World_AIW2.Instance.CurrentActiveSelectionControlGroupPrimaryKeyID)
                {
                    windowController.NeedRefresh = true;
                }

                if (windowController.NeedRefresh)
                {
                    windowController.NeedRefresh        = false;
                    windowController.TimeOfLastRefresh  = DateTime.Now;
                    windowController.LastControlGroupID = World_AIW2.Instance.CurrentActiveSelectionControlGroupPrimaryKeyID;

                    elementAsType.ClearButtons();

                    int x = 0;

                    {
                        bClear  newButtonController = new bClear();
                        Vector2 offset;
                        offset.x = x * elementAsType.ButtonWidth;
                        offset.y = 0;
                        Vector2 size;
                        size.x = elementAsType.ButtonWidth;
                        size.y = elementAsType.ButtonHeight;
                        elementAsType.AddButton(newButtonController, size, offset);
                        x++;
                    }

                    for (int i = 0; i < TargetSorterTypeDataTable.Instance.Rows.Count; i++)
                    {
                        TargetSorterTypeData item = TargetSorterTypeDataTable.Instance.Rows[i];
                        if (item.Implementation == null ||
                            !(item.Implementation is TargetSorter_Base) ||
                            !((TargetSorter_Base)item.Implementation).IsGroupSorter)
                        {
                            continue;
                        }
                        bItem   newButtonController = new bItem(item);
                        Vector2 offset;
                        offset.x = x * elementAsType.ButtonWidth;
                        offset.y = 0;
                        Vector2 size;
                        size.x = elementAsType.ButtonWidth;
                        size.y = elementAsType.ButtonHeight;
                        elementAsType.AddButton(newButtonController, size, offset);
                        x++;
                    }

                    elementAsType.ActuallyPutItemsBackInPoolThatAreStillCleared();
                }
            }
Example #2
0
 public Window_InGameTargetSorterMenu()
 {
     Instance                    = this;
     this.OnlyShowInGame         = true;
     this.SupportsMasterMenuKeys = true;
 }