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>
* Implement ServerFullPacket including server side handling and a place holder client side.
* Making suggested edits to move to an empty packet
Co-authored-by: Stephen Horan <steve.horan@theatsgroup.com>
* 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
* 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.
* My brain hurts, here is a broken dedicated server
* somewhat stablised the server
* Made it less shouty, and added channel
* Split the DS functionallity from the main.go file
* Split the DS functionallity from the main.go file, and remembered to add the server file
* My brain hurts, here is a broken dedicated server
* somewhat stablised the server
* Made it less shouty, and added channel
* Split the DS functionallity from the main.go file
* Split the DS functionallity from the main.go file, and remembered to add the server file
* Added Stable Dedicated Server Functionallity
Co-authored-by: gravestench <dknuth0101@gmail.com>
* 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