The blending mode picked by handleStateEffect was being overriden.
CompositeModeSourceOver is the default selection, we do not need to
initialise opts with this.
* character select screen's hero descriptions & hero stat panel
* cinematics names
* buttons on character select screen and "resistances" labels on hero stats panel
Co-authored-by: M. Sz <mszeptuch@protonmail.com>
* Init for gold button and label
* gold button and label in inventory menu
* gold value saved/loaded from player save file
Co-authored-by: M. Sz <mszeptuch@protonmail.com>
* d2ui/tooltip: Make it invisible by default
* d2ui/button: Add GetToggled() method
* d2player/HUD: Add tooltip for minipanel button
* d2ui/button: Add disabled frame to minipanel buttons
* d2ui/widget_group: Add SetEnable method for clickable widgets
* d2player/mini_panel: move menu button here from HUD
* d2ui/button: toggled buttons take preference over disabled buttons
* d2player/help_overlay: Make panel only use widgets
* d2player/hud: Group most widgets into widget group
* d2ui/custom_widget: Allow tooltip to be attached
* d2player/hud: Attach staminaBar tooltip to staminaBar
* d2player/hud: Attach experienceBar tooltip to experienceBar widget
* d2ui/ui_manager: Always draw tooltips last
* d2player/help_overlay: It should be drawn over the HUD
* d2player/globeWidget: Move tooltip here from HUD
* d2core/tooltip: Automatically add tooltips to the uiManager
* d2core/ui_manager: Remove special handling of widgetGroups for rendering
* d2player/help_overlay: Add button to widget group
* d2player/hud: Attack runwalk tooltip to button
* d2player/mini_panel: Add panelButton to its own widget group
* d2core/widget_group: When a clickable is added, it's also added to uiManager
* d2player/globeWidget: make tooltip un/lock on click
* d2player/hud: Add runbutton to widget group
* d2player/mini_panel: Add group for tooltips
this allows us to move the tooltip with the panelbuttons. They can't be
in the general panelGroup as they would all become visible when the
panel is opened.
* d2core/button: Remove debug log when a button with tooltip is hovered
* logger for d2audio & d2map
* logger for d2ui e.t.c
* d2inventory now passes on error messages
* no more importing log in d2core
* implemented #925
* added logger to part of d2networking & fixed "need to be changed" comments
* fixed lints
* fixed errors
Co-authored-by: M. Sz <mszeptuch@protonmail.com>
* 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
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.
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.
* 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
* Return errors for #790
* Fixing lint issues
* Returning nil instead of empty struct pointer
* Removed new hero stat calls as new player requires stats to be passed in. These were using defaults regardless of the save file.
* Removed override on the default to health/mana/experience. These should now result is proper values.
* Removed new hero stat calls as new player requires stats to be passed in. These were using defaults regardless of the save file.
* Removed override on the default to health/mana/experience. These should now result is proper values.
* saving of player should be done on the server. That's also where the loading happens.
* refactor nearly everything, but this time it looks not that bad...
* MAke Linter happy
* Typo... uuups
* d2ui: Add tooltip class
we reimplemented tooltips in several places
(inventory/skill_select_panel). Let's make it its own ui element.
* d2player: Refactor skill_select_panel to use the tooltip class
* d2player: Refactor inventory to use the tooltip class
* Make linter happy
* Make golangci-lint 1.27.0 happy as well
* tooltip: Remove const and rather disable linter