What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

[OLD] An Overview of Exilebuddy's GUI API Design

Status
Not open for further replies.

pushedx

Well-Known Member
Joined
Sep 24, 2013
Messages
4,252
Reaction score
290
This thread will cover the new design for Exilebuddy's GUI API. The GUI API provides the means to interact with Path of Exile's in-game GUI.

The original design was first introduction around August 2014, along with the 1.3 update. That design modeled each client GUI as its own system, and had very little code reuse. At that time, the GUI system the client was using wasn't understood well, so a lot of things were hacked together and patched as they broke as time went along. This design worked for a while, but due to constant client changes over time, it grew to an unmanageable state. With the compiler changes that accompanied the Ascendancy expansion, a better solution was pursued.

The new design models common controls first, then each client GUI system, reusing them where possible. As more time was spent understanding the GUI system the current client is using, a lot of similarities were discovered that helped lead to the creation of a system that would significantly reduce how much underlying code there was while at the same time add missing functionality, reduce the overhead of that functionality, and provide an easier means of future maintenance.

New GUI Manager

There's a new GUI manager class that will hold all relevant GUI functionality. In the old design, most GUI stuff was simply thrown into the global LokiPoe namespace, so things were pretty unorganized.

The new GUI manager class provides a better means to work with the GUI as well. In the past, certain issues arose from the implementations used for trying to interact with more complex GUIs. For example, when resizing the client, the tab list control on the Stash/Guild GUI would mess up due to scaling, and the functions for choosing a tab from the list would break.

A new addition is the identification of some common controls used in the game. In the old design, an inefficient method was used to try and identify some controls, which resulted in a lot of maintenance when the client changed. This system has been greatly simplified, and should now allow a much easier means of common control identification moving forward.

Common Controls

The common controls implement shared behavior that other GUI systems can reuse. In the old design, this functionality would be duplicated across each GUI system, and some systems didn't even implement them. More common controls are being worked on, but for now these are the ones that currently exist.

DockedWindowControlWrapper

The DockedWindowControlWrapper is for docked GUIs that are displayed on the left or right sides of the screen. These all have a title bar, a close button, then the fancy logo and side borders.

This control exposes:
Title - The title of the window
Close() - A function to close the window, by clicking on the X. This helps avoid the current issue of having to close all windows.

WindowControlWrapper

The WindowControlWrapper is for "floating" windows that are not docked on the left or right sides of the screen. These all have a title bar, a close button, then the fancy logo and side borders.

This control exposes:
Title - The title of the window
Close() - A function to close the window, by clicking on the X. This helps avoid the current issue of having to close all windows.

VerticalScrollBarControlWrapper

The VerticalScrollBarControlWrapper is an internal class used to interop with vertical scroll bars. This is helpful for managing any type of GUI that has a variable amount of content that must be scrolled though. One of the newest additions to this control is the ability to "fast scroll", which will be very noticeable on large stash tab lists.

TabControlWrapper

The TabControlWrapper models a simple tab control used in the game. Tab controls are used in a number of places, and this helps simplify a lot of logic. For example, the Trade GUI is a tab control that holds a Trade control on each tab. The World GUI is a tab container that nests another tab container which then holds the map for the current act/difficulty.

This control exposes:
CurrentTabName - The current tab name.
TabNames - A list of tab names.
IsOnFirstTab - A bool if the current tab is the first tab.
IsOnLastTab - A bool if the current tab is the last tab.
PreviousTabKeyboard() - A function to change to the previous tab using the keyboard. This is for stash tabs mostly as the other tab controls don't support input actions.
NextTabKeyboard() - A function to change to the next tab using the keyboard. This is for stash tabs mostly as the other tab controls don't support input actions.
SwitchToTabKeyboard() - A function to switch to a tab either by tab index or tab name using the keyboard.
SwitchToTabMouse() - A function to switch to a tab either by tab index or tab name using the mouse. This function supports "tab lists" with help of the VerticalScrollBarControlWrapper for fast tab switching.

ComboBoxWrapper

The ComboBoxWrapper is an internal class used to model a combobox control. It will be used for accurate selection of the league at the character selection screen, as there have been reported issues regarding that in the past.

InventoryControlWrapper

The InventoryControlWrapper is the best example of why the massive internal GUI changes were done. This control models an inventory control. Inventory controls are used in many GUIs, and are typically a grid shaped display (sell, main inventory, rewards) although single item inventories also exist (equipped items, Divination trader, Cadiro, etc...)

