This commit is contained in:
erik 2025-06-09 02:03:11 +02:00
parent 01151e679b
commit 57b2f0400e
265 changed files with 22828 additions and 6 deletions

View file

@ -0,0 +1,15 @@
using System;
namespace Decal.Adapter.Wrappers;
public class AcceptTradeEventArgs : EventArgs
{
private int mTargetId;
public int TargetId => mTargetId;
internal AcceptTradeEventArgs(int TargetId)
{
mTargetId = TargetId;
}
}

View file

@ -0,0 +1,22 @@
using System;
namespace Decal.Adapter.Wrappers;
public class AccountCharInfo : MarshalByRefObject
{
private int myIndex;
private CharacterFilter myFilter;
public string Name => myFilter.get_AccountCharName(myIndex);
public int Id => myFilter.get_AccountCharID(myIndex);
public int Index => myIndex;
internal AccountCharInfo(CharacterFilter filter, int index)
{
myFilter = filter;
myIndex = index;
}
}

View file

@ -0,0 +1,10 @@
using System;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public enum AddRemoveEventType
{
Add,
Delete
}

View file

@ -0,0 +1,20 @@
using System;
namespace Decal.Adapter.Wrappers;
public class AddTradeItemEventArgs : EventArgs
{
private int mItemId;
private int mSideId;
public int ItemId => mItemId;
public int SideId => mSideId;
internal AddTradeItemEventArgs(int ItemId, int SideId)
{
mItemId = ItemId;
mSideId = SideId;
}
}

View file

@ -0,0 +1,71 @@
using System;
using System.Runtime.InteropServices;
using Decal.Interop.Filters;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public class AllegianceInfoWrapper : MarshalByRefObject, IDisposable
{
private AllegianceInfo myAllegianceInfo;
private bool isDisposed;
public int Id => myAllegianceInfo.GUID;
public int Gender => myAllegianceInfo.Gender;
public int Leadership => myAllegianceInfo.Leadership;
public int Loyalty => myAllegianceInfo.Loyalty;
public string Name => myAllegianceInfo.Name;
public int Race => myAllegianceInfo.Race;
public int Rank => myAllegianceInfo.Rank;
public int ParentId => myAllegianceInfo.TreeParent;
public int Type => myAllegianceInfo.Type;
public double Unknown => myAllegianceInfo.Unknown;
public long XP => myAllegianceInfo.XP_64;
internal AllegianceInfoWrapper(AllegianceInfo info)
{
myAllegianceInfo = info;
}
~AllegianceInfoWrapper()
{
Dispose(disposing: false);
}
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!isDisposed)
{
}
if (myAllegianceInfo != null)
{
Marshal.ReleaseComObject(myAllegianceInfo);
}
isDisposed = true;
}
protected void EnforceDisposedOnce()
{
if (isDisposed)
{
throw new ObjectDisposedException("AllegianceInfoWrapper");
}
}
}

View file

@ -0,0 +1,20 @@
using System;
namespace Decal.Adapter.Wrappers;
public class ApproachVendorEventArgs : EventArgs
{
private int mMerchantId;
private Vendor vendor;
public int MerchantId => mMerchantId;
public Vendor Vendor => vendor;
internal ApproachVendorEventArgs(int MerchantId, Vendor ven)
{
mMerchantId = MerchantId;
vendor = ven;
}
}

View file

@ -0,0 +1,59 @@
using System;
using System.Runtime.InteropServices;
using Decal.Interop.Filters;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public class AttributeInfoWrapper : MarshalByRefObject, IDisposable
{
private AttributeInfo myAttribInfo;
private bool isDisposed;
public int Base => myAttribInfo.Base;
public int Buffed => myAttribInfo.Buffed;
public int Creation => myAttribInfo.Creation;
public int Exp => myAttribInfo.Exp;
public string Name => myAttribInfo.Name;
internal AttributeInfoWrapper(AttributeInfo info)
{
myAttribInfo = info;
}
~AttributeInfoWrapper()
{
Dispose(disposing: false);
}
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!isDisposed)
{
}
if (myAttribInfo != null)
{
Marshal.ReleaseComObject(myAttribInfo);
}
isDisposed = true;
}
protected void EnforceDisposedOnce()
{
if (isDisposed)
{
throw new ObjectDisposedException("AttributeInfoWrapper");
}
}
}

View file

@ -0,0 +1,20 @@
using System;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public enum AttributeType
{
CurrentStrength = 1,
CurrentEndurance,
CurrentQuickness,
CurrentCoordination,
CurrentFocus,
CurrentSelf,
BaseStrength,
BaseEndurance,
BaseQuickness,
BaseCoordination,
BaseFocus,
BaseSelf
}

View file

@ -0,0 +1,78 @@
using System;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public enum Augmentations
{
ReinforcementLugians = 218,
BleearghFortitude = 219,
OswaldEnchancement = 220,
SiraluunBlessing = 221,
EnduringCalm = 222,
SteadfastWill = 223,
CiandraEssence = 224,
YoshiEssence = 225,
JibrilEssence = 226,
CeldisethEssence = 227,
KogaEssence = 228,
ShadowSeventhMule = 229,
MightSeventhMule = 230,
ClutchMiser = 231,
EnduringEnchantment = 232,
CriticalProtection = 233,
QuickLearner = 234,
CiandraFortune = 235,
CharmedSmith = 236,
InnateRenewal = 237,
ArchmageEndurance = 238,
BladeTurner = 240,
ArrowTurner = 241,
MaceTurner = 242,
CausticEnhancement = 243,
FieryEnchancment = 244,
IcyEnchancement = 245,
LightningEnhancement = 246,
InfusedCreature = 294,
InfusedItem = 295,
InfusedLife = 296,
InfusedWar = 297,
EyeRemorseless = 298,
HandRemorseless = 299,
MasterSteelCircle = 300,
MasterFocusedEyed = 301,
MasterFiveFoldPath = 302,
FrenzySlayer = 309,
IronSkinInvincible = 310,
JackOfAllTrades = 326,
InfusedVoid = 328,
[Obsolete("Use InfusedVoid")]
UnknownAug1 = 328,
[Obsolete("Not an aug")]
UnknownAug2 = 329,
[Obsolete("Not an aug")]
UnknownAug3 = 330,
[Obsolete("Not an aug")]
UnknownAug4 = 331,
[Obsolete("Not an aug")]
UnknownAug5 = 332,
AuraValor = 333,
AuraProtection = 334,
AuraGlory = 335,
AuraTemperance = 336,
AuraSurge = 337,
[Obsolete("Not an aug")]
UnknownAug6 = 337,
AuraAethericVision = 338,
AuraManaFlow = 339,
AuraManaInfusion = 340,
[Obsolete("Use AuraManaInfusion")]
UnknownAug7 = 340,
AuraVitality = 341,
[Obsolete("Use AuraVitality")]
UnknownAug8 = 341,
AuraPurity = 342,
AuraCraftsman = 343,
AuraSpecialization = 344,
AuraWorld = 365
}

View file

@ -0,0 +1,29 @@
using System;
using Decal.Interop.Render;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public class Background : HudRenderTarget
{
private HUDBackground internalBackground;
internal HUDBackground Underlying => internalBackground;
internal Background(HUDBackground background)
: base(background)
{
internalBackground = background;
}
public Background Clone()
{
return new Background(internalBackground.Clone());
}
protected override void Dispose(bool disposing)
{
internalBackground = null;
base.Dispose(disposing);
}
}

View file

@ -0,0 +1,16 @@
namespace Decal.Adapter.Wrappers;
public enum BoolValueKey
{
Lockable = 201326592,
Inscribable = 201326593,
Open = 2,
Locked = 3,
HookVisibility = 24,
UnlimitedUses = 63,
CanBeSold = 69,
Retained = 91,
Ivoryable = 99,
Dyeable = 100,
AwayFromKeyboard = 110
}

View file

@ -0,0 +1,229 @@
using System;
using System.Drawing;
using Decal.Adapter.Support;
using Decal.Interop.Inject;
namespace Decal.Adapter.Wrappers;
public class ButtonWrapper : ControlWrapperBase<ButtonClass>
{
private EventHandler<ControlEventArgs> evtClick;
private EventHandler<ControlEventArgs> evtCancel;
private EventHandler<ControlEventArgs> evtDestroy;
private EventHandler<ControlEventArgs> evtHit;
private EventHandler<ControlEventArgs> evtUnhit;
private int myBackground;
public Color Matte
{
get
{
return Util.ColorFromBGR(base.Control.Matte);
}
set
{
base.Control.Matte = Util.ColorToBGR(value);
}
}
public int Background
{
get
{
return myBackground;
}
set
{
myBackground = value;
base.Control.SetBackground(myBackground);
}
}
public event EventHandler<ControlEventArgs> Click
{
add
{
if (evtClick == null)
{
base.Control.Accepted += ClickEvent;
}
evtClick = (EventHandler<ControlEventArgs>)Delegate.Combine(evtClick, value);
}
remove
{
evtClick = (EventHandler<ControlEventArgs>)Delegate.Remove(evtClick, value);
if (evtClick == null)
{
base.Control.Accepted -= ClickEvent;
}
}
}
public event EventHandler<ControlEventArgs> Canceled
{
add
{
if (evtCancel == null)
{
base.Control.Canceled += CanceledEvent;
}
evtCancel = (EventHandler<ControlEventArgs>)Delegate.Combine(evtCancel, value);
}
remove
{
evtCancel = (EventHandler<ControlEventArgs>)Delegate.Remove(evtCancel, value);
if (evtCancel == null)
{
base.Control.Canceled -= CanceledEvent;
}
}
}
public event EventHandler<ControlEventArgs> Destroy
{
add
{
if (evtDestroy == null)
{
base.Control.Destroy += DestroyEvent;
}
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Combine(evtDestroy, value);
}
remove
{
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, value);
if (evtDestroy == null)
{
base.Control.Destroy -= DestroyEvent;
}
}
}
public event EventHandler<ControlEventArgs> Hit
{
add
{
if (evtHit == null)
{
base.Control.Hit += HitEvent;
}
evtHit = (EventHandler<ControlEventArgs>)Delegate.Combine(evtHit, value);
}
remove
{
evtHit = (EventHandler<ControlEventArgs>)Delegate.Remove(evtHit, value);
if (evtHit == null)
{
base.Control.Hit -= HitEvent;
}
}
}
public event EventHandler<ControlEventArgs> Unhit
{
add
{
if (evtUnhit == null)
{
base.Control.Unhit += UnhitEvent;
}
evtUnhit = (EventHandler<ControlEventArgs>)Delegate.Combine(evtUnhit, value);
}
remove
{
evtUnhit = (EventHandler<ControlEventArgs>)Delegate.Remove(evtUnhit, value);
if (evtUnhit == null)
{
base.Control.Unhit -= UnhitEvent;
}
}
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (evtClick != null)
{
evtClick = (EventHandler<ControlEventArgs>)Delegate.Remove(evtClick, evtClick);
base.Control.Accepted -= ClickEvent;
}
if (evtCancel != null)
{
evtCancel = (EventHandler<ControlEventArgs>)Delegate.Remove(evtCancel, evtCancel);
base.Control.Canceled -= CanceledEvent;
}
if (evtDestroy != null)
{
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, evtDestroy);
base.Control.Destroy -= DestroyEvent;
}
if (evtHit != null)
{
evtHit = (EventHandler<ControlEventArgs>)Delegate.Remove(evtHit, evtHit);
base.Control.Hit -= HitEvent;
}
if (evtUnhit != null)
{
evtUnhit = (EventHandler<ControlEventArgs>)Delegate.Remove(evtUnhit, evtUnhit);
base.Control.Unhit -= UnhitEvent;
}
}
base.Dispose(disposing);
}
public void SetImages(int released, int pressed)
{
SetImages(0, released, pressed);
}
public void SetImages(int module, int released, int pressed)
{
base.Control.SetImages(module, released, pressed);
}
private void ClickEvent(int ID)
{
if (evtClick != null)
{
evtClick(this, new ControlEventArgs(ID));
}
}
private void UnhitEvent(int ID)
{
if (evtUnhit != null)
{
evtUnhit(this, new ControlEventArgs(ID));
}
}
private void HitEvent(int ID)
{
if (evtHit != null)
{
evtHit(this, new ControlEventArgs(ID));
}
}
private void DestroyEvent(int ID)
{
if (evtDestroy != null)
{
evtDestroy(this, new ControlEventArgs(ID));
}
}
private void CanceledEvent(int ID)
{
if (evtCancel != null)
{
evtCancel(this, new ControlEventArgs(ID));
}
}
}

View file

@ -0,0 +1,19 @@
using Decal.Interop.Filters;
namespace Decal.Adapter.Wrappers;
/// <summary>
/// Defines the WorldObjectCollection filter for all objects
/// </summary>
public class ByAllFilter : WorldObjectCollectionFilter
{
internal override void ApplyFilter(WorldIterator wi)
{
wi.ByAll();
}
internal override void ApplyFilter(Decal.Interop.Filters.Vendor ven)
{
ven.ByAll();
}
}

View file

@ -0,0 +1,52 @@
using Decal.Interop.Filters;
namespace Decal.Adapter.Wrappers;
/// <summary>
/// Defines the WorldObjectCollection filter for objects having the same category
/// </summary>
public class ByCategoryFilter : WorldObjectCollectionFilter
{
private int category;
/// <summary>
/// Category of the items in this collection
/// </summary>
public int Category
{
get
{
return category;
}
set
{
category = value;
}
}
/// <summary>
/// Creates a new filter
/// </summary>
public ByCategoryFilter()
{
}
/// <summary>
/// Creates a new filter using the specified category
/// </summary>
/// <param name="category">Category to filter by</param>
public ByCategoryFilter(int category)
{
this.category = category;
}
internal override void ApplyFilter(WorldIterator wi)
{
wi.ByCategory(category);
}
internal override void ApplyFilter(Decal.Interop.Filters.Vendor ven)
{
ven.ByCategory(category);
}
}

View file

@ -0,0 +1,47 @@
using Decal.Interop.Filters;
namespace Decal.Adapter.Wrappers;
/// <summary>
/// Defines the WorldObjectCollection filter for objects in a container
/// </summary>
public class ByContainerFilter : WorldObjectCollectionFilter
{
private int container;
/// <summary>
/// Id of the container filtered by
/// </summary>
public int Container
{
get
{
return container;
}
set
{
container = value;
}
}
/// <summary>
/// Creates a new filter
/// </summary>
public ByContainerFilter()
{
}
/// <summary>
/// Creates a new filter using the specified container
/// </summary>
/// <param name="container">Id of the container</param>
public ByContainerFilter(int container)
{
this.container = container;
}
internal override void ApplyFilter(WorldIterator wi)
{
wi.ByContainer(container);
}
}

View file

