Пример #1
0
 public static void Add( DressList list )
 {
     m_List.Add( list );
     HotKey.Add( HKCategory.Dress, HKSubCat.None, String.Format( "Dress: {0}", list.Name ), new HotKeyCallback( list.Dress ) );
     HotKey.Add( HKCategory.Dress, HKSubCat.None, String.Format( "Undress: {0}", list.Name ), new HotKeyCallback( list.Undress ) );
     HotKey.Add( HKCategory.Dress, HKSubCat.None, String.Format( "Toggle: {0}", list.Name ), new HotKeyCallback( list.Toggle ) );
 }
Пример #2
0
 public static void Add(DressList list)
 {
     if (Engine.MainWindow == null)
     {
         m_List.Add(list);
         HotKey.Add(HKCategory.Dress, HKSubCat.None, $"Dress: {list.Name}",
                    new HotKeyCallback(list.Dress));
         HotKey.Add(HKCategory.Dress, HKSubCat.None, $"Undress: {list.Name}",
                    new HotKeyCallback(list.Undress));
         HotKey.Add(HKCategory.Dress, HKSubCat.None, $"Toggle: {list.Name}",
                    new HotKeyCallback(list.Toggle));
     }
     else
     {
         Engine.MainWindow.SafeAction(s =>
         {
             m_List.Add(list);
             HotKey.Add(HKCategory.Dress, HKSubCat.None, $"Dress: {list.Name}",
                        new HotKeyCallback(list.Dress));
             HotKey.Add(HKCategory.Dress, HKSubCat.None, $"Undress: {list.Name}",
                        new HotKeyCallback(list.Undress));
             HotKey.Add(HKCategory.Dress, HKSubCat.None, $"Toggle: {list.Name}",
                        new HotKeyCallback(list.Toggle));
         });
     }
 }
Пример #3
0
 public static void Remove(DressList list)
 {
     m_List.Remove(list);
     HotKey.Remove(String.Format("Dress: {0}", list.Name));
     HotKey.Remove(String.Format("Undress: {0}", list.Name));
     HotKey.Remove(String.Format("Toggle: {0}", list.Name));
 }
Пример #4
0
 public static void Add(DressList list)
 {
     m_List.Add(list);
     HotKey.Add(HKCategory.Dress, HKSubCat.None, String.Format("Dress: {0}", list.Name), new HotKeyCallback(list.Dress));
     HotKey.Add(HKCategory.Dress, HKSubCat.None, String.Format("Undress: {0}", list.Name), new HotKeyCallback(list.Undress));
     HotKey.Add(HKCategory.Dress, HKSubCat.None, String.Format("Toggle: {0}", list.Name), new HotKeyCallback(list.Toggle));
 }
Пример #5
0
        public static Item FindUndressBag(Item item)
        {
            Item undressBag = World.Player.Backpack;

            for (int i = 0; i < m_List.Count; i++)
            {
                DressList list = m_List[i];
                if (list != null && (list.Items.Contains(item.Serial) || list.Items.Contains(item.ItemID)))
                {
                    if (list.m_UndressBag.IsValid)
                    {
                        Item bag = World.FindItem(list.m_UndressBag);
                        if (bag != null && (bag.RootContainer == World.Player ||
                                            (bag.RootContainer == null && Utility.InRange(bag.GetWorldPosition(),
                                                                                          World.Player.Position, 2))))
                        {
                            undressBag = bag;
                        }
                    }

                    break;
                }
            }

            return(undressBag);
        }
Пример #6
0
        public static DressList Find(string name)
        {
            for (int i = 0; i < m_List.Count; i++)
            {
                DressList list = m_List[i];
                if (list.Name == name)
                {
                    return(list);
                }
            }

            return(null);
        }
Пример #7
0
        public static void Load(XmlElement xml)
        {
            ClearAll();

            if (xml == null)
            {
                return;
            }

            foreach (XmlElement el in xml.GetElementsByTagName("list"))
            {
                try
                {
                    string    name = el.GetAttribute("name");
                    DressList list = new DressList(name);
                    Add(list);

                    try
                    {
                        list.m_UndressBag = Serial.Parse(el.GetAttribute("undressbag"));
                    }
                    catch
                    {
                        list.m_UndressBag = Serial.Zero;
                    }

                    foreach (XmlElement el2 in el.GetElementsByTagName("item"))
                    {
                        try
                        {
                            string ser = el2.GetAttribute("serial");
                            list.Items.Add((Serial)Convert.ToUInt32(ser));
                        }
                        catch
                        {
                            try
                            {
                                string iid = el2.GetAttribute("id");
                                list.Items.Add((ItemID)Convert.ToUInt16(iid));
                            }
                            catch
                            {
                            }
                        }
                    }
                }
                catch
                {
                }
            }
        }
Пример #8
0
 public static void Remove(DressList list)
 {
     if (Engine.MainWindow == null)
     {
         m_List.Remove(list);
         HotKey.Remove($"Dress: {list.Name}");
         HotKey.Remove($"Undress: {list.Name}");
         HotKey.Remove($"Toggle: {list.Name}");
     }
     else
     {
         Engine.MainWindow.SafeAction(s =>
         {
             m_List.Remove(list);
             HotKey.Remove($"Dress: {list.Name}");
             HotKey.Remove($"Undress: {list.Name}");
             HotKey.Remove($"Toggle: {list.Name}");
         });
     }
 }
