Jump to content

Recommended Posts

Posted (edited)

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
Posted

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.

Posted

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.
Posted

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
Posted (edited)

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

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...