コード例 #1
0
ファイル: ForestBrushTool.cs プロジェクト: thale5/ForestBrush
        public void UpdateTool(string brushName)
        {
            UserMod.Settings.SelectBrush(brushName);

            TreeInfos = new List <TreeInfo>();

            foreach (var tree in Brush.Trees)
            {
                if (!ForestBrush.Instance.Trees.TryGetValue(tree.Name, out TreeInfo treeInfo))
                {
                    continue;
                }
                if (treeInfo == null)
                {
                    continue;
                }
                TreeInfos.Add(treeInfo);
            }

            Container = CreateBrushPrefab(Brush.Trees);

            ForestBrush.Instance.ForestBrushPanel.LoadBrush(Brush);

            UserMod.SaveSettings();
        }
コード例 #2
0
ファイル: ForestBrushTool.cs プロジェクト: thale5/ForestBrush
        internal void DeleteCurrent()
        {
            Brushes.Remove(Brush);
            UserMod.Settings.SelectNextBestBrush();
            ForestBrush.Instance.ForestBrushPanel.BrushSelectSection.UpdateDropDown();
            string nextBrush = ForestBrush.Instance.ForestBrushPanel.BrushSelectSection.SelectBrushDropDown.items.Length <= 0 ? Constants.NewBrushName :
                               ForestBrush.Instance.ForestBrushPanel.BrushSelectSection.SelectBrushDropDown.selectedValue;

            UpdateTool(nextBrush);
            UserMod.SaveSettings();
        }
コード例 #3
0
        private void OnBindingKeyDown(UIComponent comp, UIKeyEventParameter p)
        {
            if (this.m_EditingBinding != null && !this.IsModifierKey(p.keycode))
            {
                p.Use();
                UIView.PopModal();
                KeyCode  keycode  = p.keycode;
                InputKey inputKey = (p.keycode == KeyCode.Escape) ? this.m_EditingBinding.value : SavedInputKey.Encode(keycode, p.control, p.shift, p.alt);
                if (p.keycode == KeyCode.Backspace)
                {
                    inputKey = SavedInputKey.Empty;
                }
                this.m_EditingBinding.value = inputKey;
                UITextComponent uITextComponent = p.source as UITextComponent;
                uITextComponent.text = this.m_EditingBinding.ToLocalizedString("KEYNAME");

                UserMod.SaveSettings();

                this.m_EditingBinding         = null;
                this.m_EditingBindingCategory = string.Empty;
            }
        }
コード例 #4
0
ファイル: ForestBrushTool.cs プロジェクト: thale5/ForestBrush
 internal void UpdateTreeList(TreeInfo treeInfo, bool value, bool updateAll)
 {
     if (value)
     {
         Add(treeInfo);
     }
     else
     {
         Remove(treeInfo);
     }
     if (updateAll)
     {
         if (value)
         {
             AddAll();
         }
         else
         {
             RemoveAll();
         }
     }
     Container = CreateBrushPrefab(Brush.Trees);
     UserMod.SaveSettings();
 }