In the old design, each GUI system implemented its own limited set of functions for interacting with the inventory. This created a massive amount of code that had to be maintained and updated when anything changed that affected all of them. In the new design, all GUIs that have an inventory now implement an InventoryControlWrapper to expose shared functionality. This means one set of code is now used for all inventory related operations. This alone has reduced internal GUI code by over 5000 lines of code as a result!

One of the biggest changes to the API design is the use of local item ids now. These were previously not exposed, due to a lot of implementation limitations but they are now fully supported. Users refer to items by id now, and can lookup an item by id to know if it exists or not to figure out if an operation has completed. The previous method of checking for an item with the specific BaseAddress still works, but is less efficient.

This control exposes:
Inventory - The Inventory object of the GUI. The Inventory class holds items and offers other features such as figuring out if an item can fit.
IsItemTransparent() - A function to know if an item has been moved into a trade inventory and is now a shadow copy.
GetItemCost() - A function to get the cost of an item in a sell inventory.
ViewItemsInInventory() - A function to selectively mouse over all items in an inventory to build their display tooltips. This is for sell inventories so GetItemCost can work.
Pickup() - A function to pickup an item to the cursor from an inventory.
FastMove() - A function to perform a fast move operation, control click, on an item in the inventory. This can be used for selecting rewards, buying items, or stashing/trading.
MergeStack() - A function to merge the cursor with another item in the inventory.
SplitStack() - A function to split an item in the inventory into a stack on the cursor.
UseItem() - A function to right click an item to use it. This mechanic has changed in that it no longer applies the item, as another function does that.
BeginApplyCursor() - A function to being applying an item on the cursor to other items in the inventory. Shift use is now supported.
EndApplyCursor() - A function to end applying an item, by clearing key states.
ApplyCursorAt() - A function to apply the cursor to an item at a specific location. This is because an item's id will change after it is modified.
ApplyCursorTo() - A function to apply the cursor to an item with a specific id.
PlaceCursorInto() - A function to place the item in the cursor into a specific position in the inventory. The mechanic for placing the item has been updated to be nearly instant now and not drag anymore.
UnequipSkillGem() - A function to unequip a skillgem from an item in the inventory. This means you can now unequip skillgems from non-equipped items!
EquipSkillGem() - A function to equip a skillgem to an item in the inventory. This means you can now equip skillgems to unequipped items!

TradeControlWrapper

The TradeControlWrapper models a trade control. The trade control is used on the NPC Sell GUI as well as inside a tab in the player Trade GUI. Once again, because of this reuse, internal code is greatly simplified now.

This control exposes:
AcceptButtonText - The text of the accept button.
IsConfirmLabelVisible - A bool if the confirm label is visible.
ConfirmLabelText - The text of the confirm label.
InventoryControl_OtherOffer - An InventoryControlWrapper for working with the items in the other offer inventory.
InventoryControl_YourOffer - An InventoryControlWrapper for working with the items in your offer inventory.
Accept() - A function to accept the trade.
Cancel() - A function to cancel the trade.

Because of the new common controls, the functionality to mouse over all player traded items is exposed though the ViewItemsInInventory function in the InventoryControlWrapper!
 
Last edited by a moderator:
InGameState GUIs

This section is to cover the new GUI systems for the InGameState. This section will be under construction a bit as a lot of things are still being changed. However, it will provide a good overview of the new design in place now.

BanditPanel

IsOpened - A bool to know if the GUI is opened.
HelpBandit() - A function to click the help button on the bandit panel.
KillBandit() - A function to click the kill button on the bandit panel.

CadiroOfferUi

IsOpened - A bool to know if the GUI is opened.
WindowControl - A WindowControlWrapper to work with the window
InventoryControl - An InventoryControlWrapper to work with the inventory of this GUI.
Accept() - A function to accept the offer.
Decline() - A function to decline the offer.
GetItemCost() - A function to parse the item cost from the GUI.

CardTradeUi

IsOpened - A bool to know if the GUI is opened.
WindowControl - A WindowControlWrapper to work with the window
InventoryControl - An InventoryControlWrapper to work with the inventory of this GUI.
Activate() - A function to click the activate button.

ChatPanel

IsOpened - A bool to know if the GUI is opened (for typing, not chat being visible).
CurrentChatLines - The number of current chat lines. This can be used to quickly know if chat has changed since you last checked it.
ActiveCharacterNames - A list of active character names in chat.
Messages - A list of current chat messages.
ToggleChat() - A function to toggle chat.
Chat() - A function to send a chat message. No more Type/Paste required!
Commands - A class that wraps simple chat commands, such as dnd. Others will be added later.

