Example #1
0
        public static void AddMenuListItem(string name, Func <int, Task> onSelect, params string[] items)
        {
            var menuListItem = new MenuListItem(name, new List <string>(items), 0);

            _menu.AddMenuItem(menuListItem);
            _menuListItemActions.Add(menuListItem.Index, onSelect);
        }
        private void FunctionsListView_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (FunctionsListView.SelectedIndex != -1)
            {
                BottomListView.SelectedIndex = -1;
                MenuListItem m = FunctionsListView.SelectedItem as MenuListItem;

                var n             = Vm.TopFunctionList.Where((a) => a.MenuF == _currentFrame);
                var menuListItems = n as MenuListItem[] ?? n.ToArray();
                if (!menuListItems.Any())
                {
                    menuListItems = Vm.BottomFunctionList.Where((a) => a.MenuF == _currentFrame).ToArray();
                }
                var currentMenu = menuListItems[0];
                currentMenu.IsEnabled = false;
                if (m != null)
                {
                    _currentFrame = m.MenuF;
                    m.IsEnabled   = true;

                    Debug.Assert(m != null, "m != null");
                    Vm.NavigateToFunction(MainFrame, m.MenuF);
                }
                MainSplitView.IsPaneOpen = false;
            }
        }
        private void InitializeMenuData()
        {
            MenuList = new ObservableCollection <MenuListItem>();
            MenuListItem m;

            m = new MenuListItem
            {
                Name      = "搜索",
                IsEnabled = true,
                GotoView  = MenuGotoView.SearchView,
                Icon      =
                    "M9.84375,0.9375 C9.2627,0.937501 8.71582,1.04858 8.20312,1.27075 C7.69043,1.49292 7.24365,1.79443 6.86279,2.17529 C6.48193,2.55615 6.18042,3.00293 5.95825,3.51562 C5.73608,4.02832 5.625,4.5752 5.625,5.15625 C5.625,5.7373 5.73608,6.28418 5.95825,6.79688 C6.18042,7.30957 6.48193,7.75635 6.86279,8.13721 C7.24365,8.51807 7.69043,8.81958 8.20312,9.04175 C8.71582,9.26392 9.2627,9.375 9.84375,9.375 C10.4248,9.375 10.9717,9.26392 11.4844,9.04175 C11.9971,8.81958 12.4438,8.51807 12.8247,8.13721 C13.2056,7.75635 13.5071,7.30957 13.7292,6.79688 C13.9514,6.28418 14.0625,5.7373 14.0625,5.15625 C14.0625,4.5752 13.9514,4.02832 13.7292,3.51562 C13.5071,3.00293 13.2056,2.55615 12.8247,2.17529 C12.4438,1.79443 11.9971,1.49292 11.4844,1.27075 C10.9717,1.04858 10.4248,0.937501 9.84375,0.9375 z M9.84375,0 C10.3174,1E-06 10.7739,0.061036 11.2134,0.183105 C11.6528,0.305177 12.063,0.478517 12.4438,0.703125 C12.8247,0.927735 13.1726,1.19751 13.4875,1.51245 C13.8025,1.82739 14.0723,2.17529 14.2969,2.55615 C14.5215,2.93701 14.6948,3.34717 14.8169,3.78662 C14.939,4.22607 15,4.68262 15,5.15625 C15,5.62988 14.939,6.08643 14.8169,6.52588 C14.6948,6.96533 14.5215,7.37549 14.2969,7.75635 C14.0723,8.13721 13.8025,8.48511 13.4875,8.80005 C13.1726,9.11499 12.8247,9.38477 12.4438,9.60938 C12.063,9.83398 11.6528,10.0073 11.2134,10.1294 C10.7739,10.2515 10.3174,10.3125 9.84375,10.3125 C9.2334,10.3125 8.64868,10.21 8.0896,10.0049 C7.53052,9.7998 7.0166,9.50439 6.54785,9.11865 L0.79834,14.8608 C0.705566,14.9536 0.595703,15 0.46875,15 C0.341797,15 0.231934,14.9536 0.13916,14.8608 C0.046387,14.7681 0,14.6582 0,14.5312 C0,14.4043 0.046387,14.2944 0.13916,14.2017 L5.88135,8.45215 C5.49561,7.9834 5.2002,7.46948 4.99512,6.9104 C4.79004,6.35132 4.6875,5.7666 4.6875,5.15625 C4.6875,4.68262 4.74854,4.22607 4.87061,3.78662 C4.99268,3.34717 5.16602,2.93701 5.39062,2.55615 C5.61523,2.17529 5.88501,1.82739 6.19995,1.51245 C6.51489,1.19751 6.86279,0.927735 7.24365,0.703125 C7.62451,0.478517 8.03467,0.305177 8.47412,0.183105 C8.91357,0.061036 9.37012,1E-06 9.84375,0 z"
            };
            MenuList.Add(m);
            m = new MenuListItem
            {
                Name      = "电台列表",
                IsEnabled = true,
                GotoView  = MenuGotoView.RadioListView,
                Icon      =
                    "M0,11.25 L9.375,11.25 L9.375,12.1875 L0,12.1875 z M0,8.4375 L9.375,8.4375 L9.375,9.375 L0,9.375 z M15,7.9541 L15,13.125 C15,13.2764 14.9646,13.4094 14.8938,13.5242 C14.823,13.6389 14.7302,13.7366 14.6155,13.8171 C14.5007,13.8977 14.3738,13.9587 14.2346,14.0002 C14.0955,14.0417 13.96,14.0625 13.8281,14.0625 C13.6963,14.0625 13.5608,14.0417 13.4216,14.0002 C13.2825,13.9587 13.1555,13.8977 13.0408,13.8171 C12.926,13.7366 12.8333,13.6389 12.7625,13.5242 C12.6916,13.4094 12.6562,13.2764 12.6562,13.125 C12.6562,12.9736 12.6916,12.8406 12.7625,12.7258 C12.8333,12.6111 12.926,12.5134 13.0408,12.4329 C13.1555,12.3523 13.2825,12.2913 13.4216,12.2498 C13.5608,12.2083 13.6963,12.1875 13.8281,12.1875 C13.9014,12.1875 13.9795,12.1948 14.0625,12.2095 L14.0625,9.15527 L11.25,9.8584 L11.25,14.0625 C11.25,14.2188 11.2109,14.3555 11.1328,14.4727 C11.0547,14.5898 10.9558,14.6875 10.8362,14.7656 C10.7166,14.8438 10.5835,14.9023 10.437,14.9414 C10.2905,14.9805 10.1514,15 10.0195,15 C9.8877,15 9.74854,14.9805 9.60205,14.9414 C9.45557,14.9023 9.32251,14.8438 9.20288,14.7656 C9.08325,14.6875 8.98438,14.5898 8.90625,14.4727 C8.82812,14.3555 8.78906,14.2188 8.78906,14.0625 C8.78906,13.9062 8.82812,13.7695 8.90625,13.6523 C8.98438,13.5352 9.08325,13.4375 9.20288,13.3594 C9.32251,13.2812 9.45557,13.2227 9.60205,13.1836 C9.74854,13.1445 9.8877,13.125 10.0195,13.125 C10.0684,13.125 10.1172,13.1274 10.166,13.1323 C10.2148,13.1372 10.2637,13.1445 10.3125,13.1543 L10.3125,9.12598 z M0,5.625 L15,5.625 L15,6.5625 L0,6.5625 z M0,2.8125 L15,2.8125 L15,3.75 L0,3.75 z"
            };

            MenuList.Add(m);
            m = new MenuListItem
            {
                Name      = "我的音乐",
                IsEnabled = true,
                GotoView  = MenuGotoView.MyMusicView,
                Icon      =
                    "M8.4375,10.3125 L15,10.3125 L15,11.25 L8.4375,11.25 z M8.4375,6.5625 L15,6.5625 L15,7.5 L8.4375,7.5 z M3.75,3.75 C3.49121,3.75 3.24829,3.80005 3.02124,3.90015 C2.79419,4.00024 2.59644,4.13452 2.42798,4.30298 C2.25952,4.47144 2.12524,4.67041 2.02515,4.8999 C1.92505,5.12939 1.875,5.37109 1.875,5.625 C1.875,5.88379 1.92505,6.12671 2.02515,6.35376 C2.12524,6.58081 2.25952,6.77856 2.42798,6.94702 C2.59644,7.11548 2.79419,7.24976 3.02124,7.34985 C3.24829,7.44995 3.49121,7.5 3.75,7.5 C4.00391,7.5 4.24561,7.44995 4.4751,7.34985 C4.70459,7.24976 4.90356,7.11548 5.07202,6.94702 C5.24048,6.77856 5.37476,6.58081 5.47485,6.35376 C5.57495,6.12671 5.625,5.88379 5.625,5.625 C5.625,5.37109 5.57495,5.12939 5.47485,4.8999 C5.37476,4.67041 5.24048,4.47144 5.07202,4.30298 C4.90356,4.13452 4.70459,4.00024 4.4751,3.90015 C4.24561,3.80005 4.00391,3.75 3.75,3.75 z M8.4375,2.8125 L15,2.8125 L15,3.75 L8.4375,3.75 z M3.75,2.8125 C4.13574,2.8125 4.49951,2.88696 4.84131,3.03589 C5.18311,3.18481 5.48096,3.38623 5.73486,3.64014 C5.98877,3.89404 6.19019,4.19189 6.33911,4.53369 C6.48804,4.87549 6.5625,5.23926 6.5625,5.625 C6.5625,6.06934 6.46118,6.4917 6.25854,6.89209 C6.05591,7.29248 5.77637,7.62451 5.41992,7.88818 C5.7373,8.04932 6.02417,8.24829 6.28052,8.48511 C6.53686,8.72192 6.75537,8.9856 6.93604,9.27612 C7.1167,9.56665 7.25586,9.87915 7.35352,10.2136 C7.45117,10.5481 7.5,10.8936 7.5,11.25 L6.5625,11.25 C6.5625,10.8643 6.48804,10.5005 6.33911,10.1587 C6.19019,9.81689 5.98877,9.51904 5.73486,9.26514 C5.48096,9.01123 5.18311,8.80981 4.84131,8.66089 C4.49951,8.51196 4.13574,8.4375 3.75,8.4375 C3.36426,8.4375 3.00049,8.51196 2.65869,8.66089 C2.31689,8.80981 2.01904,9.01123 1.76514,9.26514 C1.51123,9.51904 1.30981,9.81689 1.16089,10.1587 C1.01196,10.5005 0.9375,10.8643 0.9375,11.25 L0,11.25 C0,10.8936 0.048828,10.5481 0.146484,10.2136 C0.244141,9.87915 0.383301,9.56665 0.563965,9.27612 C0.744629,8.9856 0.963135,8.72192 1.21948,8.48511 C1.47583,8.24829 1.7627,8.04932 2.08008,7.88818 C1.72363,7.62451 1.44409,7.29248 1.24146,6.89209 C1.03882,6.4917 0.9375,6.06934 0.9375,5.625 C0.9375,5.23926 1.01196,4.87549 1.16089,4.53369 C1.30981,4.19189 1.51123,3.89404 1.76514,3.64014 C2.01904,3.38623 2.31689,3.18481 2.65869,3.03589 C3.00049,2.88696 3.36426,2.8125 3.75,2.8125 z"
            };

            MenuList.Add(m);
        }
        public virtual void Build(string type)
        {
            Clear();
            var typeList = Items.Select(pair => pair.Key).Cast <dynamic>().ToList();
            var typeItem = new MenuListItem("Category", typeList, typeList.FindIndex(n => n.ToString() == type));

            AddItem(typeItem);

            typeItem.OnListChanged += (sender, index) =>
            {
                string newType = ((MenuListItem)MenuItems[0]).IndexToItem(((MenuListItem)MenuItems[0]).Index).ToString();
                Build(newType);
                SelectionChanged?.Invoke(this, EventArgs.Empty);
            };

            var itemListItem = new MenuListItem(ItemName, Items[type].Select(s => (dynamic)s).ToList(), 0);

            AddItem(itemListItem);

            CurrentSelectedItem         = (string)itemListItem.IndexToItem(0);
            CurrentSelectedCategory     = type;
            itemListItem.OnListChanged += (sender, index) =>
            {
                CurrentSelectedItem = (string)itemListItem.IndexToItem(index);
                SelectionChanged?.Invoke(this, EventArgs.Empty);
            };

            RefreshIndex();
        }
        public void BuildFor(SerializableData.SerializableObject obj)
        {
            Clear();

            #region SpawnAfter
            {
                var item = new MenuListItem("Spawn After Objective", StaticData.StaticLists.NumberMenu, obj.SpawnAfter);

                item.OnListChanged += (sender, index) =>
                {
                    obj.SpawnAfter = index;
                };

                AddItem(item);
            }
            #endregion

            #region RemoveAfter
            {
                var item = new MenuListItem("Remove After Objective", StaticData.StaticLists.RemoveAfterList, obj.RemoveAfter);

                item.OnListChanged += (sender, index) =>
                {
                    obj.RemoveAfter = index;
                };

                AddItem(item);
            }
            #endregion
            // TODO: Change NumberMenu to max num of objectives in mission
            RefreshIndex();
        }
