New Tool for Rappelz

07/29/2019 18:45 Capturador#1
This is the new tool I am working on to add, modify, delete data from rappelz rdb
I want to implement several tables of the db for a better management of the tables.
I need help only with a problem that I have and it is the use of use_item_flag since I do not understand very well how to generate it if someone could give me an example of code to be able to create it from the application and not have to use the Flag_generator from the outside I would appreciate it.
07/29/2019 19:58 SilentWisdom#2
Code:
using System;
using System.IO;
using System.Windows.Forms;

namespace Grimoire.Tabs.Styles
{
    public partial class UseFlag : UserControl
    {
        readonly Logs.Manager lManager;
        protected bool calculating = false;

        public UseFlag()
        {
            InitializeComponent();
            lManager = Logs.Manager.Instance;
        }

        public UseFlag(int flag)
        {
            InitializeComponent();
            lManager = Logs.Manager.Instance;
        }

        private int flag
        {
            get
            {
                return (flagIO.Text.Length == 0) ? 0 : Convert.ToInt32(flagIO.Text);
            }
            set { flagIO.Text = value.ToString(); }
        }

        private void UseFlag_Load(object sender, EventArgs e)
        {
            string flagsPath = Grimoire.Utilities.OPT.GetString("useflag.list_path");
            if (flagsPath == null)
            {
                MessageBox.Show("No path for flag file defined!", "Flag Path Exception", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                return;
            }

            int flags = 0;
            
            if (File.Exists(flagsPath))
            {
                using (StreamReader sR = new StreamReader(flagsPath))
                {
                    string lineVal = null;
                    while ((lineVal = sR.ReadLine()) != null)
                    {
                        flagList.Items.Add(lineVal);
                        flags++;
                    }
                }

                lManager.Enter(Logs.Sender.USEFLAG, Logs.Level.NOTICE, "{0} Flags loaded to tab: {1}", flags, Tabs.Manager.Instance.Text);
            }
            else
            {
                string msg = string.Format("Could not load flag list at:\n{0}", flagsPath);
                lManager.Enter(Logs.Sender.USEFLAG, Logs.Level.ERROR, msg);
                MessageBox.Show(msg, "Load Flags Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void calculate_Click(object sender, EventArgs e)
        {
            calculating = true;

            flag = 0;
            for (int index = 0; index < flagList.Items.Count; index++)
            {
                if (flagList.GetSelected(index))
                {
                    flag |= (int)Math.Pow(2.0, index);
                }
            }

            calculating = false;
        }

        private void reverse_Click(object sender, EventArgs e)
        {
            for (int index = 0; index < flagList.Items.Count; index++)
            {
                flagList.SetSelected(index, ((flag >> index) & 1) == 1);
            }
        }

        private void flagIO_TextChanged(object sender, EventArgs e)
        {
            if (flag == 0) { reverse.Enabled = false; }
            else
            {
                reverse.Enabled = true;

                if (!calculating)
                {
                    if (Grimoire.Utilities.OPT.GetBool("useflag.auto_reverse"))
                    {
                        reverse_Click(null, EventArgs.Empty);
                    }
                }
            }
            if (flagIO.Text.Length == 0) { flag = 0; }
        }
    }
}
07/30/2019 02:30 Capturador#3
thanks for the code now understanding the flag better
08/02/2019 15:55 h96vy#4
english version please
08/02/2019 21:23 Capturador#5
I try to create the tools in Spanish because I have a good time working on the string of the game in Spanish, so my applications are created in that language for future servers in Spanish.
I am currently with string 9.5.2 translating it into Spanish and I have been 60% of the translated string.
Note: I have lasted a long time because the translation was done only

Currently finished
1. Interface
2 NPCs
3. Monsters
4. Combinations, titles, etc.
5. Character Skills and Creatures
6. Effects
Currently missing
1. Items
2. Quests

I currently test the string on the game portal server