Esempio n. 1
0
        private void PixelData(int slot)
        {
            Assembly assembly = Assembly.GetExecutingAssembly();
            Type     type     = assembly.GetType("Terraria_Hacker.HackFunctions");

            foreach (DictionaryEntry de in hacks)
            {
                object[]   args = new object[2];
                MethodInfo mi   = type.GetMethod("set" + de.Key);
                args[0] = slot;
                if (mi.GetParameters()[1].ParameterType == typeof(int))
                {
                    args[1] = Convert.ToInt32(((TextBox)de.Value).Text);
                }
                else if (mi.GetParameters()[1].ParameterType == typeof(float))
                {
                    args[1] = (float)Convert.ToDouble(((TextBox)de.Value).Text);
                }
                mi.Invoke(null, args);
            }
            {
                HackFunctions.setItemPrefix(slot, GetPrefixFromIndex(PrefixComboBox.SelectedIndex));
            }
            {
                HackFunctions.setItemAutoReuse(slot, (AutoReuse.CheckState == CheckState.Checked));
            }
            {
                HackFunctions.setItemAccessory(slot, (Equippable.CheckState == CheckState.Checked));
            }
        }