private void AddTabPage(uiToolBox tb, string TabTitle)
        {
            TabPage newpage = new TabPage();

            tb.Parent    = newpage;
            tb.Dock      = DockStyle.Fill;
            newpage.Text = TabTitle;
            //newpage.BackColor = Color.Black;
            newpage.Parent = this.TabContainer;
        }
Example #2
0
        public Form1()
        {
            InitializeComponent();
            this.KeyDown += new KeyEventHandler(this.Form1_KeyDown);
            this.KeyUp   += new KeyEventHandler(this.Form1_KeyUp);

            this.Map = new oMap();

            this.Editer              = new uiMapEditer(this.Map);
            this.Editer.Parent       = this;
            this.Editer.VirtualWidth = 20f;             // 10f

            this.TB        = new uiToolBox(this.Editer);
            this.TB.Parent = this;
        }
        //load every mod currently existing in the static class Crafts
        private void LoadEveryMod()
        {
            foreach (string modname in Crafts.listLoadedModName)
            {
                //create its tool box
                uiToolBox newtb = new uiToolBox(this.Editer, modname);

                //generate the title to give to the tab
                string tabtitle = modname;
                if (tabtitle == "vanilla")
                {
                    tabtitle = "Factorio";
                }

                //create the tabpage
                this.AddTabPage(newtb, tabtitle);
            }
        }
        private void Crafts_ModAdded(object sender, ModEventArgs e)
        {
            if (this.Visible)
            {
                //gets the new mod
                oMod newmod = e.Mod;

                //gets the mod name
                string newmodname = newmod.ModName;

                //create the new tool box
                uiToolBox newtb = new uiToolBox(this.Editer, newmodname);

                //create the new tabpage
                this.AddTabPage(newtb, newmodname);
            }
            else
            {
                this.DestroyCraftsEvents();
            }
        }