-
Notifications
You must be signed in to change notification settings - Fork 2
[ENG] Trophy Manager
I will show you how to add trophy with my mod.
Only trophy with a number.
First you will need to create a mod normally. You need to add the assembly TrophyManager.dll
.
In Info.json add the next line :
"Requirements": ["TrophyManager"],
"LoadAfter": ["TrophyManager"]
For the image, his size need to be 86x86. For the one when the trophy is done put "m_" before his name. If you don't know to put for image when the trophy is done, you can use this.
First you need to create a variable in the Main class like this :
static Trophy Trophy1;
In the Load method you will assign the trophy
Trophy1 = new Trophy("Name", 10, "Description", ImagePath, ImagePathDone);
"Name" : the name of the trophy (required)
10 : the objective for checking if the trophy is done(required)
"Description" : The description (optional)
ImagePath : the path of the image of the trophy (optional)
ImagePathDone : the path of the image when the trophy is done (optional)
Other variant :
Trophy1 = new Trophy("Name", 10);
Trophy1 = new Trophy("Name", 10, "Description");
Trophy1 = new Trophy(10, "Name", ImagePath);
Trophy1 = new Trophy("Name", ImagePathDone, 10);
Trophy1 = new Trophy("Name", 10, "Description", ImagePath);
Trophy1 = new Trophy("Name", "Description", ImagePathDone, 10);
Trophy1 = new Trophy("Name", ImagePath, 10, ImagePathDone);
After adding it you need to set in your OnUpdate method the following line :
Trophy1.UpdateProgression(ProgressionValue)
ProgressionValue : the progression of the trophy.
I recommend you to use a variable in the Settings class.