Skip to content

The New UI System: How to Use It

1234568

Comments

  • lefreutlefreut Member Posts: 1,462
    edited November 2019
    ***
    Post edited by lefreut on
  • lefreutlefreut Member Posts: 1,462
    edited November 2019
    ***
    Post edited by lefreut on
  • gunmangunman Member Posts: 215
    Thanks, I will try. I thought all MOS files are replaceable with PNG files.
  • ImionaImiona Member Posts: 30
    How can i align the Left and Right SIdebars Horizontal in the UI. Menu? Thx
  • lefreutlefreut Member Posts: 1,462
    edited November 2019
    ***
    Post edited by lefreut on
  • ImionaImiona Member Posts: 30
    Thx :)
  • kaitenkaiten Member Posts: 19
    edited January 2018
    Hello guys, I have a question ! I am trying to move my dialog bar to another place and make it a bit smaller. When I enable the edit mode with F11 there are 5 movable elements - one is the text, another one is the border. I am trying to figure out what the other 3 do. They all have similar width but diffferent height. One is at the top of the dialog box by default, it is very tin and its type is handle. The other 2 are at the bottom of the dialog box and their type is button. Does anyone know what these 3 bars are for ? / I need the info so I can decide how important their precise location is / Thanks in advance !
    Edit:I found out what all the bars are for ^^
    Post edited by kaiten on
  • Dameon2Dameon2 Member Posts: 46
    edited March 2018


    WIP EET Version of Swankified Hud


    (and questions)



    Hey All. A while ago I created a mod called Swankified Hud that was an extension on an old version of Dragonspear UI ++. So I'm working on a revamped Swankified UI for EET that doesn't require Dragonpear UI ++ (which isn't compatible with EET).

    I got a few questions. Mainly, I rebuilt the Journal to be like a regular menu, but I can't figure out how to pause the game when it opens like the other menus. ie priest and mage scroll, inventory, and character sheet.
    The other question is, I'm a bit confused about how to grey out or hide certain buttons when certain menus come up. I think because of the menu bar I set up I have to change that around quite a bit so it doesn't look broken when the clock disappears when a menu opens and stuff like that (see pics below).

    If you guys are interested in checking the UI I'm working on out I'll post a few screens here so you can see.
    I elected to stick with the original aspect ratio of the popup menus with the exception of the map, for scaling purposes, and so I could reuse stock SOD assets. The reason I made the map larger is that I find that bgtWorldmap mod's map is too large in scale and hard to navigate in a square viewport. ANYWAY Let me know what you think!

    Screenshots












  • rutherfordrutherford Member Posts: 13
    Hello, I am trying to modify the UI.menu for Dragonspear UI++ version 2.2, to do two things:

    1. Reinstate the blue background for magical items in the mods two quickloot modes (expert and advanced).

    2. Allow the dialogue box to be closed with the spacebar.

    I have the ui.menu open but am unable to figure out what to change. Help please?

    (I have asked in the mod's thread, but also wanted to ask here in hopes of getting help.)




    In the photo above the arrows on the bottom row right should have a blue background, as they are not yet identified.
  • AdulAdul Member Posts: 2,002
    edited October 2018
    I have a list element in my code that has its row height set to dynamic, and I want one of its rows to change its height depending on some variables. So I thought I'd try to add a label to it and set its height from a function, but I'm not sure how it can be done, or if it can be done at all.

    So I'm trying to do something like this, except, unfortunately, this produces an error:

    list { column { width 100 label { area 0 0 10 getLabelHeight() } } rowheight dynamic } function getLabelHeight() { return 200 }

    Edit: I've also tried giving the label element a name and then using Infinity_SetArea() to change its height, but for some reason that didn't work either.

    Edit 2: The same goes for Infinity_SetOffset() and adjustItemGroup(). Unfortunately, it seems that when inside a list, labels and handles just will not let you change their dimensions or position.

    Does anyone have any advice on this, please?
    Post edited by Adul on
  • BubbBubb Member Posts: 1,005
    edited September 2018
    Bah, nevermind. I should really test everything I am spouting. Maybe lefreut can help you. :p
  • lefreutlefreut Member Posts: 1,462
    @Adul You can't call a function to set the area. And as you found, SetArea/SetOffset don't work for elements inside lists.

    The only thing you can do is set the height to -1, it will adjust the height depending on the content. I don't know if it will be enough with what you want to do.
  • AdulAdul Member Posts: 2,002
    edited October 2018
    lefreut said:

    @Adul You can't call a function to set the area. And as you found, SetArea/SetOffset don't work for elements inside lists.

    The only thing you can do is set the height to -1, it will adjust the height depending on the content. I don't know if it will be enough with what you want to do.

    I've come up with two possible methods that I haven't tested yet, but neither would be very accurate, and they're both rather messy:

    The first is to create a text field and add as many lines to it as needed to set the row to the approximate desired height.

    The second method is to create many separate label elements with gradually incremental heights (e.g. increment the height of each one by 5 or 10 pixels) and enable only the one that's closest to the required height.

    Needless to say, neither of these methods is nearly as good as it would be to be able to set an element inside the list to the exact required height, but unfortunately, I haven't been able to come up with a way to do that.
  • AdulAdul Member Posts: 2,002
    edited October 2018
    Adul said:

    The first is to create a text field and add as many lines to it as needed to set the row to the approximate desired height.

    Actually, it turns out this method can be pretty accurate if used with a font style that has a point size of 1. There could still be an unintended couple-of-pixels-tall variation in height, but otherwise, it works like a charm.
    Post edited by Adul on
  • PeccaPecca Member Posts: 2,218
    lefreut said:

    @Adul You can't call a function to set the area.

    I handled this when I was trying to dynamically hide unused quickloot slots in my mod. What I did was to assign a lua function to a text attribute of a zero-sized button. In that function there are conditions that set areas of quickloot slots. It seems that the function inside text attribute is called all the time.

  • AdulAdul Member Posts: 2,002
    Do we know of any function to detect whether the game currently has focus (e.g. whether or not it's alt-tabbed out)?

    I have a function that crashes the game when it's called while the game doesn't have focus, so I think I'll need some way to detect focus in order to fix it.
  • BubbBubb Member Posts: 1,005
    @Adul: From what I can tell, there isn't a function to detect window focus. In fact, the game engine itself doesn't even keep track of its focus; the only thing the engine does is set the global volume to 0 when it loses focus, and restores the volume to 100 when it regains focus.

    I suppose if you could read the global volume, (which is separate from the volume sliders), you could technically tell if the window has focus, but of course there isn't anyway to read that value. :cry:
  • AdulAdul Member Posts: 2,002
    edited February 2019
    @Bubb Thanks for the answer! Luckily, I've realized I didn't need to have my elements call that function all the time, so this way I can get around the crash issue.

    (By the way, it's the Infinity_GetArea function specifically that seems to crash the game when it's called while the game has no focus. Which might be a bug.)
    Edit: Actually, I was wrong. I'm not entirely sure what causes the crash.
    Post edited by Adul on
  • lefreutlefreut Member Posts: 1,462
    @Adul how do you get the crash?
  • AdulAdul Member Posts: 2,002
    edited February 2019
    @lefreut I've figured it out, the crash happens when using a 1-point-tall font for any text on screen while the game doesn't have focus. I wrote about it in a bit more detail here:
    https://forums.beamdog.com/discussion/comment/1046868/#Comment_1046868
  • PathologicPathologic Member Posts: 6
    Is it possible to create extra buttons that function as action button, more specifically duplicates of the "smart spell" buttons where you can set any learned spell to them?

    Looking in the default ui.menu it appears that the action bar is automatically populated, I assume the game determines what belongs in any given button based on class. However, I know that people managed to create a permanant thieving button; I wonder if there is a similar way to replicate that for the spell slots?

    Context: I find caster characters very unweildy on tablet. I don't have access to a pc to use hotkeys or mods or write ai scripts to bind stuff. I can access and edit baldur.lua and any overrides, which means i can see the ui.menu.

    I think the ideal would be to have a column of 10 or so buttons to the right of the left side menu all acting as dynamic spell slots like the ones on the action bar, but even if anyone has an idea of how to hardcode a button to cast a specific spell that would work too!

  • PathologicPathologic Member Posts: 6
    Pathologic wrote: »
    Stuff
    Thought I'd reply to myself incase anyone else is looking for an answer. Maybe its already in this thread but i didnt know what to look for.

    If you get a basic copy of the UI.menu file into your override directory as described in this thread and search for "touchui", there are TONNES of options that still exist in the ui.menu file but have functionally been commented out (the line is something akin to "enabled e:not(touchui)"). Delete that line for any functionality you want.

    This seems like a very strange decision since bluetooth exists, to require deleting that many lines to get back basic keyboard functionality, but whatever, alteast I didnt have to merge it in from a desktop version! I feel like the game should have the option on touch devices though, "Do you want to enable options for keyboard and mouse input?"
  • SirickSirick Member Posts: 94
    edited October 2019
    A question, is there any way to increase the scale of the boarding around the portraits on the right? So that the boarding can fit around the upscaled portrait images.

    yulwdkdg8y2j.png

    Keep in mind, I've only a vague idea on messing around with this stuff, so if it is doable, please explain as if to a child.
    Post edited by Sirick on
  • fluke13fluke13 Member Posts: 399
    Hello, I've finally started to look into UI modding, the one part of modding I've never looked at before.

    The ability to edit, redesign and add new art is really fun and so simple... but, I'm really struggling with anything else.

    I've looked on every site I can think of for help, tutorials etc. - can anyone point me in the right direction?

    Is there an IESDP equivalent for actions you perform in LUA?

    To be more specific, I'm trying to add a game expansion to iwdee (like Black Pits) - I'd like to be able to do exactly what Black Pits does.. i.e. create a party, make a certain movie play, then start a new game in a new area.

    Any help at all or just pointing me to where I can learn about scripting buttons or LUA functions (specific to IE engine), would be really appreciated.
  • fearlessfearless Member Posts: 40
    Is there an IESDP equivalent for actions you perform in LUA?

    A list of Infinity Lua Functions can be found here at the EEex Docs: EE Game Lua Functions - most are self describing, others might be less intuitive, but they haven't been expansively documented yet.
    create a party, make a certain movie play, then start a new game in a new area.
    @swit is looking to do something that is kind of related to your query, using EEex: https://forums.beamdog.com/discussion/comment/1102538/#Comment_1102538

    You can also have a look at the EEex functions already created and listed on the EEex Docs: https://eeex-docs.readthedocs.io - the documentation is always work in progress, with information been added and edited as the project continues.

    EEex can be downloaded from: https://github.com/Bubb13/EEex
  • switswit Member, Translator (NDA) Posts: 495
    edited November 2019
    fearless wrote: »
    Is there an IESDP equivalent for actions you perform in LUA?

    To be more specific, I'm trying to add a game expansion to iwdee (like Black Pits) - I'd like to be able to do exactly what Black Pits does.. i.e. create a party, make a certain movie play, then start a new game in a new area.

    Any help at all or just pointing me to where I can learn about scripting buttons or LUA functions (specific to IE engine), would be really appreciated.
    this can be already done without EEex. You can find the example code in EET: https://github.com/K4thos/EET/blob/master/EET/lib/bg2_GUI.tph
    It will be easier for you to compare vanilla BG2:EE UI.MENU file with the one patched by EET and analyse what's different. Also start the game and press "Select campaign" button to see how it works in-game. In short EET replaces functions that initialize campaign startEngine:OnSoAButtonClick(true) / startEngine:OnToBButtonClick(true) / startEngine:OnTBPButtonClick(true) with a function introduced in SoD: startEngine:OnCampaignButtonClick('X',true) (where X matches the CAMPAIGN.2DA row label)
    This way you can adjust data like starting location, XP etc.
    Post edited by swit on
  • fluke13fluke13 Member Posts: 399
    @fearless @swit

    Thanks very much both - I felt like I'd hit a bit of a wall in UI modding, now I've got plenty to learn :)
  • kungfuhobbitkungfuhobbit Member Posts: 169
    edited April 2020
    Thankyou so much @Dee, I was easily able to increase game portrait boxes!

    I get an error immediately when I start the game when using block comments to remove Set Party AI and Select All buttons in the bottom right.
    The error is only cosmetic and the buttons are removed
    8ehexy5q4107.png
    [[-- button
    {
    area 0 110 72 55
    enabled "worldScreen == e:GetActiveEngine() and showJournal == 0 and not rightSidebarSmallButton"
    toggle aiButtonToggle
    bam GUILS10
    sequence 10
    tooltip lua "getPartyAITooltip()"
    clickable lua "sidebarsGreyed ~= 1"
    action
    "
    game:ToggleAI()
    "
    }
    button
    {
    area 0 165 72 55
    enabled "worldScreen == e:GetActiveEngine() and showJournal == 0 and not rightSidebarSmallButton"
    bam GUILS10
    sequence 13
    tooltip lua "Infinity_FetchString(10485)"
    clickable lua "sidebarsGreyed ~= 1"
    action
    "
    game:SelectAll()
    "
    actionDbl
    "
    game:CenterOnGroupLeader()
    "
    }
    button
    {
    area 4 170 30 44
    enabled "worldScreen == e:GetActiveEngine() and showJournal == 0 and rightSidebarSmallButton"
    toggle aiButtonToggle
    bam GUILS10
    sequence 16
    tooltip lua "getPartyAITooltip()"
    clickable lua "sidebarsGreyed ~= 1"
    action
    "
    game:ToggleAI()
    "
    }
    button
    {
    area 36 170 30 44
    enabled "worldScreen == e:GetActiveEngine() and showJournal == 0 and rightSidebarSmallButton"
    bam GUILS10
    sequence 17
    tooltip lua "Infinity_FetchString(10485)"
    clickable lua "sidebarsGreyed ~= 1"
    action
    "
    game:SelectAll()
    "
    actionDbl
    "
    game:CenterOnGroupLeader()
    "
    } --]]
    }
    menu
    {
    name 'RIGHT_SIDEBAR_HIDDEN'
    align right top
    ignoreEsc
    label
    {
    area 0 0 80 1
    ...
  • MilesTegMilesTeg Member Posts: 12
    edited May 2020
    1) You can use the common CTRL+Z key command to "Undo" your last resize/move while in "F11" UI-Edit-Mode!

    2) "Some smaller elements, though, may need to be enlarged before they can be moved. If you try hovering over the version number, for instance, you’ll notice that no matter where you put your mouse, you can’t get the entire rectangle to be blue.
    So before we move it, we’ll need to make it bigger."

    If your upper and lower borders turn green - DON'T click on it! Otherwise you'll "lock" this object (it becomes a yellow line/unmoveable/ height=0 - see screenshot).
    Use CTRL+Z to easily restore it this.

    3ix757dk6chw.png

    Not sure if this has been mentioned before (lefreut posts?) but it's worth mentioning again ;)
Sign In or Register to comment.