Example #6
0
        /// <summary>
        /// Navigate subframe to te===
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void MenuListItem_OnTapped(object sender, TappedRoutedEventArgs e)
        {
            MenuListItem m = ((Grid)sender).Tag as MenuListItem;

            Debug.Assert(m != null, "m != null");
            Vm.NavigateToFunction(MainFrame, m.MenuF);
            //MainSplitView.IsPaneOpen = false;
        }
Example #7
0
        ///// <summary>
        ///// Refresh/create the ped customization menu.
        ///// </summary>
        private void RefreshCustomizationMenu()
        {
            drawablesMenuListItems.Clear();
            propsMenuListItems.Clear();
            pedCustomizationMenu.ClearMenuItems();

            #region Ped Drawables
            for (int drawable = 0; drawable < 12; drawable++)
            {
                int currentDrawable = GetPedDrawableVariation(Game.PlayerPed.Handle, drawable);
                int maxVariations   = GetNumberOfPedDrawableVariations(Game.PlayerPed.Handle, drawable);
                int maxTextures     = GetNumberOfPedTextureVariations(Game.PlayerPed.Handle, drawable, currentDrawable);

                if (maxVariations > 0)
                {
                    List <string> drawableTexturesList = new List <string>();

                    for (int i = 0; i < maxVariations; i++)
                    {
                        drawableTexturesList.Add($"Drawable #{i + 1} (of {maxVariations})");
                    }

                    MenuListItem drawableTextures = new MenuListItem($"{textureNames[drawable]}", drawableTexturesList, currentDrawable, $"Use ← & → to select a ~o~{textureNames[drawable]} Variation~s~, press ~r~enter~s~ to cycle through the available textures.");
                    drawablesMenuListItems.Add(drawableTextures, drawable);
                    pedCustomizationMenu.AddMenuItem(drawableTextures);
                }
            }
            #endregion

            #region Ped Props
            for (int tmpProp = 0; tmpProp < 5; tmpProp++)
            {
                int realProp = tmpProp > 2 ? tmpProp + 3 : tmpProp;

                int currentProp       = GetPedPropIndex(Game.PlayerPed.Handle, realProp);
                int maxPropVariations = GetNumberOfPedPropDrawableVariations(Game.PlayerPed.Handle, realProp);

                if (maxPropVariations > 0)
                {
                    List <string> propTexturesList = new List <string>();

                    propTexturesList.Add($"Prop #1 (of {maxPropVariations + 1})");
                    for (int i = 0; i < maxPropVariations; i++)
                    {
                        propTexturesList.Add($"Prop #{i + 2} (of {maxPropVariations + 1})");
                    }


                    MenuListItem propTextures = new MenuListItem($"{propNames[tmpProp]}", propTexturesList, currentProp + 1, $"Use ← & → to select a ~o~{propNames[tmpProp]} Variation~s~, press ~r~enter~s~ to cycle through the available textures.");
                    propsMenuListItems.Add(propTextures, realProp);
                    pedCustomizationMenu.AddMenuItem(propTextures);
                }
            }
            pedCustomizationMenu.RefreshIndex();
            //pedCustomizationMenu.UpdateScaleform();
            //menu.UpdateScaleform();
            #endregion
        }
