Jump to content

[CLOSED] Devs, can you add fallbacks to the conversation portrait loader?


Recommended Posts

Looking at how conversation textures are loaded:

private void LoadConversationSmallTexture()
{
	if (!string.IsNullOrEmpty(this.m_textureConversationSmallPath))
	{
		this.m_textureConversationSmall = Portrait.LoadTexture2DFromPath(this.m_textureConversationSmallPath, 76, 96);
	}
	this.NotifyChanged();
}
I'm not sure what happens when m_textureConversation[small|Large]Path is empty, but if it is empty, it would be preferable to fallback to m_texture[small|Large]Path, so that we can create large and small portraits without worrying about also creating large and small conversation portraits.

 

In other words:

private void LoadConversationSmallTexture()
{
	string texturePath = string.IsNullOrEmpty(this.m_textureConversationSmallPath) ? this.m_textureSmallPath : this.m_textureConversationSmallPath;
	this.m_textureConversationSmall = Portrait.LoadTexture2DFromPath(texturePath, 76, 96);
	this.NotifyChanged();
}
Edited by fireundubh
Link to comment
Share on other sites

This is an unrelated note to your thread, but can you tell me what you are using to (I assume) decompile the code to take a look at behaviors? I'd like to take a look to see how specific things are being handled for modding purposes.

Link to comment
Share on other sites

This is an unrelated note to your thread, but can you tell me what you are using to (I assume) decompile the code to take a look at behaviors? I'd like to take a look to see how specific things are being handled for modding purposes.

dnSpy.
Link to comment
Share on other sites

This is already the behavior, it's just implemented a little differently that you're expecting - Portrait.GetTexture returns the non-conversation portraits if conversation portraits aren't available.

  • Like 1
Link to comment
Share on other sites

This is already the behavior, it's just implemented a little differently that you're expecting - Portrait.GetTexture returns the non-conversation portraits if conversation portraits aren't available.

 

Awesome! Thank you for the heads-up.

 

edit: I see it now!  :)

case Portrait.Style.ConversationLarge:
	return (!this.m_textureConversationLarge) ? this.m_textureLarge : this.m_textureConversationLarge;
case Portrait.Style.ConversationSmall:
	return (!this.m_textureConversationSmall) ? this.m_textureSmall : this.m_textureConversationSmall;
Edited by fireundubh
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...