示例#1
0
        private void OnStackItemReplaced(object sender, ItemStatusEventArgs <ushort> e)
        {
            // Processor artifact: item assignment before SP increment/decrement.
            if (e.Index >= lstStack.Items.Count)
            {
                return;
            }

            lstStack.Items[e.Index] = String.Format("0x{0:X2}: 0x{1:X4}", e.Index, e.Item);
        }
        private void view_StatusChanged(object source, ItemStatusEventArgs statusInformation)
        {
            if (!statusInformation.IndirectChange && statusInformation.EnabledChanged)
            {
//        propertyGrid1.Refresh();
//        propertyGrid1.ExpandAllGridItems();
            }
            else if (statusInformation.HiddenChanged)
            {
                propertyGrid1.SelectedObjects = new IModelView[] { View };
            }
        }
        public Equipment DoShieldBreakCheck()
        {
            LegacyLogic.Instance.WorldManager.HintManager.TriggerHint(EHintType.BREAKING_ITEMS);
            Shield randomItem = m_equipment.GetRandomItem <Shield>();

            if (randomItem != null && randomItem.BreakCheck())
            {
                LegacyLogic.Instance.WorldManager.HintManager.TriggerHint(EHintType.BROKEN_ITEMS);
                ItemStatusEventArgs p_eventArgs = new ItemStatusEventArgs(randomItem, m_character);
                LegacyLogic.Instance.EventManager.InvokeEvent(this, EEventType.INVENTORY_ITEM_REPAIR_STATUS_CHANGED, p_eventArgs);
                m_character.CalculateCurrentAttributes();
                return(randomItem);
            }
            return(null);
        }
示例#4
0
 private void view_StatusChanged(object source, ItemStatusEventArgs statusInformation)
 {
     if (statusInformation.EnabledChanged)
     {
         if (topLevelControlMap.ContainsKey((Guid)source))
         {
             Control c = topLevelControlMap[(Guid)source];
             c.Enabled = statusInformation.Enabled;
         }
         if (StatusChanged != null)
         {
             //propagate to subscribers
             StatusChanged(source, statusInformation);
         }
     }
 }
示例#5
0
        private void ItemRepairStatusChanged(Object p_sender, EventArgs p_args)
        {
            String text = String.Empty;

            if (p_args is ItemStatusEventArgs)
            {
                ItemStatusEventArgs itemStatusEventArgs = p_args as ItemStatusEventArgs;
                Character           itemOwner           = itemStatusEventArgs.ItemOwner;
                if (itemOwner == null)
                {
                    return;
                }
                String    str       = (itemOwner.Gender != EGender.FEMALE) ? "_M" : "_F";
                Equipment equipment = itemStatusEventArgs.AffectedItem as Equipment;
                if (equipment == null)
                {
                    return;
                }
                if (equipment is MeleeWeapon)
                {
                    text = LocaManager.GetText("GAME_MESSAGE_WEAPON_BROKEN" + str, itemOwner.Name);
                }
                else if (equipment is Shield)
                {
                    text = LocaManager.GetText("GAME_MESSAGE_SHIELD_BROKEN" + str, itemOwner.Name);
                }
                else if (equipment is Armor)
                {
                    text = LocaManager.GetText("GAME_MESSAGE_ARMOR_BROKEN" + str, itemOwner.Name);
                }
            }
            if (String.IsNullOrEmpty(text))
            {
                return;
            }
            GameMessage item = new GameMessage(text);

            m_queuedMessages.Enqueue(item);
        }
示例#6
0
 private void view_StatusChanged(object source, ItemStatusEventArgs statusInformation)
 {
     if (!statusInformation.IndirectChange)
     {
         if (statusInformation.EnabledChanged)
         {
             if (propertyControlMapping.ContainsKey((Guid)source))
             {
                 Control c = propertyControlMapping[(Guid)source];
                 c.Enabled = statusInformation.Enabled;
             }
             else
             {
                 if (StatusChanged != null)
                 {
                     //propagate to subscribers
                     StatusChanged(source, statusInformation);
                 }
             }
         }
         Invalidate();
     }
 }
示例#7
0
 private void OnRegisterChanged(object sender, ItemStatusEventArgs <byte> e)
 {
     updateRegister(e.Index);
 }