@ -0,0 +1,14 @@
using Decal.Interop.Filters;
namespace Decal.Adapter.Wrappers;
/// <summary>
/// Defines the WorldObjectCollection filter for inventory objects
/// </summary>
public class ByInventoryFilter : WorldObjectCollectionFilter
{
internal override void ApplyFilter(WorldIterator wi)
{
wi.ByInventory();
}
}

View file

@ -0,0 +1,14 @@
using Decal.Interop.Filters;
namespace Decal.Adapter.Wrappers;
/// <summary>
/// Defines the WorldObjectCollection filter for landscape objects
/// </summary>
public class ByLandscapeFilter : WorldObjectCollectionFilter
{
internal override void ApplyFilter(WorldIterator wi)
{
wi.ByLandscape();
}
}

View file

@ -0,0 +1,52 @@
using Decal.Interop.Filters;
namespace Decal.Adapter.Wrappers;
/// <summary>
/// Defines the WorldObjectCollection filter for objects having the specified name
/// </summary>
public class ByNameFilter : WorldObjectCollectionFilter
{
private string name;
/// <summary>
/// Name of the objects in this collection
/// </summary>
public string Name
{
get
{
return name;
}
set
{
name = value;
}
}
/// <summary>
/// Creates a new filter
/// </summary>
public ByNameFilter()
{
}
/// <summary>
/// Creates a new filter using the specified name
/// </summary>
/// <param name="name">Name of the object</param>
public ByNameFilter(string name)
{
this.name = name;
}
internal override void ApplyFilter(WorldIterator wi)
{
wi.ByName(name);
}
internal override void ApplyFilter(Decal.Interop.Filters.Vendor ven)
{
ven.ByName(name);
}
}

View file

@ -0,0 +1,19 @@
using Decal.Interop.Filters;
namespace Decal.Adapter.Wrappers;
/// <summary>
/// Defines the WorldObjectCollection filter for objects containing the specified name
/// </summary>
public class ByNameSubStringFilter : ByNameFilter
{
internal override void ApplyFilter(WorldIterator wi)
{
wi.ByNameSubstring(base.Name);
}
internal override void ApplyFilter(Decal.Interop.Filters.Vendor ven)
{
ven.ByNameSubstring(base.Name);
}
}

View file

@ -0,0 +1,52 @@
using Decal.Interop.Filters;
namespace Decal.Adapter.Wrappers;
/// <summary>
/// Defines the WorldObjectCollection filter for objects of the same type/class
/// </summary>
public class ByObjectClassFilter : WorldObjectCollectionFilter
{
private ObjectClass objClass;
/// <summary>
/// Class of the items in this collection
/// </summary>
public ObjectClass ObjectClass
{
get
{
return objClass;
}
set
{
objClass = value;
}
}
/// <summary>
/// Creates a new filter
/// </summary>
public ByObjectClassFilter()
{
}
/// <summary>
/// Creates a new filter using the specified ObjectClass
/// </summary>
/// <param name="objClass">Class of the items</param>
public ByObjectClassFilter(ObjectClass objClass)
{
this.objClass = objClass;
}
internal override void ApplyFilter(WorldIterator wi)
{
wi.ByObjectClass((eObjectClass)objClass);
}
internal override void ApplyFilter(Decal.Interop.Filters.Vendor ven)
{
ven.ByObjectClass((eObjectClass)objClass);
}
}

View file

@ -0,0 +1,47 @@
using Decal.Interop.Filters;
namespace Decal.Adapter.Wrappers;
/// <summary>
/// Defines the WorldObjectCollection filter for all objects owned by a character
/// </summary>
public class ByOwnerFilter : WorldObjectCollectionFilter
{
private int owner;
/// <summary>
/// Id of the owner of the objects
/// </summary>
public int Owner
{
get
{
return owner;
}
set
{
owner = value;
}
}
/// <summary>
/// Creates a new filter
/// </summary>
public ByOwnerFilter()
{
}
/// <summary>
/// Creates a new filter using the specified owner
/// </summary>
/// <param name="owner">Id of the owner</param>
public ByOwnerFilter(int owner)
{
this.owner = owner;
}
internal override void ApplyFilter(WorldIterator wi)
{
wi.ByOwner(owner);
}
}

View file

@ -0,0 +1,10 @@
using System;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public enum CastEventType
{
Untargetted,
Targetted
}

View file

@ -0,0 +1,20 @@
using System;
namespace Decal.Adapter.Wrappers;
public class ChangeEnchantmentsEventArgs : EventArgs
{
private AddRemoveEventType myType;
private EnchantmentWrapper myEnchantment;
public AddRemoveEventType Type => myType;
public EnchantmentWrapper Enchantment => myEnchantment;
internal ChangeEnchantmentsEventArgs(AddRemoveEventType type, EnchantmentWrapper enchantment)
{
myType = type;
myEnchantment = enchantment;
}
}

View file

@ -0,0 +1,20 @@
using System;
namespace Decal.Adapter.Wrappers;
public class ChangeExperienceEventArgs : EventArgs
{
private PlayerXPEventType myType;
private int myAmount;
public PlayerXPEventType Type => myType;
public int Amount => myAmount;
internal ChangeExperienceEventArgs(PlayerXPEventType type, int amount)
{
myType = type;
myAmount = amount;
}
}

View file

@ -0,0 +1,20 @@
using System;
namespace Decal.Adapter.Wrappers;
public class ChangeFellowshipEventArgs : EventArgs
{
private FellowshipEventType myType;
private int myId;
public FellowshipEventType Type => myType;
public int Id => myId;
internal ChangeFellowshipEventArgs(FellowshipEventType type, int Id)
{
myType = type;
myId = Id;
}
}

View file

@ -0,0 +1,21 @@
using System;
using Decal.Interop.Filters;
namespace Decal.Adapter.Wrappers;
public class ChangeObjectEventArgs : EventArgs
{
private WorldObject myChangedObject;
private WorldChangeType myChangeType;
public WorldObject Changed => myChangedObject;
public WorldChangeType Change => myChangeType;
internal ChangeObjectEventArgs(WorldObject changedObject, Decal.Interop.Filters.WorldChangeType changeType)
{
myChangedObject = changedObject;
myChangeType = (WorldChangeType)changeType;
}
}

View file

@ -0,0 +1,20 @@
using System;
namespace Decal.Adapter.Wrappers;
public class ChangeOptionEventArgs : EventArgs
{
private int myOption;
private int myValue;
public int Option => myOption;
public int Value => myValue;
internal ChangeOptionEventArgs(int option, int value)
{
myOption = option;
myValue = value;
}
}

View file

@ -0,0 +1,20 @@
using System;
namespace Decal.Adapter.Wrappers;
public class ChangePlayerEventArgs : EventArgs
{
private PlayerModifyEventType myType;
private int myStat;
public PlayerModifyEventType Type => myType;
public int Stat => myStat;
internal ChangePlayerEventArgs(PlayerModifyEventType type, int Stat)
{
myType = type;
myStat = Stat;
}
}

View file

@ -0,0 +1,15 @@
using System;
namespace Decal.Adapter.Wrappers;
public class ChangePortalModeEventArgs : EventArgs
{
private PortalEventType myType;
public PortalEventType Type => myType;
internal ChangePortalModeEventArgs(PortalEventType type)
{
myType = type;
}
}

View file

@ -0,0 +1,15 @@
using System;
namespace Decal.Adapter.Wrappers;
public class ChangeSettingsFlagsEventArgs : EventArgs
{
private int mySettings;
public int Settings => mySettings;
internal ChangeSettingsFlagsEventArgs(int settings)
{
mySettings = settings;
}
}

View file

@ -0,0 +1,25 @@
using System;
namespace Decal.Adapter.Wrappers;
public class ChangeShortcutEventArgs : EventArgs
{
private AddRemoveEventType myType;
private int mySlot;
private int myObjectId;
public AddRemoveEventType Type => myType;
public int Slot => mySlot;
public int ObjectId => myObjectId;
internal ChangeShortcutEventArgs(AddRemoveEventType type, int Slot, int ObjectId)
{
myType = type;
mySlot = Slot;
myObjectId = ObjectId;
}
}

View file

@ -0,0 +1,30 @@
using System;
namespace Decal.Adapter.Wrappers;
public class ChangeSpellbarEventArgs : EventArgs
{
private AddRemoveEventType myType;
private int myTab;
private int mySlot;
private int mySpellId;
public AddRemoveEventType Type => myType;
public int Tab => myTab;
public int Slot => mySlot;
public int SpellId => mySpellId;
internal ChangeSpellbarEventArgs(AddRemoveEventType type, int Tab, int Slot, int SpellId)
{
myType = type;
myTab = Tab;
mySlot = Slot;
mySpellId = SpellId;
}
}

View file

@ -0,0 +1,20 @@
using System;
namespace Decal.Adapter.Wrappers;
public class ChangeVitalEventArgs : EventArgs
{
private CharFilterVitalType myType;
private int myAmount;
public CharFilterVitalType Type => myType;
public int Amount => myAmount;
internal ChangeVitalEventArgs(CharFilterVitalType type, int amount)
{
myType = type;
myAmount = amount;
}
}

View file

@ -0,0 +1,14 @@
using System;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public enum CharFilterAttributeType
{
Strength = 1,
Endurance,
Quickness,
Coordination,
Focus,
Self
}

View file

@ -0,0 +1,16 @@
namespace Decal.Adapter.Wrappers;
public enum CharFilterIndex
{
Vassals,
Enchantments,
Vitals,
Attributes,
Skills,
Characters,
Spells,
Augmentations,
EffectiveAttributes,
EffectiveVitals,
EffectiveSkills
}

View file

@ -0,0 +1,57 @@
using System;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public enum CharFilterSkillType
{
Axe = 1,
Bow = 2,
Crossbow = 3,
Dagger = 4,
Mace = 5,
MeleeDefense = 6,
MissileDefense = 7,
Spear = 9,
Staff = 10,
Sword = 11,
ThrownWeapons = 12,
Unarmed = 13,
ArcaneLore = 14,
MagicDefense = 15,
ManaConversion = 16,
ItemTinkering = 18,
AssessPerson = 19,
Deception = 20,
Healing = 21,
Jump = 22,
Lockpick = 23,
Run = 24,
AssessCreature = 27,
WeaponTinkering = 28,
ArmorTinkering = 29,
MagicItemTinkering = 30,
CreatureEnchantment = 31,
ItemEnchantment = 32,
LifeMagic = 33,
WarMagic = 34,
Leadership = 35,
Loyalty = 36,
Fletching = 37,
Alchemy = 38,
Cooking = 39,
Salvaging = 40,
TwoHandedCombat = 41,
Gearcraft = 42,
VoidMagic = 43,
HeavyWeapons = 44,
LightWeapons = 45,
FinesseWeapons = 46,
MissileWeapons = 47,
Shield = 48,
DualWield = 49,
Recklessness = 50,
SneakAttack = 51,
DirtyFighting = 52,
Summoning = 54
}

View file

@ -0,0 +1,11 @@
using System;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public enum CharFilterVitalType
{
Health = 2,
Stamina = 4,
Mana = 6
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,135 @@
using System;
using System.Drawing;
using Decal.Adapter.Support;
using Decal.Interop.Controls;
namespace Decal.Adapter.Wrappers;
public class CheckBoxWrapper : ControlWrapperBase<CheckboxClass>
{
private EventHandler<ControlEventArgs> evtDestroy;
private EventHandler<CheckBoxChangeEventArgs> evtChange;
public bool Checked
{
get
{
return base.Control.Checked;
}
set
{
base.Control.Checked = value;
}
}
public bool RightToLeft
{
get
{
return base.Control.RightToLeft;
}
set
{
base.Control.RightToLeft = value;
}
}
public string Text
{
get
{
return base.Control.Text;
}
set
{
base.Control.Text = value;
}
}
public Color TextColor
{
get
{
return Util.ColorFromBGR(base.Control.TextColor);
}
set
{
base.Control.TextColor = Util.ColorToBGR(value);
}
}
public event EventHandler<CheckBoxChangeEventArgs> Change
{
add
{
if (evtChange == null)
{
base.Control.Change += ChangeEvent;
}
evtChange = (EventHandler<CheckBoxChangeEventArgs>)Delegate.Combine(evtChange, value);
}
remove
{
evtChange = (EventHandler<CheckBoxChangeEventArgs>)Delegate.Remove(evtChange, value);
if (evtChange == null)
{
base.Control.Change -= ChangeEvent;
}
}
}
public event EventHandler<ControlEventArgs> Destroy
{
add
{
if (evtDestroy == null)
{
base.Control.Destroy += DestroyEvent;
}
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Combine(evtDestroy, value);
}
remove
{
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, value);
if (evtDestroy == null)
{
base.Control.Destroy -= DestroyEvent;
}
}
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (evtChange != null)
{
evtChange = (EventHandler<CheckBoxChangeEventArgs>)Delegate.Remove(evtChange, evtChange);
base.Control.Change -= ChangeEvent;
}
if (evtDestroy != null)
{
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, evtDestroy);
base.Control.Destroy -= DestroyEvent;
}
}
base.Dispose(disposing);
}
private void ChangeEvent(int ID, bool Checked)
{
if (evtChange != null)
{
evtChange(this, new CheckBoxChangeEventArgs(ID, Checked));
}
}
private void DestroyEvent(int ID)
{
if (evtDestroy != null)
{
evtDestroy(this, new ControlEventArgs(ID));
}
}
}

View file

@ -0,0 +1,33 @@
using System;
using System.Runtime.InteropServices;
using Decal.Interop.Controls;
namespace Decal.Adapter.Wrappers;
public sealed class ChoiceDataIndexer : IDisposable
{
private Choice myControl;
public object this[int index]
{
get
{
return ((IChoice)myControl).get_Data(index);
}
set
{
((IChoice)myControl).set_Data(index, value);
}
}
internal ChoiceDataIndexer(Choice control)
{
myControl = control;
}
public void Dispose()
{
Marshal.ReleaseComObject(myControl);
myControl = null;
}
}

View file

@ -0,0 +1,31 @@
using System;
using Decal.Interop.Controls;
namespace Decal.Adapter.Wrappers;
public sealed class ChoiceTextIndexer : IDisposable
{
private Choice myControl;
public string this[int index]
{
get
{
return ((IChoice)myControl).get_Text(index);
}
set
{
((IChoice)myControl).set_Text(index, value);
}
}
internal ChoiceTextIndexer(Choice control)
{
myControl = control;
}
public void Dispose()
{
myControl = null;
}
}

View file

