コード例 #1
0
 public SettingsMenuWrapper(mod.Mod mod, float initialMultiplier)
 {
     _settingsSkin = (GUISkin)Resources.Load("_GUISkins/Settings");
     _regularUI = (GUISkin)Resources.Load("_GUISkins/RegularUI");
     _mod = mod;
     _multiplier = initialMultiplier;
 }
コード例 #2
0
ファイル: ModControl.cs プロジェクト: progesor/TT1
 public ModControl(mod Mod)
 {
     InitializeComponent();
     ModName = Mod.Name;
     ModDescription = Mod.Desc;
     ModLink = Mod.Link;
 }
コード例 #3
0
        public IActionResult Index()
        {
            Random rand       = new Random();
            string holdString = "";
            string chars      = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

            //step 3 repeat step 1 until 14 characters exist in holdString var
            for (int i = 1; i <= 14; i++)
            {
                //I need to randomly select 14 characters from the string of char and insert each random character into holdString var
                //step 1 randomly land on an nth element in string of char.
                int index = rand.Next(chars.Length);

                string character = chars[index].ToString();


                //step 2 insert nth element into holdString var
                holdString += character;
            }
            //this logic is for clicks counted
            const string clicks = "clickscounted";
            {
                //I need to set this to 0
                var modelss = new mod()
                {
                    ClickCount = 0
                };

                return(View(modelss));
            }
        }
コード例 #4
0
ファイル: Code.cs プロジェクト: rxaa/washmange
        /// <summary>
        /// 添加洗衣记录,初始化
        /// </summary>
        /// <param name="cod"></param>
        /// <returns></returns>
        public static bool ClothInit(mod.Code cod)
        {
            wa_code.DB.Sql.Length = 0;
            ///初始化小票
            if (!wa_code.DB.SqlInsert(cod))
                return false;

            wa_code.DB.Sql.Append(";set @last_wid=last_insert_id();insert into wa_wash(WID,Wnumber,XiangMu,YangShi,color,PinPai,XiaCi,JiaGe,number,discount,FuKuan,todate,toID,GuaDian,mark,CPay) values");
            return true;
        }
コード例 #5
0
        public void WriteNewModInfoTxt(mod selectedMod)
        {
            string txt = "";

            txt += "name=" + selectedMod.InternalName + "\n";
            txt += "author=" + selectedMod.Author + "\n";
            txt += "version=" + selectedMod.ModVersion + "\n";
            txt += "description=" + selectedMod.ModDescription + "\n";

            File.WriteAllText(Path.Combine(selectedMod.path, "modinfo.txt"), txt);
        }
コード例 #6
0
 public void setValue(mod.anim.MFrameUnit unit)
 {
     rotateDegree = unit.rotateDegree;
     alpha = unit.alpha;
     scale.X = unit.scaleX;
     scale.Y = unit.scaleY;
     anchor.X = unit.anchorX;
     anchor.Y = unit.anchorY;
     pos.X = unit.posX;
     pos.Y = unit.posY;
 }
コード例 #7
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            mod mode = mod.Test;

            if (mode == mod.Test)
            {
                Application.Run(new TestForm());
            }
            else if (mode == mod.Excute)
            {
                Application.Run(new Form1());
            }
        }
コード例 #8
0
        private void dur_Click(object sender, EventArgs e)
        {
            facebox.Visible    = false;
            program            = mod.Tanıma;
            dur.Enabled        = false;
            basla.Enabled      = true;
            capt.ImageGrabbed -= goruntual;
            capt.Stop();
            capt.Dispose();
            takip.timer.Stop();
            takip.timer.Reset();

            goruntu.Visible = false;
            mousetimer.Stop();
            stopFareForm();
        }
コード例 #9
0
        public string surusmodu(mod a)
        {
            string b = Convert.ToString(a);

            if (b == "Comfort")
            {
                return("Konfor Moduna Geçildi..");
            }
            else if (b == "Sport")
            {
                return("Spor Moduna Geçildi..");
            }
            if (b == "Ecopro")
            {
                return("Tasarruf Moduna Geçildi..");
            }
            return("");
        }
