Exemple #1
0
 public void Exit()
 {
     _itemList.Clear();
     Destroy(_itemList);
     this.gameObject.SetActive(false);
     _player.CurrentState = Player.State.Idle;
 }
Exemple #2
0
    private void _on_ReceiptList_item_selected(int _index)
    {
        //if a receipt is selected from the list, display it info
        var _title = receiptList.GetItemText(_index);

        initialTitle = _title;               //store title higher in the scope as well to be used outside

        for (var l = 0; l < list.Count; l++) //add each item to list
        {
            if (_title == list[l]["Title"].ToString())
            {
                receiptIngredients.Clear();
                IngredientList.Clear();

                receiptTitle.Text       = _title;
                receiptDescription.Text = list[l]["Description"].ToString();
                var _ingredientList = list[l]["Ingredients"].ToList();
                for (var i = 0; i < _ingredientList.Count; i++)
                {
                    var _amount     = _ingredientList[i]["Amount"].ToString();
                    var _volume     = _ingredientList[i]["Volume"].ToString();
                    var _ingredient = _ingredientList[i]["Ingredient"].ToString();
                    receiptIngredients.AddItem($"{_amount} {_volume} {_ingredient}");
                    IngredientList.Add(new Ingredient(_amount, _volume, _ingredient));
                }
            }
        }
    }
Exemple #3
0
 private void MenuCutClick(object sender, EventArgs e)
 {
     if (initialRow != -1)
     {
         clipboard.Clear();
         clipboard.Add(((ItemView)Rows[initialRow].DataBoundItem).Item);
         Items.RemoveAt(initialRow);
     }
 }
 private void DestroyComponentsCreateTrade()
 {
     _itemListPlayer1PropertiesLeft.Clear();
     _itemListPlayer1PropertiesOffer.Clear();
     _itemListPlayer2PropertiesLeft.Clear();
     _itemListPlayer2PropertiesOffer.Clear();
     Destroy(_itemListPlayer1PropertiesLeft);
     Destroy(_itemListPlayer1PropertiesOffer);
     Destroy(_itemListPlayer2PropertiesLeft);
     Destroy(_itemListPlayer2PropertiesOffer);
 }
Exemple #5
0
        public void UpdateIssuesList()
        {
            issuesList.Clear();

            using (var warningIcon = GetIcon("Warning", "EditorIcons"))
                using (var errorIcon = GetIcon("Error", "EditorIcons"))
                {
                    for (int i = 0; i < issues.Count; i++)
                    {
                        BuildIssue issue = issues[i];

                        if (!(issue.Warning ? WarningsVisible : ErrorsVisible))
                        {
                            continue;
                        }

                        string tooltip = string.Empty;
                        tooltip += $"Message: {issue.Message}";

                        if (!issue.Code.Empty())
                        {
                            tooltip += $"\nCode: {issue.Code}";
                        }

                        tooltip += $"\nType: {(issue.Warning ? "warning" : "error")}";

                        string text = string.Empty;

                        if (!issue.File.Empty())
                        {
                            text += $"{issue.File}({issue.Line},{issue.Column}): ";

                            tooltip += $"\nFile: {issue.File}";
                            tooltip += $"\nLine: {issue.Line}";
                            tooltip += $"\nColumn: {issue.Column}";
                        }

                        if (!issue.ProjectFile.Empty())
                        {
                            tooltip += $"\nProject: {issue.ProjectFile}";
                        }

                        text += issue.Message;

                        int    lineBreakIdx = text.IndexOf("\n", StringComparison.Ordinal);
                        string itemText     = lineBreakIdx == -1 ? text : text.Substring(0, lineBreakIdx);
                        issuesList.AddItem(itemText, issue.Warning ? warningIcon : errorIcon);

                        int index = issuesList.GetItemCount() - 1;
                        issuesList.SetItemTooltip(index, tooltip);
                        issuesList.SetItemMetadata(index, i);
                    }
                }
        }