@ -0,0 +1,191 @@
using System;
using Decal.Interop.Controls;
namespace Decal.Adapter.Wrappers;
public class ChoiceWrapper : ControlWrapperBase<ChoiceClass>
{
private EventHandler<ControlEventArgs> evtDropDown;
private EventHandler<ControlEventArgs> evtDestroy;
private EventHandler<IndexChangeEventArgs> evtChange;
private ChoiceTextIndexer myTextIndex;
private ChoiceDataIndexer myDataIndex;
public int Count => base.Control.ChoiceCount;
public int DropLines
{
get
{
return base.Control.DropLines;
}
set
{
base.Control.DropLines = value;
}
}
public bool Dropped
{
get
{
return base.Control.Dropped;
}
set
{
base.Control.Dropped = value;
}
}
public int Selected
{
get
{
return base.Control.Selected;
}
set
{
base.Control.Selected = value;
}
}
public ChoiceTextIndexer Text => myTextIndex;
public ChoiceDataIndexer Data => myDataIndex;
public event EventHandler<ControlEventArgs> DropDown
{
add
{
if (evtDropDown == null)
{
base.Control.DropDown += DropDownEvent;
}
evtDropDown = (EventHandler<ControlEventArgs>)Delegate.Combine(evtDropDown, value);
}
remove
{
evtDropDown = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDropDown, value);
if (evtDropDown == null)
{
base.Control.DropDown -= DropDownEvent;
}
}
}
public event EventHandler<ControlEventArgs> Destroy
{
add
{
if (evtDestroy == null)
{
base.Control.Destroy += DestroyEvent;
}
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Combine(evtDestroy, value);
}
remove
{
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, value);
if (evtDestroy == null)
{
base.Control.Destroy -= DestroyEvent;
}
}
}
public event EventHandler<IndexChangeEventArgs> Change
{
add
{
if (evtChange == null)
{
base.Control.Change += ChangeEvent;
}
evtChange = (EventHandler<IndexChangeEventArgs>)Delegate.Combine(evtChange, value);
}
remove
{
evtChange = (EventHandler<IndexChangeEventArgs>)Delegate.Remove(evtChange, value);
if (evtChange == null)
{
base.Control.Change -= ChangeEvent;
}
}
}
[CLSCompliant(false)]
public override void Initialize(object control)
{
base.Initialize(control);
myTextIndex = new ChoiceTextIndexer(base.Control);
myDataIndex = new ChoiceDataIndexer(base.Control);
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (evtDropDown != null)
{
evtDropDown = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDropDown, evtDropDown);
base.Control.DropDown -= DropDownEvent;
}
if (evtDestroy != null)
{
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, evtDestroy);
base.Control.Destroy -= DestroyEvent;
}
if (evtChange != null)
{
evtChange = (EventHandler<IndexChangeEventArgs>)Delegate.Remove(evtChange, evtChange);
base.Control.Change -= ChangeEvent;
}
myTextIndex.Dispose();
myDataIndex.Dispose();
}
base.Dispose(disposing);
}
public void Add(string display, object data)
{
base.Control.AddChoice(display, data);
}
public void Clear()
{
base.Control.Clear();
}
public void Remove(int index)
{
base.Control.RemoveChoice(index);
}
private void DropDownEvent(int ID)
{
if (evtDropDown != null)
{
evtDropDown(this, new ControlEventArgs(ID));
}
}
private void ChangeEvent(int ID, int Index)
{
if (evtChange != null)
{
evtChange(this, new IndexChangeEventArgs(ID, Index));
}
}
private void DestroyEvent(int ID)
{
if (evtDestroy != null)
{
evtDestroy(this, new ControlEventArgs(ID));
}
}
}

View file

@ -0,0 +1,12 @@
using System;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public enum CombatState
{
Peace = 1,
Melee = 2,
Missile = 4,
Magic = 8
}

View file

@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using Decal.Adapter.Support;
using Decal.Interop.Inject;
namespace Decal.Adapter.Wrappers;
/// <summary>
/// Used for the registration and creation of control wrappers
/// </summary>
public static class ControlRegistry
{
private static Dictionary<Type, Type> myWrappers;
static ControlRegistry()
{
if (myWrappers == null)
{
myWrappers = new Dictionary<Type, Type>();
RegisterControls(Assembly.GetExecutingAssembly());
}
}
/// <summary>
/// Scans an assembly and registers all of its control wrappers
/// </summary>
/// <param name="assembly">the assembly to scan</param>
public static void RegisterControls(Assembly assembly)
{
Type[] types = assembly.GetTypes();
foreach (Type type in types)
{
try
{
Type baseType = type.BaseType;
if (!(baseType == null) && baseType.IsGenericType && baseType.GetGenericTypeDefinition() == typeof(ControlWrapperBase<>))
{
Type key = baseType.GetGenericArguments()[0];
myWrappers.Add(key, type);
}
}
catch (Exception ex)
{
Util.WriteLine("RegisterControls: " + ex.Message);
}
}
}
/// <summary>
/// Creates a control wrapper for the passed in control
/// </summary>
/// <param name="control">the control to wrap</param>
/// <returns>the new wrapper</returns>
internal static IControlWrapper CreateInstance(IControl control)
{
Util.WriteLine("Creating wrapper for: " + control.GetType());
Type value;
IControlWrapper controlWrapper = ((!myWrappers.TryGetValue(control.GetType(), out value)) ? new ControlWrapper() : ((IControlWrapper)Activator.CreateInstance(value)));
controlWrapper.Initialize(control);
return controlWrapper;
}
}

View file

@ -0,0 +1,7 @@
using Decal.Interop.Inject;
namespace Decal.Adapter.Wrappers;
public class ControlWrapper : ControlWrapperBase<IControl>
{
}

View file

@ -0,0 +1,66 @@
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Decal.Interop.Inject;
namespace Decal.Adapter.Wrappers;
public abstract class ControlWrapperBase<T> : MarshalByRefObject, IControlWrapper, IDisposable where T : class
{
private T myControl;
private bool isDisposed;
[EditorBrowsable(EditorBrowsableState.Never)]
public object Underlying => myControl;
public int Id => ((IControl)myControl).ID;
public int ChildCount => ((IControl)myControl).ChildCount;
protected bool Disposed => isDisposed;
protected T Control => myControl;
~ControlWrapperBase()
{
Dispose(disposing: false);
}
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual void Initialize(object control)
{
myControl = control as T;
}
[EditorBrowsable(EditorBrowsableState.Never)]
public object ChildById(int id)
{
return ((IControl)myControl).get_Child(id, ePositionType.ePositionByID);
}
[EditorBrowsable(EditorBrowsableState.Never)]
public object ChildByIndex(int index)
{
return ((IControl)myControl).get_Child(index, ePositionType.ePositionByIndex);
}
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!isDisposed)
{
}
if (myControl != null)
{
Marshal.ReleaseComObject(myControl);
myControl = null;
}
isDisposed = true;
}
}

View file

@ -0,0 +1,149 @@
using System;
namespace Decal.Adapter.Wrappers;
public class CoordsObject
{
private double myNorthSouth;
private double myEastWest;
/// <summary>
/// The north or south component of these coordinates. North is
/// positive and south is negative.
/// </summary>
public double NorthSouth => myNorthSouth;
/// <summary>
/// The east or west component of these coordinates. East is positive
/// and west is negative.
/// </summary>
public double EastWest => myEastWest;
public CoordsObject(double northSouth, double eastWest)
{
myNorthSouth = northSouth;
myEastWest = eastWest;
}
/// <summary>
/// Calculates the straight-line distance between these coordinates
/// and the given coordinates.
/// </summary>
/// <param name="destination">The coordinates to calculate the
/// distance to.</param>
/// <returns>The distance between these coordinates and the given
/// coordinates.</returns>
public double DistanceToCoords(CoordsObject destination)
{
if (destination == null)
{
throw new ArgumentNullException("destination");
}
double num = myNorthSouth - destination.myNorthSouth;
double num2 = myEastWest - destination.myEastWest;
return Math.Sqrt(num * num + num2 * num2);
}
/// <summary>
/// Calculates the angle from these coordinates to the given
/// coordinates, in degrees. North is 0, east is 90, south is 180,
/// and west is 270.
/// </summary>
/// <param name="destination">The coordinates to calculate the
/// angle to.</param>
/// <returns>The angle between these coordinates and the given
/// coordinates.</returns>
public double AngleToCoords(CoordsObject destination)
{
return 180.0 / Math.PI * AngleToCoordsRadians(destination);
}
/// <summary>
/// Calculates the angle from these coordinates to the given
/// coordinates, in radians. North is 0, east is pi/2, south is pi,
/// and west is 3*pi/2.
/// </summary>
/// <param name="destination"></param>
/// <returns></returns>
public double AngleToCoordsRadians(CoordsObject destination)
{
if (destination == null)
{
throw new ArgumentNullException("destination");
}
double num = Math.Atan2(destination.myEastWest - myEastWest, destination.myNorthSouth - myNorthSouth);
if (num < 0.0)
{
num += Math.PI * 2.0;
}
return num;
}
/// <summary>Formats the coordinates like "0.0N, 0.0E"</summary>
/// <returns>The formatted coordinate string.</returns>
public override string ToString()
{
return ToString("0.0");
}
/// <summary>
/// Formats the coordinates using the number style you choose to
/// format the NorthSouth and EastWest numbers.
/// </summary>
/// <param name="numberFormat">The format for the NorthSouth and
/// EastWest numbers. This can be any format string used by
/// double.ToString(). E.g., use "0.00" for 2-digit precision on
/// the coordinates.</param>
/// <returns>The formatted coordinate string.</returns>
public string ToString(string numberFormat)
{
return Math.Abs(myNorthSouth).ToString(numberFormat) + ((myNorthSouth >= 0.0) ? "N" : "S") + ", " + Math.Abs(myEastWest).ToString(numberFormat) + ((myEastWest >= 0.0) ? "E" : "W");
}
public override bool Equals(object obj)
{
if (obj is CoordsObject)
{
CoordsObject coordsObject = (CoordsObject)obj;
if (coordsObject.myNorthSouth == myNorthSouth)
{
return coordsObject.myEastWest == myEastWest;
}
return false;
}
return false;
}
public bool Equals(CoordsObject obj)
{
if (obj == null)
{
return false;
}
if (obj.myNorthSouth == myNorthSouth)
{
return obj.myEastWest == myEastWest;
}
return false;
}
public override int GetHashCode()
{
return myNorthSouth.GetHashCode() ^ myEastWest.GetHashCode();
}
public static bool operator ==(CoordsObject a, CoordsObject b)
{
if (object.Equals(a, null))
{
return object.Equals(b, null);
}
return a.Equals(b);
}
public static bool operator !=(CoordsObject a, CoordsObject b)
{
return !(a == b);
}
}

View file

@ -0,0 +1,15 @@
using System;
namespace Decal.Adapter.Wrappers;
public class CreateObjectEventArgs : EventArgs
{
private WorldObject myNewObject;
public WorldObject New => myNewObject;
internal CreateObjectEventArgs(WorldObject newObject)
{
myNewObject = newObject;
}
}

View file

@ -0,0 +1,414 @@
using Decal.Interop.D3DService;
namespace Decal.Adapter.Wrappers;
public class D3DObj : GenericDisposableWrapper<CD3DObj>
{
/// <summary>
/// Colors
/// </summary>
public int Color
{
get
{
return base.Wrapped.color;
}
set
{
base.Wrapped.color = value;
}
}
public int Color2
{
get
{
return base.Wrapped.color2;
}
set
{
base.Wrapped.color2 = value;
}
}
/// <summary>
/// Autoscale
/// </summary>
public bool Autoscale
{
get
{
return base.Wrapped.autoscale;
}
set
{
base.Wrapped.autoscale = value;
}
}
/// <summary>
/// DrawBackface
/// </summary>
public bool DrawBackface
{
get
{
return base.Wrapped.drawBackface;
}
set
{
base.Wrapped.drawBackface = value;
}
}
/// <summary>
/// HBounce
/// </summary>
public float HBounce
{
get
{
return base.Wrapped.hBounce;
}
set
{
base.Wrapped.hBounce = value;
}
}
/// <summary>
/// PBounce
/// </summary>
public float PBounce
{
get
{
return base.Wrapped.pBounce;
}
set
{
base.Wrapped.pBounce = value;
}
}
/// <summary>
/// PFade
/// </summary>
public float PFade
{
get
{
return base.Wrapped.pFade;
}
set
{
base.Wrapped.pFade = value;
}
}
/// <summary>
/// POrbit
/// </summary>
public float POrbit
{
get
{
return base.Wrapped.pOrbit;
}
set
{
base.Wrapped.pOrbit = value;
}
}
/// <summary>
/// PSpin
/// </summary>
public float PSpin
{
get
{
return base.Wrapped.pSpin;
}
set
{
base.Wrapped.pSpin = value;
}
}
/// <summary>
/// ROrbit
/// </summary>
public float ROrbit
{
get
{
return base.Wrapped.rOrbit;
}
set
{
base.Wrapped.rOrbit = value;
}
}
/// <summary>
/// ScaleX
/// </summary>
public float ScaleX
{
get
{
return base.Wrapped.scaleX;
}
set
{
base.Wrapped.scaleX = value;
}
}
/// <summary>
/// ScaleY
/// </summary>
public float ScaleY
{
get
{
return base.Wrapped.scaleY;
}
set
{
base.Wrapped.scaleY = value;
}
}
/// <summary>
/// ScaleZ
/// </summary>
public float ScaleZ
{
get
{
return base.Wrapped.scaleZ;
}
set
{
base.Wrapped.scaleZ = value;
}
}
/// <summary>
/// Visible
/// </summary>
public bool Visible
{
get
{
return base.Wrapped.visible;
}
set
{
base.Wrapped.visible = value;
}
}
/// <summary>
/// AnimationPhaseOffset
/// </summary>
public float AnimationPhaseOffset
{
get
{
return base.Wrapped.AnimationPhaseOffset;
}
set
{
base.Wrapped.AnimationPhaseOffset = value;
}
}
public D3DObj(CD3DObj obj)
: base(obj)
{
}
protected override void Dispose(bool userCalled)
{
base.Dispose(userCalled);
}
public void Scale(float factor)
{
base.Wrapped.SetScale(factor);
}
/// <summary>
/// Orients to the Camera
/// </summary>
/// <param name="VerticalTilt">Vertical Tilt</param>
public void OrientToCamera(bool verticalTilt)
{
base.Wrapped.OrientToCamera(verticalTilt);
}
/// <summary>
/// Orients to the specified Coordinates
/// </summary>
/// <param name="lat">Latitude</param>
/// <param name="lng">Longitude</param>
/// <param name="alt">Altitude</param>
/// <param name="VerticalTilt">Vertical Tilt</param>
public void OrientToCoords(float lat, float lng, float alt, bool verticalTilt)
{
base.Wrapped.OrientToCoords(lat, lng, alt, verticalTilt);
}
/// <summary>
/// Orients to the specified Object
/// </summary>
/// <param name="guid">Object ID</param>
/// <param name="fractHeight">Relative Position</param>
/// <param name="VerticalTilt">Vertical Tilt</param>
public void OrientToObject(int guid, float fractHeight, bool verticalTilt)
{
base.Wrapped.OrientToObject(guid, fractHeight, verticalTilt);
}
/// <summary>
/// Orients to the Current Player
/// </summary>
/// <param name="VerticalTilt">Vertical Tilt</param>
public void OrientToPlayer(bool verticalTilt)
{
base.Wrapped.OrientToPlayer(verticalTilt);
}
/// <summary>
/// Anchors to the specified Coordinates
/// </summary>
/// <param name="lat">Latitude</param>
/// <param name="lng">Longitude</param>
/// <param name="alt">Altitude</param>
public void Anchor(float lat, float lng, float alt)
{
base.Wrapped.AnchorToCoords(lat, lng, alt);
}
/// <summary>
/// Anchors to the specified Object
/// </summary>
/// <param name="id">Object ID</param>
/// <param name="height">Height</param>
/// <param name="dx">x offset</param>
/// <param name="dy">y offset</param>
/// <param name="dz">z offset</param>
public void Anchor(int id, float height, float dx, float dy, float dz)
{
base.Wrapped.AnchorToObject(id, height, dx, dy, dz);
}
/// <summary>
/// Displays 2D text using the Arial font
/// </summary>
/// <param name="text">Text to display</param>
public void SetText(string text)
{
SetText(D3DTextType.Text2D, text, "Arial", 0);
}
/// <summary>
/// Displays 2D text using the specified font
/// </summary>
/// <param name="text">Text to display</param>
/// <param name="fontName">Font to use</param>
public void SetText(string text, string fontName)
{
SetText(D3DTextType.Text2D, text, fontName, 0);
}
/// <summary>
/// Displays 2D text using the specified font and options
/// </summary>
/// <param name="text">Text to display</param>
/// <param name="fontName">Font to use</param>
/// <param name="options">Options</param>
public void SetText(string text, string fontName, int options)
{
SetText(D3DTextType.Text2D, text, fontName, options);
}
/// <summary>
/// Displays text
/// </summary>
/// <param name="type">Type of text (2D/3D)</param>
/// <param name="text">Text to display</param>
/// <param name="fontName">Font to use</param>
/// <param name="options">Options</param>
public void SetText(D3DTextType type, string text, string fontName, int options)
{
switch (type)
{
case D3DTextType.Text2D:
base.Wrapped.Set2DText(text, fontName, options);
break;
case D3DTextType.Text3D:
base.Wrapped.Set3DText(text, fontName, options);
break;
}
}
/// <summary>
/// Sets the icon to the portal file id
/// </summary>
/// <param name="id">portal file id</param>
public void SetIcon(int id)
{
base.Wrapped.SetIcon(id);
}
/// <summary>
/// Sets the icon from the specified file
/// </summary>
/// <param name="fileName">file containing the icon</param>
public void SetIcon(string fileName)
{
base.Wrapped.SetIconFromFile(fileName);
}
/// <summary>
/// Sets the icon from a resource dll
/// </summary>
/// <param name="module">module handle of the dll</param>
/// <param name="res">resource id</param>
public void SetIcon(int module, int res)
{
base.Wrapped.SetIconFromResource(module, res);
}
/// <summary>
/// Sets the shape to that specified
/// </summary>
/// <param name="shape">Shape to use</param>
public void SetShape(D3DShape shape)
{
base.Wrapped.SetShape((eShape)shape);
}
/// <summary>
/// Sets the shape to that contained in the file
/// </summary>
/// <param name="fileName">File containing the shape definition</param>
public void SetShape(string fileName)
{
base.Wrapped.SetShapeFromFile(fileName);
}
/// <summary>
/// Sets the shape from a resource dll
/// </summary>
/// <param name="module">module handle of the dll</param>
/// <param name="res">resource id</param>
public void SetShape(int module, int res)
{
base.Wrapped.SetShapeFromResource(module, res);
}
}