Пример #9
0
        public static bool Unequip(Layer layer)
        {
            if (layer == Layer.Invalid || layer > Layer.LastUserValid)
            {
                return(false);
            }

            Item item = World.Player.GetItemOnLayer(layer);

            if (item != null)
            {
                Item pack = DressList.FindUndressBag(item);
                if (pack != null)
                {
                    DragDropManager.DragDrop(item, pack);
                    return(true);
                }
            }

            return(false);
        }
Пример #10
0
        public static void ToggleRight()
        {
            if (World.Player == null)
            {
                return;
            }

            Item item = World.Player.GetItemOnLayer(Layer.RightHand);

            if (item == null)
            {
                if (m_Right != null)
                {
                    m_Right = World.FindItem(m_Right.Serial);
                }

                if (m_Right != null && m_Right.IsChildOf(World.Player.Backpack))
                {
                    // try to also undress conflicting hand(s)
                    Item conflict = World.Player.GetItemOnLayer(Layer.LeftHand);
                    if (conflict != null && (conflict.IsTwoHanded || m_Right.IsTwoHanded))
                    {
                        Unequip(DressList.GetLayerFor(conflict));
                    }

                    Equip(m_Right, DressList.GetLayerFor(m_Right));
                }
                else
                {
                    World.Player.SendMessage(MsgLevel.Force, LocString.MustDisarm);
                }
            }
            else
            {
                Unequip(DressList.GetLayerFor(item));
                m_Right = item;
            }
        }
Пример #11
0
        public static void Load(XmlElement xml)
        {
            ClearAll();

            if (xml == null)
            {
                return;
            }

            foreach (XmlElement el in xml.GetElementsByTagName("list"))
            {
                string    name = el.GetAttribute("name");
                DressList list = new DressList(name);
                Add(list);

                list.m_UndressBag = Serial.Parse(el.GetAttribute("undressbag"));

                foreach (XmlElement el2 in el.GetElementsByTagName("item"))
                {
                    string ser = el2.GetAttribute("serial");
                    uint   val = Utility.ToUInt32(ser, Serial.MinusOne);
                    if (val == Serial.MinusOne)
                    {
                        val = Utility.ToUInt32(el2.GetAttribute("id"), 0);
                        if (val > 0)
                        {
                            list.Items.Add((ItemID)val);
                        }
                    }
                    else
                    {
                        list.Items.Add((Serial)val);
                    }
                }
            }
        }
Пример #12
0
        void onDressBagTarget( bool location, Serial serial, Point3D p, ushort gfxid )
        {
            if ( undressBagList == null )
                return;

            ShowMe();
            if ( serial.IsItem )
            {
                Item item = World.FindItem( serial );
                if ( item != null )
                {
                    undressBagList.SetUndressBag( item.Serial );
                    World.Player.SendMessage( MsgLevel.Force, LocString.UB_Set );
                }
                else
                {
                    undressBagList.SetUndressBag( Serial.Zero );
                    World.Player.SendMessage( MsgLevel.Force, LocString.ItemNotFound );
                }
            }
            else
            {
                World.Player.SendMessage( MsgLevel.Force, LocString.ItemNotFound );
            }

            undressBagList = null;
        }