Example #8
0
 private void SettingsListView_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (SettingsListView.SelectedIndex != -1)
     {
         MenuListItem m = SettingsListView.SelectedItem as MenuListItem;
         Debug.Assert(m != null, "m != null");
         _vm.NavigateToFunction(MainFrame, m.MenuF);
     }
 }
Example #9
0
        public Submenu(string title, Func <string, Task> onSelect, IEnumerable <string> items, int groupByLetters = 0) : base("PocceMod", title)
        {
            OnItemSelect += async(menu, item, index) => await onSelect(item.Text);

            OnListItemSelect += async(menu, listItem, listIndex, itemIndex) => await onSelect(listItem.ListItems[listIndex]);

            OnMenuClose += (menu) =>
            {
                var item = GetCurrentMenuItem();
                ResetFilter();
                var index = item.Index;
                RefreshIndex(index, index > MaxItemsOnScreen ? index - MaxItemsOnScreen + 1 : 0);
            };

            if (groupByLetters > 0)
            {
                var    itemList       = new List <string>();
                string lastItemPrefix = string.Empty;
                void addRow()
                {
                    if (itemList.Count > 0)
                    {
                        if (itemList.Count == 1)
                        {
                            var menuItem = new MenuItem(itemList[0]);
                            AddMenuItem(menuItem);
                        }
                        else
                        {
                            var menuListItem = new MenuListItem(lastItemPrefix + "*", itemList, 0);
                            AddMenuItem(menuListItem);
                        }
                        itemList = new List <string>();
                    }
                }

                foreach (var item in items)
                {
                    var itemPrefix = (item.Length > groupByLetters) ? item.Substring(0, groupByLetters) : item;
                    if (itemPrefix != lastItemPrefix)
                    {
                        addRow();
                        lastItemPrefix = itemPrefix;
                    }

                    itemList.Add(item);
                }
                addRow();
            }
            else
            {
                foreach (var item in items)
                {
                    AddMenuItem(new MenuItem(item));
                }
            }
        }
Example #10
0
        private void MenuList_ItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            MenuListItem menuListItem = e.SelectedItem as MenuListItem;

            if (menuListItem != null)
            {
                Detail = new NavigationPage((Page)Activator.CreateInstance(menuListItem.Target));
                MenuList.SelectedItem = null;
                IsPresented           = false;
            }
        }
Example #11
0
        private static async Task ChangeSkin(MenuListItem item, int index)
        {
            var skins = item.ItemData as List <Skin>;

            if (skins != null && skins.Count > index)
            {
                var skin = skins[index];
                await ChangeSkin(skin.Model);

                skin.Restore(API.GetPlayerPed(-1));
            }
        }
Example #12
0
        public SkinMenu() : base("PocceMod", "select skin")
        {
            foreach (var pocce in Config.PocceList)
            {
                _allSkins.Add(Skin.ModelToName(pocce));
            }

            OnItemSelect += async(_menu, _item, _index) =>
            {
                await ChangeSkin(_item.Text);
            };

            OnListItemSelect += async(_menu, _listItem, _listIndex, _itemIndex) =>
            {
                await ChangeSkin(_listItem, _listIndex);
            };

            OnMenuOpen += (_menu) =>
            {
                if (_source == null)
                {
                    return;
                }

                foreach (var items in _source.Elements)
                {
                    if (items.Value.Count > 0)
                    {
                        var list = new List <string>();
                        for (int i = 0; i < items.Value.Count; ++i)
                        {
                            list.Add("#" + i);
                        }

                        var menuItem = new MenuListItem(items.Key, list, 0);
                        menuItem.ItemData = items.Value;
                        AddMenuItem(menuItem);
                    }
                    else
                    {
                        var menuItem = new MenuItem(items.Key);
                        AddMenuItem(menuItem);
                    }
                }
            };

            OnMenuClose += (_menu) =>
            {
                ClearMenuItems();
                _source = null;
            };
        }
Example #13
0
        public void Clear()
        {
            ClearMenuItems();

            var startMeasurementItem = new MenuListItem("Start measurement for all", new List <string> {
                "10sec", "30sec", "1min", "2min", "Clear"
            }, 0)
            {
                Enabled = Permission.CanDo(Ability.ReceiveTelemetry)
            };

            AddMenuItem(startMeasurementItem);
        }
Example #14
0
        void NavigateTo(MenuListItem menu)
        {
            if (menu == null)
            {
                return;
            }

            Page displayPage = (Page)Activator.CreateInstance(menu.TargetType);

            Detail = new NavigationPage(displayPage);

            menuPage.Menu.SelectedItem = null;
            IsPresented = false;
        }
Example #15
0
        public void CreateMenu()
        {
            menu = new Menu(Game.Player.Name, "Accessories");

            helmetsListItem = new MenuListItem("Helmets", helmetsList, 0);
            menu.AddMenuItem(helmetsListItem);

            // Event handlers
            menu.OnListItemSelect += (sender, listItem, listIndex, realIndex) =>
            {
                if (listItem == helmetsListItem)
                {
                    API.RemovePedHelmet(Game.Player.Character.Handle, true);
                }
            };
        }
Example #16
0
        public static void LoadItems(dynamic items)
        {
            inventory.ClearMenuItems();
            itemInventoryList = items;

            foreach (var i in items)
            {
                List <string> itemCount = new List <string>();
                for (var a = 0; a < i.limit + 1; a++)
                {
                    itemCount.Add($"{a}");
                }
                MenuListItem itemList = new MenuListItem(i.label, itemCount, i.count, i.name);
                inventory.AddMenuItem(itemList);
            }
        }
Example #17
0
    private void Select()
    {
        MenuListItem selectedItem = currentMenu.CurrentItem();

        Debug.Log("Select " + selectedItem.itemText);
        if (selectedItem is SubMenuListItem)
        {
            currentMenu.DisplayMenu(false);
            currentMenu = (SubMenuListItem)selectedItem;
            currentMenu.DisplayMenu(true);
        }
        else
        {
            selectedItem.Select();
        }
    }