View file

@ -0,0 +1,180 @@
using Decal.Interop.D3DService;
namespace Decal.Adapter.Wrappers;
public class D3DService : GenericDisposableWrapper<CService>
{
internal D3DService(CService obj)
: base(obj)
{
}
protected override void Dispose(bool userCalled)
{
base.Dispose(userCalled);
}
/// <summary>
/// Makes a new D3DObj
/// </summary>
public D3DObj NewD3DObj()
{
return new D3DObj(base.Wrapped.NewD3DObj());
}
/// <summary>
/// Creates an arrow that points to an object
/// </summary>
/// <param name="guid">Object ID</param>
/// <param name="color">Color</param>
public D3DObj PointToObject(int guid, int color)
{
return new D3DObj(base.Wrapped.PointToObject(guid, color));
}
/// <summary>
/// Creates an arrow that points to specified Coordinates
/// </summary>
/// <param name="lat">Latitude</param>
/// <param name="lng">Longitude</param>
/// <param name="alt">Altitude</param>
/// <param name="color">Color</param>
public D3DObj PointToCoords(float lat, float lng, float alt, int color)
{
return new D3DObj(base.Wrapped.PointToCoords(lat, lng, alt, color));
}
/// <summary>
/// Mark an Object with an Icon
/// </summary>
/// <param name="guid">Object ID</param>
/// <param name="icon">Portal.dat Icon</param>
public D3DObj MarkObjectWithIcon(int guid, int icon)
{
return new D3DObj(base.Wrapped.MarkObjectWithIcon(guid, icon));
}
/// <summary>
/// Mark an Object with a Shape
/// </summary>
/// <param name="guid">Object ID</param>
/// <param name="shape">D3DShape</param>
/// <param name="color">Color</param>
public D3DObj MarkObjectWithShape(int guid, D3DShape shape, int color)
{
return new D3DObj(base.Wrapped.MarkObjectWithShape(guid, (eShape)shape, color));
}
/// <summary>
/// Mark an Object with a Shape
/// </summary>
/// <param name="guid">Object ID</param>
/// <param name="filename">Mesh filename</param>
/// <param name="color">Color</param>
public D3DObj MarkObjectWithShapeFromFile(int guid, string filename, int color)
{
return new D3DObj(base.Wrapped.MarkObjectWithShapeFromFile(guid, filename, color));
}
/// <summary>
/// Mark an Object with 2DText
/// </summary>
/// <param name="guid">Object ID</param>
/// <param name="szText">Text</param>
/// <param name="szFont">Font</param>
/// <param name="options">zero or more option flags from DecalPlugins::eFontOptions</param>
public D3DObj MarkObjectWith2DText(int guid, string szText, string szFont, int options)
{
return new D3DObj(base.Wrapped.MarkObjectWith2DText(guid, szText, szFont, options));
}
/// <summary>
/// Mark an Object with 3DText
/// </summary>
/// <param name="guid">Object ID</param>
/// <param name="szText">Text</param>
/// <param name="szFont">Font</param>
/// <param name="options">zero or more option flags from DecalPlugins::eFontOptions</param>
public D3DObj MarkObjectWith3DText(int guid, string szText, string szFont, int options)
{
return new D3DObj(base.Wrapped.MarkObjectWith3DText(guid, szText, szFont, options));
}
/// <summary>
/// Mark specified Coordinates with Icon
/// </summary>
/// <param name="lat">Latitude</param>
/// <param name="lng">Longitude</param>
/// <param name="alt">Altitude</param>
/// <param name="icon">Portal.dat Icon</param>
public D3DObj MarkCoordsWithIcon(float lat, float lng, float alt, int icon)
{
return new D3DObj(base.Wrapped.MarkCoordsWithIcon(lat, lng, alt, icon));
}
/// <summary>
/// Mark specified Coordinates with Icon
/// </summary>
/// <param name="lat">Latitude</param>
/// <param name="lng">Longitude</param>
/// <param name="alt">Altitude</param>
/// <param name="file">Icon filename</param>
public D3DObj MarkCoordsWithIconFromFile(float lat, float lng, float alt, string file)
{
return new D3DObj(base.Wrapped.MarkCoordsWithIconFromFile(lat, lng, alt, file));
}
/// <summary>
/// Mark specified Coordinates with Shape
/// </summary>
/// <param name="lat">Latitude</param>
/// <param name="lng">Longitude</param>
/// <param name="alt">Altitude</param>
/// <param name="shape">D3DShape</param>
/// <param name="color">Color</param>
public D3DObj MarkCoordsWithShape(float lat, float lng, float alt, D3DShape shape, int color)
{
return new D3DObj(base.Wrapped.MarkCoordsWithShape(lat, lng, alt, (eShape)shape, color));
}
/// <summary>
/// Mark specified Coordinates with Shape
/// </summary>
/// <param name="lat">Latitude</param>
/// <param name="lng">Longitude</param>
/// <param name="alt">Altitude</param>
/// <param name="file">Mesh filename</param>
/// <param name="color">Color</param>
public D3DObj MarkCoordsWithShapeFromFile(float lat, float lng, float alt, string file, int color)
{
return new D3DObj(base.Wrapped.MarkCoordsWithShapeFromFile(lat, lng, alt, file, color));
}
/// <summary>
/// Mark specified Coordinates with 2DText
/// </summary>
/// <param name="lat">Latitude</param>
/// <param name="lng">Longitude</param>
/// <param name="alt">Altitude</param>
/// <param name="szText">Text</param>
/// <param name="szFont">Font</param>
/// <param name="options">zero or more option flags from DecalPlugins::eFontOptions</param>
public D3DObj MarkCoordsWith2DText(float lat, float lng, float alt, string szText, string szFont, int options)
{
return new D3DObj(base.Wrapped.MarkCoordsWith2DText(lat, lng, alt, szText, szFont, options));
}
/// <summary>
/// Mark specified Coordinates with 3DText
/// </summary>
/// <param name="lat">Latitude</param>
/// <param name="lng">Longitude</param>
/// <param name="alt">Altitude</param>
/// <param name="szText">Text</param>
/// <param name="szFont">Font</param>
/// <param name="options">zero or more option flags from DecalPlugins::eFontOptions</param>
public D3DObj MarkCoordsWith3DText(float lat, float lng, float alt, string szText, string szFont, int options)
{
return new D3DObj(base.Wrapped.MarkCoordsWith3DText(lat, lng, alt, szText, szFont, options));
}
}

View file

@ -0,0 +1,12 @@
namespace Decal.Adapter.Wrappers;
public enum D3DShape
{
HorizontalArrow,
VerticalArrow,
Ring,
Cylinder,
Sphere,
Cube,
TiltedCube
}

View file

@ -0,0 +1,7 @@
namespace Decal.Adapter.Wrappers;
public enum D3DTextType
{
Text2D,
Text3D
}

View file

@ -0,0 +1,15 @@
using System;
namespace Decal.Adapter.Wrappers;
public class DeathEventArgs : EventArgs
{
private string myText;
public string Text => myText;
internal DeathEventArgs(string text)
{
myText = text;
}
}

View file

@ -0,0 +1,84 @@
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Decal.Adapter.Support;
using Decal.Interop.Core;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public class DecalWrapper : MarshalByRefObject, IDisposable
{
internal static Guid IID_IDISPATCH = new Guid("{00020400-0000-0000-C000-000000000046}");
internal static Guid IID_IUNKNOWN = new Guid("{00000000-0000-0000-C000-000000000046}");
private DecalCore myDecal;
private bool isDisposed;
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public DecalCore Underlying => myDecal;
public IntPtr Hwnd => new IntPtr(myDecal.HWND);
public bool Focus => myDecal.Focus;
internal DecalWrapper(DecalCore decal)
{
myDecal = decal;
}
~DecalWrapper()
{
Dispose(disposing: false);
}
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
private void Dispose(bool disposing)
{
if (!isDisposed)
{
}
if (myDecal != null)
{
Marshal.ReleaseComObject(myDecal);
myDecal = null;
}
isDisposed = true;
}
public object GetObject(string path)
{
return GetObject(path, IID_IDISPATCH);
}
public object GetObject(string path, string iid)
{
return GetObject(path, new Guid(iid));
}
public object GetObject(string path, Guid iid)
{
try
{
return ((IDecalCore)myDecal).get_Object(path, ref iid);
}
catch (Exception ex)
{
Util.WriteLine("Exception for {0} during get_Object: {1}", path, ex);
return null;
}
}
public string MapPath(string path)
{
return myDecal.MapPath(path);
}
}

View file

@ -0,0 +1,15 @@
using System;
namespace Decal.Adapter.Wrappers;
public class DeclineTradeEventArgs : EventArgs
{
private int mTraderId;
public int TraderId => mTraderId;
internal DeclineTradeEventArgs(int TraderId)
{
mTraderId = TraderId;
}
}

View file

@ -0,0 +1,29 @@
namespace Decal.Adapter.Wrappers;
public enum DoubleValueKey
{
SlashProt = 167772160,
PierceProt = 167772161,
BludgeonProt = 167772162,
AcidProt = 167772163,
LightningProt = 167772164,
FireProt = 167772165,
ColdProt = 167772166,
Heading = 167772167,
ApproachDistance = 167772168,
SalvageWorkmanship = 167772169,
Scale = 167772170,
Variance = 167772171,
AttackBonus = 167772172,
Range = 167772173,
DamageBonus = 167772174,
ManaRateOfChange = 5,
MeleeDefenseBonus = 29,
ManaTransferEfficiency = 87,
HealingKitRestoreBonus = 100,
ManaStoneChanceDestruct = 137,
ManaCBonus = 144,
MissileDBonus = 149,
MagicDBonus = 150,
ElementalDamageVersusMonsters = 152
}

View file

@ -0,0 +1,87 @@
using System;
using Decal.Adapter.NetParser;
using Decal.Adapter.Support;
using Decal.Interop.Filters;
using Decal.Interop.Net;
namespace Decal.Adapter.Wrappers;
public class EchoFilter2 : GenericDisposableWrapper<Decal.Interop.Filters.EchoFilter2>
{
private event EventHandler<NetworkMessageEventArgs> serverDispatch;
private event EventHandler<NetworkMessageEventArgs> clientDispatch;
/// <summary>
/// Fires when the client receives a message from the server
/// </summary>
public event EventHandler<NetworkMessageEventArgs> ServerDispatch
{
add
{
serverDispatch += value;
}
remove
{
serverDispatch -= value;
}
}
/// <summary>
/// Fires when the client sends a message to the server
/// </summary>
public event EventHandler<NetworkMessageEventArgs> ClientDispatch
{
add
{
clientDispatch += value;
}
remove
{
clientDispatch -= value;
}
}
public EchoFilter2(Decal.Interop.Filters.EchoFilter2 obj)
: base(obj)
{
base.Wrapped.EchoClient += onEchoClient;
base.Wrapped.EchoServer += onEchoServer;
}
protected override void Dispose(bool userCalled)
{
if (userCalled && base.Wrapped != null)
{
base.Wrapped.EchoClient -= onEchoClient;
base.Wrapped.EchoServer -= onEchoServer;
}
base.Dispose(userCalled);
}
private void onEchoServer(IMessage2 pMsg)
{
try
{
Message message = null;
Util.SafeFireEvent(args: new NetworkMessageEventArgs((!(pMsg is MessageWrapper messageWrapper)) ? new Message(pMsg, MessageDirection.Inbound) : messageWrapper.Wrapped), sender: this, eventHandler: this.serverDispatch);
}
catch (Exception ex)
{
Util.WriteLine("Exception in onEchoServer {0}", ex);
}
}
private void onEchoClient(IMessage2 pMsg)
{
try
{
Message message = null;
Util.SafeFireEvent(args: new NetworkMessageEventArgs((!(pMsg is MessageWrapper messageWrapper)) ? new Message(pMsg, MessageDirection.Inbound) : messageWrapper.Wrapped), sender: this, eventHandler: this.clientDispatch);
}
catch (Exception ex)
{
Util.WriteLine("Exception in onEchoClient {0}", ex);
}
}
}

