Beispiel #1
0
        private void loadwcdata()
        {
            try
            {
                if ((wondercard_data[0x52] & 2) != 0) // is used
                {
                    if (DialogResult.Yes !=
                        Util.Prompt(MessageBoxButtons.YesNo,
                                    "Wonder Card is marked as USED and will not be able to be picked up in-game.",
                                    "Do you want to remove the USED flag so that it is UNUSED?"))
                    {
                        return;
                    }

                    wondercard_data[0x52] &= 0xFD; // keep all bits but bit1 (11111101)
                }
                RTB.Text         = getWCDescriptionString(wondercard_data);
                PB_Preview.Image = getWCPreviewImage(wondercard_data);
            }
            catch (Exception e)
            {
                Util.Error("Loading of data failed... is this really a Wonder Card?", e.ToString());
                Array.Copy(new byte[WC6.Size], wondercard_data, WC6.Size);
                RTB.Clear();
            }
        }
        private void loadwcdata()
        {
            if (wc6 == null)
            {
                return;
            }
            try
            {
                if (wc6.GiftUsed && DialogResult.Yes ==
                    Util.Prompt(MessageBoxButtons.YesNo,
                                "Wonder Card is marked as USED and will not be able to be picked up in-game.",
                                "Do you want to remove the USED flag so that it is UNUSED?"))
                {
                    wc6.GiftUsed = false;
                }

                RTB.Text         = wc6.Description;
                PB_Preview.Image = wc6.Preview;
            }
            catch (Exception e)
            {
                Util.Error("Loading of data failed... is this really a Wonder Card?", e.ToString());
                wc6 = new WC6();
                RTB.Clear();
            }
        }
Beispiel #3
0
        private void loadwcdata()
        {
            try
            {
                // Load up the data according to the wiki!
                int cardID = BitConverter.ToUInt16(wondercard_data, 0);
                if (cardID == 0)
                {
                    RTB.Text = "Empty Slot. No data!";
                    return;
                }
                string cardname = Util.TrimFromZero(Encoding.Unicode.GetString(wondercard_data, 0x2, 0x48));
                int    cardtype = wondercard_data[0x51];
                string s        = "";
                s += "Card #: " + cardID.ToString("0000") + Environment.NewLine + cardname + Environment.NewLine + Environment.NewLine;

                if (cardtype == 1) // Item
                {
                    int item = BitConverter.ToUInt16(wondercard_data, 0x68);
                    int qty  = BitConverter.ToUInt16(wondercard_data, 0x70);

                    s += "Item: " + Form1.itemlist[item] + Environment.NewLine + "Quantity: " + qty.ToString();
                }
                else if (cardtype == 0) // PKM
                {
                    int species  = BitConverter.ToUInt16(wondercard_data, 0x82);
                    int helditem = BitConverter.ToUInt16(wondercard_data, 0x78);
                    int move1    = BitConverter.ToUInt16(wondercard_data, 0x7A);
                    int move2    = BitConverter.ToUInt16(wondercard_data, 0x7C);
                    int move3    = BitConverter.ToUInt16(wondercard_data, 0x7E);
                    int move4    = BitConverter.ToUInt16(wondercard_data, 0x80);
                    int TID      = BitConverter.ToUInt16(wondercard_data, 0x68);
                    int SID      = BitConverter.ToUInt16(wondercard_data, 0x6A);

                    string OTname = Util.TrimFromZero(Encoding.Unicode.GetString(wondercard_data, 0xB6, 22));
                    s +=
                        "Species: " + Form1.specieslist[species] + Environment.NewLine
                        + "Item: " + Form1.itemlist[helditem] + Environment.NewLine
                        + "Move 1: " + Form1.movelist[move1] + Environment.NewLine
                        + "Move 2: " + Form1.movelist[move2] + Environment.NewLine
                        + "Move 3: " + Form1.movelist[move3] + Environment.NewLine
                        + "Move 4: " + Form1.movelist[move4] + Environment.NewLine
                        + "OT: " + OTname + Environment.NewLine
                        + "ID: " + TID.ToString() + "/" + SID.ToString();
                }
                else
                {
                    s = "Unsupported Wondercard Type!";
                }
                RTB.Text = s;
            }
            catch (Exception e)
            {
                Util.Error("Loading of data failed... is this really a Wondercard?", e.ToString());
                Array.Copy(new byte[0x108], wondercard_data, 0x108);
                RTB.Clear();
                return;
            }
        }
Beispiel #4
0
        public Form1()
        {
            InitializeComponent();

            this.DragEnter += new DragEventHandler(Form_DragEnter);
            this.DragDrop  += new DragEventHandler(Form_DragDrop);
            RTB.Clear();
        }
 public void Clear()
 {
     if (RTB.InvokeRequired)
     {
         RTB.Invoke((MethodInvoker) delegate { Clear(); });
     }
     else
     {
         RTB.Clear();
     }
 }