Example #18
0
        public Menu EditSpawnMenu(Menu parent, Map map, Spawn spawn)
        {
            MenuListItem spawnTypes = new MenuListItem("Set spawn type", Enum.GetNames(typeof(SpawnType)).ToList <string>(), 0);


            if (spawn.ID == -3)
            {
                spawn = new Spawn(-3, LocalPlayer.Character.Position, 0, "player", 0);
            }

            Menu spawnEditMenu = AddSubMenu(parent, "Edit spawn");

            string name = spawn.ID == -3 ? "Create spawn" : spawn.SpawnType.ToString();

            MenuItem spawnEditItem = AddMenuItem(parent, spawnEditMenu, name, "", "", true);

            spawnEditMenu.AddMenuItem(spawnTypes);

            MenuSliderItem slider = new MenuSliderItem("Slider", 0, 10, 0, false);

            spawnEditMenu.AddMenuItem(slider);


            // Add team here
            spawnEditMenu.AddMenuItem(new MenuItem("Save"));

            spawnEditMenu.OnItemSelect += (_menu, _item, _index) => {
                if (_item.Text == "Save")
                {
                    if (spawn.ID == -3)
                    {
                        var spawny = new Spawn(-1, LocalPlayer.Character.Position, (SpawnType)spawnTypes.ListIndex, "player", slider.Position);
                        map.Spawns.Add(spawny);
                        EditSpawnMenu(parent, map, spawny);
                        spawnEditMenu.GoBack();
                    }
                    else
                    {
                        spawn.SpawnType = (SpawnType)spawnTypes.ListIndex;
                        parent.GetCurrentMenuItem().Text = spawn.SpawnType.ToString();
                        spawnEditMenu.GoBack();
                    }
                }
            };

            return(spawnEditMenu);
        }
        public void BuildFor(SerializableData.SerializablePickup actor)
        {
            Clear();

            #region SpawnAfter
            {
                var item = new MenuListItem("Spawn Before Objective", StaticData.StaticLists.NumberMenu, actor.SpawnAfter);

                item.OnListChanged += (sender, index) =>
                {
                    actor.SpawnAfter = index;
                };

                AddItem(item);
            }
            #endregion

            #region Weapons
            {
                var listIndex = actor.Ammo == 0
                    ? StaticData.StaticLists.AmmoChoses.FindIndex(n => n == (dynamic)9999)
                    : StaticData.StaticLists.AmmoChoses.FindIndex(n => n == (dynamic)actor.Ammo);
                var item = new MenuListItem("Ammo Count", StaticData.StaticLists.AmmoChoses, listIndex);

                item.OnListChanged += (sender, index) =>
                {
                    int newAmmo = int.Parse(((MenuListItem)sender).IndexToItem(index).ToString(), CultureInfo.InvariantCulture);
                    actor.Ammo = newAmmo;
                };

                AddItem(item);
            }
            #endregion

            #region Respawn
            {
                var item = new MenuCheckboxItem("Respawn", actor.Respawn);
                item.CheckboxEvent += (sender, @checked) =>
                {
                    actor.Respawn = @checked;
                };
                AddItem(item);
            }
            #endregion

            RefreshIndex();
        }
        /// <summary>
        /// Initialize function list in splitview control
        /// </summary>
        private void InitializeData()
        {
            FunctionItemList = new ObservableCollection <MenuListItem>();
            MenuListItem m = new MenuListItem
            {
                Name      = "Function 1",
                IsEnabled = true,
                MenuF     = MenuFunc.Func1,
                Icon      =
                    "M48.850243,32.061127L40.837259,42.988266 36.466324,40.074284 26.633064,51.365921 61.962049,51.365921 57.591017,36.067707 52.492086,36.067707z M30.036716,26.927057C27.798449,26.927057 25.983376,28.740846 25.983376,30.979034 25.983376,33.21732 27.798449,35.031313 30.036716,35.031313 32.273483,35.031313 34.088657,33.21732 34.088657,30.979034 34.088657,28.740846 32.273483,26.927057 30.036716,26.927057z M17.322001,19.069001L65.332998,19.069001 65.332998,54.707001 17.322001,54.707001z M42.922237,0L50.809,15.735769 13.98841,15.735769 13.98841,49.422001 0,21.513156z"
            };

            _functionItemList.Add(m);

            m = new MenuListItem
            {
                Name      = "Function 2",
                IsEnabled = true,
                MenuF     = MenuFunc.Func2,
                Icon      =
                    "M31.348,48.494C32.685356,48.494 33.770001,49.577489 33.770001,50.913598 33.770001,52.249612 32.685356,53.333001 31.348,53.333001 30.013346,53.333001 28.930001,52.249612 28.930001,50.913598 28.930001,49.577489 30.013346,48.494 31.348,48.494z M22.1227,48.494C23.457356,48.494 24.542,49.577489 24.542,50.913598 24.542,52.249612 23.457356,53.333001 22.1227,53.333001 20.785345,53.333001 19.702,52.249612 19.702,50.913598 19.702,49.577489 20.785345,48.494 22.1227,48.494z M35.26405,41.272998C36.60138,41.272998 37.686001,42.357621 37.686001,43.69365 37.686001,45.029576 36.60138,46.113 35.26405,46.113 33.929424,46.113 32.846001,45.029576 32.846001,43.69365 32.846001,42.357621 33.929424,41.272998 35.26405,41.272998z M26.508051,41.272998C27.845278,41.272998 28.930001,42.357621 28.930001,43.69365 28.930001,45.029576 27.845278,46.113 26.508051,46.113 25.173323,46.113 24.09,45.029576 24.09,43.69365 24.09,42.357621 25.173323,41.272998 26.508051,41.272998z M17.2318,41.272998C18.567579,41.272998 19.652001,42.357621 19.652001,43.69365 19.652001,45.029576 18.567579,46.113 17.2318,46.113 15.896121,46.113 14.813,45.029576 14.813,43.69365 14.813,42.357621 15.896121,41.272998 17.2318,41.272998z M44.021054,19.436998L46.029053,20.664867C46.758328,21.111492 46.98745,22.068645 46.540806,22.799085 46.17791,23.393704 45.478031,23.656512 44.837174,23.493527L44.815964,23.486991 44.755482,23.36905C44.331001,22.588596,43.814919,21.86488,43.221752,21.212421L43.130867,21.117109 43.312847,20.826513C43.580288,20.382326,43.817284,19.918125,44.021054,19.436998z M44.828007,13.720999L47.233292,13.786101C48.090233,13.810902 48.76614,14.523125 48.741337,15.381254 48.719235,16.238081 48.005619,16.913905 47.148682,16.890402L44.771996,16.825301C44.846211,16.353886 44.893116,15.874769 44.908718,15.386453 44.92432,14.821335 44.895718,14.266617 44.828007,13.720999z M21.976753,10.773001C26.979286,10.773001 31.208513,14.566015 32.614826,19.786035 33.396027,19.568634 34.218937,19.442332 35.069241,19.442332 40.136975,19.442332 44.245003,23.550448 44.245003,28.616866 44.245003,31.877278 42.539391,34.731389 39.976872,36.357696 38.948166,37.194999 37.640854,37.698899 36.213749,37.710603 35.840042,37.756803 35.459843,37.790002 35.069241,37.790002 34.687737,37.790002 34.312737,37.756803 33.940331,37.7119L10.320378,37.7119C9.942775,37.756803 9.5625736,37.790002 9.1705706,37.790002 4.1054971,37.790002 2.7073101E-07,33.840787 0,28.969668 2.7073101E-07,24.09855 4.1054971,20.150635 9.1705706,20.150635 9.871175,20.150635 10.552179,20.232635 11.208384,20.375936 12.447993,14.856316 16.789219,10.773001 21.976753,10.773001z M45.672386,7.174134C46.223133,7.1814017 46.751801,7.4817498 47.025681,8.0036976 47.424053,8.762845 47.132473,9.7023534 46.374729,10.100129L44.221188,11.232998C43.857914,10.249938,43.361851,9.3319101,42.749996,8.4998286L44.929535,7.352598C45.167145,7.2280803,45.422043,7.1708302,45.672386,7.174134z M22.363896,6.4076095C22.626137,6.4149718,22.889933,6.4890428,23.129202,6.6360126L25.232002,7.9243071C24.983002,8.2199299,24.749006,8.5292008,24.531187,8.8507769L24.325581,9.1660111 23.90588,9.0875378C23.275191,8.9828922 22.630835,8.9289981 21.976551,8.9289984 21.806952,8.9289981 21.637982,8.9326974 21.469708,8.9400355L21.134642,8.961946 21.056421,8.86325C20.704596,8.3712656 20.660401,7.6966183 20.996401,7.148304 21.275526,6.6914134 21.754027,6.4305587 22.251677,6.4085212 22.289,6.4068675 22.326431,6.4065576 22.363896,6.4076095z M33.776642,5.6300144C33.857746,5.6301656 33.939079,5.6313434 34.020622,5.6335616 39.242119,5.7754722 43.354096,10.120625 43.213494,15.340688 43.169556,16.971583 42.715012,18.494635 41.951519,19.813686L41.865544,19.954264 41.657589,19.790779C39.818852,18.414998 37.537552,17.599476 35.068867,17.599476 34.66787,17.599476 34.261574,17.622975 33.857876,17.668475 32.385815,13.866086 29.595959,11.014804 26.199589,9.711732L26.027451,9.6495949 26.288347,9.2962282C28.025217,7.0564322,30.74283,5.6243949,33.776642,5.6300144z M40.950501,2.1025438C41.249367,2.0946379 41.553959,2.1728296 41.825966,2.345706 42.547425,2.8067083 42.760941,3.7664986 42.298603,4.4892459L40.963902,6.5819988C40.17614,5.913939,39.294472,5.3526425,38.339997,4.9202757L39.681301,2.8197699C39.9702,2.3680468,40.452393,2.1157179,40.950501,2.1025438z M27.487883,1.5610685C28.038714,1.5662165,28.569157,1.8650618,28.844816,2.3860846L30.014,4.5899091C29.027098,4.9434433,28.105391,5.4317431,27.266875,6.033999L26.101694,3.8418369C25.700634,3.0827036 25.989704,2.1438856 26.746128,1.7428083 26.982916,1.6170683 27.237505,1.5587282 27.487883,1.5610685z M34.094422,0.00037670135C34.120896,-0.00020503998 34.147526,-0.00011539459 34.174298,0.00065898895 35.032345,0.022751808 35.706803,0.73763561 35.683403,1.593688L35.615608,4.0929995C35.11044,4.0083418 34.593571,3.9536633 34.066303,3.9406538 33.541535,3.9269848 33.023365,3.952373 32.512997,4.0096216L32.580693,1.5110502C32.603359,0.67979717,33.273724,0.018374443,34.094422,0.00037670135z"
            };

            _functionItemList.Add(m);

            BottomFunctionItemList = new ObservableCollection <MenuListItem>();

            m = new MenuListItem
            {
                Name  = "Settings",
                MenuF = MenuFunc.Settings,
                Icon  =
                    "M14.682,10.493 C12.398,10.493 10.546,12.344 10.546,14.628 C10.546,16.912 12.398,18.764 14.682,18.764 C16.966,18.764 18.818,16.912 18.818,14.628 C18.818,12.344 16.966,10.493 14.682,10.493 z M14.682,8.46201 C18.088,8.46201 20.849,11.223 20.849,14.628 C20.849,18.034 18.088,20.795 14.682,20.795 C11.276,20.795 8.515,18.034 8.515,14.628 C8.515,11.223 11.276,8.46201 14.682,8.46201 z M13.423,2.454 C13.135,3.083 12.67,3.702 12.227,4.922 C12.149,5.142 11.983,5.316 11.771,5.403 L10.084,6.104 C9.883,6.187 9.66,6.185 9.461,6.099 C8.243,5.57 6.8,4.978 6.15,4.758 L4.643,6.263 C4.886,6.917 5.494,8.299 6.038,9.466 C6.138,9.678 6.141,9.925 6.052,10.145 L5.352,11.837 C5.266,12.045 5.103,12.208 4.896,12.289 C3.671,12.772 3.054,13.143 2.431,13.447 L2.431,15.889 C3.06,16.179 3.669,16.623 4.888,17.066 C5.103,17.146 5.276,17.312 5.363,17.526 L6.059,19.217 C6.146,19.427 6.143,19.665 6.054,19.873 C5.532,21.077 4.951,22.499 4.723,23.159 L6.23,24.664 C6.875,24.426 8.275,23.808 9.459,23.258 C9.661,23.164 9.893,23.159 10.1,23.244 L11.793,23.945 C11.998,24.029 12.16,24.195 12.241,24.403 C12.726,25.631 13.118,26.261 13.423,26.881 L15.866,26.881 C16.152,26.254 16.618,25.633 17.061,24.411 C17.14,24.195 17.306,24.018 17.517,23.933 L19.21,23.231 C19.407,23.149 19.633,23.151 19.832,23.239 C21.049,23.766 22.487,24.359 23.139,24.582 L24.645,23.072 C24.404,22.421 23.792,21.038 23.249,19.875 C23.151,19.662 23.144,19.414 23.234,19.195 L23.931,17.502 C24.016,17.295 24.182,17.131 24.387,17.051 C25.613,16.567 26.231,16.191 26.858,15.889 L26.858,13.447 C26.224,13.159 25.617,12.718 24.399,12.276 C24.184,12.198 24.01,12.033 23.921,11.816 L23.224,10.12 C23.139,9.909 23.139,9.671 23.231,9.461 C23.752,8.26 24.333,6.839 24.562,6.176 L23.054,4.672 C22.408,4.909 21.007,5.527 19.824,6.078 C19.624,6.173 19.39,6.179 19.183,6.093 L17.491,5.394 C17.287,5.31 17.122,5.143 17.042,4.934 C16.559,3.706 16.17,3.077 15.866,2.454 z M13.062,0 L16.098,0 C16.676,0 16.844,0 18.42,3.99 L19.47,4.423 C22.708,2.924 23.098,2.924 23.267,2.924 C23.48,2.924 23.719,3.018 23.87,3.169 L26.023,5.313 C26.441,5.736 26.56,5.856 24.857,9.805 L25.28,10.835 C29.288,12.297 29.288,12.472 29.288,13.083 L29.288,16.123 C29.288,16.731 29.286,16.888 25.293,18.468 L24.871,19.495 C26.669,23.362 26.545,23.49 26.117,23.924 L23.963,26.076 C23.809,26.228 23.571,26.323 23.359,26.323 C23.205,26.323 22.802,26.323 19.507,24.899 L18.457,25.333 C16.991,29.337 16.82,29.337 16.226,29.337 L13.19,29.337 C12.611,29.337 12.444,29.337 10.868,25.35 L9.816,24.912 C6.575,26.415 6.186,26.415 6.019,26.415 C5.805,26.415 5.564,26.32 5.413,26.166 L3.266,24.017 C2.839,23.587 2.729,23.476 4.431,19.529 L4.007,18.505 C0,17.039 0,16.862 0,16.251 L0,13.21 C0,12.602 0,12.447 3.993,10.868 L4.417,9.842 C2.62,5.969 2.744,5.844 3.175,5.41 L5.326,3.262 C5.476,3.111 5.717,3.016 5.93,3.016 C6.085,3.016 6.491,3.016 9.786,4.438 L10.831,4.003 C12.297,0 12.483,0 13.062,0 z"
            };
            BottomFunctionItemList.Add(m);

            //TODO: if you want about function be exposed in splitview, uncomment code below
            //m = new MenuListItem
            //{
            //    Name = "About",
            //    MenuF = MenuFunc.About,
            //    Icon =
            //        "M11.818,11.774 L15.352,11.774 L15.352,20.02 L16.53,20.02 L16.53,21.198 L11.818,21.198 L11.818,20.02 L12.996,20.02 L12.996,12.952 L11.818,12.952 z M13.6999,7.14979 C13.8292,7.15009 13.9854,7.15299 14.174,7.15299 C15.38,7.15299 15.261,7.03399 15.261,8.24099 C15.261,9.44699 15.38,9.32799 14.174,9.32799 C12.967,9.32799 13.087,9.44699 13.087,8.24099 C13.087,7.22259 13.0016,7.14818 13.6999,7.14979 z M14.173,2.022 C7.462,2.022 2.022,7.463 2.022,14.174 C2.022,20.885 7.462,26.325 14.173,26.325 C20.884,26.325 26.324,20.885 26.324,14.174 C26.324,7.463 20.884,2.022 14.173,2.022 z M14.173,0 C22.001,0 28.346,6.346 28.346,14.174 C28.346,22.001 22.001,28.347 14.173,28.347 C6.345,28.347 0,22.001 0,14.174 C0,6.346 6.345,0 14.173,0 z"
            //};
            //BottomFunctionItemList.Add(m);
        }
        private void AddBottomFunctionList()
        {
            BottomFunctionList = new ObservableCollection <MenuListItem>();

            MenuListItem m = new MenuListItem
            {
                Name = ResourceManager.Current.MainResourceMap.GetValue(
                    "Resources/StartViewModel_AddBottomFunctionList_Setting",
                    new ResourceContext())
                       .ValueAsString,
                MenuF     = MenuFunc.Settings,
                IsEnabled = false,
                Icon      = "M16,8.5C11.899994,8.5 8.5,11.899994 8.5,16 8.5,20.100006 11.899994,23.5 16,23.5 20.099976,23.5 23.5,20.100006 23.5,16 23.5,11.899994 20.099976,8.5 16,8.5z M14.099976,0L17.899994,0 17.899994,4.8999939C19.599976,5.1999817,21.199982,5.8999939,22.5,6.7999878L26,3.2999878 28.699982,6 25.199982,9.5C26.199982,10.799988,26.799988,12.399994,27.099976,14.100006L32,14.100006 32,17.899994 27.099976,17.899994C26.799988,19.600006,26.099976,21.199982,25.199982,22.5L28.699982,26 26,28.699982 22.5,25.199982C21.199982,26.199982,19.599976,26.799988,17.899994,27.100006L17.899994,32 14.099976,32 14.099976,27.100006C12.399994,26.799988,10.799988,26.100006,9.5,25.199982L6,28.699982 3.2999878,26 6.7999878,22.5C5.7999878,21.199982,5.1999817,19.600006,4.8999939,17.899994L0,17.899994 0,14.100006 4.8999939,14.100006C5.1999817,12.399994,5.8999939,10.799988,6.7999878,9.5L3.2999878,6 6,3.2999878 9.5,6.7999878C10.799988,5.7999878,12.399994,5.1999817,14.099976,4.8999939z"
            };

            BottomFunctionList.Add(m);
        }