View file

@ -0,0 +1,66 @@
using System;
using System.Runtime.InteropServices;
using Decal.Interop.Filters;
namespace Decal.Adapter.Wrappers;
public class EnchantmentWrapper : MarshalByRefObject, IDisposable
{
private Enchantment myEnchantment;
private bool isDisposed;
public double Adjustment => myEnchantment.Adjustment;
public int Affected => myEnchantment.Affected;
public int AffectedMask => myEnchantment.AffectedMask;
public double Duration => myEnchantment.Duration;
public int Family => myEnchantment.Family;
public int Layer => myEnchantment.Layer;
public int SpellId => myEnchantment.SpellID;
public int TimeRemaining => myEnchantment.TimeRemaining;
public DateTime Expires => DateTime.Now.AddSeconds(TimeRemaining);
internal EnchantmentWrapper(Enchantment enchant)
{
myEnchantment = enchant;
}
~EnchantmentWrapper()
{
Dispose(disposing: false);
}
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!isDisposed)
{
}
if (myEnchantment != null)
{
Marshal.ReleaseComObject(myEnchantment);
}
isDisposed = true;
}
protected void EnforceDisposedOnce()
{
if (isDisposed)
{
throw new ObjectDisposedException("EnchantmentWrapper");
}
}
}

View file

@ -0,0 +1,15 @@
using System;
namespace Decal.Adapter.Wrappers;
public class EndTradeEventArgs : EventArgs
{
private int mReasonId;
public int ReasonId => mReasonId;
internal EndTradeEventArgs(int ReasonId)
{
mReasonId = ReasonId;
}
}

View file

@ -0,0 +1,20 @@
using System;
namespace Decal.Adapter.Wrappers;
public class EnterTradeEventArgs : EventArgs
{
private int mTraderId;
private int mTradeeId;
public int TraderId => mTraderId;
public int TradeeId => mTradeeId;
internal EnterTradeEventArgs(int TraderId, int TradeeId)
{
mTraderId = TraderId;
mTradeeId = TradeeId;
}
}

View file

@ -0,0 +1,20 @@
using System;
namespace Decal.Adapter.Wrappers;
public class FailToAddTradeItemEventArgs : EventArgs
{
private int mItemId;
private int mReasonId;
public int ItemId => mItemId;
public int ReasonId => mReasonId;
internal FailToAddTradeItemEventArgs(int ItemId, int ReasonId)
{
mItemId = ItemId;
mReasonId = ReasonId;
}
}

View file

@ -0,0 +1,13 @@
using System;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public enum FellowshipEventType
{
Create,
Quit,
Dismiss,
Recruit,
Disband
}

View file

@ -0,0 +1,26 @@
using System;
namespace Decal.Adapter.Wrappers;
/// <summary>
/// FontWeight for use in HUD Rendering
/// </summary>
[CLSCompliant(true)]
public enum FontWeight
{
Black = 900,
Bold = 700,
DemiBold = 600,
DoNotCare = 0,
ExtraBold = 800,
ExtraLight = 200,
Heavy = 900,
Light = 300,
Medium = 500,
Normal = 400,
Regular = 400,
SemiBold = 600,
Thin = 100,
UltraBold = 800,
UltraLight = 200
}

View file

@ -0,0 +1,23 @@
using System;
using System.Globalization;
namespace Decal.Adapter.Wrappers;
/// <summary>
/// Support class for HooksWrapper
/// This class
/// </summary>
public sealed class HookIndexer<IndexType> : MarshalByRefObject where IndexType : struct, IConvertible
{
private hookIndexType myIndex;
private IIndexedValueProvider myWrap;
public int this[IndexType item] => myWrap.GetIndexedObject(myIndex, item.ToInt32(CultureInfo.InvariantCulture));
internal HookIndexer(IIndexedValueProvider wrap, hookIndexType index)
{
myIndex = index;
myWrap = wrap;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,75 @@
using System;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public abstract class HostBase : MarshalByRefObject, IDisposable
{
private HooksWrapper myInternalHooks;
private DecalWrapper myInternalDecal;
private RenderServiceWrapper myInternalRender;
private bool isDisposed;
protected bool IsDisposed => isDisposed;
protected DecalWrapper MyDecal
{
get
{
return myInternalDecal;
}
set
{
myInternalDecal = value;
}
}
protected RenderServiceWrapper MyRender
{
get
{
return myInternalRender;
}
set
{
myInternalRender = value;
}
}
~HostBase()
{
Dispose(disposing: false);
}
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!isDisposed && disposing)
{
if (myInternalHooks != null)
{
myInternalHooks.Dispose();
}
if (myInternalDecal != null)
{
myInternalDecal.Dispose();
}
if (myInternalRender != null)
{
myInternalRender.Dispose();
}
}
myInternalHooks = null;
myInternalDecal = null;
myInternalRender = null;
isDisposed = true;
}
}

View file

@ -0,0 +1,31 @@
using System;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public class HotkeyEventArgs : EventArgs
{
private string myTitle;
private bool myEat;
public string Title => myTitle;
public bool Eat
{
get
{
return myEat;
}
set
{
myEat = value;
}
}
internal HotkeyEventArgs(string Title, bool Eat)
{
myTitle = Title;
myEat = Eat;
}
}

View file

@ -0,0 +1,133 @@
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Decal.Interop.DHS;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public class HotkeySystem : MarshalByRefObject, IDisposable
{
private Decal.Interop.DHS.HotkeySystem myHKS;
private bool isDisposed;
private EventHandler<HotkeyEventArgs> mHotkey;
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public Decal.Interop.DHS.HotkeySystem Underlying => myHKS;
public event EventHandler<HotkeyEventArgs> Hotkey
{
add
{
mHotkey = (EventHandler<HotkeyEventArgs>)Delegate.Combine(mHotkey, value);
}
remove
{
mHotkey = (EventHandler<HotkeyEventArgs>)Delegate.Remove(mHotkey, value);
}
}
internal HotkeySystem(Decal.Interop.DHS.HotkeySystem hks)
{
myHKS = hks;
myHKS.HotkeyEvent += myHKS_HotkeyEvent;
}
~HotkeySystem()
{
Dispose(disposing: false);
}
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!isDisposed && disposing && myHKS != null)
{
myHKS.HotkeyEvent -= myHKS_HotkeyEvent;
}
if (myHKS != null)
{
Marshal.ReleaseComObject(myHKS);
}
isDisposed = true;
}
public void AddHotkey(string szPlugin, HotkeyWrapper hotkey)
{
if (hotkey == null)
{
throw new ArgumentNullException("hotkey");
}
AddHotkey(szPlugin, hotkey.Underlying);
}
public void AddHotkey(string szPlugin, string szTitle, string szDescription)
{
Hotkey hotkey = new HotkeyClass();
hotkey.EventTitle = szTitle;
hotkey.EventDescription = szDescription;
AddHotkey(szPlugin, hotkey);
Marshal.ReleaseComObject(hotkey);
}
public void AddHotkey(string plugin, string title, string description, int virtualKey, bool altState, bool controlState, bool shiftState)
{
Hotkey hotkey = new HotkeyClass();
hotkey.EventTitle = title;
hotkey.EventDescription = description;
hotkey.VirtualKey = virtualKey;
hotkey.AltState = altState;
hotkey.ControlState = controlState;
hotkey.ShiftState = shiftState;
AddHotkey(plugin, hotkey);
Marshal.ReleaseComObject(hotkey);
}
private void AddHotkey(string szPlugin, Hotkey hotkey)
{
if (hotkey == null)
{
throw new ArgumentNullException("hotkey");
}
myHKS.AddHotkey(szPlugin, hotkey);
}
public void DeleteHotkey(string plugin, string hotkeyName)
{
myHKS.DeleteHotkey(plugin, hotkeyName);
}
public bool Exists(string hotkeyName)
{
return myHKS.QueryHotkey(hotkeyName);
}
public HotkeyWrapper GetHotkey(string plugin, string hotkeyName)
{
Hotkey hotkey = myHKS.QueryHotkeyEx(plugin, hotkeyName);
HotkeyWrapper result = null;
if (hotkey != null)
{
result = new HotkeyWrapper(hotkey);
}
return result;
}
private void myHKS_HotkeyEvent(string szTitle, ref bool Eat)
{
if (mHotkey != null)
{
HotkeyEventArgs e = new HotkeyEventArgs(szTitle, Eat);
mHotkey(this, e);
Eat = e.Eat;
}
}
}

View file

@ -0,0 +1,82 @@
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Decal.Interop.DHS;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public class HotkeyWrapper : MarshalByRefObject, IDisposable
{
private Hotkey myHotkey;
private bool isDisposed;
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public Hotkey Underlying => myHotkey;
public bool AltState => myHotkey.AltState;
public bool ControlState => myHotkey.ControlState;
public bool ShiftState => myHotkey.ShiftState;
public int VirtualKey => myHotkey.VirtualKey;
public string Title => myHotkey.EventTitle;
public string Description => myHotkey.EventDescription;
internal HotkeyWrapper(Hotkey hotkey)
{
myHotkey = hotkey;
}
public HotkeyWrapper(string title, string description)
: this(new HotkeyClass())
{
myHotkey.EventTitle = title;
myHotkey.EventDescription = description;
}
public HotkeyWrapper(string title, string description, int virtualKey, bool altState, bool controlState, bool shiftState)
: this(title, description)
{
myHotkey.VirtualKey = virtualKey;
myHotkey.AltState = altState;
myHotkey.ControlState = controlState;
myHotkey.ShiftState = shiftState;
}
~HotkeyWrapper()
{
Dispose(disposing: false);
}
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!isDisposed)
{
}
if (myHotkey != null)
{
Marshal.ReleaseComObject(myHotkey);
}
isDisposed = true;
}
protected void EnforceDisposedOnce()
{
if (isDisposed)
{
throw new ObjectDisposedException("HotkeyWrapper");
}
}
}

View file

@ -0,0 +1,92 @@
using System;
using System.Runtime.InteropServices;
using Decal.Interop.Render;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public class Hud : HudRenderScalable
{
private HUDView internalView;
internal HUDView Underlying => internalView;
public bool Enabled
{
get
{
return internalView.Enabled;
}
set
{
internalView.Enabled = value;
}
}
public int Id => internalView.ID;
/// <summary>
/// Angle in Radians for rotation of the HUD
/// </summary>
public float Angle
{
get
{
return internalView.Angle;
}
set
{
internalView.Angle = value;
}
}
/// <summary>
/// Alpha for entire hud
/// </summary>
public int Alpha
{
get
{
return internalView.Alpha;
}
set
{
internalView.Alpha = value;
}
}
internal event EventHandler Disposing;
internal Hud(HUDView view)
: base(view)
{
internalView = view;
}
public void SetBackground(Background background)
{
if (background != null)
{
internalView.SetBackground(background.Underlying);
return;
}
throw new ArgumentNullException("background");
}
protected override void Dispose(bool disposing)
{
try
{
if (disposing && this.Disposing != null)
{
this.Disposing(this, new EventArgs());
}
Marshal.ReleaseComObject(internalView);
internalView = null;
}
finally
{
base.Dispose(disposing);
}
}
}

View file

@ -0,0 +1,66 @@
using System;
using System.Drawing;
using Decal.Adapter.Support;
using Decal.Interop.Core;
using Decal.Interop.Render;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public class HudRenderScalable : HudRenderTarget
{
private IRenderScalable myScalable;
/// <summary>
/// Returns the Area scaling has caused the Hud to encompass
/// </summary>
public Rectangle ScaleRect => Util.toRectangle(myScalable.ScaleRect);
/// <summary>
/// Scale the width and height of the Hud by the specified value keeping the current position.
/// This will not return 'good' values when using ScaleTo
/// </summary>
public float ScaleFactor
{
get
{
return myScalable.ScaleFactor;
}
set
{
myScalable.ScaleFactor = value;
}
}
/// <summary>
/// Specifies whether or not Scaling is occuring (setting to false disables scaling)
/// </summary>
public bool Scaling
{
get
{
return myScalable.Scaling;
}
set
{
myScalable.Scaling = value;
}
}
[CLSCompliant(false)]
protected HudRenderScalable(IRenderScalable newTarget)
: base(newTarget)
{
myScalable = newTarget;
}
/// <summary>
/// Scales the Hud to fill the area specified
/// </summary>
/// <param name="rect">Area for the Hud to encompass</param>
public void ScaleTo(Rectangle rect)
{
tagRECT pArea = Util.toTagRECT(rect);
myScalable.ScaleTo(ref pArea);
}
}

View file