Exemple #6
0
        private void RetrieveItems(int orderNumber)
        {
            try
            {
                ItemList.Clear();
                ItemList = ItemFactory.RetrieveByOrderNumber(orderNumber);

                Employee tmpEmployee = EmployeeFactory.RetrieveByOrderNumber(orderNumber);
                tmpDepartment      = DepartmentFactory.RetrieveByEmployeeId(tmpEmployee.Id);
                txtEmployee.Text   = tmpEmployee.FirstName + " " + tmpEmployee.LastName;
                txtDepartment.Text = tmpDepartment.Title;
                txtSupervisor.Text = tmpDepartment.SupervisorName;

                Order = PurchaseOrderFactory.RetrieveByNumber(orderNumber, tmpEmployee.Id);
                grdItems.DataSource = ItemList;
                grdItems.DataBind();

                txtPONumber.Text     = Order.OrderNumber.ToString();
                txtCreationDate.Text = Order.OrderDate.ToShortDateString();
                txtStatus.Text       = Order.Status;
                txtSubtotal.Text     = String.Format("{0:C}", Order.Subtotal);
                txtTaxes.Text        = String.Format("{0:C}", Order.Taxes);
                txtTotal.Text        = String.Format("{0:C}", Order.Total);

                orderDetails.Attributes.Add("style", "display:block");
                confirmation.Attributes.Add("style", "display:none");
                lblMessage.Text = "";
            }
            catch (Exception ex)
            {
                confirmation.Attributes.Add("style", "display:block");
                lblMessage.Text = ex.Message + " " + ex.GetType().ToString();
            }
        }
Exemple #7
0
        /// <summary>Assigns all controls to modifiable values.</summary>
        private void AssignControls()
        {
            BtnAttack          = (Button)GetNode("BtnAttack");
            BtnCastSpell       = (Button)GetNode("BtnCastSpell");
            BtnEnemyDetails    = (Button)GetNode("Enemy/CC/VB/BtnEnemyDetails");
            BtnFlee            = (Button)GetNode("BtnFlee");
            BtnLootBody        = (Button)GetNode("Enemy/CC/VB/BtnLootBody");
            BtnReturn          = (Button)GetNode("BtnReturn");
            LstSpells          = (ItemList)GetNode("LstSpells");
            LblHeroName        = (Label)GetNode("Hero/LblName");
            LblHeroHealth      = (Label)GetNode("Hero/LblHealth");
            LblHeroMagic       = (Label)GetNode("Hero/LblMagic");
            LblHeroShield      = (Label)GetNode("Hero/LblShield");
            LblEnemyName       = (Label)GetNode("Enemy/LblName");
            LblEnemyHealth     = (Label)GetNode("Enemy/LblHealth");
            LblEnemyMagic      = (Label)GetNode("Enemy/LblMagic");
            LblEnemyShield     = (Label)GetNode("Enemy/LblShield");
            LblSpellTypeAmount = (Label)GetNode("LblSpellTypeAmount");
            LblSpellCost       = (Label)GetNode("LblSpellCost");
            LblWeight          = (Label)GetNode("Hero/LblWeight");
            TxtBattle          = (RichTextLabel)GetNode("TxtBattle");

            LstSpells.Clear();
            foreach (Spell spl in GameState.CurrentHero.Spellbook.Spells)
            {
                LstSpells.AddItem(spl.Name);
            }
            if (GameState.CurrentHero.CurrentSpell != new Spell())
            {
                LstSpells.Select(GameState.CurrentHero.Spellbook.Spells.IndexOf(GameState.CurrentHero.CurrentSpell));
            }
        }