Пример #13
0
        public bool Load()
        {
            if (m_Name == null || m_Name.Trim() == "")
            {
                return(false);
            }

            string path = Config.GetUserDirectory("Profiles");
            string file = Path.Combine(path, String.Format("{0}.xml", m_Name));

            if (!File.Exists(file))
            {
                return(false);
            }

            XmlDocument doc = new XmlDocument();

            try
            {
                doc.Load(file);
            }
            catch
            {
                MessageBox.Show(Engine.ActiveWindow, Language.Format(LocString.ProfileCorrupt, file), "Profile Load Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return(false);
            }

            XmlElement root = doc["profile"];

            if (root == null)
            {
                return(false);
            }

            Assembly exe = Assembly.GetCallingAssembly();

            if (exe == null)
            {
                return(false);
            }

            foreach (XmlElement el in root.GetElementsByTagName("property"))
            {
                try
                {
                    string name    = el.GetAttribute("name");
                    string typeStr = el.GetAttribute("type");
                    string val     = el.InnerText;

                    if (typeStr == "-null-" || name == "LimitSize" || name == "VisRange")
                    {
                        //m_Props[name] = null;
                        if (m_Props.ContainsKey(name))
                        {
                            m_Props.Remove(name);
                        }
                    }
                    else
                    {
                        Type type = Type.GetType(typeStr);
                        if (type == null)
                        {
                            type = exe.GetType(typeStr);
                        }

                        if (m_Props.ContainsKey(name))
                        {
                            if (type == null)
                            {
                                m_Props.Remove(name);
                            }
                            else
                            {
                                m_Props[name] = GetObjectFromString(val, type);
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    MessageBox.Show(Engine.ActiveWindow, Language.Format(LocString.ProfileLoadEx, e.ToString()), "Profile Load Exception", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }

            Filter.Load(root["filters"]);
            Counter.LoadProfile(root["counters"]);
            Agent.LoadProfile(root["agents"]);
            DressList.Load(root["dresslists"]);
            HotKey.Load(root["hotkeys"]);

            return(true);
        }
Пример #14
0
 private void addDress_Click(object sender, System.EventArgs e)
 {
     if ( InputBox.Show( this, Language.GetString( LocString.DressName ), Language.GetString( LocString.EnterAName ) ) )
     {
         string str = InputBox.GetString();
         if ( str == null || str == "" )
             return;
         DressList list = new DressList( str );
         DressList.Add( list );
         dressList.Items.Add( list );
         dressList.SelectedItem = list;
     }
 }
Пример #15
0
        public static void Load( XmlElement xml )
        {
            ClearAll();

            if ( xml == null )
                return;

            foreach( XmlElement el in xml.GetElementsByTagName( "list" ) )
            {
                try
                {
                    string name = el.GetAttribute( "name" );
                    DressList list = new DressList( name );
                    Add( list );

                    try
                    {
                        list.m_UndressBag = Serial.Parse( el.GetAttribute( "undressbag" ) );
                    }
                    catch
                    {
                        list.m_UndressBag = Serial.Zero;
                    }

                    foreach ( XmlElement el2 in el.GetElementsByTagName( "item" ) )
                    {
                        try
                        {
                            string ser = el2.GetAttribute( "serial" );
                            list.Items.Add( (Serial)Convert.ToUInt32( ser ) );
                        }
                        catch
                        {
                            try
                            {
                                string iid = el2.GetAttribute( "id" );
                                list.Items.Add( (ItemID)Convert.ToUInt16( iid ) );
                            }
                            catch
                            {
                            }
                        }
                    }
                }
                catch
                {
                }
            }
        }
Пример #16
0
        public void MakeDefault()
        {
            m_Props.Clear();

            AddProperty("ShowMobNames", false);
            AddProperty("ShowCorpseNames", false);
            AddProperty("DisplaySkillChanges", false);
            AddProperty("TitleBarText", @"UO - {char} {crimtime}- {mediumstatbar} {bp} {bm} {gl} {gs} {mr} {ns} {ss} {sa} {aids}");
            AddProperty("TitleBarDisplay", true);
            AddProperty("AutoSearch", true);
            AddProperty("NoSearchPouches", true);
            AddProperty("CounterWarnAmount", (int)5);
            AddProperty("CounterWarn", true);
            AddProperty("ObjectDelay", (int)600);
            AddProperty("AlwaysOnTop", false);
            AddProperty("SortCounters", true);
            AddProperty("QueueActions", true);
            AddProperty("QueueTargets", true);
            AddProperty("WindowX", (int)400);
            AddProperty("WindowY", (int)400);
            AddProperty("CountStealthSteps", true);
            AddProperty("AlwaysStealth", false);

            AddProperty("SysColor", (int)0x03B1);
            AddProperty("WarningColor", (int)0x0025);
            AddProperty("ExemptColor", (int)0x0480);
            AddProperty("SpeechHue", (int)0x03B1);
            AddProperty("BeneficialSpellHue", (int)0x0005);
            AddProperty("HarmfulSpellHue", (int)0x0025);
            AddProperty("NeutralSpellHue", (int)0x03B1);
            AddProperty("ForceSpeechHue", false);
            AddProperty("ForceSpellHue", false);
            AddProperty("SpellFormat", @"{power} [{spell}]");

            AddProperty("ShowNotoHue", true);
            AddProperty("Opacity", (int)100);

            AddProperty("AutoOpenCorpses", false);
            AddProperty("CorpseRange", (int)2);

            AddProperty("FilterSpam", false);
            AddProperty("BlockDismount", false);

            AddProperty("UndressConflicts", true);
            AddProperty("HighlightReagents", true);
            AddProperty("TitlebarImages", true);

            AddProperty("SellAgentMax", (int)99);
            AddProperty("SkillListCol", (int)-1);
            AddProperty("SkillListAsc", false);

            AddProperty("AutoStack", false);
            AddProperty("ActionStatusMsg", true);
            AddProperty("RememberPwds", false);

            AddProperty("SpellUnequip", false);
            AddProperty("RangeCheckLT", true);
            AddProperty("LTRange", (int)12);

            AddProperty("FilterSnoopMsg", true);

            AddProperty("SmartLastTarget", false);
            AddProperty("LastTargTextFlags", true);
            AddProperty("LTHilight", (int)0);

            AddProperty("AutoFriend", false);

            AddProperty("MessageLevel", 0);

            AddProperty("ForceIP", "");
            AddProperty("ForcePort", 0);

            AddProperty("PotionEquip", false);
            AddProperty("BlockHealPoison", false);

            AddProperty("SmoothWalk", false);

            AddProperty("Negotiate", true);

            AddProperty("MapX", 200);
            AddProperty("MapY", 200);
            AddProperty("MapW", 200);
            AddProperty("MapH", 200);

            AddProperty("ShowHealth", false);
            AddProperty("HealthFmt", "[{0}%]");
            AddProperty("ShowPartyStats", false);
            AddProperty("PartyStatFmt", "[{0}% / {1}%]");

            Counter.Default();
            Filter.DisableAll();
            DressList.ClearAll();
            HotKey.ClearAll();
            Agent.ClearAll();
        }
Пример #17
0
        public void MakeDefault()
        {
            m_Props.Clear();

            AddProperty("ShowMobNames", false);
            AddProperty("ShowCorpseNames", false);
            AddProperty("DisplaySkillChanges", false);
            AddProperty("TitleBarText",
                        @"UO - {char} {crimtime}- {mediumstatbar} {bp} {bm} {gl} {gs} {mr} {ns} {ss} {sa} {aids}");
            AddProperty("TitleBarDisplay", true);
            AddProperty("AutoSearch", true);
            AddProperty("NoSearchPouches", true);
            AddProperty("CounterWarnAmount", (int)5);
            AddProperty("CounterWarn", true);
            AddProperty("ObjectDelay", (int)600);
            AddProperty("AlwaysOnTop", false);
            AddProperty("SortCounters", true);
            AddProperty("QueueActions", true);
            AddProperty("QueueTargets", true);
            AddProperty("WindowX", (int)400);
            AddProperty("WindowY", (int)400);
            AddProperty("CountStealthSteps", true);
            AddProperty("AlwaysStealth", false);

            AddProperty("SysColor", (int)0x03B1);
            AddProperty("WarningColor", (int)0x0025);
            AddProperty("ExemptColor", (int)0x0480);
            AddProperty("SpeechHue", (int)0x03B1);
            AddProperty("BeneficialSpellHue", (int)0x0005);
            AddProperty("HarmfulSpellHue", (int)0x0025);
            AddProperty("NeutralSpellHue", (int)0x03B1);
            AddProperty("ForceSpeechHue", false);
            AddProperty("ForceSpellHue", false);
            AddProperty("SpellFormat", @"{power} [{spell}]");

            AddProperty("ShowNotoHue", true);
            AddProperty("Opacity", (int)100);

            AddProperty("AutoOpenCorpses", false);
            AddProperty("CorpseRange", (int)2);

            AddProperty("FilterSpam", false);
            AddProperty("BlockDismount", false);

            AddProperty("AutoCap", false);
            AddProperty("CapFullScreen", false);
            AddProperty("CapPath",
                        Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), "RazorScreenShots"));
            AddProperty("CapTimeStamp", true);
            AddProperty("ImageFormat", "jpg");

            AddProperty("UndressConflicts", true);
            AddProperty("HighlightReagents", true);
            AddProperty("Systray", true);
            AddProperty("TitlebarImages", true);

            AddProperty("SellAgentMax", (int)99);
            AddProperty("SkillListCol", (int)-1);
            AddProperty("SkillListAsc", false);

            AddProperty("AutoStack", false);
            AddProperty("ActionStatusMsg", true);
            AddProperty("RememberPwds", false);

            AddProperty("SpellUnequip", false);
            AddProperty("RangeCheckLT", true);
            AddProperty("LTRange", (int)12);

            AddProperty("ClientPrio", "Normal");
            AddProperty("FilterSnoopMsg", true);
            AddProperty("OldStatBar", false);

            AddProperty("SmartLastTarget", false);
            AddProperty("LastTargTextFlags", true);
            //AddProperty("SmartCPU", false);
            AddProperty("LTHilight", (int)0);

            AddProperty("RecFolder",
                        Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), "RazorScreenShots"));
            AddProperty("AviFPS", 15);
            AddProperty("AviRes", 1);

            AddProperty("AutoFriend", false);

            AddProperty("AutoOpenDoors", true);

            AddProperty("MessageLevel", 0);

            AddProperty("ForceIP", "");
            AddProperty("ForcePort", 0);

            AddProperty("ForceSizeEnabled", false);
            AddProperty("ForceSizeX", 800);
            AddProperty("ForceSizeY", 600);

            AddProperty("FlipVidH", false);
            AddProperty("FlipVidV", false);

            AddProperty("PotionEquip", false);
            AddProperty("BlockHealPoison", false);

            AddProperty("SmoothWalk", false);

            AddProperty("Negotiate", true);

            AddProperty("MapX", 200);
            AddProperty("MapY", 200);
            AddProperty("MapW", 200);
            AddProperty("MapH", 200);

            AddProperty("LogPacketsByDefault", false);

            AddProperty("ShowHealth", false);
            AddProperty("HealthFmt", "[{0}%]");
            AddProperty("ShowPartyStats", false);
            AddProperty("PartyStatFmt", "[{0}% / {1}%]");

            AddProperty("JsonApi", false);
            AddProperty("HotKeyStop", false);
            AddProperty("DiffTargetByType", false);
            AddProperty("StepThroughMacro", false);

            Counter.Default();
            Filter.DisableAll();
            DressList.ClearAll();
            HotKey.ClearAll();
            Agent.ClearAll();
            PasswordMemory.ClearAll();
        }
Пример #18
0
        public void Save()
        {
            string profileDir = Config.GetUserDirectory("Profiles");
            string file       = Path.Combine(profileDir, String.Format("{0}.xml", m_Name));

            if (m_Name != "default" && !m_Warned)
            {
                try
                {
                    m_Mutex = new System.Threading.Mutex(true, String.Format("Razor_Profile_{0}", m_Name));

                    if (!m_Mutex.WaitOne(10, false))
                    {
                        throw new Exception("Can't grab profile mutex, must be in use!");
                    }
                }
                catch
                {
                    //MessageBox.Show( Engine.ActiveWindow, Language.Format( LocString.ProfileInUse, m_Name ), "Profile In Use", MessageBoxButtons.OK, MessageBoxIcon.Warning );
                    //m_Warned = true;
                    return;                     // refuse to overwrite profiles that we don't own.
                }
            }

            XmlTextWriter xml;

            try
            {
                xml = new XmlTextWriter(file, Encoding.Default);
            }
            catch
            {
                return;
            }

            xml.Formatting  = Formatting.Indented;
            xml.IndentChar  = '\t';
            xml.Indentation = 1;

            xml.WriteStartDocument(true);
            xml.WriteStartElement("profile");

            foreach (KeyValuePair <string, object> de in m_Props)
            {
                xml.WriteStartElement("property");
                xml.WriteAttributeString("name", de.Key);
                if (de.Value == null)
                {
                    xml.WriteAttributeString("type", "-null-");
                }
                else
                {
                    xml.WriteAttributeString("type", de.Value.GetType().FullName);
                    xml.WriteString(de.Value.ToString());
                }
                xml.WriteEndElement();
            }

            xml.WriteStartElement("filters");
            Filter.Save(xml);
            xml.WriteEndElement();

            xml.WriteStartElement("counters");
            Counter.SaveProfile(xml);
            xml.WriteEndElement();

            xml.WriteStartElement("agents");
            Agent.SaveProfile(xml);
            xml.WriteEndElement();

            xml.WriteStartElement("dresslists");
            DressList.Save(xml);
            xml.WriteEndElement();

            xml.WriteStartElement("hotkeys");
            HotKey.Save(xml);
            xml.WriteEndElement();

            xml.WriteStartElement("passwords");
            PasswordMemory.Save(xml);
            xml.WriteEndElement();

            xml.WriteEndElement();             // end profile section

            xml.Close();
        }
Пример #19
0
        public bool Load()
        {
            if (m_Name == null || m_Name.Trim() == "")
            {
                return(false);
            }

            string path = Config.GetUserDirectory("Profiles");
            string file = Path.Combine(path, String.Format("{0}.xml", m_Name));

            if (!File.Exists(file))
            {
                return(false);
            }

            XmlDocument doc = new XmlDocument();

            try
            {
                doc.Load(file);
            }
            catch
            {
                MessageBox.Show(Engine.ActiveWindow, Language.Format(LocString.ProfileCorrupt, file), "Profile Load Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return(false);
            }

            XmlElement root = doc["profile"];

            if (root == null)
            {
                return(false);
            }

            Assembly exe = Assembly.GetCallingAssembly();

            if (exe == null)
            {
                return(false);
            }

            foreach (XmlElement el in root.GetElementsByTagName("property"))
            {
                try
                {
                    string name    = el.GetAttribute("name");
                    string typeStr = el.GetAttribute("type");
                    string val     = el.InnerText;

                    if (typeStr == "-null-" || name == "LimitSize" || name == "VisRange")
                    {
                        //m_Props[name] = null;
                        if (m_Props.ContainsKey(name))
                        {
                            m_Props.Remove(name);
                        }
                    }
                    else
                    {
                        Type type = Type.GetType(typeStr);
                        if (type == null)
                        {
                            type = exe.GetType(typeStr);
                        }

                        if (m_Props.ContainsKey(name) || name == "ForceSize")
                        {
                            if (type == null)
                            {
                                m_Props.Remove(name);
                            }
                            else
                            {
                                m_Props[name] = GetObjectFromString(val, type);
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    MessageBox.Show(Engine.ActiveWindow, Language.Format(LocString.ProfileLoadEx, e.ToString()), "Profile Load Exception", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }

            Filter.Load(root["filters"]);
            Counter.LoadProfile(root["counters"]);
            Agent.LoadProfile(root["agents"]);
            DressList.Load(root["dresslists"]);
            HotKey.Load(root["hotkeys"]);
            PasswordMemory.Load(root["passwords"]);

            if (m_Props.ContainsKey("ForceSize"))
            {
                try
                {
                    int x, y;
                    switch ((int)m_Props["ForceSize"])
                    {
                    case 1: x = 960;        y = 600;        break;

                    case 2: x = 1024;       y = 768;        break;

                    case 3: x = 1152;       y = 864;        break;

                    case 4: x = 1280;       y = 720;        break;

                    case 5: x = 1280;       y = 768;        break;

                    case 6: x = 1280;       y = 800;        break;

                    case 7: x = 1280;       y = 960;        break;

                    case 8: x = 1280;       y = 1024;       break;

                    case 0:
                    default: x = 800;        y = 600;        break;
                    }

                    SetProperty("ForceSizeX", x);
                    SetProperty("ForceSizeY", y);

                    if (x != 800 || y != 600)
                    {
                        SetProperty("ForceSizeEnabled", true);
                    }

                    m_Props.Remove("ForceSize");
                }
                catch
                {
                }
            }

            //if ( !Language.Load( GetString( "Language" ) ) )
            //	MessageBox.Show( Engine.ActiveWindow, "Warning: Could not load language from profile, using current language instead.", "Language Error", MessageBoxButtons.OK, MessageBoxIcon.Warning );

            return(true);
        }
Пример #20
0
        public void MakeDefault()
        {
            m_Props.Clear();

            AddProperty("ShowMobNames", false);
            AddProperty("ShowCorpseNames", false);
            AddProperty("DisplaySkillChanges", false);
            AddProperty("TitleBarText",
                        @"UO - {char} {crimtime}- {mediumstatbar} {bp} {bm} {gl} {gs} {mr} {ns} {ss} {sa} {aids}");
            AddProperty("TitleBarDisplay", true);
            AddProperty("AutoSearch", true);
            AddProperty("NoSearchPouches", true);
            AddProperty("CounterWarnAmount", (int)5);
            AddProperty("CounterWarn", true);
            AddProperty("ObjectDelay", (int)600);
            AddProperty("ObjectDelayEnabled", true);
            AddProperty("AlwaysOnTop", false);
            AddProperty("SortCounters", true);
            AddProperty("QueueActions", false);
            AddProperty("QueueTargets", false);
            AddProperty("WindowX", (int)400);
            AddProperty("WindowY", (int)400);
            AddProperty("CountStealthSteps", true);

            AddProperty("SysColor", (int)0x03B1);
            AddProperty("WarningColor", (int)0x0025);
            AddProperty("ExemptColor", (int)0x0480);
            AddProperty("SpeechHue", (int)0x03B1);
            AddProperty("BeneficialSpellHue", (int)0x0005);
            AddProperty("HarmfulSpellHue", (int)0x0025);
            AddProperty("NeutralSpellHue", (int)0x03B1);
            AddProperty("ForceSpeechHue", false);
            AddProperty("ForceSpellHue", false);
            AddProperty("SpellFormat", @"{power} [{spell}]");

            AddProperty("ShowNotoHue", true);
            AddProperty("Opacity", (int)100);

            AddProperty("AutoOpenCorpses", false);
            AddProperty("CorpseRange", (int)2);

            AddProperty("BlockDismount", false);

            AddProperty("CapFullScreen", false);
            AddProperty("CapPath",
                        Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), "RazorScreenShots"));
            AddProperty("CapTimeStamp", true);
            AddProperty("ImageFormat", "jpg");

            AddProperty("UndressConflicts", true);
            AddProperty("HighlightReagents", true);
            AddProperty("Systray", false);
            AddProperty("TitlebarImages", true);

            AddProperty("SellAgentMax", (int)99);
            AddProperty("SkillListCol", (int)-1);
            AddProperty("SkillListAsc", false);

            AddProperty("AutoStack", true);
            AddProperty("ActionStatusMsg", true);
            AddProperty("RememberPwds", false);

            AddProperty("SpellUnequip", true);
            AddProperty("RangeCheckLT", true);
            AddProperty("LTRange", (int)12);

            AddProperty("ClientPrio", "Normal");
            AddProperty("FilterSnoopMsg", true);
            AddProperty("OldStatBar", false);

            AddProperty("SmartLastTarget", false);
            AddProperty("LastTargTextFlags", true);
            //AddProperty("SmartCPU", false);
            AddProperty("LTHilight", (int)0);

            AddProperty("AutoFriend", false);

            AddProperty("AutoOpenDoors", true);

            AddProperty("MessageLevel", 0);

            AddProperty("ForceIP", "");
            AddProperty("ForcePort", 0);

            AddProperty("ForceSizeEnabled", false);
            AddProperty("ForceSizeX", 1000);
            AddProperty("ForceSizeY", 800);

            AddProperty("PotionEquip", false);
            AddProperty("BlockHealPoison", true);

            AddProperty("SmoothWalk", false);

            AddProperty("Negotiate", true);

            AddProperty("MapX", 200);
            AddProperty("MapY", 200);
            AddProperty("MapW", 200);
            AddProperty("MapH", 200);

            AddProperty("LogPacketsByDefault", false);

            AddProperty("ShowHealth", true);
            AddProperty("HealthFmt", "[{0}%]");
            AddProperty("ShowPartyStats", true);
            AddProperty("PartyStatFmt", "[{0}% / {1}%]");

            AddProperty("HotKeyStop", false);
            AddProperty("DiffTargetByType", false);
            AddProperty("StepThroughMacro", false);

            // Map options

            /*AddProperty("ShowPlayerPosition", true);
             * AddProperty("TrackPlayerPosition", true);
             * AddProperty("ShowPartyMemberPositions", true);
             * AddProperty("TiltMap", true);*/

            AddProperty("ShowTargetSelfLastClearOverhead", true);
            AddProperty("ShowOverheadMessages", false);
            AddProperty("CaptureMibs", false);

            //OverheadFormat
            AddProperty("OverheadFormat", "[{msg}]");
            AddProperty("OverheadStyle", 1);

            AddProperty("GoldPerDisplay", false);

            AddProperty("LightLevel", 31);
            AddProperty("LogSkillChanges", false);
            AddProperty("StealthOverhead", false);

            AddProperty("ShowBuffDebuffOverhead", true);
            AddProperty("BuffDebuffFormat", "[{action}{name} ({duration}s)]");

            AddProperty("BlockOpenCorpsesTwice", false);

            AddProperty("ScreenshotUploadNotifications", false);
            AddProperty("ScreenshotUploadClipboard", true);
            AddProperty("ScreenshotUploadOpenBrowser", true);

            AddProperty("ShowAttackTargetOverhead", true);

            AddProperty("RangeCheckTargetByType", false);
            AddProperty("RangeCheckDoubleClick", false);

            AddProperty("ShowContainerLabels", false);
            AddProperty("ContainerLabelFormat", "[{label}] ({type})");
            AddProperty("ContainerLabelColor", 88);
            AddProperty("ContainerLabelStyle", 1);

            AddProperty("Season", 5);

            AddProperty("BlockTradeRequests", false);
            AddProperty("BlockPartyInvites", false);
            AddProperty("AutoAcceptParty", false);

            AddProperty("MaxLightLevel", 31);
            AddProperty("MinLightLevel", 0);
            AddProperty("MinMaxLightLevelEnabled", false);
            AddProperty("ShowStaticWalls", false);
            AddProperty("ShowStaticWallLabels", false);

            AddProperty("ShowTextTargetIndicator", false);
            AddProperty("ShowAttackTargetNewOnly", false);

            AddProperty("FilterDragonGraphics", false);
            AddProperty("FilterDrakeGraphics", false);
            AddProperty("DragonGraphic", 0);
            AddProperty("DrakeGraphic", 0);

            AddProperty("ShowDamageDealt", false);
            AddProperty("ShowDamageDealtOverhead", false);
            AddProperty("ShowDamageTaken", false);
            AddProperty("ShowDamageTakenOverhead", false);

            AddProperty("ShowInRazorTitleBar", false);
            AddProperty("RazorTitleBarText", "{name} on {account} ({profile} - {shard}) - Razor v{version}");

            AddProperty("EnableUOAAPI", true);
            AddProperty("UOAMPath", string.Empty);
            AddProperty("UltimaMapperPath", string.Empty);

            AddProperty("TargetIndicatorFormat", "* Target *");

            AddProperty("NextPrevTargetIgnoresFriends", false);

            AddProperty("StealthStepsFormat", "Steps: {step}");

            AddProperty("ShowFriendOverhead", false);

            AddProperty("DisplaySkillChangesOverhead", false);

            AddProperty("GrabHotBag", "0");

            // Enable it for OSI client by default, CUO turn it off
            AddProperty("MacroActionDelay", Client.IsOSI);

            AddProperty("AutoOpenDoorWhenHidden", false);

            AddProperty("DisableMacroPlayFinish", false);

            AddProperty("ShowBandageTimer", false);
            AddProperty("ShowBandageTimerFormat", "Bandage: {count}s");
            AddProperty("ShowBandageTimerLocation", 0);
            AddProperty("OnlyShowBandageTimerEvery", false);
            AddProperty("OnlyShowBandageTimerSeconds", 1);
            AddProperty("ShowBandageTimerHue", 88);

            AddProperty("FriendOverheadFormat", "[Friend]");
            AddProperty("FriendOverheadFormatHue", 0x03F);

            AddProperty("TargetIndicatorHue", 10);

            AddProperty("FilterSystemMessages", false);
            AddProperty("FilterRazorMessages", false);
            AddProperty("FilterDelay", 3.5);
            AddProperty("FilterOverheadMessages", false);

            AddProperty("OnlyNextPrevBeneficial", false);
            AddProperty("FriendlyBeneficialOnly", false);
            AddProperty("NonFriendlyHarmfulOnly", false);

            AddProperty("ShowBandageStart", false);
            AddProperty("BandageStartMessage", "Bandage: Starting");
            AddProperty("ShowBandageEnd", false);
            AddProperty("BandageEndMessage", "Bandage: Ending");

            AddProperty("BuffDebuffSeconds", 20);
            AddProperty("BuffHue", 88);
            AddProperty("DebuffHue", 338);
            AddProperty("DisplayBuffDebuffEvery", false);
            AddProperty("BuffDebuffFilter", string.Empty);
            AddProperty("BuffDebuffEveryXSeconds", false);

            AddProperty("CaptureOthersDeathDelay", 0.5);
            AddProperty("CaptureOwnDeathDelay", 0.5);
            AddProperty("CaptureOthersDeath", false);
            AddProperty("CaptureOwnDeath", false);

            AddProperty("TargetFilterEnabled", false);

            AddProperty("FilterDaemonGraphics", false);
            AddProperty("DaemonGraphic", 0);

            AddProperty("SoundFilterEnabled", false);
            AddProperty("ShowFilteredSound", false);
            AddProperty("ShowPlayingSoundInfo", false);
            AddProperty("ShowMusicInfo", false);

            AddProperty("AutoSaveScript", false);
            AddProperty("AutoSaveScriptPlay", false);

            AddProperty("HighlightFriend", false);

            Counter.Default();
            Filter.DisableAll();
            DressList.ClearAll();
            HotKey.ClearAll();
            Agent.ClearAll();
            PasswordMemory.ClearAll();
            FriendsManager.ClearAll();
            DressList.ClearAll();
            OverheadMessages.ClearAll();
            ContainerLabels.ClearAll();
            MacroVariables.ClearAll();
            ScriptVariables.ClearAll();
            FriendsManager.ClearAll();
        }
Пример #21
0
        public bool Load()
        {
            if (m_Name == null || m_Name.Trim() == "")
            {
                return(false);
            }

            string path = Config.GetUserDirectory("Profiles");
            string file = Path.Combine(path, $"{m_Name}.xml");

            if (!File.Exists(file))
            {
                return(false);
            }

            XmlDocument doc = new XmlDocument();

            try
            {
                doc.Load(file);
            }
            catch
            {
                MessageBox.Show(Engine.ActiveWindow, Language.Format(LocString.ProfileCorrupt, file),
                                "Profile Load Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return(false);
            }

            XmlElement root = doc["profile"];

            if (root == null)
            {
                return(false);
            }

            Assembly exe = Assembly.GetCallingAssembly();

            if (exe == null)
            {
                return(false);
            }

            foreach (XmlElement el in root.GetElementsByTagName("property"))
            {
                try
                {
                    string name    = el.GetAttribute("name");
                    string typeStr = el.GetAttribute("type");
                    string val     = el.InnerText;

                    if (typeStr == "-null-" || name == "LimitSize" || name == "VisRange")
                    {
                        //m_Props[name] = null;
                        if (m_Props.ContainsKey(name))
                        {
                            m_Props.Remove(name);
                        }
                    }
                    else
                    {
                        Type type = Type.GetType(typeStr);
                        if (type == null)
                        {
                            type = exe.GetType(typeStr);
                        }

                        if (m_Props.ContainsKey(name) || name == "ForceSize")
                        {
                            if (type == null)
                            {
                                m_Props.Remove(name);
                            }
                            else
                            {
                                m_Props[name] = GetObjectFromString(val, type);
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    MessageBox.Show(Engine.ActiveWindow, Language.Format(LocString.ProfileLoadEx, e.ToString()),
                                    "Profile Load Exception", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }

            Filter.Load(root["filters"]);
            Counter.LoadProfile(root["counters"]);
            Agent.LoadProfile(root["agents"]);
            DressList.Load(root["dresslists"]);
            TargetFilterManager.Load(root["targetfilters"]);
            SoundMusicManager.Load(root["soundfilters"]);
            WaypointManager.Load(root["waypoints"]);
            TextFilterManager.Load(root["textfilters"]);
            FriendsManager.Load(root["friends"]);
            HotKey.Load(root["hotkeys"]);
            PasswordMemory.Load(root["passwords"]);
            OverheadManager.Load(root["overheadmessages"]);
            ContainerLabels.Load(root["containerlabels"]);
            MacroVariables.Load(root["macrovariables"]);
            //imports previous absolutetargets and doubleclickvariables if present in profile
            if ((root.SelectSingleNode("absolutetargets") != null) ||
                (root.SelectSingleNode("doubleclickvariables") != null))
            {
                MacroVariables.Import(root);
            }

            ScriptVariables.Load(root["scriptvariables"]);

            GoldPerHourTimer.Stop();
            DamageTracker.Stop();

            if (m_Props.ContainsKey("ForceSize"))
            {
                try
                {
                    int x, y;
                    switch ((int)m_Props["ForceSize"])
                    {
                    case 1:
                        x = 960;
                        y = 600;
                        break;

                    case 2:
                        x = 1024;
                        y = 768;
                        break;

                    case 3:
                        x = 1152;
                        y = 864;
                        break;

                    case 4:
                        x = 1280;
                        y = 720;
                        break;

                    case 5:
                        x = 1280;
                        y = 768;
                        break;

                    case 6:
                        x = 1280;
                        y = 800;
                        break;

                    case 7:
                        x = 1280;
                        y = 960;
                        break;

                    case 8:
                        x = 1280;
                        y = 1024;
                        break;

                    case 0:
                    default:
                        x = 800;
                        y = 600;
                        break;
                    }

                    SetProperty("ForceSizeX", x);
                    SetProperty("ForceSizeY", y);

                    if (x != 800 || y != 600)
                    {
                        SetProperty("ForceSizeEnabled", true);
                    }

                    m_Props.Remove("ForceSize");
                }
                catch
                {
                }
            }

            //if ( !Language.Load( GetString( "Language" ) ) )
            //	MessageBox.Show( Engine.ActiveWindow, "Warning: Could not load language from profile, using current language instead.", "Language Error", MessageBoxButtons.OK, MessageBoxIcon.Warning );

            return(true);
        }
Пример #22
0
 public static void Remove( DressList list )
 {
     m_List.Remove( list );
     HotKey.Remove( String.Format( "Dress: {0}", list.Name ) );
     HotKey.Remove( String.Format( "Undress: {0}", list.Name ) );
     HotKey.Remove( String.Format( "Toggle: {0}", list.Name ) );
 }
Пример #23
0
        private void undressBag_Click(object sender, System.EventArgs e)
        {
            if ( World.Player == null )
                return;

            DressList list = (DressList)dressList.SelectedItem;
            if ( list == null )
                return;

            undressBagList = list;
            Targeting.OneTimeTarget( new Targeting.TargetResponseCallback( onDressBagTarget ) );
            World.Player.SendMessage( MsgLevel.Force, LocString.TargUndressBag, list.Name );
        }