示例#1
0
        protected override void Init()
        {
            Size = new Vector2 {
                X = 840, Y = 630
            };
            base.Init();
            List <Task> tasks = new List <Task>
            {
                Task.Run(() => Data.TryAdd(SectionName.Help, new IGMDataItem.HelpBox {
                    Pos = new Rectangle(15, 69, 810, 78), Title = Icons.ID.HELP, Options = Box_Options.Middle
                })),
                Task.Run(() => {
                    FF8String[] keys = new FF8String[] {
                        Strings.Name.Use, //todo add to Strings.Name
                        Strings.Name.Rearrange,
                        Strings.Name.Sort,
                        Strings.Name.Battle
                    };
                    FF8String[] values = new FF8String[] {
                        Strings.Description.Use, //todo add to Strings.Description
                        Strings.Description.Rearrange,
                        Strings.Description.Sort,
                        Strings.Description.Battle
                    };
                    if (keys.Distinct().Count() == keys.Length && keys.Length == values.Length)
                    {
                        Data.TryAdd(SectionName.TopMenu, IGMData_TopMenu.Create((from i in Enumerable.Range(0, keys.Length) select i).ToDictionary(x => keys[x], x => values[x])));
                    }
                    else
                    {
                        Data.TryAdd(SectionName.TopMenu, null);
                    }
                }),
                Task.Run(() => Data.TryAdd(SectionName.Title, new IGMDataItem.Box {
                    Data = Memory.Strings.Read(Strings.FileID.MNGRP, 0, 2), Pos = new Rectangle(615, 0, 225, 66)
                })),
                Task.Run(() => Data.TryAdd(SectionName.UseItemGroup, IGMData.Group.Base.Create(IGMData_Statuses.Create(), IGMData.Pool.Item.Create(), IGMData_TargetPool.Create())))
            };

            Task.WaitAll(tasks.ToArray());
            ChoiceChangeHandler         = help.TextChangeEvent;
            ItemPool.ItemChangeHandler += help.TextChangeEvent;
            ModeChangeHandler          += help.ModeChangeEvent;
            Func <bool> TopMenuInputs = null;

            if (Data[SectionName.TopMenu] != null)
            {
                TopMenuInputs = Data[SectionName.TopMenu].Inputs;
            }
            InputsDict = new Dictionary <Mode, Func <bool> >()
            {
                { Mode.TopMenu, TopMenuInputs },
                { Mode.SelectItem, UseItemGroup.ITEM[1, 0].Inputs },
                { Mode.UseItemOnTarget, UseItemGroup.ITEM[2, 0].Inputs }
            };
            SetMode(Mode.SelectItem);
        }
示例#2
0
        protected override void Init()
        {
            Size = new Vector2 {
                X = 843, Y = 630
            };
            base.Init();

            Action[] actions = new Action[]
            {
                () => Data.TryAdd(SectionName.Header, IGMData_Header.Create()),
                () => Data.TryAdd(SectionName.Footer, IGMData_Footer.Create()),
                () => Data.TryAdd(SectionName.Clock, IGMData_Clock.Create()),
                () => Data.TryAdd(SectionName.PartyGroup, IGMData_PartyGroup.Create(IGMData_Party.Create(), IGMData_NonParty.Create())),
                () => {
                    FF8String[] keys = new FF8String[] {
                        Strings.Name.SideMenu.Junction,
                        Strings.Name.SideMenu.Item,
                        Strings.Name.SideMenu.Magic,
                        Strings.Name.SideMenu.GF,
                        Strings.Name.SideMenu.Status,
                        Strings.Name.SideMenu.Ability,
                        Strings.Name.SideMenu.Switch,
                        Strings.Name.SideMenu.Card,
                        Strings.Name.SideMenu.Config,
                        Strings.Name.SideMenu.Tutorial,
                        Strings.Name.SideMenu.Save,
                        Strings.Name.SideMenu.Battle
                    };

                    FF8String[] values = new FF8String[] {
                        Strings.Description.SideMenu.Junction,
                        Strings.Description.SideMenu.Item,
                        Strings.Description.SideMenu.Magic,
                        Strings.Description.SideMenu.GF,
                        Strings.Description.SideMenu.Status,
                        Strings.Description.SideMenu.Ability,
                        Strings.Description.SideMenu.Switch,
                        Strings.Description.SideMenu.Card,
                        Strings.Description.SideMenu.Config,
                        Strings.Description.SideMenu.Tutorial,
                        Strings.Description.SideMenu.Save,
                        Strings.Description.SideMenu.Battle
                    };

                    if (keys.Distinct().Count() == keys.Length && values.Length == keys.Length)
                    {
                        Data.TryAdd(SectionName.SideMenu, IGMData_SideMenu.Create((from i in Enumerable.Range(0, keys.Length)
                                                                                   select i).ToDictionary(x => keys[x], x => values[x])));
                    }
                    else
                    {
                        Data.TryAdd(SectionName.SideMenu, null);
                    }
                }
            };
            Memory.ProcessActions(actions);
            Func <bool> SideMenuInputs = null;

            if (Data[SectionName.SideMenu] != null)
            {
                SideMenuInputs = Data[SectionName.SideMenu].Inputs;
            }
            InputDict = new Dictionary <Mode, Func <bool> >
            {
                { Mode.ChooseItem, SideMenuInputs },
                { Mode.ChooseChar, Data[SectionName.PartyGroup].Inputs },
            };
            SetMode((Mode)0);
        }