Skip to content

[MOD] Lefreut's enhanced UI (for BG1EE, SoD, BG2EE and EET)

17810121320

Comments

  • NervaNerva Member Posts: 133
    Yes, it really does improve the game's feel compared to the EE 2.0 UI.

    I'm not sure if this is something your mod can do or if I should make it a feature request to Beamdog, but one thing I've noticed is if I go to cast a spell or manually attack, the mouse pointer does not generate a tooltip for the target -- normally, if there's no manual action being done, the mouse pointer tooltip says who the target is and what their health is -- I'd like it if it also did that when targeting a spell or manual attack etc.
  • kaitenkaiten Member Posts: 19
    edited January 2018
    Hello again, lefreut ! I am currently using your mod and I wanted to ask - is it safe to move the dialog box with the edit mode and F11? I noticed that you have made few cool changes to the dialog box that I want to use but the box itself seems to be a bit different compared to the ogirinal one and I am worried that if I move it Ill break it :( . I noticed that when I try to reduce the width of the border box - the right border line disappears / or if I make the box bigger the right border line just does not move /. Is there are a way to fix that if it's safe at all to make the dialog bar smaller or is it gonna cause problems?
  • lefreutlefreut Member Posts: 1,462
    @kaiten I use a fixed sized texture for the dialog box in my mod. It allows to have a smaller hit box otherwise there is a small empty zone around the dialog box that is not clickable. The downside is that you can't change the size only with the edit mode.

    You will have to either change the code to use the original texture that will automatically adapt to any size if you don't care about the non clickable zone (I have the code needed if you want) or update the textures used (box5.MOS which use MOS4290.PVRZ and box5b.MOS which use MOS4291.PVRZ) to the new size you want.
  • kaitenkaiten Member Posts: 19
    edited January 2018
    @lefreut That sounds a bit complicated for me. I guess Ill just leave it like that. Can I ask you something else though. I've tried to use EEUITweaks so I can install individually some of your UI improvements - like the dialog box. But when I started the install process I noticed most of your mini mods/tweaks are skipped and then I read in the EEUITweaks thread that they actually cannot be used for BG EE but only for BG 2 EE :( Does that mean that tweaks like the Improved Record Screen or the old journal cannot be installed individually but only with the full UI mod for BG EE?
  • KilivitzKilivitz Member Posts: 1,459
    lefreut said:

    Kilivitz said:

    By the way, I have a question regarding adorned letters: how exactly do you determine how many lines to indent? Is it related to the width of the body of text? The reason I'm asing is because I've been playing around with your code but whenever I screw around the scrolling text box width, I get results like this:

    @Kilivitz yes it's related to the width of the text element.

    For example if you want to add adorned letter to this:
    text
    {
    	area 96 470 832 224
    	text lua "text_CHAPTERSCROLL"
    	text style normal
    	scrollbar 'GUISCRC'
    }
    You need to add an hidden element that will be used to compute where to split the text. You must give it an unique name, the width is "text element width - 50" (enough space for the adorned letter). Be sure to use the same text style and scrollbar name in both element so that it works properly.
    label
    {
    	name "chapterSplit"
    	enabled "false"
    	area 0 0 782 -1
    	text lua "text_CHAPTERSCROLL:sub(startPos, curPos)"
    	text style normal
    	scrollbar 'GUISCRC'
    }
    And then, in the onOpen, you call the helper function with the text to split and the name of the hidden element:
    computeSplitPosition(text_CHAPTERSCROLL, 'chapterSplit')

    It will set startPos and splitPos which can be used in a list element to draw the adorned letter, the first indented part of the text and the remaining of the text. If splitPos is -1 it means that there is no adorned letter for the first character and in this case you need to fallback to a simple text.

    The labels in the list also use: opacity lua "textOpacity" This is used to bypass a bug where in the first frame, the text is not properly scrolled. The opacity is set to 0 in the onOpen and then to 255 in the scrollbar func so that the text is invisible only the first frame.

    Here is a complete mininal example:
    function makeTable(length)
    	local t = {}
    	for i=1,length do
    		table.insert(t, 1, '')
    	end
    	return t
    end
    
    function computeSplitPosition(str, name)
    	startPos = -1
    	local firstChar = str:len() > 0 and str:byte() or 0
    	if firstChar >= 65 and firstChar <= 90 then startPos = 2
    	elseif firstChar >= 97 and firstChar <= 122 then startPos = 2
    	elseif firstChar == 195 then startPos = 3 end
    	splitPos = startPos
    	curPos = startPos
    	while splitPos ~= -1 do
    		local b = str:byte(curPos)
    		if b == nil then
    			splitPos = curPos
    		elseif b >= 240 then
    			curPos = curPos + 3
    		elseif b >= 224 then
    			curPos = curPos + 2
    		elseif b >= 194 then
    			curPos = curPos + 1
    		elseif b == 10 or b == 32 then
    			splitPos = curPos
    		end
    		Infinity_ScaleToText(name)
    		local x,y,w,h = Infinity_GetArea(name)
    		if h > 50 or curPos > str:len() then break end
    		curPos = curPos + 1
    	end
    end
    
    function UpdateChapterScroll(top, height, contentHeight)
    	textOpacity = 255
    	if(text_CHAPTERSCROLL_auto == 0) then
    		--defer to default scrolling
    		return nil
    	end
    	local dT = Infinity_GetClockTicks() - text_CHAPTERSCROLL_timeStart
    	return (dT * -0.006) + height
    end
    
    menu
    {
    	name 'CHAPTER'
    	align center center
    	ignoreEsc
    	onOpen
    	"
    		textOpacity = 0
    		computeSplitPosition(text_CHAPTERSCROLL, 'chapterSplit')
    	"
    	label
    	{
    		name "chapterSplit"
    		enabled "false"
    		area 0 0 782 -1
    		text lua "text_CHAPTERSCROLL:sub(startPos, curPos)"
    		text style normal
    		scrollbar 'GUISCRC'
    	}
    	list
    	{
    		column
    		{
    			width 100
    			label
    			{
    				enabled "rowNumber == 1"
    				opacity lua "textOpacity"
    				area 0 0 40 38
    				bam INITIALS
    				sequence lua "text_CHAPTERSCROLL:byte(startPos - 1) - 1"
    			}
    			label
    			{
    				enabled "rowNumber == 1"
    				opacity lua "textOpacity"
    				area 44 0 -1 -1
    				text lua "text_CHAPTERSCROLL:sub(startPos, splitPos - 1)"
    				text style normal
    			}
    			label
    			{
    				enabled "rowNumber == 2"
    				opacity lua "textOpacity"
    				area 0 0 -1 -1
    				text lua "text_CHAPTERSCROLL:sub(splitPos + 1)"
    				text style normal
    			}
    		}
    		enabled "splitPos ~= -1"
    		rowheight dynamic
    		hidehighlight
    		table "makeTable(2)"
    		area 96 470 832 224
    		scrollbar 'GUISCRC'
    		scrollbar func 'UpdateChapterScroll'
    		scrollbar hide lua 'text_CHAPTERSCROLL_auto == 1'
    		action
    		"
    			text_CHAPTERSCROLL_auto = 0
    		"
    	}
    	text
    	{
    		enabled "splitPos == -1"
    		area 96 470 832 224
    		text lua "text_CHAPTERSCROLL"
    		text style normal
    		scrollbar 'GUISCRC'
    		scrollbar func 'UpdateChapterScroll'
    		scrollbar hide lua 'text_CHAPTERSCROLL_auto == 1'
    		action
    		"
    			text_CHAPTERSCROLL_auto = 0
    		"
    	}
    }
    @lefreut thanks for the insight and my apologies for not replying sooner. You, sir, are a hero. I'll use your tips and will share the results later.
  • John_DoeJohn_Doe Member Posts: 9
    edited January 2018
    This is a great UI. If I wanted to use the entire UI except for the inventory screen (leave as default or use another), how would I do it?
  • Badger1Badger1 Member Posts: 1
    How do I uninstall this? BitDefender removed the .exe file and I can't move a copy into the game folder! Can I just delete the related folders? Thanks.
  • CahirCahir Member, Moderator, Translator (NDA) Posts: 2,819
    @Badger1 I had the same issue with Bitdefender (but other mod was involved). I suggest changing your AV.
  • lefreutlefreut Member Posts: 1,462
    Nerva said:

    I'm not sure if this is something your mod can do or if I should make it a feature request to Beamdog, but one thing I've noticed is if I go to cast a spell or manually attack, the mouse pointer does not generate a tooltip for the target -- normally, if there's no manual action being done, the mouse pointer tooltip says who the target is and what their health is -- I'd like it if it also did that when targeting a spell or manual attack etc.

    This behavior is hardcoded, you should open a feature request about this.
  • lefreutlefreut Member Posts: 1,462
    kaiten said:

    Can I ask you something else though. I've tried to use EEUITweaks so I can install individually some of your UI improvements - like the dialog box. But when I started the install process I noticed most of your mini mods/tweaks are skipped and then I read in the EEUITweaks thread that they actually cannot be used for BG EE but only for BG 2 EE :( Does that mean that tweaks like the Improved Record Screen or the old journal cannot be installed individually but only with the full UI mod for BG EE?

    @kaiten I start looking at EEUITweaks to see if I can make these components compatible with the other skins.
  • GusindaGusinda Member Posts: 1,915
    Hi @lefreut, love the mod... Using the M_*.lua convention, is there a way to change the portrait name inside the mod rather than see m#gusL.bmp etc, when creating a PC?

    Thanks
    Gus
  • ElensarElensar Member Posts: 3
    edited February 2018
    Hello @lefreut ! First of all thank you for the mod! I registered because even after installing it I see the Quests in the Journal completely empty... Could you (or someone) please help me with this issue? Thank you in advance!!

    Edit: I have to help the Dryads in the beginning and finally I have a Quest. Did it fix by itself?
    Post edited by Elensar on
  • lefreutlefreut Member Posts: 1,462
    Gusinda said:

    Hi @lefreut, love the mod... Using the M_*.lua convention, is there a way to change the portrait name inside the mod rather than see m#gusL.bmp etc, when creating a PC?

    Thanks
    Gus

    My mod detect m# and f# to automatically set the correct gender for the portrait. But you can also use lua code to do that :
    table.insert(portraits, {'gusL', 1}) // 1 for male portrait, 2 for female

    You need to put the portrait in the override folder and not the portraits folder for this to work properly.
  • lefreutlefreut Member Posts: 1,462
    Elensar said:

    Hello @lefreut ! First of all thank you for the mod! I registered because even after installing it I see the Quests in the Journal completely empty... Could you (or someone) please help me with this issue? Thank you in advance!!

    Edit: I have to help the Dryads in the beginning and finally I have a Quest. Did it fix by itself?

    Hello @Elensar :)

    Which game and version ? Do you have a save game that shows the problem ?
  • megamike15megamike15 Member Posts: 2,666
    lefreut said:

    Gusinda said:

    Hi @lefreut, love the mod... Using the M_*.lua convention, is there a way to change the portrait name inside the mod rather than see m#gusL.bmp etc, when creating a PC?

    Thanks
    Gus

    My mod detect m# and f# to automatically set the correct gender for the portrait. But you can also use lua code to do that :
    table.insert(portraits, {'gusL', 1}) // 1 for male portrait, 2 for female

    You need to put the portrait in the override folder and not the portraits folder for this to work properly.
    so if i have my custom portraits structured like F1L M1L it should be able to sort them fine?
  • lefreutlefreut Member Posts: 1,462

    so if i have my custom portraits structured like F1L M1L it should be able to sort them fine?

    No, the '#' need to be there it was not a wildcard in my answer ;) So it should be F#1L or M#1L.

    You can edit the UI.menu if you want to only match 'M' or 'F'.
  • megamike15megamike15 Member Posts: 2,666
    alright. i'll just edit them with # and all should be good.
  • BillyYankBillyYank Member Posts: 2,768

    alright. i'll just edit them with # and all should be good.

    I have a Powershell script that creates a .lua file to do the table insert if your portraits start with M or F.
    https://forums.beamdog.com/discussion/53891/portraits-utility-for-version-2-x-updated-for-version-2-2
  • ElensarElensar Member Posts: 3
    lefreut said:



    Hello @Elensar :)

    Which game and version ? Do you have a save game that shows the problem ?

    Thank you for the quick answer! My version is v2.3.67.3 and my savegame is this. By the way, I am playing it in Spanish, maybe that is causing problems..

    Here is my necromancer: https://ufile.io/hr45m

  • megamike15megamike15 Member Posts: 2,666
    it seems something must have changed as it did not pick up my portraits unless it was in the my documents folder not over ride.
  • lefreutlefreut Member Posts: 1,462

    it seems something must have changed as it did not pick up my portraits unless it was in the my documents folder not over ride.

    You only need to put the portraits in the override folder if you use the lua code to set the gender (manually or with @BillyYank script). Otherwise, you need to put them in the portraits folder.
  • lefreutlefreut Member Posts: 1,462
    Elensar said:

    Thank you for the quick answer! My version is v2.3.67.3 and my savegame is this. By the way, I am playing it in Spanish, maybe that is causing problems..

    Here is my necromancer: https://ufile.io/hr45m

    I have this:


    What's the problem exactly?
  • ElensarElensar Member Posts: 3
    Yes, I have the same. Even after finishing Chapter1 and arriving to Athkatla I have the dryad mission (which is normal) but even if I press the arrows I don't have the Chapter2 or any mission apart from it. Could it be that it is like this?
  • NervaNerva Member Posts: 133
    I have a Github account -- is there a way for it to notify me when a new version has been posted? I see I can "watch" to "Be notified of all conversations" but I'm not sure if "conversations"=versions, or something else.
  • lefreutlefreut Member Posts: 1,462
    Elensar said:

    Yes, I have the same. Even after finishing Chapter1 and arriving to Athkatla I have the dryad mission (which is normal) but even if I press the arrows I don't have the Chapter2 or any mission apart from it. Could it be that it is like this?

    Chapter 2 only starts when you enter the Slums not immediately after you exit the Dungeon.
  • lefreutlefreut Member Posts: 1,462
    Nerva said:

    I have a Github account -- is there a way for it to notify me when a new version has been posted? I see I can "watch" to "Be notified of all conversations" but I'm not sure if "conversations"=versions, or something else.

    Watch will notify for every changes or new issues. But this repository is very quiet, I only commit when I release a new version and there is no active tickets so it should work.
  • ALIENALIEN Member Posts: 1,271
    edited February 2018
    lefreut said:

    Nerva said:

    I have a Github account -- is there a way for it to notify me when a new version has been posted? I see I can "watch" to "Be notified of all conversations" but I'm not sure if "conversations"=versions, or something else.

    Watch will notify for every changes or new issues. But this repository is very quiet, I only commit when I release a new version and there is no active tickets so it should work.
    @Elendar It doesn't work like that. The "Watch" is only for conversations, mentions etc.
  • ALIENALIEN Member Posts: 1,271
    edited February 2018
    @lefreut
    I can think about two solutions:

    1. First solution involves some kind of script that require player to run script and he will be able to know if there is a new version of the mod. It's easy to do but I don't like such approach because it throws additional actions at players back. It might still be better than checking 5 websites and several threads.

    2. Second solution is something which I've recently think about: when player install a mod, mod itself checks for updated version and if it finds it, it overwrite local copy with new version ( but only when there aren't any mod components already installed ).

    I can digg and prepare prof of concept for second solution IF there is interest.
  • lefreutlefreut Member Posts: 1,462
    ALIEN said:

    @Elendar It doesn't work like that. The "Watch" is only for conversations, mentions etc.

    I "Watch" NearInfinity repository and I think I get a mail when there is a new release.
    ALIEN said:

    @lefreut
    I can think about two solutions:

    1. First solution involves some kind of script that require player to run script and he will be able to know if there is a new version of the mod. It's easy to do but I don't like such approach because it throws additional actions at players back. It might still be better than checking 5 websites and several threads.

    2. Second solution is something which I've recently think about: when player install a mod, mod itself checks for updated version and if it finds it, it overwrite local copy with new version ( but only when there aren't any mod components already installed ).

    I can digg and prepare prof of concept for second solution IF there is interest.

    It's not for the same use case. The second solution ensure that when players install a mod, they will get the latest version. But if the mod is already installed, you won't know if there is a new release.
  • ALIENALIEN Member Posts: 1,271
    @lefreut
    Yes, but you don't use "Releases" so no notification.

    Agree, but if the mod is already installed, players tend to ignore new mod releases until they finish playthrough because reinstalling everything might break save game in terms of string/kit/abilities.
    And if they use BWS, new mod versions will be used. I'm not sure that simple 'notifier' is worth the effort.
Sign In or Register to comment.