Skip to content

A couple of BGEE/SOD character screen level progress bar tweaks

AncientCowboyAncientCowboy Member Posts: 199
edited May 2016 in UI Modding

These tweaks have been incorporated into a larger set of Progress Bar related tweaks/enhancements detailed in this thread. If you haven't already, you might want to check it out instead.

I have to start by saying I haven't even looked at BG2 V 2.0 - these are specifically for BG/SOD.

The first tweak is to change the red (while progressing) and blue (when ready to level) progress bar in the character screen. In UI.menu at around line 363 (depending on prior mods) you'll find the definition of the progress bar as follows: (I deleted the comment at the end of the "progressbar lua" line to avoid scrollbars)

label
{
	area		654 476 174 20
	progressbar lua	"getPercent(characters[currentID].level.xp, characters[currentID].level.nextLvlXp)" 
	greyscale		0 --display greyscale or not, number 0-1
	progressbar color	128 0 0 255	 --color when percentage != 100
	progressbar full	0 0 255 255	 --color when percentage == 100
}

The two 4 number color specifications represent Red, Green, Blue, and probably opacity (changing it doesn't affect the progress bar). Change them to suit your taste. A slightly reddish brown worked for me; so mine is as follows:

	progressbar color	92 34 10 255	 --color when percentage != 100
	progressbar full	92 34 10 255	 --color when percentage == 100

The second tweak is to turn the progress bar into a 'level up' button. I invariably click on the progress bar when I'm ready to level up. This turned out to be pretty easy. Immediately after the label definition for the progress bar is a label definition for the text that overlays the progress bar. It looks like this:

label
{
	area		654 476 174 20
	text		lua "getNextLevelString()"
	text style	'normal'
	text align	center center
	text shadow	1
}

Were going to change the label into a button:

button
{
	enabled 	"CurrentlyInGame()"
	area		654 476 174 20
	text		lua "getNextLevelString()"
	text style	'normal'
	text align	center center
	text shadow	1
	clickable	lua "characterScreen:IsLevelUpButtonClickable()"
	action		"characterScreen:OnLevelUpButtonClick();"
}

That's it! Enjoy - time to cleanup the Cloakwood :smile:

Post edited by AncientCowboy on

Comments

  • AmmarAmmar Member Posts: 1,297
    Thanks! Since I am greedy, can you show some example screenshot to help us find the best settings?
  • moody_magemoody_mage Member Posts: 2,054
    Stupid person here. Do I simply copy these into my baldur.lua?
  • AncientCowboyAncientCowboy Member Posts: 199

    @decado - No, you'll need to extract UI.menu into the 00806/Override directory of wherever you've installed the game - take a look at Dee's thread at the top of this section for directions on how to get NearInfinity and use it to extract UI.menu. Then search for the code corresponding to the first label and change the first 3 numeric values (representing Red, Green, and Blue) in the 'progressbar color' and 'progressbar full' lines to whatever color you would like. For the second label (which should be right after the first) change the word 'label' to 'button' and add the 'enabled', 'clickable', and 'action' lines so that it looks like the button code shown. Of course, the easiest way is probably to just copy and paste over the existing label definition :smile:

    @Ammar - There won't really be any visual change other than just the color of the progressbar. The second tweak - changing the text overlay label to a text overlay button - doesn't affect the appearance since they are both just text written on a transparent background. As for the choice of color, I'd recommend using Paint (Windows) or any other graphical tool that allows you to play with the color palette and find an RGB combination that you think will look good. With over 16 million (256 cubed) possibilities, a screen shot wouldn't be very useful :smile:

  • ParysParys Member Posts: 205
    @AncientCowboy
    Do you know how I can change the colour of red indicator in spellbook/scrollbook?
  • AncientCowboyAncientCowboy Member Posts: 199
    @Parys
    I've been poking around the spellbook code and unfortunately there's no straightforward exporting of the indicator colors as there is for the progress bar. I suspect that these colors are set somewhere in the engine code. I'm now curious about it and continuing to dig (and learn Lua :smile: ) but I'm not optimistic. If I find something that works I'll post it - but it probably won't be as simple as this case was.
  • AncientCowboyAncientCowboy Member Posts: 199
    I've verified that this continues to work correctly in BGEE/SOD 2.1.
  • AncientCowboyAncientCowboy Member Posts: 199

    I've verified that these tweaks continue to work correctly in BGEE/SOD 2.2. However, over the last couple of weeks I've become dissatisfied with how changing the label to a button results in the text being dimmed unless ready to level up. So, I've developed an alternative solution. Rather than changing the label to a button, leave the 'getNextLevelString' label alone and add the following invisible button definition after it:

    button
    {
    	area          654 476 174 20
    	clickable lua "characterScreen:IsLevelUpButtonClickable()"
    	action        "characterScreen:OnLevelUpButtonClick()"
    }

    This prevents the 'greying' of the button (and thus easier for my old eyes to read :smile:). It does have a slight drawback however - you won't see the 'press' animation when you click the button. So go with whichever works best for you. Have fun!

Sign In or Register to comment.