Example #22
0
        public void Initialize()
        {
            FunctionList       = new ObservableCollection <MenuListItem>();
            BottomFunctionList = new ObservableCollection <MenuListItem>();

            MenuListItem m = new MenuListItem
            {
                Name  = "Map",
                MenuF = MenuFunc.Map,
                Icon  =
                    "M261.812,82.4125L261.812,406.848 499.238,437.495 499.238,112.012z M199.759,81.3682L47.5926,144.239 47.5926,473.608 199.759,401.726z M698.175,55.752L566.681,107.553 566.681,422.657 698.175,368.836z M745.768,0L745.768,386.544 531.549,474.902 214.219,433.633 214.219,433.446 0,536 0,125.805 214.219,43.5135 531.549,83.3014z"
            };

            FunctionList.Add(m);

            m = new MenuListItem
            {
                Name  = "Search",
                MenuF = MenuFunc.Search,
                Icon  =
                    "M126.657970428467,122.742496490479L158.354923248291,122.742496490479 158.354923248291,179.566555023193 199.302227020264,179.566555023193 199.302227020264,191.499996185303 84.3891906738281,191.499996185303 84.3891906738281,179.566555023193 126.657970428467,179.566555023193z M73.9703731536865,74.9139022827148L246.564800262451,74.9139022827148 285.305004119873,92.4833106994629 246.564800262451,109.388332366943 73.9703731536865,109.388332366943z M38.7448372840881,27.1810321807861L211.339275360107,27.1810321807861 211.339275360107,61.6555194854736 38.7448372840881,61.6555194854736 0,44.7505570948124z M126.657970428467,0L158.354923248291,0 158.354923248291,17.3319454193115 126.657970428467,17.3319454193115z"
            };
            FunctionList.Add(m);

            m = new MenuListItem
            {
                Name  = "Alarm",
                MenuF = MenuFunc.Alarm,
                Icon  =
                    "M10.05,5.0760006L11.384528,5.0760006 11.384528,9.4289235 14.873,9.4289235 14.873,10.765 11.384528,10.765 10.716714,10.765 10.05,10.765z M10.73913,2.9416503C6.7547405,2.9416503 3.5139221,6.1813825 3.5139223,10.164588 3.5139221,14.146413 6.7547405,17.386114 10.73913,17.386114 14.720629,17.386114 17.960248,14.146413 17.960248,10.164588 17.960248,6.1813825 14.720629,2.9416503 10.73913,2.9416503z M10.73913,1.0340003C15.780502,1.0340003 19.869,5.1214088 19.869,10.164588 19.869,13.673698 17.884551,16.716793 14.979723,18.246841L16.843076,20.11 13.88215,20.11 12.819678,19.047666C12.149094,19.203972 11.455212,19.294975 10.73913,19.294975 10.050247,19.294975 9.3823044,19.212973 8.7364399,19.067169L7.6948469,20.11 4.7339809,20.11 6.564625,18.278044C3.6233492,16.763697 1.6089999,13.701098 1.6089998,10.164588 1.6089999,5.1214088 5.6961172,1.0340003 10.73913,1.0340003z M17.033309,8.7380409E-05C17.92249,-0.0075750351 19.01958,0.49064106 19.93044,1.4016109 21.319918,2.7910937 21.749642,4.6115907 20.890294,5.4697789 20.749587,5.6116933 20.576377,5.7042331 20.388966,5.7770003 19.417512,3.611488 17.756016,1.8235244 15.675,0.70371947 15.732403,0.61246994 15.785705,0.51870531 15.86381,0.44191551 16.158833,0.14691561 16.567549,0.0041009188 17.033309,8.7380409E-05z M4.2990081,8.7022781E-05C4.7646682,0.0041009188 5.1732659,0.14691561 5.4681668,0.44191515 5.5463498,0.51870531 5.5998151,0.61246994 5.6569998,0.70371914 3.5764955,1.8235244 1.9152038,3.611488 0.94392025,5.7770003 0.75649714,5.7042331 0.58335257,5.6116933 0.44261813,5.4697789 -0.41655827,4.6115907 0.013091445,2.7910937 1.4021895,1.4016109 2.313062,0.49064106 3.4100208,-0.0075750351 4.2990081,8.7022781E-05z"
            };
            FunctionList.Add(m);

            m = new MenuListItem
            {
                Name  = "Setting",
                MenuF = MenuFunc.Settings,
                Icon  =
                    "M383.482,203.57C284.07,203.57 203.534,284.142 203.534,383.554 203.534,482.93 284.07,563.502 383.482,563.502 482.894,563.502 563.431,482.93 563.431,383.554 563.431,284.142 482.894,203.57 383.482,203.57z M338.073,0L428.927,0 428.927,117.641C469.52,124.544,507.055,140.471,539.377,163.41L622.574,80.1771 686.823,144.462 603.627,227.659C626.565,259.982,642.457,297.481,649.396,338.073L767,338.073 767,428.963 649.432,428.963C642.492,469.52,626.565,507.091,603.627,539.378L686.823,622.574 622.538,686.788 539.377,603.626C507.055,626.601,469.555,642.528,428.927,649.432L428.927,767 338.073,767 338.073,649.432C297.409,642.528,259.909,626.601,227.587,603.626L144.426,686.788 80.2128,622.574 163.374,539.378C140.399,507.091,124.508,469.591,117.569,428.963L0,428.963 0,338.073 117.569,338.073C124.508,297.481,140.435,259.982,163.374,227.659L80.1766,144.462 144.426,80.2133 227.623,163.41C259.909,140.471,297.445,124.544,338.073,117.641z"
            };
            BottomFunctionList.Add(m);
        }
