* 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.
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.
* 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
* 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
* d2player/skilltree: Add label for skillpoints
this also darkens the skillicon if no skillpoint was invested yet.
* d2player/gamecontrols: learnskills <class> should only learn class
specific skills
the character would learn skills of enemies as well, like DiabWall. I
wasn't expecting the command to do that.
* 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
* d2player/inventory.go: fixed gocyclo error, broke up render method to smaller methods
* d2client/game_client.go: suppressing gocyclo error for OnPacketReceived, doesnt make sense to split
* d2remoteclient/remote_client_connection.go: suppressing gocyclo error for decodeToPacket, doesnt make sense to split
* d2dcc/dcc_direction.go: suppressing gocyclo error in generateFrames
* suppressing the magic number lint errors in mapgen, it will get a heavy refactor soon, hopefully...
* adding string token constants for SkillClass
* adding panic on error to left/right skill select render
* fixed cuddle lint error
* fixed unnecessary conversion, unused func param lint errors in dcc_animation.go
* adding comment for skill class tokens
* fixed typo in comment
* removed unused parameter in dcc/dc6 animations
* supress warning about Object.setMode always being passed direction value of 0
* fixed all invalid golint directives
* fixed a couple gocritic lint errors
* d2player/panels: Add close button to hero/inventory/skilltree panel
we require a OnClose callback here, as we need to update the perspective
of the view which is handled by gamecontrols.updateLayout().
* d2player/skilltree: Fix using the same tab label for all tabs
* d2player/game_controls: Fix wrong position of left/right menu
the character would not detect that a click was in a menu and start
walking.
* removed the rest of the magic number errors from d2game
* hotfix for bug i added in map engine test
* removed TODO's from d2mapengine/engine.go, added link to github issue
* removed TODO's and made issues and other minor lint work
* lint cleanup, mostly removing TODO's and putting links to their issues on github
* d2game/d2player/inventory.go: magic number lint cleanup
* d2game/d2player/mini_panel.go: magic number lint cleanup
* d2game/d2player/skill_select_panel.go: lint cleanup
* d2game/d2player/skilltree.go: removed all lint errors
* removed the rest of the magic number errors from d2game
* hotfix for bug i added in map engine test
* all magic numbers removed (excluding mapgen)
* minor refactor of hero_stats_panel to clean up lint errors
* minor edit to skill_select_panel.go
* major refactor of d2game/d2player/game_controls.go, removed most lint errors.
- Clicking the active left/right skill now opens a skill select panel.
Only the available skills for the hero, which are valid for the panel type are shown.
Clicking on a skill from the skill select panel makes it the new active skill for the hero.
- Hovering a skill in the skill select panel shows the skill name +
skill description.
- New command which learns all skills for a specific
class(not persisted to a save file yet) - e.g. `learnskills ama` will learn
skills for the Amazon class.
- Initialize HeroSkill.shallowHeroSkill struct in the hero state factory, so we can use it
when we serialize the HeroSkill to packets/game save files.
- The parsed Skill.ListRow is now a number instead of string.
Co-authored-by: Presiyan Ivanov <presiyan-ivanov@users.noreply.github.com>
* d2ui/UIFrame: Refactor into its own class
it's not useful to have the handling of frames for the
inventory/herostate/skilltree/quest panels individually in each of
those.
* d2ui/button: Fix crash when a buttonlayout was not allowing FrameChange
When AllowFrameChange is false we do not create pressedSurface. So if we
press the button the game will crash.
* d2ui/button: Allow label-only buttons
At least for the skillmenu we need buttons were the graphic size does
not match the buttonsize. So let's render the graphic in there and make
the button label only.
* d2hero/hero_state_factory: Give all heroes their class specific skills
* d2player/gamecontrols: Fix wrong inventory/stats layouts for exp chars
For Druid/Assassin the inventory frame was rendered for a 640x480
resolution. This brings it in line with all other characters.
* d2player: Add inital Skilltree panel
* d2player/game_controls: Enable skilltree
Note here, that the inventory panel and skilltree panel can overlap.
* d2player/skilltree: Add skillicon rendering
Note here, that I couldn't figure out how to render them dark if no
skillpoints are invested.
Signed-off-by: juander <juander@rumtueddeln.de>
* Casting a skill now plays the corresponding overlay(if any).
* Prevent a crash caused by nil pointer in HeroSkill deserialization, happening when
unmarshalling HeroSkill from packets as a remote client.
* Add PlayerAnimationModeNone to handle some of the Skills(e.g.
Paladin auras) having "" as animation mode.
* Joining a game as remote client now waits for map generation to finish
before rendering map or processing map entities. This is temporary hack to prevent the game from
crashing due to concurrent map read & write exception.
* Send CastSkill packet to other clients.
Co-authored-by: Presiyan Ivanov <presiyan-ivanov@users.noreply.github.com>