@ -0,0 +1,429 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Runtime.InteropServices;
using Decal.Adapter.Support;
using Decal.Interop.Core;
using Decal.Interop.Render;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public class HudRenderTarget : MarshalByRefObject, IDisposable
{
private IRenderTarget myTarget;
private bool isDisposed;
private Rectangle areaRect;
private bool inRender;
private bool inText;
public bool Lost => myTarget.Lost;
[EditorBrowsable(EditorBrowsableState.Never)]
public Rectangle Constraint
{
get
{
Rectangle region = Region;
return new Rectangle(0, 0, region.Width, region.Height);
}
}
public Rectangle Region
{
get
{
return Util.toRectangle(myTarget.Region);
}
set
{
tagRECT pVal = Util.toTagRECT(value);
myTarget.Region = ref pVal;
areaRect.Width = value.Width;
areaRect.Height = value.Height;
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public object UnsafeSurface => myTarget.GetSurface();
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public tagRECT UnsafeRegion
{
get
{
return myTarget.Region;
}
set
{
myTarget.Region = ref value;
}
}
protected bool IsDisposed => isDisposed;
[CLSCompliant(false)]
protected HudRenderTarget(IRenderTarget newTarget)
{
if (newTarget == null)
{
throw new ArgumentNullException("newTarget");
}
myTarget = newTarget;
tagRECT region = myTarget.Region;
areaRect = new Rectangle(0, 0, region.right - region.left, region.bottom - region.top);
}
~HudRenderTarget()
{
Dispose(disposing: false);
}
/// <summary>
/// Begin rendering to this object, must be paired with EndRender
/// </summary>
public void BeginRender()
{
BeginRender(enableTextureFilter: false);
}
/// <summary>
/// Begin rendering to this object, must be paired with EndRender
/// </summary>
/// <param name="enableTextureFilter">True to enable texture filtering during rendering</param>
public void BeginRender(bool enableTextureFilter)
{
if (!inRender)
{
myTarget.BeginRender(enableTextureFilter);
inRender = true;
return;
}
throw new RenderViolationException("Cannot call 'BeginRender' when already rendering");
}
/// <summary>
/// End rendering to this object, must be paired with BeginRender
/// </summary>
public void EndRender()
{
if (inRender)
{
myTarget.EndRender();
inRender = false;
return;
}
throw new RenderViolationException("Cannot call 'EndRender' without a previous call to 'BeginRender'");
}
/// <summary>
/// Begin writing text
/// </summary>
/// <param name="fontName">Name of the font to use for writing text</param>
/// <param name="pixelHeight">Height in pixels to use when writing text</param>
public void BeginText(string fontName, int pixelHeight)
{
BeginText(fontName, pixelHeight, FontWeight.Normal, italic: false);
}
/// <summary>
/// Begin writing text
/// </summary>
/// <param name="fontName">Name of the font to use for writing text</param>
/// <param name="pixelHeight">Height in pixels to use when writing text</param>
/// <param name="weight">Bold, Strong, etc, indicator for text to be written</param>
/// <param name="italic">Write text in italics?</param>
public void BeginText(string fontName, int pixelHeight, FontWeight weight, bool italic)
{
UnsafeBeginText(fontName, pixelHeight, (int)weight, italic);
}
/// <summary>
/// Display text,using the full rectangle of the render target as the area.
/// This overload will draw the text in black.
/// </summary>
/// <param name="text">Text to display</param>
public void WriteText(string text)
{
WriteText(text, Color.Black, WriteTextFormats.None, areaRect);
}
/// <summary>
/// Display text,using the full rectangle of the render target as the area.
/// </summary>
/// <param name="text">Text to display</param>
/// <param name="color">Color to use to display the text. (Including alpha channel)</param>
public void WriteText(string text, Color color)
{
WriteText(text, color, WriteTextFormats.None, areaRect);
}
/// <summary>
/// Display text,using the full rectangle of the render target as the area.
/// </summary>
/// <param name="text">Text to display</param>
/// <param name="color">Color to use to display the text. (Including alpha channel)</param>
/// <param name="format">Format specifiers, including centered, etc.</param>
/// <param name="region">Rectangle relative to this object to use to bound the text</param>
public void WriteText(string text, Color color, WriteTextFormats format, Rectangle region)
{
UnsafeWriteText(Util.toTagRECT(region), color.ToArgb(), (int)format, text);
}
/// <summary>
/// Display text,using the full rectangle of the render target as the area.
/// </summary>
/// <param name="text">Text to display</param>
/// <param name="color">Color to use to display the text. (Including alpha channel)</param>
/// <param name="format">Format specifiers, including centered, etc.</param>
/// <param name="region">Rectangle relative to this object to use to bound the text</param>
public void WriteText(string text, int color, WriteTextFormats format, Rectangle region)
{
UnsafeWriteText(Util.toTagRECT(region), color, (int)format, text);
}
/// <summary>
/// End drawing of text.
/// </summary>
public void EndText()
{
if (inRender && inText)
{
myTarget.EndText();
inText = false;
return;
}
throw new RenderViolationException("Cannot call 'EndText' without a previous call to 'BeginText'");
}
public void Clear()
{
Clear(areaRect);
}
public void Clear(Rectangle clearArea)
{
UnsafeClear(Util.toTagRECT(clearArea));
}
public void DrawPortalImage(int portalFile, Rectangle destinationArea)
{
UnsafeDrawPortalImage(portalFile, Util.toTagRECT(destinationArea));
}
public void DrawPortalImage(int portalFile, int alpha, Rectangle srcArea, Rectangle destinationArea)
{
UnsafeDrawPortalImage(portalFile, alpha, Util.toTagRECT(srcArea), Util.toTagRECT(destinationArea));
}
public void DrawPortalImage(int portalFile, Rectangle srcArea, Rectangle destinationArea)
{
UnsafeDrawPortalImage(portalFile, 255, Util.toTagRECT(srcArea), Util.toTagRECT(destinationArea));
}
public void TilePortalImage(int portalFile, Rectangle destinationArea)
{
UnsafeTilePortalImage(portalFile, Util.toTagRECT(destinationArea));
}
public void TilePortalImage(int portalFile, Rectangle srcArea, Rectangle destinationArea)
{
UnsafeTilePortalImage(portalFile, Util.toTagRECT(srcArea), Util.toTagRECT(destinationArea));
}
public void DrawImage(Image image, Rectangle destinationRegion)
{
DrawImage(image, destinationRegion, Color.Cyan.ToArgb());
}
public void DrawImage(Image image, Rectangle destinationRegion, Color colorKey)
{
DrawImage(image, destinationRegion, colorKey.ToArgb());
}
public void DrawImage(Image image, Rectangle destinationRegion, int colorKey)
{
if (image == null)
{
throw new ArgumentNullException("image");
}
MemoryStream memoryStream = new MemoryStream();
image.Save(memoryStream, ImageFormat.Bmp);
byte[] buffer = memoryStream.GetBuffer();
IntPtr zero = IntPtr.Zero;
int num = buffer.Length;
zero = Marshal.AllocCoTaskMem(num);
try
{
Marshal.Copy(buffer, 0, zero, num);
if (zero != IntPtr.Zero)
{
UnsafeDrawImage(zero, num, Util.toTagRECT(destinationRegion), colorKey);
}
}
finally
{
Marshal.FreeCoTaskMem(zero);
memoryStream.Dispose();
}
}
public void Fill(Color color)
{
Fill(areaRect, color);
}
public void Fill(Rectangle fillArea, Color color)
{
Fill(fillArea, color.ToArgb());
}
public void Fill(Rectangle fillArea, int color)
{
UnsafeFill(Util.toTagRECT(fillArea), color);
}
[EditorBrowsable(EditorBrowsableState.Never)]
public void UnsafeBeginText(string fontName, int pixelHeight, int weight, bool italic)
{
if (inRender && !inText)
{
myTarget.BeginText(fontName, pixelHeight, weight, italic);
inText = true;
return;
}
if (inRender && inText)
{
throw new RenderViolationException("Cannot call 'BeginText' when already rendering text");
}
throw new RenderViolationException("Cannot call 'BeginText' outside of a BeginRender/EndRender block");
}
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public void UnsafeWriteText(tagRECT region, int color, int format, string text)
{
if (inRender && inText)
{
myTarget.WriteText(ref region, color, format, text);
return;
}
throw new RenderViolationException("Cannot call 'WriteText' outside of a BeginText/EndText block");
}
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public void UnsafeClear(tagRECT clearArea)
{
if (!inRender)
{
myTarget.Clear(ref clearArea);
return;
}
throw new RenderViolationException("MUST call 'Clear' outside of a BeginRender/EndRender block");
}
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public void UnsafeDrawPortalImage(int portalFile, tagRECT destinationArea)
{
if (inRender)
{
myTarget.DrawPortalImage(portalFile, ref destinationArea);
return;
}
throw new RenderViolationException("Cannot call 'DrawPortalImage' outside of a BeginRender/EndRender block");
}
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public void UnsafeDrawPortalImage(int portalFile, int alpha, tagRECT srcArea, tagRECT destinationArea)
{
if (inRender)
{
myTarget.DrawPortalImageEx(portalFile, alpha, ref srcArea, ref destinationArea);
return;
}
throw new RenderViolationException("Cannot call 'DrawPortalImageEx' outside of a BeginRender/EndRender block");
}
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public void UnsafeTilePortalImage(int portalFile, tagRECT destinationArea)
{
if (inRender)
{
myTarget.TilePortalImage(portalFile, ref destinationArea);
return;
}
throw new RenderViolationException("Cannot call 'TilePortalImage' outside of a BeginRender/EndRender block");
}
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public void UnsafeTilePortalImage(int portalFile, tagRECT srcArea, tagRECT destinationArea)
{
if (inRender)
{
myTarget.TilePortalImageEx(portalFile, ref srcArea, ref destinationArea);
return;
}
throw new RenderViolationException("Cannot call 'TilePortalImageEx' outside of a BeginRender/EndRender block");
}
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public void UnsafeDrawImage(IntPtr buffer, int size, tagRECT destinationRegion, int colorKey)
{
if (inRender)
{
myTarget.DrawImage((int)buffer, size, ref destinationRegion, colorKey);
return;
}
throw new RenderViolationException("Cannot call 'DrawImage' outside of a BeginRender/EndRender block");
}
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public void UnsafeFill(tagRECT fillArea, int color)
{
if (!inRender)
{
myTarget.Fill(ref fillArea, color);
return;
}
throw new RenderViolationException("MUST call 'Fill' outside of a BeginRender/EndRender block");
}
[EditorBrowsable(EditorBrowsableState.Never)]
public void UnsafeSetSurface(object pSurface)
{
myTarget.SetSurface(pSurface);
}
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!isDisposed)
{
}
if (myTarget != null)
{
Marshal.ReleaseComObject(myTarget);
}
myTarget = null;
isDisposed = true;
}
}

View file

@ -0,0 +1,22 @@
using System.ComponentModel;
namespace Decal.Adapter.Wrappers;
public interface IControlWrapper
{
[EditorBrowsable(EditorBrowsableState.Never)]
object Underlying { get; }
int Id { get; }
int ChildCount { get; }
[EditorBrowsable(EditorBrowsableState.Never)]
void Initialize(object control);
[EditorBrowsable(EditorBrowsableState.Never)]
object ChildById(int id);
[EditorBrowsable(EditorBrowsableState.Never)]
object ChildByIndex(int index);
}

View file

@ -0,0 +1,12 @@
using System.Collections;
namespace Decal.Adapter.Wrappers;
public interface IIndexedProvider<IndexType>
{
object GetIndexedObject(IndexType index, int item);
IEnumerator GetEnumerator(IndexType index);
int Count(IndexType index);
}

View file

@ -0,0 +1,6 @@
namespace Decal.Adapter.Wrappers;
internal interface IIndexedValueProvider
{
int GetIndexedObject(hookIndexType index, int item);
}

View file

@ -0,0 +1,14 @@
using System.Reflection;
namespace Decal.Adapter.Wrappers;
public interface IViewHandler
{
ViewWrapper DefaultView { get; }
BindingFlags BindingFlags { get; }
void LoadView(string name, string resource);
ViewWrapper GetView(string name);
}

View file

@ -0,0 +1,33 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
namespace Decal.Adapter.Wrappers;
public sealed class IndexedCollection<InternalIndexType, IndexType, RType> : MarshalByRefObject, IEnumerable<RType>, IEnumerable where InternalIndexType : struct, IConvertible where IndexType : struct, IConvertible
{
private InternalIndexType myDataType;
private IIndexedProvider<InternalIndexType> myWrap;
public RType this[IndexType index] => (RType)myWrap.GetIndexedObject(myDataType, index.ToInt32(CultureInfo.InvariantCulture));
public int Count => myWrap.Count(myDataType);
internal IndexedCollection(IIndexedProvider<InternalIndexType> wrap, InternalIndexType data)
{
myDataType = data;
myWrap = wrap;
}
IEnumerator<RType> IEnumerable<RType>.GetEnumerator()
{
return (IEnumerator<RType>)myWrap.GetEnumerator(myDataType);
}
IEnumerator IEnumerable.GetEnumerator()
{
return myWrap.GetEnumerator(myDataType);
}
}

View file

@ -0,0 +1,56 @@
using System.Drawing;
using Decal.Adapter.Support;
namespace Decal.Adapter.Wrappers;
public class ListColumn
{
private ListWrapper myList;
private int rowIndex;
private int colIndex;
public object this[int subVal]
{
get
{
return myList.get_Data(rowIndex, colIndex, subVal);
}
set
{
myList.set_Data(rowIndex, colIndex, subVal, ref value);
}
}
public Color Color
{
get
{
return Util.ColorFromBGR(myList.get_Color(rowIndex, colIndex));
}
set
{
myList.set_Color(rowIndex, colIndex, Util.ColorToBGR(value));
}
}
public int Width
{
get
{
return myList.get_ColWidth(colIndex);
}
set
{
myList.set_ColWidth(colIndex, value);
}
}
internal ListColumn(ListWrapper list, int row, int col)
{
myList = list;
rowIndex = row;
colIndex = col;
}
}

View file

@ -0,0 +1,29 @@
namespace Decal.Adapter.Wrappers;
public class ListRow
{
private ListWrapper myList;
private int rowIndex;
private int colCount;
public ListColumn this[int column]
{
get
{
if (column >= 0 && column < colCount)
{
return new ListColumn(myList, rowIndex, column);
}
return null;
}
}
internal ListRow(ListWrapper list, int row)
{
myList = list;
rowIndex = row;
colCount = myList.ColCount;
}
}

View file

