Skip to content

Is it possible to assign one class' interface to that of another class?

Contemplative_HamsterContemplative_Hamster Member Posts: 844
edited April 2018 in UI Modding
Is it possible to assign one class' interface to another class? Like, assigning the cleric's or cleric/mage's panel to a single-class mage for that sweet Turn Undead button (which does nothing in itself, of course)?
Post edited by Contemplative_Hamster on

Comments

  • BubbBubb Member Posts: 1,000
    edited April 2018
    Short answer: no. Long answer: no*

    The actionbar is one of the most hardcoded things in the UI. At the moment, there is nothing you can do in UI.MENU to alter the actionbar, or what appears in it. If you were *really* determined to change buttons around in the actionbar, you could technically re-implement it from scratch, though this is monumental task in of itself. Basically, you would be creating a custom actionbar, hiding the real actionbar, and simply mimicking the buttons of the real action bar. It would be more akin to macro buttons that link back to the original actionbar, but it would have the advantage of allowing complete customization. New buttons could be added, buttons could be removed, buttons could be moved around, etc.

    Edit: You would have to overcome some very big obstacles in order to create a completely custom actionbar... it is just the only way I can think of doing what you want. Of course you can add new buttons next to the actionbar very easily, if that also works.

    This is, of course, strictly talking about the UI side of things. I am not sure if you could implement what you want in some other part of the engine.
  • Contemplative_HamsterContemplative_Hamster Member Posts: 844
    @Bubb . I see. Thank you. One more question if I may:

    If I were to obtain the cleric/mage action bar for my mage by other means - a dual-classed cleric 2/specialist wizard X (dual classing into a kit thanks to Kjeron's mod) - is there a way to reassign what the Turn Undead button does?
  • BubbBubb Member Posts: 1,000
    @Contemplative_Hamster Yes, it should be easy enough to reassign the Turn Undead button's action. You can do this by checking the tooltip of the correct button, making sure it's in the Turn Undead state, and then executing an alternate behavior if everything checks out. Here's a quick example of how to do it:

    1. Search UI.MENU for WORLD_ACTIONBAR
    2. Scroll down until you see this code:
    button { area 231 1 52 52 actionBar 3 enabled "buttonArray:GetButtonEnabled(3)" tooltip lua "actionBarTooltip[3]" action "buttonArray:OnLButtonPressed(3)" actionAlt "buttonArray:OnRButtonPressed(3)" }
    3. Replace that code with this code:
    button { area 231 1 52 52 actionBar 3 enabled "buttonArray:GetButtonEnabled(3)" tooltip lua "actionBarTooltip[3]" action " if actionBarTooltip[3] == 'F4 : Turn Undead' then Infinity_DisplayString('Overriden Behavior!') -- Do whatever you want your custom action to be here. else buttonArray:OnLButtonPressed(3) end " actionAlt "buttonArray:OnRButtonPressed(3)" }
    It's even possible to check against the current player's class behavior overriding. Here's an example where only Cleric / Mages' Turn Undead button is overridden:
    button { area 231 1 52 52 actionBar 3 enabled "buttonArray:GetButtonEnabled(3)" tooltip lua "actionBarTooltip[3]" action " if actionBarTooltip[3] == 'F4 : Turn Undead' then Infinity_UpdateLuaStats() if characters[id].class == 'Cleric / Mage' then Infinity_DisplayString('Overriden Behavior!') -- Do whatever you want your custom action to be here. else buttonArray:OnLButtonPressed(3) end else buttonArray:OnLButtonPressed(3) end " actionAlt "buttonArray:OnRButtonPressed(3)" }
  • lefreutlefreut Member Posts: 1,462
    Be aware that this will not work if you change the languages or change the key binding.
  • BubbBubb Member Posts: 1,000
    edited April 2018
    @lefreut
    Thanks; that's a good point! Here's a version of the first example which should work with any game language (and having the keybindings text disabled in Baldur.lua), just to show that it is possible:
    button { area 231 1 52 52 actionBar 3 enabled "buttonArray:GetButtonEnabled(3)" tooltip lua "actionBarTooltip[3]" action " tooltipString = actionBarTooltip[3] firstColonIndex = tooltipString:find(':', 1, true) if firstColonIndex == nil then firstColonIndex = -1 end actionbarButtonText = tooltipString:sub(firstColonIndex + 2, #tooltipString) if actionbarButtonText == Infinity_FetchString(4974) then Infinity_DisplayString('Overriden Behavior!') -- Do whatever you want your custom action to be here. else buttonArray:OnLButtonPressed(3) end " actionAlt "buttonArray:OnRButtonPressed(3)" }
    It should work, (in Baldur's Gate II, at least), as the string at strref 4974 is the Turn Undead label. We are also cutting off the key binding text, to make sure we are only comparing the actual button label.
  • TVKRgntv1985TVKRgntv1985 Member Posts: 1
    Can someone tell me where in the file UI.MENU (Near Infinity) i can find the code string for the "hide in the shadows" key? I want to change something there...
  • EndarireEndarire Member Posts: 1,512
    @Contemplative_Hamster
    Years later, the 2.6 version of EEex allows hotbar UI customization - not merely switching one class's hotbar layout for another.
  • AquadrizztAquadrizzt Member Posts: 1,065
    edited June 2023
    Following up on this thread, I have found a (somewhat hacky) way of getting access to Thief skill buttons on other characters within PSTEE.
    comd09kpa2qi.png

    I have done this by having the special ability button pull up the Thief context menu rather than the special abilities menu.

    My question is whether there is a way to *only* display the 3 Thief skills (or some other subset of the bar).
    Post edited by Aquadrizzt on
Sign In or Register to comment.