コード例 #10
0
ファイル: Code.cs プロジェクト: rxaa/washmange
 /// <summary>
 /// 添加一件衣服
 /// </summary>
 /// <param name="wash"></param>
 /// <returns></returns>
 public static void ClothAdd(mod.Wash wash)
 {
     wa_code.DB.Sql.Append("(null,@last_wid,'" + wash.XiangMu + "','" + wash.YangShi + "','" + wash.color + "','" + wash.PinPai + "','" + wash.XiaCi + "','" + wash.JiaGe + "','" + wash.number + "','" + wash.discount + "','" + wash.FuKuan + "','" + wash.todate + "','" + wash.toID + "','" + wash.GuaDian + "','" + wash.mark + "','" + wash.CPay + "'),");
 }
コード例 #11
0
        private void Form1_Load(object sender, EventArgs e)
        {
            if (Path.GetFileName(Path.GetDirectoryName(Application.ExecutablePath)) != "mods")
            {
                MessageBox.Show("This application should only be run from the /mods/ directory.", "Wrong directory", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Close();
                return;
            }

            DirectoryInfo modDir = new DirectoryInfo(Path.GetDirectoryName(Application.ExecutablePath));

            checkedListBox1.Items.Clear();

            configPath = Path.Combine(modDir.FullName, "mod_config.ini");
            htDocsPath = Path.GetDirectoryName(modDir.FullName);

            backupPath = Path.Combine(htDocsPath, "vanilla_backups");

            if (!Directory.Exists(backupPath))
            {
                Directory.CreateDirectory(backupPath);
            }

            if (File.Exists(configPath))
            {
                LoadConfig();
            }

            foreach (DirectoryInfo dirInfo in modDir.GetDirectories())
            {
                if (Path.GetFileName(dirInfo.FullName) == "src")
                {
                    continue;
                }

                mod newMod = new mod(dirInfo.FullName, Path.GetFileNameWithoutExtension(dirInfo.FullName), false);

                checkedListBox1.Items.Add(newMod.displayname);

                string modInfoPath = Path.Combine(dirInfo.FullName, "modinfo.txt");

                if (File.Exists(modInfoPath))        //if modinfo.txt exists in this mod's directory
                {
                    string[] modinfo = File.ReadAllLines(modInfoPath);

                    //read modinfo

                    foreach (string line in modinfo)
                    {
                        string[] splitline = line.Split('=');

                        if (splitline.Length == 1)      //if there wasn't a value after the equals sign
                        {
                            continue;
                        }

                        switch (splitline[0])       //read the key and use the value accordingly
                        {
                        case "name":
                            newMod.InternalName = splitline[1];
                            break;

                        case "author":
                            newMod.Author = splitline[1];
                            break;

                        case "version":
                            newMod.ModVersion = splitline[1];
                            break;

                        case "description":
                            newMod.ModDescription = splitline[1].Replace("<newline>", "\n");
                            break;
                        }
                    }
                }
                else
                {
                    File.Create(Path.Combine(dirInfo.FullName, "modinfo.txt"));     //modinfo.txt didn't exist for this mod, create a new modinfo.txt
                }

                if (enableds_from_config.ContainsKey(newMod.displayname))       //if this mod is enabled in mod_config.ini, tick its box in the mod manager
                {
                    if (enableds_from_config[newMod.displayname])
                    {
                        checkedListBox1.SetItemChecked(checkedListBox1.Items.IndexOf(newMod.displayname), true);
                    }
                }

                mods.Add(newMod);
            }
        }
コード例 #12
0
I've really found this mod mod makes docking a whole lot easier. All you have to do to install this mod is first install the DockingCam mod and then replacing the DockingCamera.dll and DockingCamera.dll.mdb in the Plugins folder with the ones I've provided. I'm not yet finished with the modifications, but I wonder what you think of these overlays
コード例 #13
0
        private void goruntual(object sender, EventArgs e)
        {
            try { capt.Retrieve(kare); }
            catch (Exception exc)
            {
                console1.Invoke((Action) delegate { console1.AppendText("CaptureError:" + exc.Message + "\n"); });
            }



            karei = kare.ToImage <Bgr, Byte>();
            // karei.Flip(FlipType.Horizontal);
            //karei.Rotate(60,new PointF(320,24),Inter.Area,new Bgr(0,0,0),true);



            karei._GammaCorrect(1);



            kareg = karei.Convert <Gray, Byte>();                              //siyah beyaza çevrim

            veriler = sinif.DetectMultiScale(kareg, 1.1, 4, new Size(80, 80)); //tanıma

            if (veriler.Length != 0)
            {
                for (int i = 1; i < veriler.Length; i++)
                {
                    if ((veriler[i].Width * veriler[i].Height) > (veriler[0].Width * veriler[0].Height))
                    {
                        veriler[0] = veriler[i];
                    }
                }
            }

            // en büyüğüne 0 indisine alma



            try
            {
                takip.step(veriler);

                processedveri = takip.al();
                #region yuz ve göz işleme

                if (processedveri.Length > 0 && takip.bulundu)
                {
                    karei.ROI = processedveri[0];
                    faceim    = karei.Copy();
                    faceg     = faceim.Convert <Gray, Byte>();
                    Rectangle[] gozrect = gozler.DetectMultiScale(faceg, 1.1, 4, new Size(20, 20));    //tanıma


                    if (gozrect.Length > 0)
                    {
                        for (int i = 0; i < gozrect.Length; i++)
                        {
                            if ((gozrect[i].Width * gozrect[i].Height) > (gozrect[0].Width * gozrect[0].Height))
                            {
                                gozrect[0] = gozrect[i];
                            }
                        }    //en büyüğü alma
                        gozrect[0].Y      -= 30;
                        gozrect[0].Height += 40;
                        gozrect[0].X      -= 5;
                        gozrect[0].Width  += 10;
                    }

                    if (gozrect.Length > 0)
                    {
                        filtre.besle(gozrect[0], fps);
                        Rectangle EyeRect = filtre.al(faceim.Width, faceim.Height);
                        faceim.ROI = EyeRect;
                        Image <Bgr, Byte> Gozim = faceim.Copy();

                        Image <Hsv, Byte> GozimHSV = Gozim.Convert <Hsv, Byte>();

                        Image <Gray, Byte> RangeMask = GozimHSV.InRange(new Hsv(13, 10, 58), new Hsv(19, 40, 180));

                        faceim.ROI = new Rectangle();

                        eyebox.Image = Gozim;
                        faceim.Draw(EyeRect, new Bgr(0, 0, 255), 2);
                    }


                    facebox.Image = faceim;
                    karei.ROI     = new Rectangle();
                    faceg         = null;
                }
            }
            catch (Exception exc)
            {
                console1.Invoke((Action) delegate { console1.AppendText("Gozrect:" + exc.Message + "\n"); });
            }
            #endregion

            try
            {
                if (takip.bulundu)
                {
                    if (program == mod.Tanıma)
                    {
                        karefactor(ref processedveri[0], 0.5f);
                    }



                    kareg.ROI = processedveri[0];


                    faceg     = kareg.Copy();
                    kareg.ROI = new Rectangle();


                    if (program == mod.Tanıma && !modtimer.IsRunning)
                    {
                        modtimer.Start();
                    }

                    foreach (Rectangle veri in processedveri)
                    {
                        karei.Draw(veri, new Bgr(255, 0, 0));    // kalmandan gelen verileri ekrana çizme ekrana çizme
                    }
                    if (program == mod.Tanıma)
                    {
                        #region tanıma
                        stopFareForm();

                        MKeyPoint[] noktalar = gftt.Detect(faceg);



                        noktalarf[0] = new PointF[noktalar.Length];

                        for (int i = 0; i < noktalar.Length; i++)
                        {
                            noktalarf[0][i].X = noktalar[i].Point.X;
                            noktalarf[0][i].Y = noktalar[i].Point.Y;
                        }

                        faceg.FindCornerSubPix(noktalarf, new Size(5, 5), new Size(-1, -1), new MCvTermCriteria(60, .05d));

                        for (int i = 0; i < noktalarf[0].Length; i++)    //koordinasyon
                        {
                            noktalarf[0][i].X += processedveri[0].X;
                            noktalarf[0][i].Y += processedveri[0].Y;
                        }
                        // }
                        ///Deneme başlangıç yeri
                        ///

                        /*noktalarf[0] = new PointF[]{
                         *   new PointF(processedveri[0].X+processedveri[0].Width/2,processedveri[0].Top),
                         *   new PointF(processedveri[0].Left,processedveri[0].Y+processedveri[0].Height/2),
                         *   new PointF(processedveri[0].Right,processedveri[0].Y+processedveri[0].Height/2),
                         *   new PointF(processedveri[0].X+processedveri[0].Width/2,processedveri[0].Bottom),
                         * };*/

                        ///Bitiş yeri
                        ///

                        if (takip.yuzhizi >= 32.0)
                        {
                            modtimer.Reset();
                        }

                        if (modtimer.ElapsedMilliseconds >= 2200)
                        {
                            program = mod.Takip;
                            eskiftr = noktalarf[0];
                            renkler = new List <Bgr>(new Bgr[noktalarf[0].Length]);
                            for (int i = 0; i < renkler.Count; i++)
                            {
                                renkler[i] = new Bgr(255, 255, 255);
                            }

                            //pozlama açılıyor

                            pozlama = new Pozlama(noktalarf[0], processedveri[0], new Size(640, 480));
                        }
                        Bgr noktarengi = new Bgr(255, 0, 0);

                        foreach (PointF aa in noktalarf[0])
                        {
                            karei.Draw(new CircleF(new PointF(aa.X, aa.Y), 2), noktarengi, 1);
                        }


                        #endregion
                    }
                }

                else
                {
                    modtimer.Stop();
                    modtimer.Reset();
                }
            }
            catch (Exception exc)
            {
                console1.Invoke((Action) delegate { console1.AppendText("" + exc.Message + "\n"); });
            }

            if (program == mod.Takip)
            {
                //Fare form oluşturulmamışsa açılır
                startFareForm();
                float[]  trackError;
                byte[]   status;
                PointF[] noktayeni = new PointF[eskiftr.Length];



                #region opticalFlow algoritması
                modtimer.Stop();
                modtimer.Reset();
                Image <Gray, Byte>[] pyramid = eskikare.BuildPyramid(0);
                //pyramid oluşturuldu

                CvInvoke.CalcOpticalFlowPyrLK(pyramid[0], kareg, eskiftr, new Size(60, 60), 15, new MCvTermCriteria(150, 1d), out noktayeni, out status, out trackError);



                #endregion


                List <PointF> liste = new List <PointF>(noktayeni);
                if (takip.bulundu)
                {
                    for (int j = 0; j < liste.Count; j++)
                    {
                        if (!(

                                liste[j].X >= processedveri[0].Left
                                &&
                                liste[j].Y >= processedveri[0].Top
                                &&
                                liste[j].X <= processedveri[0].Right
                                &&
                                liste[j].Y <= processedveri[0].Bottom


                                ))
                        {
                            int azalim = 28;

                            var renk = renkler[j];
                            renk.Blue  -= azalim;
                            renk.Green -= azalim;

                            renkler[j] = renk;
                        }
                        else
                        {
                            renkler[j] = new Bgr(255, 255, 255);
                        }
                        if (renkler[j].Blue <= 30)
                        {
                            renkler.RemoveAt(j);
                            liste.RemoveAt(j);
                            pozlama.NoktaSil(j);
                            program = mod.Tanıma;
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < renkler.Count; i++)
                    {
                        renkler[i] = new Bgr(255, 255, 255);
                    }
                }


                noktayeni = liste.ToArray();


                //ypr değerlerini yazdırma
                int index = 0;
                foreach (PointF aa in noktayeni)
                {
                    karei.Draw(new CircleF(new PointF(aa.X, aa.Y), 2), renkler[index], 3);
                    index++;
                }



                eskiftr = noktayeni;
                float[] rotasyon = pozlama.rotasyon(eskiftr, processedveri[0]);
                imlec.feed(rotasyon[0], rotasyon[1], (float)fps);
                this.Invoke((Action) delegate { fareform.mouseVelocity = imlec.Hiz; });
                console1.Invoke((Action) delegate { console1.AppendText("" + fareform.tickIndex + "\n"); });

                /*yprgosterge.Invoke((Action)delegate
                 * {
                 *  yprgosterge.Text = "Yaw:" + Math.Round(rotasyon[0], 2, MidpointRounding.AwayFromZero) + "Pitch:" + Math.Round(rotasyon[1], 2, MidpointRounding.AwayFromZero) + "Roll:" + Math.Round(rotasyon[2], 2, MidpointRounding.ToEven);
                 * });*/
            }

            eskikare      = kareg;
            karei.ROI     = new Rectangle();
            goruntu.Image = karei;
            if (!fpstimer.IsRunning)
            {
                fpstimer.Start();
            }
            else
            {
                fps = 1000.0 / fpstimer.ElapsedMilliseconds;
                fps = Math.Round(fps, 3);
                fpstimer.Reset();
                fpstimer.Start();
                karei.Draw("FPS:" + fps, new System.Drawing.Point(30, 48), FontFace.HersheyComplex, 0.5, new Bgr(0, 0, 0), 1);
            }



            GC.Collect();



            /* catch (Exception exc)
             * {
             *
             *
             *   console1.Invoke((Action)delegate { console1.AppendText(exc.Message + "\n"); });
             *
             *
             * }*/
        }