public override object Call(params object[] args) { string msg = (string)args[0]; switch (msg) { case "AddAchievement": if (Main.netMode != 0) { break; } GenerateAchievement((Mod)args[1], (string)args[2], (string)args[3], (Texture2D)args[4], (Texture2D)args[5], (AchievementCategory)args[6]); //GetSaveData(); break; case "UnlockLocal": ModAchievement.UnlockLocal((string)args[1], (string)args[2], (Player)args[3]); break; case "UnlockGlobal": ModAchievement.UnlockGlobal((string)args[1], (string)args[2]); break; case "GetAchievement": for (int k = 0; k < lines.Count; k++) { if (lines[k] == (string)args[1] && lines[k + 1] == (string)args[2]) { return(lines[k + 2] == "True" ? true : false); } } break; } return("success"); }
public override bool CanUseItem(Player player) { ModAchievement.UnlockLocal <ExampleAchievement>(player); //This unlocks the "AchievementLib Tester" achievement when the item is used, for the player that used it. return(true); }