forked from UNLOZE/sm-plugins
entWatch4: Actually make it work.
Since pushing the configurated 'item' as an item would break stuff, so now the configs and items are split between 2 classes.
This commit is contained in:
@@ -6,30 +6,17 @@
|
||||
|
||||
methodmap CItem < Basic
|
||||
{
|
||||
public CItem()
|
||||
public CItem(CConfig value = view_as<CConfig>(INVALID_HANDLE))
|
||||
{
|
||||
Basic myclass = new Basic();
|
||||
|
||||
myclass.SetString("sName", "");
|
||||
myclass.SetString("sShort", "");
|
||||
myclass.SetString("sColor", "");
|
||||
myclass.SetString("sFilter", "");
|
||||
|
||||
myclass.SetInt("iButtonID", 0);
|
||||
myclass.SetInt("iWeaponID", 0);
|
||||
myclass.SetInt("iTriggerID", 0);
|
||||
myclass.SetHandle("dConfig", value);
|
||||
|
||||
myclass.SetInt("iOwner", INVALID_ENT_REFERENCE);
|
||||
myclass.SetInt("iButton", INVALID_ENT_REFERENCE);
|
||||
myclass.SetInt("iWeapon", INVALID_ENT_REFERENCE);
|
||||
myclass.SetInt("iTrigger", INVALID_ENT_REFERENCE);
|
||||
|
||||
myclass.SetInt("iDisplay", 0);
|
||||
myclass.SetInt("iMode", 0);
|
||||
|
||||
myclass.SetInt("iMaxUses", 0);
|
||||
myclass.SetInt("iCooldown", 0);
|
||||
|
||||
myclass.SetInt("iTimesUsed", 0);
|
||||
myclass.SetInt("iTimeReady", 0);
|
||||
|
||||
@@ -37,80 +24,15 @@ methodmap CItem < Basic
|
||||
}
|
||||
|
||||
|
||||
public bool GetName(char[] buffer, int length)
|
||||
{
|
||||
return this.GetString("sName", buffer, length);
|
||||
}
|
||||
|
||||
public void SetName(const char[] buffer)
|
||||
{
|
||||
this.SetString("sName", buffer);
|
||||
}
|
||||
|
||||
public bool GetShort(char[] buffer, int length)
|
||||
{
|
||||
return this.GetString("sShort", buffer, length);
|
||||
}
|
||||
|
||||
public void SetShort(const char[] buffer)
|
||||
{
|
||||
this.SetString("sShort", buffer);
|
||||
}
|
||||
|
||||
public bool GetColor(char[] buffer, int length)
|
||||
{
|
||||
return this.GetString("sColor", buffer, length);
|
||||
}
|
||||
|
||||
public void SetColor(const char[] buffer)
|
||||
{
|
||||
this.SetString("sColor", buffer);
|
||||
}
|
||||
|
||||
public bool GetFilter(char[] buffer, int length)
|
||||
{
|
||||
return this.GetString("sFilter", buffer, length);
|
||||
}
|
||||
|
||||
public void SetFilter(const char[] buffer)
|
||||
{
|
||||
this.SetString("sFilter", buffer);
|
||||
}
|
||||
|
||||
|
||||
property int iButtonID
|
||||
property CConfig dConfig
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iButtonID");
|
||||
return view_as<CConfig>(this.GetHandle("dConfig"));
|
||||
}
|
||||
public set(int value)
|
||||
public set(CConfig value)
|
||||
{
|
||||
this.SetInt("iButtonID", value);
|
||||
}
|
||||
}
|
||||
|
||||
property int iWeaponID
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iWeaponID");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iWeaponID", value);
|
||||
}
|
||||
}
|
||||
|
||||
property int iTriggerID
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iTriggerID");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iTriggerID", value);
|
||||
this.SetHandle("dConfig", value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,56 +86,6 @@ methodmap CItem < Basic
|
||||
}
|
||||
|
||||
|
||||
property int iDisplay
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iDisplay");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iDisplay", value);
|
||||
}
|
||||
}
|
||||
|
||||
property int iMode
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iMode");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iMode", value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
property int iMaxUses
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iMaxUses");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iMaxUses", value);
|
||||
}
|
||||
}
|
||||
|
||||
property int iCooldown
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return this.GetInt("iCooldown");
|
||||
}
|
||||
public set(int value)
|
||||
{
|
||||
this.SetInt("iCooldown", value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
property int iTimesUsed
|
||||
{
|
||||
public get()
|
||||
@@ -270,29 +142,4 @@ methodmap CItem < Basic
|
||||
return view_as<bool>(this.iTrigger != INVALID_ENT_REFERENCE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
property bool bDisplayEventMessages
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return view_as<bool>(this.iDisplay & (1<<0));
|
||||
}
|
||||
}
|
||||
|
||||
property bool bDisplayActivateMessages
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return view_as<bool>(this.iDisplay & (1<<1));
|
||||
}
|
||||
}
|
||||
|
||||
property bool bDisplayInterface
|
||||
{
|
||||
public get()
|
||||
{
|
||||
return view_as<bool>(this.iDisplay & (1<<2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user