So I changed the plugin by adding a new function
Code:
private string EmptyRing(IMonster m, bool showDebuff) {
if (!showDebuff) return "";
string emptyDebuff = null;
if (m.Locust) emptyDebuff += "Locust";
if (m.Haunted) emptyDebuff += (emptyDebuff == null ? "Haunt" : ", Haunt");
var output = emptyDebuff;
return output;
}
and then changing a line :
Code:
var textLayout2 = Font_Mon.GetTextLayout(EmptyRing(monster, showDebuff));
but I get lots of errors when I haunt an elite in game. Before haunting it - there's no errors. Errors are :
Code:
2020.03.07 22:42:11.194 20.3.4.1 minimap draw error (System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
at ***********.**********(String , Boolean )
at Turbo.Plugins.User.DAV_EliteInfo.DrawInfo(WorldLayer layer, IMonster monster, Single Pos_X, Single& Pos_Y, Single offset, Boolean showDebuff, Boolean showCurse)
at Turbo.Plugins.User.DAV_EliteInfoPlugin.PaintWorld(WorldLayer layer)
at *********.***************.*************()
at *********.********(IPlugin , String , Action )
at *********.***********(Object , EventArgs )
at **********.************())
2020.03.07 22:42:11.195 20.3.4.1 overlay paint error (System.ArgumentNullException: Value cannot be null.
Parameter name: key
at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
at ***********.**********(String , Boolean )
at Turbo.Plugins.User.DAV_EliteInfo.DrawInfo(WorldLayer layer, IMonster monster, Single Pos_X, Single& Pos_Y, Single offset, Boolean showDebuff, Boolean showCurse)
at Turbo.Plugins.User.DAV_EliteInfoPlugin.PaintWorld(WorldLayer layer)
at *********.************.***************()
at *********.********(IPlugin , String , Action )
at *********.*************(Object , EventArgs )
at **********.***********())
can someone please help to understand what 's wrong with my code?