protected override void MakeWidgets()
        {
            widgetIndex = 0;

            MakeInput(Get(0), 330, false, 32, "&gUsername..")
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, -120);
            MakeInput(Get(1), 330, false, 64, "&gIP address:Port number..")
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, -75);
            MakeInput(Get(2), 330, false, 32, "&gMppass..")
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, -30);

            connectIndex = widgetIndex;
            Makers.Button(this, "Connect", 110, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -110, 20);
            backIndex = widgetIndex;
            Makers.Button(this, "Back", 80, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 125, 20);

            statusIndex = widgetIndex;
            Makers.Label(this, "", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 70);
            Makers.Label(this, "Use classicube.net for skins", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 30, 100);

            ccSkinsIndex = widgetIndex;
            Makers.Checkbox(this, true, 24)
            .SetLocation(Anchor.Centre, Anchor.Centre, -110, 100);
        }
示例#2
0
        protected override void MakeWidgets()
        {
            widgetIndex = 0;

            updatesIndex = widgetIndex;
            Makers.Button(this, "Updates", 110, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -135, -120);
            Makers.Label(this, "&eGet the latest stuff", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 10, -120);

            modeIndex = widgetIndex;
            Makers.Button(this, "Mode", 110, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -135, -70);
            Makers.Label(this, "&eChange the enabled features", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 55, -70);

            coloursIndex = widgetIndex;
            Makers.Button(this, "Colours", 110, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -135, -20);
            Makers.Label(this, "&eChange how the launcher looks", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 65, -20);

            if (game.ClassicBackground)
            {
                widgets[coloursIndex].Visible     = false;
                widgets[coloursIndex + 1].Visible = false;
            }

            backIndex = widgetIndex;
            Makers.Button(this, "Back", 80, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 170);
        }
示例#3
0
        public ActionResult DeleteConfirmed(int id)
        {
            Makers makers = db.Makers.Find(id);

            db.Makers.Remove(makers);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#4
0
 public ActionResult Edit([Bind(Include = "Id,Name")] Makers makers)
 {
     if (ModelState.IsValid)
     {
         db.Entry(makers).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(makers));
 }
示例#5
0
        public ActionResult Create([Bind(Include = "Id,Name")] Makers makers)
        {
            if (ModelState.IsValid)
            {
                db.Makers.Add(makers);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(makers));
        }
示例#6
0
        protected override void MakeWidgets()
        {
            widgetIndex = 0;
            MakeInput(Get(0), 475, false, 32, "&gSearch servers..")
            .SetLocation(Anchor.LeftOrTop, Anchor.LeftOrTop, 10, 10);
            MakeInput(Get(1), 475, false, 32, "&gclassicube.net/server/play/...")
            .SetLocation(Anchor.LeftOrTop, Anchor.BottomOrRight, 10, -10);

            Makers.Button(this, "Back", 110, 30, titleFont)
            .SetLocation(Anchor.BottomOrRight, Anchor.LeftOrTop, -20, 10);
            Makers.Button(this, "Connect", 110, 30, titleFont)
            .SetLocation(Anchor.BottomOrRight, Anchor.BottomOrRight, -20, -10);
            MakeTableWidget();
        }
示例#7
0
        // GET: Makers/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Makers makers = db.Makers.Find(id);

            if (makers == null)
            {
                return(HttpNotFound());
            }
            return(View(makers));
        }
示例#8
0
        protected override void MakeWidgets()
        {
            widgetIndex = 0;
            MakeAllRGBTriplets(false);
            int start = widgetIndex;

            Makers.Label(this, "Background", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -60, -100);
            Makers.Label(this, "Button border", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -70, -60);
            Makers.Label(this, "Button highlight", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -80, -20);
            Makers.Label(this, "Button", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -40, 20);
            Makers.Label(this, "Active button", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -70, 60);

            for (int i = start; i < widgetIndex; i++)
            {
                // TODO: darken when inactive for sliders
                //((LabelWidget)widgets[i]).DarkenWhenInactive = true;
                widgets[i].TabSelectable = true;
            }

            Makers.Label(this, "Red", titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 30, -130);
            Makers.Label(this, "Green", titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 95, -130);
            Makers.Label(this, "Blue", titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 160, -130);

            defIndex = widgetIndex;
            Makers.Button(this, "Default colours", 160, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 120);
            Makers.Button(this, "Back", 80, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 170);

            // TODO: sliders
            return;

            sliderIndex = widgetIndex;
            Makers.Slider(this, 100, 10, 30, 255, PackedCol.Red)
            .SetLocation(Anchor.Min, Anchor.Min, 5, 5);
            Makers.Slider(this, 100, 10, 30, 255, PackedCol.Green)
            .SetLocation(Anchor.Min, Anchor.Min, 5, 25);
            Makers.Slider(this, 100, 10, 30, 255, PackedCol.Blue)
            .SetLocation(Anchor.Min, Anchor.Min, 5, 45);
        }