ContextMenu

IsOpened - A bool to know if the GUI is opened.
TitleString - The title of the context menu.
Close() - A function to close the context menu.
VisitHideout() - A function to click on the visit hideout option if it exists.
Trade() - A function to click on the trade option if it exists.

CursorItemOverlay

This new GUI system provides a very efficient means of working with items on the cursor. The old design did not handle this well at all, but the new design will be used to improve a lot of logic.

IsOpened - A bool to know if the GUI is opened (an item is on the cursor).
Mode - The item mode of the cursor item. This can be a physical item for move operations, a virtual item for using or trade pickups.
Item - The item on the cursor.
Inventory - The inventory the item on the cursor is in. If you are using an item, this is the item where the source item resides!

DebugOverlay

IsOpened - A bool to know if the GUI is opened.
IsShowingFull - A bool for if the debug overlay is in the full display mode.
IsShowingMinimal - A bool for if the debug overlay is in the minimal display mode.
LatencyText - The text of the latency graph.
LatencyValues - A list of the current latency values.
FpsText - The text of the FPS graph
FpsValues - A list of the current fps values.
FrameTimeText - The text of the frame time graph.
FrameTimeValues - A list of the current frame time values.

GlobalWarningDialog

This new GUI system manages the global warning dialog. In the old design, only a few of these were accounted for in LokiPoe..

IsOpened - A bool to know if the GUI is opened.
TitleText - The title of the dialog.
BodyText - The body of the dialog.
CancelText - The text of the cancel button.
ActionText - The text of the action button.
ConfirmDialog() - A function to confirm the dialog by clicking on the action button.
CancelDialog() - A function to cancel the dialog by clicking on the cancel button.
IsTradingItemWithCosmeticsOverlayOpen - Detection of this specific overlay.
IsTradingItemWithGemsOverlayOpen - Detection of this specific overlay.
IsVendoringItemWithGemsOverlayOpen - Detection of this specific overlay.
IsPassiveWarningOverlayOpen - Detection of this specific overlay.
IsPvpOnlyOverlayOpen - Detection of this specific overlay.
IsPassiveTreeWarningOverlayOpen - Detection of this specific overlay.
IsDestroyItemWarningOverlayOpen - Detection of this specific overlay.

GuildStashUi

TabControl - A TabControlWrapper for working with the GUIs tab control.
WindowControl - A DockedWindowControlWrapper for working with the GUI's window.
InventoryControl - An InventoryControlWrapper for working with the current tab's inventory.
StashTabInfo - Info about the current stash tab (name, readonly, premium, public, etc..).

InstanceManagerUi

IsOpened - A bool to know if the GUI is opened.
WindowControl - A WindowControlWrapper for working with the GUI's window.
InstanceCount - The number of instances listed.
JoinNewInstance() - A function to join a new instance.

Support for joining existing instances will be added later.

InventoryUi

IsOpened - A bool to know if the GUI is opened.
WindowControl - A DockedWindowControlWrapper for working with the GUI's window.
InventoryControl_Head - An InventoryControlWrapper for this inventory.
InventoryControl_Neck - An InventoryControlWrapper for this inventory.
InventoryControl_Chest - An InventoryControlWrapper for this inventory.
InventoryControl_PrimaryMainHand - An InventoryControlWrapper for this inventory.
InventoryControl_PrimaryOffHand - An InventoryControlWrapper for this inventory.
InventoryControl_SecondaryMainHand - An InventoryControlWrapper for this inventory.
InventoryControl_SecondaryOffHand - An InventoryControlWrapper for this inventory.
InventoryControl_LeftRing - An InventoryControlWrapper for this inventory.
InventoryControl_RightRing - An InventoryControlWrapper for this inventory.
InventoryControl_Gloves - An InventoryControlWrapper for this inventory.
InventoryControl_Belt - An InventoryControlWrapper for this inventory.
InventoryControl_Boots - An InventoryControlWrapper for this inventory.
InventoryControl_Main - An InventoryControlWrapper for this inventory.
InventoryControl_Flasks - An InventoryControlWrapper for this inventory.

MapDeviceUi

IsOpened - A bool to know if the GUI is opened.
WindowControl - A WindowControlWrapper for working with the GUI's window.
InventoryControl - An InventoryControlWrapper to work with the inventory of this GUI.
Activate() - A function to click the activate button.

NotificationPanel

Temporarily Removed

MasterDeviceUi