@ -0,0 +1,194 @@
using System;
using Decal.Interop.Controls;
namespace Decal.Adapter.Wrappers;
public class ListWrapper : ControlWrapperBase<ListClass>
{
private EventHandler<ControlEventArgs> evtDestroy;
private EventHandler<ListSelectEventArgs> evtSelect;
public ListRow this[int row]
{
get
{
if (row >= 0 && row < base.Control.Count)
{
return new ListRow(this, row);
}
return null;
}
}
public bool AutoScroll
{
get
{
return base.Control.AutoScroll;
}
set
{
base.Control.AutoScroll = value;
}
}
public int RowEstimate
{
set
{
base.Control.RowEstimate = value;
}
}
public int ScrollPosition
{
get
{
return base.Control.ScrollPosition;
}
set
{
base.Control.ScrollPosition = value;
}
}
public int RowCount => base.Control.Count;
public int ColCount => base.Control.CountCols;
public event EventHandler<ControlEventArgs> Destroy
{
add
{
if (evtDestroy == null)
{
base.Control.Destroy += DestroyEvent;
}
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Combine(evtDestroy, value);
}
remove
{
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, value);
if (evtDestroy == null)
{
base.Control.Destroy -= DestroyEvent;
}
}
}
public event EventHandler<ListSelectEventArgs> Selected
{
add
{
if (evtSelect == null)
{
base.Control.Change += SelectEvent;
}
evtSelect = (EventHandler<ListSelectEventArgs>)Delegate.Combine(evtSelect, value);
}
remove
{
evtSelect = (EventHandler<ListSelectEventArgs>)Delegate.Remove(evtSelect, value);
if (evtSelect == null)
{
base.Control.Change -= SelectEvent;
}
}
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (evtDestroy != null)
{
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, evtDestroy);
base.Control.Destroy -= DestroyEvent;
}
if (evtSelect != null)
{
evtSelect = (EventHandler<ListSelectEventArgs>)Delegate.Remove(evtSelect, evtSelect);
base.Control.Change -= SelectEvent;
}
}
base.Dispose(disposing);
}
internal int AddRow()
{
return base.Control.AddRow();
}
internal object get_Data(int row, int col, int subVal)
{
return base.Control.get_Data(col, row, subVal);
}
internal void set_Data(int row, int col, int subVal, ref object val)
{
base.Control.set_Data(col, row, subVal, ref val);
}
internal int get_Color(int row, int col)
{
return base.Control.get_Color(col, row);
}
internal void set_Color(int row, int col, int color)
{
base.Control.set_Color(col, row, color);
}
internal int get_ColWidth(int col)
{
return base.Control.get_ColumnWidth(col);
}
internal void set_ColWidth(int col, int width)
{
base.Control.set_ColumnWidth(col, width);
}
public ListRow Add()
{
return new ListRow(this, AddRow());
}
public ListRow Insert(int row)
{
base.Control.InsertRow(row);
return new ListRow(this, row);
}
public void JumpToPosition(int row)
{
base.Control.JumpToPosition(row);
}
public void Clear()
{
base.Control.Clear();
}
public void Delete(int index)
{
base.Control.DeleteRow(index);
}
private void SelectEvent(int ID, int Col, int Row)
{
if (evtSelect != null)
{
evtSelect(new ListColumn(this, Row, Col), new ListSelectEventArgs(ID, Row, Col));
}
}
private void DestroyEvent(int ID)
{
if (evtDestroy != null)
{
evtDestroy(this, new ControlEventArgs(ID));
}
}
}

View file

@ -0,0 +1,15 @@
using System;
namespace Decal.Adapter.Wrappers;
public class LoginEventArgs : EventArgs
{
private int myId;
public int Id => myId;
internal LoginEventArgs(int Id)
{
myId = Id;
}
}

View file

@ -0,0 +1,15 @@
using System;
namespace Decal.Adapter.Wrappers;
public class LogoffEventArgs : EventArgs
{
private LogoffEventType myType;
public LogoffEventType Type => myType;
internal LogoffEventArgs(LogoffEventType type)
{
myType = type;
}
}

View file

@ -0,0 +1,10 @@
using System;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public enum LogoffEventType
{
Requested,
Authorized
}

View file

@ -0,0 +1,108 @@
namespace Decal.Adapter.Wrappers;
public enum LongValueKey
{
Type = 218103808,
Icon = 218103809,
Container = 218103810,
Landblock = 218103811,
ItemSlots = 218103812,
PackSlots = 218103813,
StackCount = 218103814,
StackMax = 218103815,
AssociatedSpell = 218103816,
SlotLegacy = 218103817,
Wielder = 218103818,
WieldingSlot = 218103819,
Monarch = 218103820,
Coverage = 218103821,
EquipableSlots = 218103822,
EquipType = 218103823,
IconOutline = 218103824,
MissileType = 218103825,
UsageMask = 218103826,
HouseOwner = 218103827,
HookMask = 218103828,
HookType = 218103829,
Model = 218103830,
Flags = 218103831,
CreateFlags1 = 218103832,
CreateFlags2 = 218103833,
Category = 218103834,
Behavior = 218103835,
MagicDef = 218103836,
SpecialProps = 218103837,
SpellCount = 218103838,
WeapSpeed = 218103839,
EquipSkill = 218103840,
DamageType = 218103841,
MaxDamage = 218103842,
Unknown10 = 218103843,
Unknown100000 = 218103844,
Unknown800000 = 218103845,
Unknown8000000 = 218103846,
PhysicsDataFlags = 218103847,
ActiveSpellCount = 218103848,
IconOverlay = 218103849,
IconUnderlay = 218103850,
Species = 2,
Burden = 5,
EquippedSlots = 10,
RareId = 17,
Value = 19,
TotalValue = 20,
SkillCreditsAvail = 24,
CreatureLevel = 25,
RestrictedToToD = 26,
ArmorLevel = 28,
Rank = 30,
Bonded = 33,
NumberFollowers = 35,
Unenchantable = 36,
LockpickDifficulty = 38,
Deaths = 43,
WandElemDmgType = 45,
MinLevelRestrict = 86,
MaxLevelRestrict = 87,
LockpickSkillBonus = 88,
AffectsVitalId = 89,
AffectsVitalAmt = 90,
HealKitSkillBonus = 90,
UsesTotal = 91,
UsesRemaining = 92,
DateOfBirth = 98,
Workmanship = 105,
Spellcraft = 106,
CurrentMana = 107,
MaximumMana = 108,
LoreRequirement = 109,
RankRequirement = 110,
PortalRestrictions = 111,
Gender = 113,
Attuned = 114,
SkillLevelReq = 115,
ManaCost = 117,
Age = 125,
XPForVPReduction = 129,
Material = 131,
WieldReqType = 158,
WieldReqAttribute = 159,
WieldReqValue = 160,
SlayerSpecies = 166,
NumberItemsSalvagedFrom = 170,
NumberTimesTinkered = 171,
DescriptionFormat = 172,
PagesUsed = 174,
PagesTotal = 175,
ActivationReqSkillId = 176,
GemSettingQty = 177,
GemSettingType = 178,
Imbued = 179,
Heritage = 188,
FishingSkill = 192,
KeysHeld = 193,
ElementalDmgBonus = 204,
CleaveType = 263,
ArmorSet = 265,
Slot = 231735296
}

View file

@ -0,0 +1,15 @@
using System;
namespace Decal.Adapter.Wrappers;
public class MoveObjectEventArgs : EventArgs
{
private WorldObject myMovedObject;
public WorldObject Moved => myMovedObject;
internal MoveObjectEventArgs(WorldObject movedObject)
{
myMovedObject = movedObject;
}
}

View file

@ -0,0 +1,43 @@
using System;
using System.ComponentModel;
using Decal.Interop.Net;
namespace Decal.Adapter.Wrappers;
public sealed class NetServiceHost : HostBase
{
private NetService myService;
[EditorBrowsable(EditorBrowsableState.Never)]
public NetService Underlying => myService;
public DecalWrapper Decal
{
get
{
if (base.MyDecal == null)
{
base.MyDecal = new DecalWrapper(myService.Decal);
}
return base.MyDecal;
}
}
public HooksWrapper Actions => CoreManager.Current.Actions;
internal NetServiceHost(NetService svc)
{
myService = svc;
base.MyDecal = new DecalWrapper(myService.Decal);
}
public object GetComFilter(string progId)
{
return ((INetService)myService).get_FilterVB(progId);
}
public object GetComFilter(Guid clsid, Guid riid)
{
return ((INetService)myService).get_Filter(ref clsid, ref riid);
}
}

View file

@ -0,0 +1,117 @@
using System;
using Decal.Interop.Controls;
using Decal.Interop.Inject;
namespace Decal.Adapter.Wrappers;
public class NotebookWrapper : ControlWrapperBase<NotebookClass>
{
private EventHandler<ControlEventArgs> evtDestroy;
private EventHandler<IndexChangeEventArgs> evtChange;
private PageTextIndexer myPageIndex;
public int ActiveTab
{
get
{
return base.Control.ActiveTab;
}
set
{
base.Control.ActiveTab = value;
}
}
public PageTextIndexer PageText => myPageIndex;
public event EventHandler<ControlEventArgs> Destroy
{
add
{
if (evtDestroy == null)
{
base.Control.Destroy += DestroyEvent;
}
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Combine(evtDestroy, value);
}
remove
{
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, value);
if (evtDestroy == null)
{
base.Control.Destroy -= DestroyEvent;
}
}
}
public event EventHandler<IndexChangeEventArgs> Change
{
add
{
if (evtChange == null)
{
base.Control.Change += ChangeEvent;
}
evtChange = (EventHandler<IndexChangeEventArgs>)Delegate.Combine(evtChange, value);
}
remove
{
evtChange = (EventHandler<IndexChangeEventArgs>)Delegate.Remove(evtChange, value);
if (evtChange == null)
{
base.Control.Change -= ChangeEvent;
}
}
}
public override void Initialize(object control)
{
base.Initialize(control);
myPageIndex = new PageTextIndexer(base.Control);
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (evtDestroy != null)
{
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, evtDestroy);
base.Control.Destroy -= DestroyEvent;
}
if (evtChange != null)
{
evtChange = (EventHandler<IndexChangeEventArgs>)Delegate.Remove(evtChange, evtChange);
base.Control.Change -= ChangeEvent;
}
if (myPageIndex != null)
{
myPageIndex.Dispose();
}
}
base.Dispose(disposing);
}
public void AddPage(string text, IControl control)
{
base.Control.AddPage(text, control);
}
private void ChangeEvent(int ID, int Index)
{
if (evtChange != null)
{
evtChange(this, new IndexChangeEventArgs(ID, Index));
}
}
private void DestroyEvent(int ID)
{
if (evtDestroy != null)
{
evtDestroy(this, new ControlEventArgs(ID));
}
}
}

View file

@ -0,0 +1,49 @@
namespace Decal.Adapter.Wrappers;
public enum ObjectClass
{
Unknown,
MeleeWeapon,
Armor,
Clothing,
Jewelry,
Monster,
Food,
Money,
Misc,
MissileWeapon,
Container,
Gem,
SpellComponent,
Key,
Portal,
TradeNote,
ManaStone,
Plant,
BaseCooking,
BaseAlchemy,
BaseFletching,
CraftedCooking,
CraftedAlchemy,
CraftedFletching,
Player,
Vendor,
Door,
Corpse,
Lifestone,
HealingKit,
Lockpick,
WandStaffOrb,
Bundle,
Book,
Journal,
Sign,
Housing,
Npc,
Foci,
Salvage,
Ust,
Services,
Scroll,
NumObjectClasses
}

View file

@ -0,0 +1,31 @@
using System;
using Decal.Interop.Controls;
namespace Decal.Adapter.Wrappers;
public sealed class PageTextIndexer : IDisposable
{
private NotebookClass myControl;
public string this[int index]
{
get
{
return myControl.get_PageText(index);
}
set
{
myControl.set_PageText(index, value);
}
}
internal PageTextIndexer(NotebookClass control)
{
myControl = control;
}
public void Dispose()
{
myControl = null;
}
}

View file

@ -0,0 +1,14 @@
using System;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public enum PlayerModifyEventType
{
Skill,
Attribute,
Vital,
Statistic,
Allegiance,
Augmentation
}

View file

@ -0,0 +1,10 @@
using System;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public enum PlayerXPEventType
{
Total,
Unassigned
}

View file

@ -0,0 +1,202 @@
using System;
using System.ComponentModel;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Xml;
using Decal.Interop.Core;
using Decal.Interop.Inject;
using Decal.Interop.Render;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public sealed class PluginHost : HostBase
{
private IPluginSite2 mySite;
private IPluginSite myOldSite;
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public IPluginSite2 Underlying => mySite;
/// <summary>
/// Wrapped Decal OM
/// </summary>
public DecalWrapper Decal
{
get
{
if (base.MyDecal == null)
{
base.MyDecal = new DecalWrapper(mySite.Decal);
}
return base.MyDecal;
}
}
/// <summary>
/// Wrapped version of the ACHooks interface
/// </summary>
public HooksWrapper Actions => CoreManager.Current.Actions;
/// <summary>
/// Wrapped version of the DecalRenderService
/// </summary>
public RenderServiceWrapper Render
{
get
{
if (base.MyRender == null)
{
base.MyRender = new RenderServiceWrapper((RenderService)GetObject("services\\DecalRender.RenderService"));
}
return base.MyRender;
}
}
internal PluginHost(PluginSite2 pSite)
{
mySite = pSite;
base.MyDecal = new DecalWrapper(mySite.Decal);
myOldSite = (IPluginSite)mySite.PluginSite;
}
protected override void Dispose(bool disposing)
{
try
{
_ = base.IsDisposed;
if (myOldSite != null)
{
Marshal.ReleaseComObject(myOldSite);
myOldSite = null;
}
if (mySite != null)
{
Marshal.ReleaseComObject(mySite);
mySite = null;
}
}
finally
{
base.Dispose(disposing);
}
}
/// <summary>
/// Function to get a COM object by path from Decal.
/// </summary>
/// <param name="path">The decal services path to resolve the COM object</param>
/// <returns>instance of the object requested</returns>
public object GetObject(string path)
{
return mySite.get_Object(path);
}
/// <summary>
/// Get Mapped Keyboard Key
/// </summary>
/// <param name="name">Name to retrive mapping for. </param>
/// <returns>Mapped Key</returns>
public int GetKeyboardMapping(string name)
{
return myOldSite.QueryKeyboardMap(name);
}
/// <summary>
/// Initializes an already exisint viewhandler (plugins)
/// </summary>
/// <param name="handler">the handler to init</param>
internal static void LoadViewHandler(IViewHandler handler)
{
if (ViewWrapper.ScanViews(handler))
{
ViewWrapper.ScanControls(handler);
ViewWrapper.ScanReferences(handler);
}
}
/// <summary>
/// Load a view handler of the specified type
/// </summary>
/// <param name="handlerType">type of handler to load</param>
/// <returns>the new handler</returns>
public ViewHandler LoadViewHandler(Type handlerType)
{
ViewHandler obj = (ViewHandler)Activator.CreateInstance(handlerType, this);
LoadViewHandler(obj);
obj.LoadComplete();
return obj;
}
/// <summary>
/// Load a view in the current assembly using the specified resource
/// </summary>
/// <param name="resourcePath">path of the embedded view xml resource</param>
/// <returns>the new view</returns>
public ViewWrapper LoadViewResource(string resourcePath)
{
Assembly callingAssembly = Assembly.GetCallingAssembly();
return LoadViewResource(resourcePath, callingAssembly);
}
/// <summary>
/// Load a view in the specified assembly using the specified resource
/// </summary>
/// <param name="resourcePath">path of the embedded view xml resource</param>
/// <param name="resourceAssembly">assembly containing the resource</param>
/// <returns>the new view</returns>
public ViewWrapper LoadViewResource(string resourcePath, Assembly resourceAssembly)
{
if (null == resourceAssembly)
{
throw new ArgumentNullException("resourceAssembly");
}
Stream manifestResourceStream = resourceAssembly.GetManifestResourceStream(resourcePath);
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(manifestResourceStream);
return LoadView(xmlDocument.OuterXml);
}
/// <summary>
/// Load a view from the specified XML element
/// </summary>
/// <param name="viewSchema">XmlElement containing the view schema</param>
/// <returns>the new view</returns>
public ViewWrapper LoadView(XmlElement viewSchema)
{
if (viewSchema == null)
{
throw new ArgumentNullException("viewSchema");
}
return LoadView(viewSchema.OuterXml);
}
/// <summary>
/// Load a view from the specified XML string
/// </summary>
/// <param name="viewSchema">string containing the view schema</param>
/// <returns>the new view</returns>
public ViewWrapper LoadView(string viewSchema)
{
View view = myOldSite.LoadView(viewSchema);
if (view != null)
{
return new ViewWrapper(view);
}
return null;
}
/// <summary>
/// Get a COM based filter object.
/// (Similar to GetObject, but requires only ProgID instead of full path)
/// </summary>
/// <param name="progId"></param>
/// <returns></returns>
public object ComFilter(string progId)
{
return mySite.get_Object("services\\DecalNet.NetService\\" + progId);
}
}