示例#9
0
        protected override void MakeWidgets()
        {
            widgetIndex = 0;
            string exePath = Path.Combine(Program.AppDirectory, "ClassicalSharp.exe");

            Makers.Label(this, "Your build:", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -55, -120);
            string yourBuild = File.GetLastWriteTime(exePath).ToString(dateFormat);

            Makers.Label(this, yourBuild, textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 70, -120);

            Makers.Label(this, "Latest release:", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -70, -75);
            string latestStable = GetDateString(LastStable);

            Makers.Label(this, latestStable, textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 70, -75);
            relIndex = widgetIndex;
            Makers.Button(this, "Direct3D 9", 130, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -80, -40);
            Makers.Button(this, "OpenGL", 130, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 80, -40);

            Makers.Label(this, "Latest dev build:", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -80, 20);
            string latestDev = GetDateString(LastDev);

            Makers.Label(this, latestDev, textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 70, 20);
            devIndex = widgetIndex;
            Makers.Button(this, "Direct3D 9", 130, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -80, 55);
            Makers.Button(this, "OpenGL", 130, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 80, 55);

            Makers.Label(this, "&eDirect3D 9 is recommended for Windows", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 105);
            statusIndex = widgetIndex;
            string text = gameOpen ? "&cThe game must be closed before updating" : "";

            Makers.Label(this, text, textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 130);

            backIndex = widgetIndex;
            Makers.Button(this, "Back", 80, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 170);
        }
示例#10
0
 void MakeStatus()
 {
     widgetIndex = 0;
     if (downloadingItems)
     {
         Makers.Label(this, widgets[0].Text, statusFont)
         .SetLocation(Anchor.Centre, Anchor.Centre, 0, -10);
     }
     else
     {
         float  dataSize = game.fetcher.DownloadSize;
         string text     = String.Format(format, dataSize.ToString("F2"));
         Makers.Label(this, text, statusFont)
         .SetLocation(Anchor.Centre, Anchor.Centre, 0, 10);
     }
 }
示例#11
0
        protected override void MakeWidgets()
        {
            widgetIndex = 0;
            DateTime writeTime = Platform.FileGetModifiedTime("ClassicalSharp.exe");

            Makers.Label(this, "Your build:", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -55, -120);
            string yourBuild = writeTime.ToLocalTime().ToString(dateFormat);

            Makers.Label(this, yourBuild, textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 70, -120);

            Makers.Label(this, "Latest release:", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -70, -75);
            string latestStable = GetDateString(LastStable);

            Makers.Label(this, latestStable, textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 70, -75);
            relIndex = widgetIndex;
            Makers.Button(this, "Direct3D 9", 130, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -80, -40);
            Makers.Button(this, "OpenGL", 130, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 80, -40);

            Makers.Label(this, "Latest dev build:", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -80, 20);
            string latestDev = GetDateString(LastDev);

            Makers.Label(this, latestDev, textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 70, 20);
            devIndex = widgetIndex;
            Makers.Button(this, "Direct3D 9", 130, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -80, 55);
            Makers.Button(this, "OpenGL", 130, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 80, 55);

            Makers.Label(this, "&eDirect3D 9 is recommended for Windows", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 105);
            statusIndex = widgetIndex;
            Makers.Label(this, statusText, textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 130);

            backIndex = widgetIndex;
            Makers.Button(this, "Back", 80, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 170);
        }
示例#12
0
        protected override void MakeWidgets()
        {
            widgetIndex = 0;
            MakeInput(Get(0), 370, false, 32, "&gSearch servers..")
            .SetLocation(Anchor.Min, Anchor.Min, 10, 10);
            MakeInput(Get(1), 475, false, 32, "&gclassicube.net/server/play/...")
            .SetLocation(Anchor.Min, Anchor.Max, 10, -10);

            Makers.Button(this, "Back", 110, 30, titleFont)
            .SetLocation(Anchor.Max, Anchor.Min, -10, 10);
            Makers.Button(this, "Connect", 130, 30, titleFont)
            .SetLocation(Anchor.Max, Anchor.Max, -10, -10);

            MakeTableWidget();
            Makers.Button(this, RefreshText, 110, 30, titleFont)
            .SetLocation(Anchor.Max, Anchor.Min, -135, 10);
        }