IsOpened - A bool to know if the GUI is opened.
WindowControl - A WindowControlWrapper for working with the GUI's window.
InventoryControl - An InventoryControlWrapper to work with the inventory of this GUI.
Activate() - A function to click the activate button.

NpcDialogUi

IsOpened - A bool to know if the GUI is opened.
Title - The title of this GUI.
SpeechText - The text of the NPC speech (after choosing something to talk about).
DialogDepth - The depth of the GUI (1 is choosing menus, 2 is speech or windows)
DialogEntries - A list of dialog entries.
GetDialogEntryByText() - A function to get a dialog entry by text.
Goodbye() - A function for choosing this dialog option.
PurchaseItems() - A function for choosing this dialog option.
SellItems() - A function for choosing this dialog option.
DailyMission() - A function for choosing this dialog option.
CanConverse() - A function for checking if a dialog option can be conversed (daily missions).
HasConversed() - A function for checking if a dialog has already been talked about.
Converse() - A function for talking to the NPC about something.
Continue() - A function to finish the current NPC speech.

PurchaseUi

IsOpened - A bool to know if the GUI is opened.
WindowControl - A WindowControlWrapper for working with the GUI's window.
TabControl - A TabControlWrapper for working with the GUIs tab control.
InventoryControl - An InventoryControlWrapper for working with the current tab's inventory.

QuestTrackerOverlay

IsOpened - A bool to know if the GUI is opened.
QuestTrackerEntries - A list of the quest text shown in the tracker.

QuickFlaskHud

IsOpened - A bool to know if the GUI is opened.
InventoryControl - An InventoryControlWrapper for working with the current GUI's inventory.
UseFlaskInSlot() - Uses a flask in a specific slot.

ResurrectPanel

IsOpened - A bool to know if the GUI is opened.
Resurrect() - A function to resurrect using the best available method.
ResurrectToTown() - A function to resurrect to town.
ResurrectToCheckPoint() - A function to resurrect to the check point.

RewardUi

IsOpened - A bool to know if the GUI is opened.
WindowControl - A WindowControlWrapper for working with the GUI's window.
InventoryControl - An InventoryControlWrapper for working with the current tab's inventory.

SacrificeUi

IsOpened - A bool to know if the GUI is opened.
WindowControl - A WindowControlWrapper for working with the GUI's window.
InventoryControl - An InventoryControlWrapper for working with the current tab's inventory.
Activate() - A function to activate the current GUI.

SellUi

IsOpened - A bool to know if the GUI is opened.
WindowControl - A WindowControlWrapper for working with the GUI's window.
TradeControl - A TradeControlWrapper for working with the GUI's trade control.

SkillBarHud

Slot() - A function to return a Skill in a particular 1-based index slot.
Slot1 - Returns the Skill in this slot.
Slot2 - Returns the Skill in this slot.
Slot3 - Returns the Skill in this slot.
Slot4 - Returns the Skill in this slot.
Slot5 - Returns the Skill in this slot.
Slot6 - Returns the Skill in this slot.
Slot7 - Returns the Skill in this slot.
Slot8 - Returns the Skill in this slot.
SetSlot() - A function to set a Skill to a specific slot.
SetSlot1() - A function to set a Skill to a specific slot.
SetSlot2() - A function to set a Skill to a specific slot.
SetSlot3() - A function to set a Skill to a specific slot.
SetSlot4() - A function to set a Skill to a specific slot.
SetSlot5() - A function to set a Skill to a specific slot.
SetSlot6() - A function to set a Skill to a specific slot.
SetSlot7() - A function to set a Skill to a specific slot.
SetSlot8() - A function to set a Skill to a specific slot.
ClearSlot() - A function to clear a specific slot.
ClearSlot1() - A function to clear a specific slot.
ClearSlot2() - A function to clear a specific slot.
ClearSlot3() - A function to clear a specific slot.
ClearSlot4() - A function to clear a specific slot.
ClearSlot5() - A function to clear a specific slot.
ClearSlot6() - A function to clear a specific slot.
ClearSlot7() - A function to clear a specific slot.
ClearSlot8() - A function to clear a specific slot.
IsSkillSelectorOpen - A bool if the skill selector popup is open.
Skills - An ienumerable of Skills of the player.
BeginUseAt() - A function to being using a skill at a location.
BeginUse() - A function to being using a skill.
BeginUseOn() - A function to being using a skill on a network object.
Use() - A function to use a skill.
UseAt() - A function to use a skill at a location.
UseOn() - A function to use a skill on a network object.
CanUse() - A function to return if a slot can be used.
CanUseSlot1 - Returns if the specific slot can be used.
CanUseSlot2 - Returns if the specific slot can be used.
CanUseSlot3 - Returns if the specific slot can be used.
CanUseSlot4 - Returns if the specific slot can be used.
CanUseSlot5 - Returns if the specific slot can be used.
CanUseSlot6 - Returns if the specific slot can be used.
CanUseSlot7 - Returns if the specific slot can be used.
CanUseSlot8 - Returns if the specific slot can be used.
LastBoundMoveSkill - Returns the Skill that is the last bound Move skill.