Example #23
0
        /// <summary>
        /// Creates the menu.
        /// </summary>
        private void CreateMenu()
        {
            menu = new Menu("Time & Weather Options", "Time & Weather Options");

            clientSidedEnabled = new MenuCheckboxItem("Client-Sided Time & Weather", "Enable or disable client-sided time and weather changes.", false);
            menu.AddMenuItem(clientSidedEnabled);

            timeFrozen = new MenuCheckboxItem("Freeze Time", "Enable or disable time freezing.", false);
            menu.AddMenuItem(timeFrozen);

            List <string> timeData = new List <string>();

            for (var i = 0; i < 24; i++)
            {
                timeData.Add(i.ToString() + ".00");
            }
            timeDataList = new MenuListItem("Change Time", timeData, 12, "Select time of day.");
            menu.AddMenuItem(timeDataList);

            weatherList = new MenuListItem("Change Weather", weatherListData, 0, "Select weather.");
            menu.AddMenuItem(weatherList);
        }
Example #24
0
        private void InitializeMenuData()
        {
            MenuList = new ObservableCollection <MenuListItem>();
            //初始化一个菜单列表
            MenuListItem item = new MenuListItem
            {
                Name      = "MusicView",
                IsEnabled = true,
                GotoView  = MenuGotoView.MusicView,
                Icon      = "M48.850243,32.061127L40.837259,42.988266 36.466324,40.074284 26.633064,51.365921 61.962049,51.365921 57.591017,36.067707 52.492086,36.067707z M30.036716,26.927057C27.798449,26.927057 25.983376,28.740846 25.983376,30.979034 25.983376,33.21732 27.798449,35.031313 30.036716,35.031313 32.273483,35.031313 34.088657,33.21732 34.088657,30.979034 34.088657,28.740846 32.273483,26.927057 30.036716,26.927057z M17.322001,19.069001L65.332998,19.069001 65.332998,54.707001 17.322001,54.707001z M42.922237,0L50.809,15.735769 13.98841,15.735769 13.98841,49.422001 0,21.513156z"
            };

            MenuList.Add(item);
            item = new MenuListItem
            {
                Name      = "RadioListView",
                IsEnabled = true,
                GotoView  = MenuGotoView.RadioListView,
                Icon      = "M31.348,48.494C32.685356,48.494 33.770001,49.577489 33.770001,50.913598 33.770001,52.249612 32.685356,53.333001 31.348,53.333001 30.013346,53.333001 28.930001,52.249612 28.930001,50.913598 28.930001,49.577489 30.013346,48.494 31.348,48.494z M22.1227,48.494C23.457356,48.494 24.542,49.577489 24.542,50.913598 24.542,52.249612 23.457356,53.333001 22.1227,53.333001 20.785345,53.333001 19.702,52.249612 19.702,50.913598 19.702,49.577489 20.785345,48.494 22.1227,48.494z M35.26405,41.272998C36.60138,41.272998 37.686001,42.357621 37.686001,43.69365 37.686001,45.029576 36.60138,46.113 35.26405,46.113 33.929424,46.113 32.846001,45.029576 32.846001,43.69365 32.846001,42.357621 33.929424,41.272998 35.26405,41.272998z M26.508051,41.272998C27.845278,41.272998 28.930001,42.357621 28.930001,43.69365 28.930001,45.029576 27.845278,46.113 26.508051,46.113 25.173323,46.113 24.09,45.029576 24.09,43.69365 24.09,42.357621 25.173323,41.272998 26.508051,41.272998z M17.2318,41.272998C18.567579,41.272998 19.652001,42.357621 19.652001,43.69365 19.652001,45.029576 18.567579,46.113 17.2318,46.113 15.896121,46.113 14.813,45.029576 14.813,43.69365 14.813,42.357621 15.896121,41.272998 17.2318,41.272998z M44.021054,19.436998L46.029053,20.664867C46.758328,21.111492 46.98745,22.068645 46.540806,22.799085 46.17791,23.393704 45.478031,23.656512 44.837174,23.493527L44.815964,23.486991 44.755482,23.36905C44.331001,22.588596,43.814919,21.86488,43.221752,21.212421L43.130867,21.117109 43.312847,20.826513C43.580288,20.382326,43.817284,19.918125,44.021054,19.436998z M44.828007,13.720999L47.233292,13.786101C48.090233,13.810902 48.76614,14.523125 48.741337,15.381254 48.719235,16.238081 48.005619,16.913905 47.148682,16.890402L44.771996,16.825301C44.846211,16.353886 44.893116,15.874769 44.908718,15.386453 44.92432,14.821335 44.895718,14.266617 44.828007,13.720999z M21.976753,10.773001C26.979286,10.773001 31.208513,14.566015 32.614826,19.786035 33.396027,19.568634 34.218937,19.442332 35.069241,19.442332 40.136975,19.442332 44.245003,23.550448 44.245003,28.616866 44.245003,31.877278 42.539391,34.731389 39.976872,36.357696 38.948166,37.194999 37.640854,37.698899 36.213749,37.710603 35.840042,37.756803 35.459843,37.790002 35.069241,37.790002 34.687737,37.790002 34.312737,37.756803 33.940331,37.7119L10.320378,37.7119C9.942775,37.756803 9.5625736,37.790002 9.1705706,37.790002 4.1054971,37.790002 2.7073101E-07,33.840787 0,28.969668 2.7073101E-07,24.09855 4.1054971,20.150635 9.1705706,20.150635 9.871175,20.150635 10.552179,20.232635 11.208384,20.375936 12.447993,14.856316 16.789219,10.773001 21.976753,10.773001z M45.672386,7.174134C46.223133,7.1814017 46.751801,7.4817498 47.025681,8.0036976 47.424053,8.762845 47.132473,9.7023534 46.374729,10.100129L44.221188,11.232998C43.857914,10.249938,43.361851,9.3319101,42.749996,8.4998286L44.929535,7.352598C45.167145,7.2280803,45.422043,7.1708302,45.672386,7.174134z M22.363896,6.4076095C22.626137,6.4149718,22.889933,6.4890428,23.129202,6.6360126L25.232002,7.9243071C24.983002,8.2199299,24.749006,8.5292008,24.531187,8.8507769L24.325581,9.1660111 23.90588,9.0875378C23.275191,8.9828922 22.630835,8.9289981 21.976551,8.9289984 21.806952,8.9289981 21.637982,8.9326974 21.469708,8.9400355L21.134642,8.961946 21.056421,8.86325C20.704596,8.3712656 20.660401,7.6966183 20.996401,7.148304 21.275526,6.6914134 21.754027,6.4305587 22.251677,6.4085212 22.289,6.4068675 22.326431,6.4065576 22.363896,6.4076095z M33.776642,5.6300144C33.857746,5.6301656 33.939079,5.6313434 34.020622,5.6335616 39.242119,5.7754722 43.354096,10.120625 43.213494,15.340688 43.169556,16.971583 42.715012,18.494635 41.951519,19.813686L41.865544,19.954264 41.657589,19.790779C39.818852,18.414998 37.537552,17.599476 35.068867,17.599476 34.66787,17.599476 34.261574,17.622975 33.857876,17.668475 32.385815,13.866086 29.595959,11.014804 26.199589,9.711732L26.027451,9.6495949 26.288347,9.2962282C28.025217,7.0564322,30.74283,5.6243949,33.776642,5.6300144z M40.950501,2.1025438C41.249367,2.0946379 41.553959,2.1728296 41.825966,2.345706 42.547425,2.8067083 42.760941,3.7664986 42.298603,4.4892459L40.963902,6.5819988C40.17614,5.913939,39.294472,5.3526425,38.339997,4.9202757L39.681301,2.8197699C39.9702,2.3680468,40.452393,2.1157179,40.950501,2.1025438z M27.487883,1.5610685C28.038714,1.5662165,28.569157,1.8650618,28.844816,2.3860846L30.014,4.5899091C29.027098,4.9434433,28.105391,5.4317431,27.266875,6.033999L26.101694,3.8418369C25.700634,3.0827036 25.989704,2.1438856 26.746128,1.7428083 26.982916,1.6170683 27.237505,1.5587282 27.487883,1.5610685z M34.094422,0.00037670135C34.120896,-0.00020503998 34.147526,-0.00011539459 34.174298,0.00065898895 35.032345,0.022751808 35.706803,0.73763561 35.683403,1.593688L35.615608,4.0929995C35.11044,4.0083418 34.593571,3.9536633 34.066303,3.9406538 33.541535,3.9269848 33.023365,3.952373 32.512997,4.0096216L32.580693,1.5110502C32.603359,0.67979717,33.273724,0.018374443,34.094422,0.00037670135z"
            };
            MenuList.Add(item);
        }