Beispiel #6
0
 private void loadwcdata()
 {
     try
     {
         RTB.Text         = getWCDescriptionString(wondercard_data);
         PB_Preview.Image = getWCPreviewImage(wondercard_data);
     }
     catch (Exception e)
     {
         Util.Error("Loading of data failed... is this really a Wondercard?", e.ToString());
         Array.Copy(new byte[0x108], wondercard_data, 0x108);
         RTB.Clear();
     }
 }
        private void loadwcdata()
        {
            // Load up the data according to the wiki!
            int cardID = BitConverter.ToUInt16(wondercard_data, 0);

            if (cardID == 0)
            {
                RTB.Text = "Empty Slot. No data!";
                return;
            }
            string cardname = Encoding.Unicode.GetString(wondercard_data, 0x2, 0x48);
            int    cardtype = wondercard_data[0x51];

            RTB.Clear();
            RTB.AppendText("Card #: " + cardID.ToString("0000") + "\r\n" + cardname + "\r\n");

            if (cardtype == 1) // Item
            {
                int item = BitConverter.ToUInt16(wondercard_data, 0x68);
                int qty  = BitConverter.ToUInt16(wondercard_data, 0x70);

                RTB.AppendText("\r\nItem: " + Form1.itemlist[item] + "\r\n" + "Quantity: " + qty.ToString());
            }
            else if (cardtype == 0) // PKM
            {
                int species  = BitConverter.ToUInt16(wondercard_data, 0x82);
                int helditem = BitConverter.ToUInt16(wondercard_data, 0x78);
                int move1    = BitConverter.ToUInt16(wondercard_data, 0x7A);
                int move2    = BitConverter.ToUInt16(wondercard_data, 0x7C);
                int move3    = BitConverter.ToUInt16(wondercard_data, 0x7E);
                int move4    = BitConverter.ToUInt16(wondercard_data, 0x80);
                int TID      = BitConverter.ToUInt16(wondercard_data, 0x68);
                int SID      = BitConverter.ToUInt16(wondercard_data, 0x6A);

                string OTname = Util.TrimFromZero(Encoding.Unicode.GetString(wondercard_data, 0xB6, 22));
                RTB.Text +=
                    "\r\nSpecies: " + Form1.specieslist[species] + "\r\n"
                    + "Item: " + Form1.itemlist[helditem] + "\r\n"
                    + "Move 1: " + Form1.movelist[move1] + "\r\n"
                    + "Move 2: " + Form1.movelist[move2] + "\r\n"
                    + "Move 3: " + Form1.movelist[move3] + "\r\n"
                    + "Move 4: " + Form1.movelist[move4] + "\r\n"
                    + "OT: " + OTname + "\r\n"
                    + "ID: " + TID.ToString() + "/" + SID.ToString();
            }
            else
            {
                RTB.Text = "Unsupported Wondercard Type!";
            }
        }
        public void Resultados(List <string> MAC)
        {
            List <string> dirrMac  = new List <string>();
            List <string> dirrMac2 = new List <string>();
            string        cadena   = "";
            string        cadena2  = "";

            if (contador == 1)
            {
                foreach (string s in MAC)
                {
                    if (s.StartsWith("MAC"))
                    {
                        dirrMac.Add(s);
                        cadena += s;
                        cadena += "\n";
                    }
                }
                RTB.Text = cadena;
            }
            if (contador > 1)
            {
                int primerR = dirrMac.Count;
                foreach (string s in MAC)
                {
                    if (s.StartsWith("MAC"))
                    {
                        dirrMac2.Add(s);
                        cadena2 += s;
                        cadena2 += "\n";
                    }
                }
                int segundoR = dirrMac2.Count;
                if (segundoR > primerR)
                {
                    textBox1.Enabled = true;
                    MessageBox.Show(" Hay un intruso en tu red");
                    RTB.Clear();
                    RTB.Text = cadena2;
                }
            }
        }
Beispiel #9
0
        private void ViewGiftData(DataMysteryGift g)
        {
            try
            {
                // only check if the form is visible (not opening)
                if (Visible && g.GiftUsed && DialogResult.Yes == WinFormsUtil.Prompt(MessageBoxButtons.YesNo, MsgMsyteryGiftUsedAlert, MsgMysteryGiftUsedFix))
                {
                    g.GiftUsed = false;
                }

                RTB.Lines        = g.GetDescription().ToArray();
                PB_Preview.Image = g.Sprite();
                mg = g;
            }
            catch (Exception e)
            {
                WinFormsUtil.Error(MsgMysteryGiftParseTypeUnknown, e);
                RTB.Clear();
            }
        }
