Jump to content

Req: Enable to change the icon of an existing profession.


PePePePePeil

Recommended Posts

I want to change the icon of an existing profession.

 

I checked the vanilla Java code and found that the zombie.characters.professions.ProfessionFactory$ Profession class had a setIconPath method.

 

I tried to specify my own icon path with this method, but it couldn't changed.

In vanilla, it seems that the texture of the icon is set only at the time of instantiation.

 

Isn't it possible to change the texture by executing this setIconPath on the vanilla side?

Or if there is another way to change the icon, please let me know.

 

Best regards.

 

Peil

Link to comment
Share on other sites

I was able to change the icon by overwriting the existing profession.

local MyMod.DoProfessions = function()
	local burglar = ProfessionFactory.addProfession("burglar", getText("UI_prof_Burglar"), "MY_TEXTURE_NAME", -6);
	burglar:addXPBoost(Perks.Nimble, 2)
	burglar:addXPBoost(Perks.Sneak, 2)
	burglar:addXPBoost(Perks.Lightfoot, 2)
	burglar:addFreeTrait("Burglar");
	BaseGameCharacterDetails.SetProfessionDescription(burglar)
end
Events.OnGameBoot.Add(DoProfessions);

I've achieved what I want to do, but I understand this is a highly dependent way.

So, I would like to continue requesting icon changes.

 

Best regards.

Peil

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...