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
* d2records/: suppressing function legnth lint errors for record loaders
* d2gamescreen/character_select.go: broke up OnLoad method to reduce complexity
* d2ui/button.go: suppressing funlen lint error, can't reduce function size
* 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
* removed dupl lint errors in d2compression/huffman.go
* remove duplicate code for set/unique item properties
This is a more involved edit. I've added a `PropertyDescriptor`
which is a common struct that should have existed already. The
`PropertyDescriptor` is used to generate property instances, and is common
to item affixes, set items, sets, unique items, and runewords.
This was all to remove duplicate code in d2item/
* removed duplicate code for rare item affixes