{Solution} How to alter the hardcoded text colors without engine recompiles

Users who are viewing this thread

Swyter

Grandmaster Knight
After like three years and a half today I found out how to alter the hard-coded menu text colors.
As I'd like to know how to do it in any other parallel universe, here I leave the snippet for general enjoyment.

This is a modified version of the Mount&Blade 1.011 bitmap text pixel shader.

I just added dynamic branching, that isn't that cheap performance wise, but the code is pretty simple and doesn't slows down text rendering at all.
Actually, while writing this I got the idea of moving all the code to the vertex shader. So it becomes even faster.

Code:
PS_OUTPUT ps_font_uniform_color(PS_INPUT_FONT In)
{

/*
  Replace hardcoded menu colors--
  Yellow: #fddd0b
  DGreen: #218221
  BBrown: #d4c5b5
  BGreen: #7cfd78
 */

	if( In.Color.r == 1.0f  //--> Replace yellow
	 && In.Color.g >= 0.86f
	 && In.Color.g <= 0.87f
	 && In.Color.b == 0.0f
	 ||                     //--> This thing means OR
            In.Color.r == 0.0f  //--> Replace black
	 && In.Color.g == 0.0f
	 && In.Color.b == 0.0f ){
	    In.Color.rgb = float3(0.0f,0.0f,1.0f);  //--> We like blue.
	}
	
	PS_OUTPUT Output;
	Output.RGBColor =  In.Color;
	
	Output.RGBColor.a *= tex2D(FontTextureSampler, In.Tex0).a;
	return Output;
}


Before anyone starts talking about configurable colors for main menu in
Code:
module.ini
, plus other general widgets in
Code:
game_variables.txt
. I'll say that this is for that other stuff, like hover states and the general black text you find in the game.

Thanks to this you can have your own color scheme without restrictions.
Something that always bothered me with the game since my first days of modding.



This is the result while hovering, just to showoff.
I'm not going to leave that ugly color in the final version of SWC :wink::

199944001340639105.png


Let me know if you want detailed steps.
 
Do want.  Shaders are beyond me, though.  Still, I'm glad to know there are those still modding the original (probably more than F&S).  That's pretty much my biggest and only gripe about this community.  People have moved on to Warband and With Fire and Sword is underrated.
 
Pyrate said:
(probably more than F&S).  That's pretty much my biggest and only gripe about this community.  People have moved on to Warband and With Fire and Sword is underrated.
Maybe it's because WFAS could probably use a remake from Taleworlds rather than a mod,(but a mod might damn quicker!).Taleworlds doesn't seem to care about WFAS either,the last patch was a year ago. :evil:

Lumos said:
Sure we have, Whorearband is awesome. :razz:
Very bad joke,but funny nonetheless. :twisted:
 
Back
Top Bottom