SkillGemHud

IsOpened - A bool to know if the GUI is opened.
AreIconsDisplayed - A bool to know if icons are displayed.
HandlePendingLevelUps() - A function to level or dismiss the displayed icons.

SkillsPanel

Temporarily Removed

SocialPanel

Temporarily Removed

SplitStackUi

IsOpened - A bool to know if the GUI is opened.
RemainingQuantity - An int for how many items will remain after the split.
SplitQuantity - An item for how many items will be split.
DecreaseSplitQuantity() - A function to decrease the split quantity.
IncreaseSplitQuantity() - A function to increase the split quantity.
Accept() - A function to accept the split.
Cancel() - A function to cancel the split.

StashUi

IsOpened - A bool to know if the GUI is opened.
WindowControl - A DockedWindowControlWrapper for working with the GUI's window.
TabControl - A TabControlWrapper for working with the GUIs tab control.
InventoryControl - An InventoryControlWrapper for working with the current tab's inventory (non-currency tabs).
StashTabInfo - Info about the current stash tab (name, readonly, premium, public, etc..).
InventoryControl_BlacksmithsWhetstone - An InventoryControlWrapper for the specific inventory (currency only tabs)
InventoryControl_ScrollOfWisdom
InventoryControl_ChaosOrb
InventoryControl_ArmourersScrap
InventoryControl_MirrorOfKalandra
InventoryControl_OrbOfAlchemy
InventoryControl_OrbOfChance
InventoryControl_OrbOfRegret
InventoryControl_OrbOfTransmutation
InventoryControl_OrbOfAlteration
InventoryControl_OrbOfScouring
InventoryControl_ExaltedOrb
InventoryControl_RegalOrb
InventoryControl_OrbOfAugmentation
InventoryControl_PortalScroll
InventoryControl_GlassblowersBauble
InventoryControl_GemcuttersPrism
InventoryControl_ChromaticOrb
InventoryControl_OrbOfFusing
InventoryControl_JewellersOrb
InventoryControl_DivineOrb
InventoryControl_BlessedOrb
InventoryControl_CartographersChisel
InventoryControl_ScrollFragment
InventoryControl_TransmutationShard
InventoryControl_AlterationShard
InventoryControl_AlchemyShard
InventoryControl_VaalOrb
InventoryControl_Utility
InventoryControl_Misc1
InventoryControl_Misc2
InventoryControl_Misc3
InventoryControl_Misc4
InventoryControl_Misc5

Due to how currency tabs are implemented, each item has their own inventory, and the mechanics for working with this tab is different than a normal stash tab.

TimerHud

IsOpened - A bool to know if the GUI is opened.
Text - A string to get the current timer's text.

TradeUi

IsOpened - A bool to know if the GUI is opened.
WindowControl - A WindowControlWrapper for working with the GUI's window.
TabControl - A TabControlWrapper for working with the GUIs tab control.
TradeControl - A TradeControlWrapper for working with the current tab's trade control.

WorldUi

IsOpened - A bool to know if the GUI is opened.
WindowControl - A DockedWindowControlWrapper for working with the GUI's window.
CurrentDifficultyTabName - The name of the current difficulty selected.
CurrentActTabName - The name of the current act selected.
GoToHideout() - A function to go to the hideout.
TakeWaypoint() - A function to take a waypoint.
 
Last edited:
LoginState

This section is to cover the new GUI systems for the LoginState. This section will be under construction a bit as things get properly documented.

CreateCharacterState

This section is to cover the new GUI systems for the CreateCharacterState. This section will be under construction a bit as things get properly documented.

PreGameState

This section is to cover the new GUI systems for the PreGameState. This section will be under construction a bit as things get properly documented.

SelectCharacterState

This section is to cover the new GUI systems for the SelectCharacterState. This section will be under construction a bit as things get properly documented.
 
Last edited:
Status
Not open for further replies.
Back
Top