Exemple #8
0
 public void Stop()
 {
     Players.Clear();
     List.Clear();
     Turn            = 0;
     Action.Disabled = true;
 }
    public void UpdateLists()
    {
        Spectators.Clear();
        RedTeam.Clear();
        BlueTeam.Clear();


        UserManager = GetNode("/root/GameRoot/GameWorld/Users");
        Godot.Collections.Array users = UserManager.GetChildren();

        foreach (Node p in users)
        {
            UserProvider user = (UserProvider)p;
            switch (user.ThisTeam)
            {
            case UserProvider.Team.Unassigned:
                Spectators.AddItem(user.Alias);
                break;

            case UserProvider.Team.Red:
                RedTeam.AddItem(user.Alias);
                break;

            case UserProvider.Team.Blue:
                BlueTeam.AddItem(user.Alias);
                break;
            }
        }
    }
        public void Populate(int serverCount, string[] serverNames, int[] serverIds, int selectedServerId)
        {
            _serverCount      = serverCount;
            _serverNames      = serverNames;
            _serverIds        = serverIds;
            _selectedServerId = selectedServerId;

            // Disable so we can select the new selected server without triggering a new sync request.
            _servers.OnItemSelected   -= OnItemSelected;
            _servers.OnItemDeselected -= OnItemDeselected;

            _servers.Clear();
            for (var i = 0; i < _serverCount; i++)
            {
                var id = _serverIds[i];
                _servers.AddItem(Loc.GetString("research-client-server-selection-menu-server-entry-text", ("id", id), ("serverName", _serverNames[i])));
                if (id == _selectedServerId)
                {
                    _servers[id].Selected = true;
                }
            }

            _servers.OnItemSelected   += OnItemSelected;
            _servers.OnItemDeselected += OnItemDeselected;
        }
Exemple #11
0
    void _selectAlbum(ButtonBase <Button> _button)
    {
        selectAlbum = _button.Id;
        selectBtn   = _button.VId;
        var cfg = ConfigManager.Instance.GetRes <AnimeConfig>(npkKeys[selectAlbum]);

        $"{_button.Id} {npkKeys[_button.Id]} {cfg.key}".log();

        spriteList.Clear();
        if (selectBtn > 0 && selectBtn != _button.VId)
        {
            buttons[selectBtn].target.Flat = false;
            ConfigManager.Instance.UnloadRes(ConfigManager.Instance.GetRes <AnimeConfig>(npkKeys[buttons[selectBtn].Id]));
        }
        //albumList.ScrollIndex(selectAlbum, _button.Id);

        buttons[_button.VId].target.Flat = true;
        var album = cfg.Frames;

        for (int i = 0; i < album.Length; i++)
        {
            spriteList.AddItem($"{album[i].Image} {album[i].ImageIdx} {album[i].Delay}");
        }
        if (album.Length > 0)
        {
            setImage(0);
        }
    }