Example #25
0
        public static void AddMenuListItem(string item, string subitem, Func <Task> onSelect)
        {
            foreach (var menuItem in _menu.GetMenuItems())
            {
                if (menuItem is MenuListItem && menuItem.Text == item)
                {
                    var subitems = ((MenuListItem)menuItem).ListItems;
                    subitems.Add(subitem);
                    _menuListItemActions[menuItem.Index].Add(onSelect);
                    return;
                }
            }

            var menuListItem = new MenuListItem(item, new List <string> {
                subitem
            }, 0);

            _menu.AddMenuItem(menuListItem);
            _menuListItemActions.Add(menuListItem.Index, new List <Func <Task> > {
                onSelect
            });
        }
Example #26
0
        private void CreateMenu()
        {
            Menu        = new Menu(Game.Player.Name, "Style");
            Accessories = new Accessories();

            MenuController.AddSubmenu(Menu, Accessories.GetMenu());
            MenuItem AccessoriesItem = new MenuItem("Accessories", "Contains options that allow you to change your parachute appearance.");

            Menu.AddMenuItem(AccessoriesItem);
            MenuController.BindMenuItem(Menu, Accessories.GetMenu(), AccessoriesItem);

            toggleMotorcycleHelmetOptionsItem = new MenuListItem("Auto Show Bike Helmet", toggleMotorcycleHelmetOptions, 0);
            Menu.AddMenuItem(toggleMotorcycleHelmetOptionsItem);

            Menu.OnListItemSelect += (sender, listItem, listIndex, realIndex) =>
            {
                if (listItem == toggleMotorcycleHelmetOptionsItem)
                {
                    API.SetPedConfigFlag(Game.Player.Character.Handle, 35, !Convert.ToBoolean(listIndex));
                }
            };
        }
