Skip to content

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

1679111220

Comments

  • AstroBryGuyAstroBryGuy Member Posts: 3,437
    edited November 2017
    That's the nice thing about GitHub's versioning features. You can tag new versions for release, but the link to GitHub is always just "github.com/[username]/[repository_name]/releases/latest/".

  • AxieAxie Member Posts: 23
    edited November 2017
    Just wanted to say — thank you, @lefreut!

  • lefreutlefreut Member Posts: 1,462
    edited December 2017
    New version \o/

    v2.9:
    - Re-add Tutorial button for BGEE.
    - Fix for empty item description.
    - Add missing files.
  • EtaminEtamin Member Posts: 830
    I just noticed your mod is in BWS, but only in ENG option. Can you allow it to install in other languages too?
  • lefreutlefreut Member Posts: 1,462
    Etamin said:

    I just noticed your mod is in BWS, but only in ENG option. Can you allow it to install in other languages too?

    I don't use BWS and I don't really know how it works so I don't know what I have to do to allow other languages. I'm not even sure if it has the latest version of the mod. And the BGEE and SoD skin variants are probably not available either.
  • Hi this is probably a silly question but I've never used mods before and I couldn't find a thread about it, how exactly do I install this mod? I really need this mod to fix the journal glitch.
  • lefreutlefreut Member Posts: 1,462
    @comicsandslushies To install, extract the contents of the archive into your game folder (the folder which contains the chitin.key file) and then double-click setup-LeUI.exe and follow the instructions on screen.
  • NervaNerva Member Posts: 133
    Is it possible to add tooltips for spells, at least on the spellbook screen? I seem to remember the old UI, when you hovered over a spell, it would say the name of it, but the current UI doesn't do that.
  • lefreutlefreut Member Posts: 1,462
    @Nerva The UI element used to display the spells can't have tooltips. I opened a ticket about it but I have no feedback from the devs if it's something they want to fix in the future.

    It may be possible to rewrite the code to fix the problem. So far, I didn't did it because it's a lot of work. But the last time I played, I also miss this feature so I will look at it again. After all it will not be the first time I completely rewrite a part of the UI to bypass an engine limitation :p
  • lefreutlefreut Member Posts: 1,462
    Holiday release \o/

    v3.0 is out (v1.7 for the BG1EE skin and v1.5 for the SoD skin). :)

    I usually release all three mods at the same time. I don't know what's best, one post here linking to the other topics or one post in each topic ? I don't want to spam with almost the same content in three topics.

    This new release adds one new features:

    The combat log remains scrollable after you die so now you can see what kills you :p


    Adorned letters have been improved.

    Non-ascii letters are excluded and no longer try to use non-existent texture:


    Fix the texture for the letter 'A' (top before / bottom after):


    Accented letters (for example 'É' and 'À') will now properly have adorned letters (can be seen if you play in French):



    And last, I backport most of the changes from patch 2.5 to prepare for its future release. The mod is not fully compatible with 2.5 because there are UI regressions (https://support.baldursgate.com/issues/34061 and https://support.baldursgate.com/issues/34514) that I hope will be fixed before the 2.5 final release.
  • AndreaColomboAndreaColombo Member Posts: 5,533
    While I’m sure @Kilivitz has this thread subbed, I’ll namedrop him anyway to make sure he sees your work on these features; it is relevant to our own project ;)
  • lefreutlefreut Member Posts: 1,462

    While I’m sure @Kilivitz has this thread subbed, I’ll namedrop him anyway to make sure he sees your work on these features; it is relevant to our own project ;)

    It's out of topic, but I always thought that @Kilivitz was a girl !
  • AstroBryGuyAstroBryGuy Member Posts: 3,437
    Minor suggestion - unify the version numbers across all skins.
  • tortuosittortuosit Member Posts: 63
    edited January 2018
    I'm ready to rebuild a new override folder from scratch, because mine is messed up. Now I'm not too much into BG modding business and forgot a lot. How do I do a clean start? Remove old override, install mods one by one?

    I want to install Stratagems, NPC Project etc. - Does setup-leui.exe also start other installers if it sees them in the BG directory? I was under the impression it did touch Stratagems components, not sure.

    EDIT: I have removed override and started your installer. On character creation I have that multi portrait picker, but no choice of gender. All characters are flagged as female after all. I consider to re-install BG1 cleanly, then install leUI. Hmm.
  • ThelsThels Member Posts: 1,422
    If you just clean out the override folder, your dialog.tlk will still be messed up.

    Best thing is to uninstall and do a complete new installation. Then, copy the new installation somewhere else and mod the copy. That way, whenever you want to mod the game again, you simply make another copy of the original installation. Also, if a new update comes out, it will only update the clean install and not your modded game.

    If you have BG1+SoD from Steam or GOG, be sure to run modmerge before installing any mods (but on the copy, not the original).

    As for installations touching each other, WeiDU checks to make sure if all WeiDU installers are at the exact same version. If they are not, it will check which WeiDU installer is the newest version, and update all the other installers to that version.
  • lefreutlefreut Member Posts: 1,462
    tortuosit said:

    EDIT: I have removed override and started your installer. On character creation I have that multi portrait picker, but no choice of gender. All characters are flagged as female after all. I consider to re-install BG1 cleanly, then install leUI. Hmm.

    I you only install my UI mod, you should have this screen:


    The gender choices is merged with the portrait picker. The buttons are below the selected portrait.

    If you want to use another portrait picker, it will probably interact badly with them as my mod automatically skips the gender choices screen :/
  • tortuosittortuosit Member Posts: 63
    Thanks guys, I was able to cleanly install anything.
  • KilivitzKilivitz Member Posts: 1,459
    lefreut said:

    It's out of topic, but I always thought that @Kilivitz was a girl !

    I understand why you'd think that what with my predilection for women-depicting avatars but yeah, I'm a guy!

    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:







    P.S.: Happy New Year, everyone
  • lefreutlefreut Member Posts: 1,462
    edited January 2018
    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
    		"
    	}
    }
    Post edited by lefreut on
  • tortuosittortuosit Member Posts: 63
    In the portrait picker there are quite some black entries, even though the names follow the same conventions. Sometimes two filenames only differs in a counter, but only one is displayed. I have a rather large portrait folder with 540 entries in it. All files 208616 bytes. What are typical problems here? Is it maybe some rendering error on engine side?
  • PeccaPecca Member Posts: 2,217
    lefreut said:

    @Nerva The UI element used to display the spells can't have tooltips. I opened a ticket about it but I have no feedback from the devs if it's something they want to fix in the future.

    It may be possible to rewrite the code to fix the problem. So far, I didn't did it because it's a lot of work. But the last time I played, I also miss this feature so I will look at it again. After all it will not be the first time I completely rewrite a part of the UI to bypass an engine limitation :p

    I use list element for each known spell in my mod. It's dirty, but it works well, and it shows tooltips. You can alternatively set an empty label somewhere and make it show a spell name on hovering on spell icon (same as how showing spell description work in an unmodded game).
  • pacodawgpacodawg Member Posts: 8
    Hi, lefreut!

    Have been thoroughly enjoying your UI, and i can't play without it now. I do miss the Unhide Chargen Options, and tried to implement it by tweaking the UI.menu as described here:

    https://forums.beamdog.com/discussion/59647/mod-unhide-chargen-options

    but all i could get was a blank box on the class select options (i realize not all of the lines in your UI.menu were the same as original UI.menu, so i tried to tweak accordingly... in many different ways).

    If you have any advice or guidance or have a tweak to unhide those options, please let me know!
    If not, I will happily continue enjoying the heck out of your mod.

    Thanks!
  • lefreutlefreut Member Posts: 1,462
    tortuosit said:

    In the portrait picker there are quite some black entries, even though the names follow the same conventions. Sometimes two filenames only differs in a counter, but only one is displayed. I have a rather large portrait folder with 540 entries in it. All files 208616 bytes. What are typical problems here? Is it maybe some rendering error on engine side?

    Does it happens only in my mod or also in unmodded game or with another portrait picker?

    Since 2.0, the game is very picky about the naming convention.
  • lefreutlefreut Member Posts: 1,462
    pacodawg said:

    Hi, lefreut!

    Have been thoroughly enjoying your UI, and i can't play without it now. I do miss the Unhide Chargen Options, and tried to implement it by tweaking the UI.menu as described here:

    https://forums.beamdog.com/discussion/59647/mod-unhide-chargen-options

    but all i could get was a blank box on the class select options (i realize not all of the lines in your UI.menu were the same as original UI.menu, so i tried to tweak accordingly... in many different ways).

    If you have any advice or guidance or have a tweak to unhide those options, please let me know!
    If not, I will happily continue enjoying the heck out of your mod.

    Thanks!

    My mod heavily change the character creation code and the Unhide Chargen Options mod is quite complex as it has to bypass engine limitation. I can look to see if I can make both work together.
  • NervaNerva Member Posts: 133
    LoL, that's funny, I submitted a feature request to Beamdog about having a message when overriding a keyboard shortcut, but maybe that was a problem with this mod, so either way thanks for fixing it.
  • lefreutlefreut Member Posts: 1,462
    Nerva said:

    LoL, that's funny, I submitted a feature request to Beamdog about having a message when overriding a keyboard shortcut, but maybe that was a problem with this mod, so either way thanks for fixing it.

    It's also a problem in unmodded game so the ticket is valid. I often look at feature requests to see if they can be done using UI modding ;)
  • NervaNerva Member Posts: 133
    edited January 2018
    I just spotted a bug with your mod (or at least the BG1EE "blue" variant of it) -- go to the Character Record screen for a character and then change to a different character -- it updates the center panel with the new character's portrait, class, level, etc. but the left and right panels are still for the first character.
  • pacodawgpacodawg Member Posts: 8
    thanks so much for all your work lefreut! enjoying my playthrough with your UI!
Sign In or Register to comment.