Exemple #12
0
        public override async void PerformSearch(string query)
        {
            IsBusy = true;

            try
            {
                ItemList.Clear();

                var filteredsongs = string.IsNullOrWhiteSpace(query) ? await DataStore.GetAllAsync(true) : await((SongRealmDataStore)DataStore).GetByName(query);

                foreach (var song in filteredsongs)
                {
                    ItemList.Add(song);
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(string.Format("SongListViewModel: Could not PerformSearch() with query: '{0}'.", query));
                Debug.WriteLine(e.Message);
            }
            finally
            {
                IsBusy = false;
            }
        }
Exemple #13
0
        private void PopulateBy(string search, string category)
        {
            _recipes.Clear();

            foreach (var recipe in _prototypeManager.EnumeratePrototypes <ConstructionPrototype>())
            {
                if (!string.IsNullOrEmpty(search))
                {
                    if (!recipe.Name.ToLowerInvariant().Contains(search.Trim().ToLowerInvariant()))
                    {
                        continue;
                    }
                }

                if (!string.IsNullOrEmpty(category) && category != Loc.GetString("All"))
                {
                    if (recipe.Category != category)
                    {
                        continue;
                    }
                }

                _recipes.Add(GetItem(recipe, _recipes));
            }
        }
        private void BuildTileList(string searchStr = null)
        {
            TileList.Clear();

            IEnumerable <ITileDefinition> tileDefs = __tileDefinitionManager;

            if (!string.IsNullOrEmpty(searchStr))
            {
                tileDefs = tileDefs.Where(s =>
                                          s.DisplayName.IndexOf(searchStr, StringComparison.InvariantCultureIgnoreCase) >= 0 ||
                                          s.Name.IndexOf(searchStr, StringComparison.OrdinalIgnoreCase) >= 0);
            }

            tileDefs = tileDefs.OrderBy(d => d.DisplayName);

            _shownItems = tileDefs.ToList();

            foreach (var entry in _shownItems)
            {
                Texture texture = null;
                if (!string.IsNullOrEmpty(entry.SpriteName))
                {
                    texture = _resourceCache.GetResource <TextureResource>($"/Textures/Tiles/{entry.SpriteName}.png");
                }
                TileList.AddItem(entry.DisplayName, texture);
            }
        }
    // Refresh Lobby's player list
    // This is run after we have gotten updates from the server regarding new players
    public void RefreshLobby()
    {
        // Get the latest list of players from NetworkManager.Instance
        object[][] playerList = NetworkManager.Instance.GetPlayerList();

        // Add the updated player_list to the itemlist
        ItemList itemlist = lobbyContainer.FindNode("itemlist_players") as ItemList;

        itemlist.Clear();
        itemlist.AddItem(NetworkManager.Instance.GetPlayerName() + " (YOU)"); // Add yourself to the top

        // Add every other player to the list
        foreach (object[] player in playerList)
        {
            if (player[0] != NetworkManager.Instance.GetPlayerName())
            {
                itemlist.AddItem(player[0].ToString());
            }
        }

        // If you are not the server, we disable the 'start game' button
        if (!GetTree().IsNetworkServer())
        {
            ((Button)lobbyContainer.FindNode("start_game_button")).Disabled = false;
        }
    }
Exemple #16
0
    void _selectAlbum(ButtonBase <Button> _button)
    {
        var npk  = ResourceManager.Instance.allNpkData[npkKeys[_button.Id]];
        var path = System.IO.Path.GetFileName(npk.filePath);

        $"{_button.Id} {npkKeys[_button.Id]} {path} {npk.index}".log();
        npk.album.LoadImage(npk.filePath);
        spriteList.Clear();
        if (selectBtn > 0 && selectBtn != _button.VId)
        {
            buttons[selectBtn].target.Flat = false;
            ResourceManager.Instance.allNpkData[npkKeys[buttons[selectBtn].Id]].album.UnloadImage();
        }
        //albumList.ScrollIndex(selectAlbum, _button.Id);
        selectAlbum = _button.Id;
        selectBtn   = _button.VId;
        buttons[_button.VId].target.Flat = true;
        var album = npk.album;

        for (int i = 0; i < album.List.Count; i++)
        {
            spriteList.AddItem($"{album.List[i].Index} {album.List[i].Version} {album.List[i].Type} {album.List[i].Height} {album.List[i].Width} {album.List[i].FrameSize} {album.List[i].Location}");
        }
        if (album.Count > 0)
        {
            setImage(0);
        }
    }
        public void Populate(int serverCount, string[] serverNames, int[] serverIds, int selectedServerId)
        {
            _serverCount      = serverCount;
            _serverNames      = serverNames;
            _serverIds        = serverIds;
            _selectedServerId = selectedServerId;

            // Disable so we can select the new selected server without triggering a new sync request.
            _servers.OnItemSelected   -= OnItemSelected;
            _servers.OnItemDeselected -= OnItemDeselected;

            _servers.Clear();
            for (var i = 0; i < _serverCount; i++)
            {
                var id = _serverIds[i];
                _servers.AddItem($"ID: {id} || {_serverNames[i]}");
                if (id == _selectedServerId)
                {
                    _servers[id].Selected = true;
                }
            }

            _servers.OnItemSelected   += OnItemSelected;
            _servers.OnItemDeselected += OnItemDeselected;
        }
Exemple #18
0
        /// <summary>
        /// 商品情報一覧取得
        /// </summary>
        /// <returns></returns>
        async Task GetItemList()
        {
            // 商品情報一覧を取得
            var targetItemList = await ItemMethod.GetItemListAsync(true);

            // 初期化
            ItemList.Clear();
            ProductPoint = string.Empty;
            TotalSales   = string.Empty;

            // 取得した商品を画面表示用のコレクションに追加&合計金額を取得
            decimal totalSales = 0;

            foreach (var item in targetItemList)
            {
                totalSales += Convert.ToDecimal(item.SalePrice);
                ItemList.Add(item);
            }

            // 商品点数を設定
            ProductPoint = ItemList.Count.ToString();

            // 合計金額を設定
            TotalSales = DisplayUtil.convertNumToDisplay(totalSales.ToString());
        }
Exemple #19
0
    public void RefreshPluginList(bool StartupCall)
    {
        PluginItemList.Clear();
        CreatePluginListHeader();

        // Used so we don't go through the plugin directory twice on startup
        if (!StartupCall)
        {
            GlobalSettings.CheckForNewPlugins();
        }

        string[] EnabledPluginNames = (string[])GlobalSettings.UserConfig.GetValue("plugins", "enabled_plugins");
        foreach (string PluginName in EnabledPluginNames)
        {
            PluginItemList.AddItem(PluginName);
            PluginItemList.AddItem("y");
        }

        string[] DisabledPluginNames = (string[])GlobalSettings.UserConfig.GetValue("plugins", "disabled_plugins");
        foreach (string PluginName in DisabledPluginNames)
        {
            PluginItemList.AddItem(PluginName);
            PluginItemList.AddItem("n");
        }

        // string[] InactivePluginNames = GlobalSettings.UserConfig.GetInactivePlugins();
        // foreach (string PluginName in InactivePluginNames)
        // {
        //     PluginItemList.AddItem(PluginName);
        //     PluginItemList.AddItem("i");
        // }
    }
        /// <summary>
        ///     Populate all technologies in the ItemLists.
        /// </summary>
        public void PopulateItemLists()
        {
            _unlockedTechnologies.Clear();
            _unlockableTechnologies.Clear();
            _futureTechnologies.Clear();

            _unlockedTechnologyPrototypes.Clear();
            _unlockableTechnologyPrototypes.Clear();
            _futureTechnologyPrototypes.Clear();

            var prototypeMan = IoCManager.Resolve <IPrototypeManager>();

            // For now, we retrieve all technologies. In the future, this should be changed.
            foreach (var tech in prototypeMan.EnumeratePrototypes <TechnologyPrototype>())
            {
                if (Owner.IsTechnologyUnlocked(tech))
                {
                    _unlockedTechnologies.AddItem(tech.Name, tech.Icon.Frame0());
                    _unlockedTechnologyPrototypes.Add(tech);
                }
                else if (Owner.CanUnlockTechnology(tech))
                {
                    _unlockableTechnologies.AddItem(tech.Name, tech.Icon.Frame0());
                    _unlockableTechnologyPrototypes.Add(tech);
                }
                else
                {
                    _futureTechnologies.AddItem(tech.Name, tech.Icon.Frame0());
                    _futureTechnologyPrototypes.Add(tech);
                }
            }
        }
Exemple #21
0
 public void Reset()
 {
     ItemList.Clear();
     EnemyList.Clear();
     BlockList.Clear();
     BackgroundList.Clear();
 }
Exemple #22
0
        private void SetDeleteReactiveCommand()
        {
            this.WhenAny(vm => vm.SelectedToDoItem, item => item != null);
            Delete = ReactiveCommand.CreateAsyncTask(
                this.WhenAny(vm => vm.SelectedToDoItem, item => item != null),
                _ => Task.Run(() =>
            {
                //avoid NullRefferenceException
                if (SelectedToDoItem == null)
                {
                    return(false);
                }

                _toDoToDoRepository.Remove(SelectedToDoItem);
                return(true);
            }));
            Delete.ThrownExceptions.ObserveOn(RxApp.MainThreadScheduler).Subscribe(e => MessageBox.Show(e.Message));
            Delete.Subscribe(e =>
            {
                if (!e)
                {
                    return;
                }

                //Reload items
                ItemList.Clear();
                GetToDoList(ItemList);
                SelectedToDoItem = ItemList.FirstOrDefault();
            });
        }
        private void SortList()
        {
            List <ShoppingListItem> sortedList = null;

            switch (CurrentingSorting)
            {
            case SortMethod.ImportantFirst:
                sortedList = ItemList.OrderByDescending(x => x.IsImportant).ThenBy(x => x.ShoppingListDescription).ToList();
                break;

            case SortMethod.PriceAscending:
                sortedList = ItemList.OrderBy(x => x.LineCost).ToList();
                break;

            case SortMethod.PriceDescending:
                sortedList = ItemList.OrderByDescending(x => x.LineCost).ToList();
                break;

            case SortMethod.Alphabetical:
                sortedList = ItemList.OrderBy(x => x.Description).ToList();
                break;
            }
            ItemList.Clear();
            ItemList.AddRange(sortedList);
            OnPropertyChanged("ItemList");
        }
Exemple #24
0
 private void UpdateGuidList()
 {
     _itemList.Clear();
     foreach (var guid in DataManager.GetGuids())
     {
         _itemList.AddItem(guid.ToString());
     }
 }
Exemple #25
0
 /// <summary>
 /// ITypicalItemStorage
 /// </summary>
 public void DropAll()
 {
     foreach (Agent ag in ItemList)
     {
         ag.CurrentLocation = Owner.CurrentLocation;
     }
     ItemList.Clear();
 }
 private void InitBlocksSelector()
 {
     blocksSelector.Clear();
     foreach (var type in Item.grindable)
     {
         blocksSelector.AddItem(type.ToString(), Item.textures[(int)type], false);
     }
 }
Exemple #27
0
 private void ClearInfo()
 {
     _buildButton.Disabled = true;
     _targetName.SetMessage(string.Empty);
     _targetDescription.SetMessage(string.Empty);
     _targetTexture.Texture = null;
     _stepList.Clear();
 }
Exemple #28
0
 /// <summary>クリア
 /// </summary>
 private void Clear()
 {
     if (TimeTable != null)
     {
         ItemList.Clear();
     }
     items.Clear();
 }
Exemple #29
0
 public void UpdateChecks(string c)
 {
     updating = true;
     try
     {
         tStartingItemsString.Text = c;
         ItemListString            = c;
         ItemList.Clear();
         string[] v  = c.Split('-');
         int[]    vi = new int[_itemGroupCount];
         if (v.Length != vi.Length)
         {
             ExternalLabel = "Invalid custom starting item string";
             return;
         }
         for (int i = 0; i < _itemGroupCount; i++)
         {
             if (v[_itemGroupCount - 1 - i] != "")
             {
                 vi[i] = Convert.ToInt32(v[_itemGroupCount - 1 - i], 16);
             }
         }
         for (int i = 0; i < 32 * _itemGroupCount; i++)
         {
             int j = i / 32;
             int k = i % 32;
             if (((vi[j] >> k) & 1) > 0)
             {
                 if (i >= ItemUtils.AllLocations().Count())
                 {
                     throw new IndexOutOfRangeException();
                 }
                 ItemList.Add(BaseItemList[i]);
             }
         }
         foreach (ListViewItem l in lStartingItems.Items)
         {
             if (ItemList.Contains((Item)l.Tag))
             {
                 l.Checked = true;
             }
             else
             {
                 l.Checked = false;
             }
         }
         ExternalLabel = $"{ItemList.Count}/{BaseItemList.Count} items randomized";
     }
     catch
     {
         ItemList.Clear();
         ExternalLabel = "Invalid custom starting item string";
     }
     finally
     {
         updating = false;
     }
 }
 private void EndTransaction_Click(object sender, EventArgs e)
 {
     TransactionDatabase.transactions[TransactionNumber] = returnTransaction;
     MessageBox.Show("Transaction Complete");
     ItemList.Clear();
     StartReturn.Enabled      = true;
     EndTransaction.Enabled   = false;
     ReturnItemButton.Enabled = false;
 }