Example #27
0
        private void MenuListItem_OnTapped(object sender, TappedRoutedEventArgs e)
        {
            MenuListItem m = ((Grid)sender).DataContext as MenuListItem;


            //Debug.Assert(m != null, "m != null");
            if (m != null && m.MenuF != _currentFrame)
            {
                var n             = Vm.FunctionItemList.Where((a) => a.MenuF == _currentFrame);
                var menuListItems = n as MenuListItem[] ?? n.ToArray();
                if (!menuListItems.Any())
                {
                    menuListItems = Vm.BottomFunctionItemList.Where((a) => a.MenuF == _currentFrame).ToArray();
                }
                var currentMenu = menuListItems[0];
                currentMenu.IsEnabled = false;
                NavigateToPage(m.MenuF);
                _currentFrame = m.MenuF;
                m.IsEnabled   = true;
            }
            Vm.IsSplitViewPaneOpened = false;
        }
        public void Initialize()
        {
            FunctionList = new ObservableCollection <MenuListItem>();

            MenuListItem m = new MenuListItem
            {
                Name  = "Map Source",
                MenuF = MenuFunc.MapSource,
                Icon  =
                    "M40.764999,0.046999931L64,10.093993 64,15.637031 40.764999,25.752998 40.764999,19.216354 56.9785,12.841311 40.764999,6.5366688z M23.212,0L23.212,6.5818844 7.0216017,12.772051 23.212,19.192526 23.212,25.729 0,15.636739 0,10.046861z"
            };

            FunctionList.Add(m);

            m = new MenuListItem
            {
                Name  = "Update database",
                MenuF = MenuFunc.UpdateDatabase,
                Icon  =
                    "M0,33.893959L4.4794149,33.893959 4.4794149,44.677959 48.903614,44.677959 48.903614,33.893959 53.333035,33.893959 53.333035,49.104958 0,49.104958z M24.842734,0L28.513577,0 28.513577,24.615005 35.345016,17.78297 40.346104,17.78297 40.436089,17.883007 26.673088,31.644001 24.072548,29.047991 12.910089,17.883007 13.010208,17.78297 18.001283,17.78297 24.842734,24.615005z"
            };
            FunctionList.Add(m);
        }
Example #29
0
        public void AddMenuListItemAsync(string item, string subitem, Func <Task> onSelect)
        {
            MenuController.DontOpenAnyMenu = false;

            foreach (var menuItem in GetMenuItems())
            {
                if (menuItem is MenuListItem && menuItem.Text == item)
                {
                    var subitems = ((MenuListItem)menuItem).ListItems;
                    subitems.Add(subitem);
                    _menuListItemActions[menuItem.Index].Add(onSelect);
                    return;
                }
            }

            var menuListItem = new MenuListItem(item, new List <string> {
                subitem
            }, 0);

            AddMenuItem(menuListItem);
            _menuListItemActions.Add(menuListItem.Index, new List <Func <Task> > {
                onSelect
            });
        }
        private void AddTopFunctionList()
        {
            TopFunctionList = new ObservableCollection <MenuListItem>();
            MenuListItem m = new MenuListItem
            {
                Name =
                    ResourceManager.Current.MainResourceMap.GetValue(
                        "Resources/StartViewModel_AddTopFunctionList_Render_all_Sizes", new ResourceContext())
                    .ValueAsString,
                MenuF     = MenuFunc.RenderSizes,
                IsEnabled = true,
                Icon      =
                    "M21.994995,11.757997L12.500992,22.164003 21.994995,22.164003z M9.9360046,9.0230113L9.9360046,20.296007 20.220001,9.0230113z M6.647995,0L9.9360046,0 9.9360046,6.035996 22.942993,6.035996 28.280991,0.18600463 30.813995,2.0930024 25.285004,8.1530009 25.285004,22.164003 32,22.164003 32,25.151003 25.350998,25.151003 25.350998,31.187 22.065002,31.187 22.065002,25.151003 6.647995,25.151003 6.647995,9.0230113 0,9.0230113 0,6.035996 6.647995,6.035996z"
            };

            TopFunctionList.Add(m);

            m = new MenuListItem
            {
                Name      = ResourceManager.Current.MainResourceMap.GetValue("Resources/StartViewModel_AddBottomFunctionList_Add_new_size", new ResourceContext()).ValueAsString,
                MenuF     = MenuFunc.Add,
                IsEnabled = false,
                Icon      =
                    "M12.099999,0L18.700002,0 18.700002,12.6 30.8,12.6 30.8,19.499998 18.800008,19.499998 18.800008,31.999998 12.200005,31.999998 12.200005,19.4 0,19.4 0,12.500001 12.099999,12.500001z"
            };
            TopFunctionList.Add(m);

            //m = new MenuListItem
            //{
            //    Name = ResourceManager.Current.MainResourceMap.GetValue("Resources/StartViewModel_AddTopFunctionList_Add_from_SVG", new ResourceContext()).ValueAsString,
            //    MenuF = MenuFunc.AddSvg,
            //    Icon =
            //        "M28,28L28,30.699951 30.700012,30.699951 30.700012,28z M1.3000488,1.5L1.3000488,4.1999512 4,4.1999512 4,1.5z M16,0C17.5,0 18.700012,1.1999512 18.700012,2.6999512 18.700012,3.8999634 17.900024,4.8999634 16.800049,5.2999878L16.700012,5.2999878 16.700012,13.399963 18.800049,13.399963 18.800049,19.099976 16.700012,19.099976 16.800049,19.399963C17.600037,22.399963,19.900024,27,26.5,28.199951L26.800049,28.199951 26.800049,26.699951 32,26.699951 32,32 26.800049,32 26.800049,29.5C21.400024,28.699951,18.5,25.699951,16.900024,22.899963L16.800049,22.699951 16.800049,26.699951 16.900024,26.699951C18,27 18.800049,28.099976 18.800049,29.299988 18.800049,30.799988 17.600037,32 16.100037,32 14.600037,32 13.400024,30.799988 13.400024,29.299988 13.400024,28.099976 14.200012,27.099976 15.300049,26.699951L15.300049,19.099976 13.300049,19.099976 13.300049,13.399963 15,13.399963 14.900024,13.099976C13.5,6.1999512,8.1000366,4.1999512,5.3000488,3.6999512L5.2000122,3.6999512 5.2000122,5.5999756 0,5.5999756 0,0.19995117 5.2000122,0.19995117 5.2000122,2.2999878C7.7000122,2.7999878,12.700012,4.3999634,15.100037,9.5999756L15.200012,9.7999878 15.200012,5.1999512C14.100037,4.8999634 13.300049,3.7999878 13.300049,2.5999756 13.300049,1.1999512 14.5,0 16,0z"
            //};
            //TopFunctionList.Add(m);
        }