View file

@ -0,0 +1,10 @@
using System;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public enum PortalEventType
{
EnterPortal,
ExitPortal
}

View file

@ -0,0 +1,211 @@
using System;
using System.Drawing;
using Decal.Adapter.Support;
using Decal.Interop.Controls;
namespace Decal.Adapter.Wrappers;
public class ProgressWrapper : ControlWrapperBase<ProgressClass>
{
private EventHandler<ControlEventArgs> evtDestroy;
private string alignment;
private Color borderColor;
private int borderWidth;
private bool drawText;
private Color faceColor;
private Color fillColor;
private int maxValue;
private string preText;
private string postText;
private Color textColor;
public string Alignment
{
get
{
return alignment;
}
set
{
alignment = value;
base.Control.Alignment = value;
}
}
public Color BorderColor
{
get
{
return borderColor;
}
set
{
borderColor = value;
base.Control.BorderColor = Util.ColorToBGR(value);
}
}
public int BorderWidth
{
get
{
return borderWidth;
}
set
{
borderWidth = value;
base.Control.BorderWidth = value;
}
}
public bool DrawText
{
get
{
return drawText;
}
set
{
drawText = value;
base.Control.DecalDrawText = value;
}
}
public Color FaceColor
{
get
{
return faceColor;
}
set
{
faceColor = value;
base.Control.FaceColor = Util.ColorToBGR(value);
}
}
public Color FillColor
{
get
{
return fillColor;
}
set
{
fillColor = value;
base.Control.FillColor = Util.ColorToBGR(value);
}
}
public int MaxValue
{
get
{
return maxValue;
}
set
{
maxValue = value;
base.Control.MaxValue = value;
}
}
public string PostText
{
get
{
return postText;
}
set
{
postText = value;
base.Control.PostText = value;
}
}
public string PreText
{
get
{
return preText;
}
set
{
preText = value;
base.Control.PreText = value;
}
}
public Color TextColor
{
get
{
return textColor;
}
set
{
textColor = value;
base.Control.TextColor = Util.ColorToBGR(value);
}
}
public int Value
{
get
{
return base.Control.Value;
}
set
{
base.Control.Value = value;
}
}
public event EventHandler<ControlEventArgs> Destroy
{
add
{
if (evtDestroy == null)
{
base.Control.Destroy += DestroyEvent;
}
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Combine(evtDestroy, value);
}
remove
{
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, value);
if (evtDestroy == null)
{
base.Control.Destroy -= DestroyEvent;
}
}
}
protected override void Dispose(bool disposing)
{
if (disposing && evtDestroy != null)
{
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, evtDestroy);
base.Control.Destroy -= DestroyEvent;
}
base.Dispose(disposing);
}
private void DestroyEvent(int ID)
{
if (evtDestroy != null)
{
evtDestroy(this, new ControlEventArgs(ID));
}
}
}

View file

@ -0,0 +1,228 @@
using System;
using System.Drawing;
using Decal.Adapter.Support;
using Decal.Interop.Controls;
namespace Decal.Adapter.Wrappers;
public class PushButtonWrapper : ControlWrapperBase<PushButtonClass>
{
private EventHandler<ControlEventArgs> evtClick;
private EventHandler<ControlEventArgs> evtCancel;
private EventHandler<ControlEventArgs> evtDestroy;
private EventHandler<ControlEventArgs> evtHit;
private EventHandler<ControlEventArgs> evtUnhit;
public Color FaceColor
{
get
{
return Util.ColorFromBGR(base.Control.FaceColor);
}
set
{
base.Control.FaceColor = Util.ColorToBGR(value);
}
}
public Color TextColor
{
get
{
return Util.ColorFromBGR(base.Control.TextColor);
}
set
{
base.Control.TextColor = Util.ColorToBGR(value);
}
}
public string Text
{
get
{
return base.Control.Text;
}
set
{
base.Control.Text = value;
}
}
public event EventHandler<ControlEventArgs> Click
{
add
{
if (evtClick == null)
{
base.Control.Accepted += ClickEvent;
}
evtClick = (EventHandler<ControlEventArgs>)Delegate.Combine(evtClick, value);
}
remove
{
evtClick = (EventHandler<ControlEventArgs>)Delegate.Remove(evtClick, value);
if (evtClick == null)
{
base.Control.Accepted -= ClickEvent;
}
}
}
public event EventHandler<ControlEventArgs> Canceled
{
add
{
if (evtCancel == null)
{
base.Control.Canceled += CanceledEvent;
}
evtCancel = (EventHandler<ControlEventArgs>)Delegate.Combine(evtCancel, value);
}
remove
{
evtCancel = (EventHandler<ControlEventArgs>)Delegate.Remove(evtCancel, value);
if (evtCancel == null)
{
base.Control.Canceled -= CanceledEvent;
}
}
}
public event EventHandler<ControlEventArgs> Destroy
{
add
{
if (evtDestroy == null)
{
base.Control.Destroy += DestroyEvent;
}
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Combine(evtDestroy, value);
}
remove
{
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, value);
if (evtDestroy == null)
{
base.Control.Destroy -= DestroyEvent;
}
}
}
public event EventHandler<ControlEventArgs> Hit
{
add
{
if (evtHit == null)
{
base.Control.Hit += HitEvent;
}
evtHit = (EventHandler<ControlEventArgs>)Delegate.Combine(evtHit, value);
}
remove
{
evtHit = (EventHandler<ControlEventArgs>)Delegate.Remove(evtHit, value);
if (evtHit == null)
{
base.Control.Hit -= HitEvent;
}
}
}
public event EventHandler<ControlEventArgs> Unhit
{
add
{
if (evtUnhit == null)
{
base.Control.Unhit += UnhitEvent;
}
evtUnhit = (EventHandler<ControlEventArgs>)Delegate.Combine(evtUnhit, value);
}
remove
{
evtUnhit = (EventHandler<ControlEventArgs>)Delegate.Remove(evtUnhit, value);
if (evtUnhit == null)
{
base.Control.Unhit -= UnhitEvent;
}
}
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
if (evtClick != null)
{
evtClick = (EventHandler<ControlEventArgs>)Delegate.Remove(evtClick, evtClick);
base.Control.Accepted -= ClickEvent;
}
if (evtCancel != null)
{
evtCancel = (EventHandler<ControlEventArgs>)Delegate.Remove(evtCancel, evtCancel);
base.Control.Canceled -= CanceledEvent;
}
if (evtDestroy != null)
{
evtDestroy = (EventHandler<ControlEventArgs>)Delegate.Remove(evtDestroy, evtDestroy);
base.Control.Destroy -= DestroyEvent;
}
if (evtHit != null)
{
evtHit = (EventHandler<ControlEventArgs>)Delegate.Remove(evtHit, evtHit);
base.Control.Hit -= HitEvent;
}
if (evtUnhit != null)
{
evtUnhit = (EventHandler<ControlEventArgs>)Delegate.Remove(evtUnhit, evtUnhit);
base.Control.Unhit -= UnhitEvent;
}
}
base.Dispose(disposing);
}
private void ClickEvent(int ID)
{
if (evtClick != null)
{
evtClick(this, new ControlEventArgs(ID));
}
}
private void UnhitEvent(int ID)
{
if (evtUnhit != null)
{
evtUnhit(this, new ControlEventArgs(ID));
}
}
private void HitEvent(int ID)
{
if (evtHit != null)
{
evtHit(this, new ControlEventArgs(ID));
}
}
private void DestroyEvent(int ID)
{
if (evtDestroy != null)
{
evtDestroy(this, new ControlEventArgs(ID));
}
}
private void CanceledEvent(int ID)
{
if (evtCancel != null)
{
evtCancel(this, new ControlEventArgs(ID));
}
}
}

View file

@ -0,0 +1,15 @@
using System;
namespace Decal.Adapter.Wrappers;
public class ReleaseObjectEventArgs : EventArgs
{
private WorldObject mWO;
public WorldObject Released => mWO;
internal ReleaseObjectEventArgs(WorldObject releasedObject)
{
mWO = releasedObject;
}
}

View file

@ -0,0 +1,149 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.InteropServices;
using Decal.Adapter.Support;
using Decal.Interop.Core;
using Decal.Interop.Inject;
using Decal.Interop.Render;
namespace Decal.Adapter.Wrappers;
/// <summary>
/// RenderServiceWrapper is a wrapper for RenderService
/// </summary>
[CLSCompliant(true)]
public class RenderServiceWrapper : MarshalByRefObject, IDisposable
{
private RenderService internalRender;
private bool isDisposed;
private EventHandler myDeviceLost;
[EditorBrowsable(EditorBrowsableState.Never)]
public object UnsafeDevice => internalRender.Device;
internal event EventHandler DeviceLost
{
add
{
myDeviceLost = (EventHandler)Delegate.Combine(myDeviceLost, value);
}
remove
{
myDeviceLost = (EventHandler)Delegate.Combine(myDeviceLost, value);
}
}
internal RenderServiceWrapper(RenderService render)
{
internalRender = render;
internalRender.DeviceLost += internalRender_DeviceLost;
}
~RenderServiceWrapper()
{
Dispose(disposing: false);
}
private void internalRender_DeviceLost()
{
if (myDeviceLost != null)
{
myDeviceLost(this, new EventArgs());
}
}
private void myHUD_Disposing(object sender, EventArgs e)
{
if (sender is Hud hud)
{
RemoveHud(hud);
hud.Disposing -= myHUD_Disposing;
}
}
/// <summary>
/// Create a new Background object to be used as a background in HUDS
/// </summary>
/// <param name="region">The rectangle to use for the size of the background</param>
/// <returns>Newly created and wrapped RenderService.HUDBackground</returns>
public Background CreateBackground(Rectangle region)
{
return UnsafeCreateBackground(Util.toTagRECT(region));
}
/// <summary>
/// Create a new HUD. New huds need to be made visible before they render.
/// </summary>
/// <param name="region">Size and location of where the HUD should be rendered</param>
/// <returns>Newly created and wrapped RenderService.HUDView</returns>
public Hud CreateHud(Rectangle region)
{
return UnsafeCreateHud(Util.toTagRECT(region));
}
/// <summary>
/// Remove a HUD from the render pipeline
/// </summary>
/// <param name="hud">HUD To remove</param>
public void RemoveHud(Hud hud)
{
if (hud == null)
{
throw new ArgumentNullException("hud");
}
internalRender.RemoveHUD(hud.Underlying);
}
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public Background UnsafeCreateBackground(tagRECT pRegion)
{
return new Background(internalRender.CreateBackground(ref pRegion));
}
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public Hud UnsafeCreateHud(tagRECT pRegion)
{
Hud hud = new Hud(internalRender.CreateHUD(ref pRegion));
hud.Disposing += myHUD_Disposing;
return hud;
}
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public Background EncapsulateBackground(tagPOINT coordinates, object surface)
{
return new Background(internalRender.EncapsulateBackground(ref coordinates, surface));
}
[CLSCompliant(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public Hud EncapsulateHud(tagPOINT coordinates, object surface)
{
return new Hud(internalRender.EncapsulateHUD(ref coordinates, surface));
}
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!isDisposed && disposing)
{
internalRender.DeviceLost -= internalRender_DeviceLost;
}
if (internalRender != null)
{
Marshal.ReleaseComObject(internalRender);
}
internalRender = null;
isDisposed = true;
}
}

View file

@ -0,0 +1,15 @@
using System;
namespace Decal.Adapter.Wrappers;
public class ResetTradeEventArgs : EventArgs
{
private int mTraderId;
public int TraderId => mTraderId;
internal ResetTradeEventArgs(int TraderId)
{
mTraderId = TraderId;
}
}

View file

@ -0,0 +1,15 @@
using System;
namespace Decal.Adapter.Wrappers;
public class SettingsEventArgs : EventArgs
{
private int mySetting;
public int Setting => mySetting;
internal SettingsEventArgs(int Setting)
{
mySetting = Setting;
}
}

View file

@ -0,0 +1,91 @@
using System;
using System.Runtime.InteropServices;
using Decal.Interop.Filters;
namespace Decal.Adapter.Wrappers;
[CLSCompliant(true)]
public class SkillInfoWrapper : MarshalByRefObject, IDisposable
{
private SkillInfo mySkillInfo;
private TrainingType myTraining;
private bool isDisposed;
public int Base => mySkillInfo.Base;
public int Bonus => mySkillInfo.Bonus;
public int Buffed => mySkillInfo.Buffed;
public int Current => mySkillInfo.Current;
public int XP => mySkillInfo.Exp;
public string Formula => mySkillInfo.Formula;
public int Increment => mySkillInfo.Increment;
public bool Known => mySkillInfo.Known;
public string Name => mySkillInfo.Name;
public string ShortName => mySkillInfo.ShortName;
public TrainingType Training => myTraining;
internal SkillInfoWrapper(SkillInfo info)
{
mySkillInfo = info;
switch (info.Training)
{
case eTrainingType.eTrainUnusable:
myTraining = TrainingType.Unusable;
break;
case eTrainingType.eTrainUntrained:
myTraining = TrainingType.Untrained;
break;
case eTrainingType.eTrainTrained:
myTraining = TrainingType.Trained;
break;
case eTrainingType.eTrainSpecialized:
myTraining = TrainingType.Specialized;
break;
default:
myTraining = TrainingType.Unusable;
break;
}
}
~SkillInfoWrapper()
{
Dispose(disposing: false);
}
public void Dispose()
{
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!isDisposed)
{
}
if (mySkillInfo != null)
{
Marshal.ReleaseComObject(mySkillInfo);
}
isDisposed = true;
}
protected void EnforceDisposedOnce()
{
if (isDisposed)
{
throw new ObjectDisposedException("SkillInfoWrapper");
}
}
}

Some files were not shown because too many files have changed in this diff Show more