Beispiel #10
0
        private void viewGiftData(MysteryGift g)
        {
            try
            {
                // only check if the form is visible (not opening)
                if (Visible && g.GiftUsed && DialogResult.Yes ==
                        Util.Prompt(MessageBoxButtons.YesNo,
                            "Wonder Card is marked as USED and will not be able to be picked up in-game.",
                            "Do you want to remove the USED flag so that it is UNUSED?"))
                    g.GiftUsed = false;

                RTB.Text = getDescription(g);
                PB_Preview.Image = getSprite(g);
                mg = g;
            }
            catch (Exception e)
            {
                Util.Error("Loading of data failed... is this really a Wonder Card?", e);
                RTB.Clear();
            }
        }
Beispiel #11
0
        private void ViewGiftData(DataMysteryGift g)
        {
            try
            {
                // only check if the form is visible (not opening)
                if (Visible && g.GiftUsed && DialogResult.Yes == WinFormsUtil.Prompt(MessageBoxButtons.YesNo, MsgMsyteryGiftUsedAlert, MsgMysteryGiftUsedFix))
                {
                    g.GiftUsed = false;
                }

                RTB.Lines        = g.GetDescription().ToArray();
                PB_Preview.Image = g.Sprite();
                mg = g;
            }
            // Some user input mystery gifts can have out-of-bounds values. Just swallow any exception.
#pragma warning disable CA1031 // Do not catch general exception types
            catch (Exception e)
#pragma warning restore CA1031 // Do not catch general exception types
            {
                WinFormsUtil.Error(MsgMysteryGiftParseTypeUnknown, e);
                RTB.Clear();
            }
        }
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            //upp
            if (keyData == Keys.Up)
            {
                for (int i = 0; i < World.Length; i++)
                {
                    if (World[i].Name == currentX + ":" + currentY)
                    {
                        if (World[i].Text == "green")
                        {
                            World[i].BackColor = Color.LightGreen;
                            World[i].ForeColor = World[i].BackColor;
                        }
                        if (World[i].Text == "brown")
                        {
                            World[i].BackColor = Color.Brown;
                            World[i].ForeColor = World[i].BackColor;
                        }
                    }
                }


                currentY = currentY - basemovementspeed;


                for (int i = 0; i < World.Length; i++)
                {
                    if (World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.DarkGreen || World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.FromArgb(86, 51, 20) ||
                        World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.FromArgb(78, 47, 18) || World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.FromArgb(69, 36, 14) ||
                        World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.Black || World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.Blue)
                    {
                        currentY = currentY + basemovementspeed;
                    }
                }

                for (int i = 0; i < World.Length; i++)
                {
                    if (World[i].Name == currentX + ":" + currentY)
                    {
                        World[i].BackColor = Color.Black;
                        World[i].ForeColor = World[i].BackColor;
                    }
                }
                return(true);
            }

            //niður
            if (keyData == Keys.Down)
            {
                for (int i = 0; i < World.Length; i++)
                {
                    if (World[i].Name == currentX + ":" + currentY)
                    {
                        if (World[i].Text == "green")
                        {
                            World[i].BackColor = Color.LightGreen;
                            World[i].ForeColor = World[i].BackColor;
                        }
                        if (World[i].Text == "brown")
                        {
                            World[i].BackColor = Color.Brown;
                            World[i].ForeColor = World[i].BackColor;
                        }
                    }
                }

                currentY = currentY + basemovementspeed;

                for (int i = 0; i < World.Length; i++)
                {
                    if (World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.DarkGreen || World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.FromArgb(86, 51, 20) ||
                        World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.FromArgb(78, 47, 18) || World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.FromArgb(69, 36, 14) ||
                        World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.Black || World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.Blue)
                    {
                        currentY = currentY - basemovementspeed;
                    }
                }

                for (int i = 0; i < World.Length; i++)
                {
                    if (World[i].Name == currentX + ":" + currentY)
                    {
                        World[i].BackColor = Color.Black;
                        World[i].ForeColor = World[i].BackColor;
                    }
                }
                return(true);
            }

            //vinstri
            if (keyData == Keys.Left)
            {
                for (int i = 0; i < World.Length; i++)
                {
                    if (World[i].Name == currentX + ":" + currentY)
                    {
                        if (World[i].Text == "green")
                        {
                            World[i].BackColor = Color.LightGreen;
                            World[i].ForeColor = World[i].BackColor;
                        }
                        if (World[i].Text == "brown")
                        {
                            World[i].BackColor = Color.Brown;
                            World[i].ForeColor = World[i].BackColor;
                        }
                    }
                }

                currentX = currentX - basemovementspeed;

                for (int i = 0; i < World.Length; i++)
                {
                    if (World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.DarkGreen || World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.FromArgb(86, 51, 20) ||
                        World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.FromArgb(78, 47, 18) || World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.FromArgb(69, 36, 14) ||
                        World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.Black || World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.Blue)
                    {
                        currentX = currentX + basemovementspeed;
                    }
                }

                for (int i = 0; i < World.Length; i++)
                {
                    if (World[i].Name == currentX + ":" + currentY)
                    {
                        World[i].BackColor = Color.Black;
                        World[i].ForeColor = World[i].BackColor;
                    }
                }
                return(true);
            }

            //hægri
            if (keyData == Keys.Right)
            {
                for (int i = 0; i < World.Length; i++)
                {
                    if (World[i].Name == currentX + ":" + currentY)
                    {
                        if (World[i].Text == "green")
                        {
                            World[i].BackColor = Color.LightGreen;
                            World[i].ForeColor = World[i].BackColor;
                        }
                        if (World[i].Text == "brown")
                        {
                            World[i].BackColor = Color.Brown;
                            World[i].ForeColor = World[i].BackColor;
                        }
                    }
                }


                currentX = currentX + basemovementspeed;

                for (int i = 0; i < World.Length; i++)
                {
                    if (World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.DarkGreen || World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.FromArgb(86, 51, 20) ||
                        World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.FromArgb(78, 47, 18) || World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.FromArgb(69, 36, 14) ||
                        World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.Black || World[i].Name == currentX + ":" + currentY && World[i].BackColor == Color.Blue)
                    {
                        currentX = currentX - basemovementspeed;
                    }
                }
                for (int i = 0; i < World.Length; i++)
                {
                    if (World[i].Name == currentX + ":" + currentY)
                    {
                        World[i].BackColor = Color.Black;
                        World[i].ForeColor = World[i].BackColor;
                    }
                }
                return(true);
            }


            //SPACEBAR
            if (keyData == Keys.Space && tal1 == 3 && ja == 1)
            {
                RTB.Clear();
                for (int i = 0; i < World.Length; i++)
                {
                    if (World[i].Name == 57 + ":" + 6 && World[i].BackColor == Color.Black)
                    {
                        tikk2 = rand.Next(1, 6);
                        if (tikk2 == 1)
                        {
                            RTB.Text += "Þú náðir einum Ingosilung";
                            ingosilungar++;
                            label2.Text = ingosilungar.ToString();
                        }
                        else
                        {
                            RTB.Text += "Þú náðir eingu";
                        }
                    }
                }
            }
            if (keyData == Keys.Space && tal1 == 0)
            {
                for (int i = 0; i < World.Length; i++)
                {
                    if (tal1 == 0)
                    {
                        if (World[i].Name == 18 + ":" + 16 && World[i].BackColor == Color.Black || World[i].Name == 16 + ":" + 17 && World[i].BackColor == Color.Black || World[i].Name == 17 + ":" + 17 && World[i].BackColor == Color.Black || World[i].Name == 18 + ":" + 17 && World[i].BackColor == Color.Black ||
                            World[i].Name == 16 + ":" + 16 && World[i].BackColor == Color.Black)
                        {
                            RTB.Text = "HJÁÁÁÁÁÁÁÁLP";
                            tal1     = 1;
                        }
                    }
                }
                return(true);
            }
            if (keyData == Keys.Space && tal1 == 1)
            {
                RTB.Text = "Ég er svangur \n" + "villtu hjálpa mér? \n";
                tal1     = 2;
            }

            if (keyData == Keys.J && tal1 == 2)
            {
                ja++;
                tal1++;
                RTB.Text = "æðislegt, ég hélt ég þyrfti að gera þetta sjálfur \n " +
                           "farðu austur og veiddu handa mér 3 Ingosilunga á brúnni á bryggjunni \n "
                           + "ég skal gefa þér verðlaun (gamli maðurinn blikkar einu auga) ";
            }
            if (keyData == Keys.N && tal1 == 2)
            {
                tal1++;
                RTB.Text = "argasti dónaskapur";
            }
            if (keyData == Keys.Space && tal1 == 3 && ingosilungar >= 3)
            {
                RTB.Text = "ummmm nom nom nom þetta eru fínir fiskar hér er súkkulaði ;) ";
            }


            return(base.ProcessCmdKey(ref msg, keyData));
        }
Beispiel #13
0
 private void clearTextbox(object sender, EventArgs e)
 {
     RTB.Clear();
 }
Beispiel #14
0
 public void Clear()
 {
     RTB.Clear();
 }
Beispiel #15
0
 private void InputClear()
 {
     RTB.Clear();
 }
Beispiel #16
0
 //Rich Text Box Clear
 private void RTBClear()
 {
     RTB.Invoke(new MethodInvoker(delegate { RTB.Clear(); }));
 }