示例#13
0
        protected override void MakeWidgets()
        {
            widgetIndex = 0;
            int middle = game.Width / 2;

            Makers.Label(this, "&fChoose game mode", titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, -135);

            nIndex = widgetIndex;
            Makers.Button(this, "Enhanced", 145, 35, titleFont)
            .SetLocation(Anchor.Min, Anchor.Centre, middle - 250, -72);
            Makers.Label(this, "&eEnables custom blocks, changing env", textFont)
            .SetLocation(Anchor.Min, Anchor.Centre, middle - 85, -72 - 12);
            Makers.Label(this, "&esettings, longer messages, and more", textFont)
            .SetLocation(Anchor.Min, Anchor.Centre, middle - 85, -72 + 12);

            clHaxIndex = widgetIndex;
            Makers.Button(this, "Classic +hax", 145, 35, titleFont)
            .SetLocation(Anchor.Min, Anchor.Centre, middle - 250, 0);
            Makers.Label(this, "&eSame as Classic mode, except that", textFont)
            .SetLocation(Anchor.Min, Anchor.Centre, middle - 85, 0 - 12);
            Makers.Label(this, "&ehacks (noclip/fly/speed) are enabled", textFont)
            .SetLocation(Anchor.Min, Anchor.Centre, middle - 85, 0 + 12);

            clIndex = widgetIndex;
            Makers.Button(this, "Classic", 145, 35, titleFont)
            .SetLocation(Anchor.Min, Anchor.Centre, middle - 250, 72);
            Makers.Label(this, "&eOnly uses blocks and features from", textFont)
            .SetLocation(Anchor.Min, Anchor.Centre, middle - 85, 72 - 12);
            Makers.Label(this, "&ethe original minecraft classic", textFont)
            .SetLocation(Anchor.Min, Anchor.Centre, middle - 85, 72 + 12);

            if (FirstTime)
            {
                backIndex = -1;
                Makers.Label(this, "&eClick &fEnhanced &eif you're not sure which mode to choose.", textFont)
                .SetLocation(Anchor.Centre, Anchor.Centre, 0, 160);
            }
            else
            {
                backIndex = widgetIndex;
                Makers.Button(this, "Back", 80, 35, titleFont)
                .SetLocation(Anchor.Centre, Anchor.Centre, 0, 170);
            }
        }
示例#14
0
 public MakersIEF(Makers obj, my_db_for_db_2Entities _db)
 {
     InitializeComponent();
     db = _db;
     countriesBindingSource.DataSource = db.Countries.ToList();
     brandBindingSource.DataSource     = db.Brand.ToList();
     makersBindingSource.DataSource    = db.Makers.ToList();
     if (obj == null)
     {
         makersBindingSource.DataSource = new Makers();
         db.Makers.Add(makersBindingSource.Current as Makers);
     }
     else
     {
         makersBindingSource.DataSource = obj;
         db.Makers.Attach(makersBindingSource.Current as Makers);
     }
 }
示例#15
0
        protected override void MakeWidgets()
        {
            widgetIndex   = 0;
            usernameIndex = widgetIndex;
            MakeInput(Get(0), 280, false, 16, "&gUsername..")
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, -120);
            MakeInput(Get(1), 280, true, 64, "&gPassword..")
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, -75);

            loginIndex = widgetIndex;
            Makers.Button(this, "Sign in", 100, buttonHeight, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -90, -25);
            statusIndex = widgetIndex;
            Makers.Label(this, Get(statusIndex), textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 20);


            resIndex = widgetIndex;
            Makers.Button(this, "Resume", 100, buttonHeight, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 90, -25);
            dcIndex = widgetIndex;
            Makers.Button(this, "Direct connect", 200, buttonHeight, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 60);
            spIndex = widgetIndex;
            Makers.Button(this, "Singleplayer", 200, buttonHeight, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 110);

            sslIndex = widgetIndex;
            bool sslVisible = widgets[sslIndex] != null && widgets[sslIndex].Visible;

            Makers.Checkbox(this, true, 30)
            .SetLocation(Anchor.Centre, Anchor.Centre, 160, -20);
            Makers.Label(this, "Skip SSL check", textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 250, -20);
            widgets[sslIndex].Visible     = sslVisible;
            widgets[sslIndex + 1].Visible = sslVisible;

            Makers.Label(this, updateText, inputHintFont)
            .SetLocation(Anchor.Max, Anchor.Max, -10, -45);

            settingsIndex = widgetIndex;
            Makers.Button(this, "Options", 100, buttonHeight, titleFont)
            .SetLocation(Anchor.Max, Anchor.Max, -6, -6);
        }
示例#16
0
        protected override void MakeWidgets()
        {
            widgetIndex = 0;
            MakeStatus();

            textIndex = widgetIndex;
            Makers.Label(this, mainText, textFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, -40);
            yesIndex = widgetIndex;
            Makers.Button(this, "Yes", 70, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, -70, 45);
            noIndex = widgetIndex;
            Makers.Button(this, "No", 70, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 70, 45);

            cancelIndex = widgetIndex;
            Makers.Button(this, "Cancel", 120, 35, titleFont)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 45);
            sliderIndex = widgetIndex;
            Makers.Slider(this, 200, 10, 0, 100, progFront)
            .SetLocation(Anchor.Centre, Anchor.Centre, 0, 15);
        }
示例#17
0
 protected Widget MakeInput(string text, int width,
                            bool password, int maxChars, string hint)
 {
     return(Makers.Input(this, text, width, textFont,
                         inputHintFont, password, maxChars, hint));
 }