* d2player/hud: Make minipanel button a real ui/button
* d2ui/button: Add implicit tooltips
for now it is only for close buttons.
* d2ui/frame: Add size caluclation
now frame.GetSize() returns meaningful values.
* d2ui/button: Add minipanel button types
* d2ui/hero_stats_panel: Fix cached image being way to big
* d2ui/widget_group: Fix widget groups size calculation
* d2ui/widget_group: Add debug rendering
* d2ui/widget_group: SetVisible() now sets the visibility of the group object
* d2player: Refactor mini_panel
we converted all elements to widgets. Thus rendering from game_controls
is no longer neccessary.
* d2ui/button: Add disabled color to layouts
* d2player/gamecontrols: temp hide minipanel when in esc menu
* d2ui/widget_group: Add OffsetPosition() method
* d2player/mini_panel: Implement moving of minipanel
this only occours when other panels are opened.
* d2player/minipanel: Fix inv/skilltree/char closebuttons
these would screw up the moving of the mini panel.
* Fix linter
* d2player/minipanel: Add tooltips to buttons
* d2player/skilltree: Fix icon rendering
* d2ui/skilltree: Don't render availSPLabel
this is handled by the ui_manager now.
* d2ui/custom_widget: Allow them to be cached into static images
* d2player/hero_stats_panel: Remove render() function from game_controls
all ui elements are now grouped into a WidgetGroup, thus rendering is
done by the ui manager.
* d2player/hero_stats_panel: Remove unnecessary widgets from struct
we don't need to store them in the HeroStatsPanel struct anymore as they
are completly handled by the uiManager.
* d2ui/widget_group: Remove priority member
this is already defined by the BaseWidget.
* d2ui/widget: Move uiManager.contains() to the baseWidgets
this method makes more sense on a widget anyways.
* d2ui/widget: Add methods to handle widget hovering
* d2ui/custom_widget: Require define width/height
since the custom render() method can do whatever, we need the user to specify
the width/height such that GetSize() calls are meaningful.
* d2ui/widget: Allow widgets to return the uiManager
* d2player/HUD: Refactor health/mana globe into its own widget
* d2player/hud: Refactor load()
seperate each type of loading into its own method.
* d2player/HUD: Move stamina/exp bar into widgets
* d2player/HUD: Refactor left/right skills into widget
* d2ui/custom_widget: cached custom widgets should use widget.x/y
since we render to an image, we use widget.x/y to position the cached
image.
* d2player/HUD: User cached custom widget for all static images
* Feat(KeyBindingMenu): Adds dynamic box system with scrollbar
* Feat(Hotkeys): WIP Adds a lot of things
* Feat(KeyBindingMenu): WIP Adds logic to binding
* Feat(KeyBindingMenu): Fixes assignment logic
* Feat(KeyBindingMenu): Adds buttons logic
* Feat(KeyBindingMenu): Fixes sprites positions+add padding to Box
* Feat(KeyBindingMenu): Adds label blinking cap
* Feat(KeyBindingMenu): Removes commented func
* Feat(KeyBindingMenu): Fixes lint errors and refactors a bit
* Feat(KeyBindingMenu): Corrects few minor things from Grave
* Feat(KeyBindingMenu): removes forgotten key to string mapping
if we clicked twice on the single player button of the main menu, then
the first click would set the current screen to the
character_select. The second click directly after that will be
handled by the character_select screen. It's OnLoad() method was not
called yet, which initialized all widgets. The click handler of
character_select screen referenced the nil scrollbar and crashes.
this simplifies error handling statements all over the ui code. Before
we had to write:
if err := foo.Render(target); err != nil {
return err
}
which simplifies now to foo.Render(target)
the uiManager now handles every element of the ui, so we don't need to
render elements manually in game_controls. Now we can also use
widget_groups to simplify handling the opening/closing of the panel.
when we ran the command before we would always throw away old skill
objects and create a new one. This is nasty if we have a pointer to the
old object. By throwing it away we have to update all these pointers.
Now we rather increase the skillpoint, if the hero already has this
skill.
this also adds missing methods to elements not implementing widget. Note
here that we do not enable sprite and label, as this would produce a
crazy amount of linter warnings due to render() requiering error
handling then, which non of the callers handle. Since we remove the
render calls later anyways, we can postpone this static check for now.
this allows us to groups screens together, such that they can be
de-/activated by de-/activating the group instead of every ui element by
hand.
Before we were deactivating buttons and stopped rendering to deactivate ui
elements. This tied the renderer to these elements.
* Escape in MainMenu cause game exit
* Escape in MainMenu cause game exit
* Shortcuts in d2 main menu
* Shortcuts in Main Menu
* Shortcuts in Main Menu
* hotfix for "Shortcuts in Main Menu"
* hotfix for "Shortcuts in Main Menu" - removet some lint error
* fix lint errors
Co-authored-by: M. Sz <mszeptuch@protonmail.com>
Co-authored-by: gravestench <dknuth0101@gmail.com>
* d2player/game_controls: Refactor HUD into it's own class
game_controls slowly becomes a superclass that does too many things.
So move HUD into it's own class. This is the first step of getting the
renderer out of game_controls (#798)
* d2ui/tooltip: Allow background box to be disabled
* d2ui/tooltip: Make GetSize() a public function
* d2player: Move const from game_controls to hud
* d2player: Fix missing entity hover tooltip
* Remove d2config.Config singleton
* refactored config file bootstrap
* `d2loader.Loader` adds the config directories during init
* `d2asset.AssetManager` loads the config file during init
* mpq verification logic removed from d2config; this is done by d2loader
* added `errorMessage` to `d2app.App` for setting the error message for the error screen.
* fixed loader test
* refactored logging in d2config, d2record, and d2asset
* asset manager, record manager, and file loader now utilitize d2util.Logger
* added colored logging to d2util.Logger (excluding windows platforms)
* removed mpq file verification from d2config; d2loader handles this
* record loaders now use the record manager's logger for printing info
* added command line argument for setting log level (`--loglevel 4`, `-l4`, or `-l 4`
* added `LogLevel` parameter to config file
* default log level will show errors, warnings, and info log messages
* specifying log level as an argument overrides setting from config file
* fixed log level tests
* Move engine initialization to d2app
* adding debug print of error returned from `App.Run`
* adding ClampInt utility function to d2math
* cleaned up argument parsing in app.go, dedicated server no longer starts a renderer
Co-authored-by: gravestench <dknuth0101@gmail.com>