1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-13 03:00:42 +00:00
Commit Graph

1130 Commits

Author SHA1 Message Date
gravestench
d6c9748fef
refactored logging in d2loader, d2record, and d2asset (#898)
* 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
2020-11-02 21:23:07 -05:00
gravestench
b052006922
add comment explaining significance of input handler return value (#895) 2020-11-02 01:14:03 -08:00
Julien Ganichot
004a3faf7d
Misc(CONTRIB): Adds Ganitzsh as a contributor (#896) 2020-11-02 01:13:46 -08:00
Julien Ganichot
8365400ff5
Feat(KeyMapping): Adds a configurable keymap to GameControls, resolves #793 (#893)
* Feat(KeyMapping): Adds a configurable keymap to GameControls + Updates help overlay to use it

Co-authored-by: gravestench <dknuth0101@gmail.com>
2020-11-01 19:43:23 -08:00
Julien Ganichot
1f2771e8bc
Resolves #874 and #892 (#894)
* 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>
2020-11-01 16:05:50 -08:00
gravestench
33cf06732e
Revert "Misc(CodeCleanup): Moves engine initialization to d2app #874 (#890)" (#891)
This reverts commit 40879db32f.
2020-11-01 12:12:45 -08:00
Julien Ganichot
40879db32f
Misc(CodeCleanup): Moves engine initialization to d2app #874 (#890)
Move engine initialization out of main and into d2app
2020-11-01 11:16:15 -08:00
gravestench
aa680d030f
ServerFull Packet Implementation (#889)
* 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>
2020-11-01 08:26:15 -05:00
Stephen Horan
4dd69e7709
Health/Mana/Exp load values from save file #815 (#886)
* 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.
2020-10-31 23:59:24 -04:00
Gürkan Kaymak
2c6c54acce
removed global variable for singleton game server (#888) 2020-10-31 23:58:55 -04:00
Thomas Christlieb
40cc421f51
Saving and loading game data, Fixes #868 #799 (#883)
* 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
2020-10-31 14:30:08 -04:00
Stephen Horan
fb8e25ebdb
Code Cleanup for #790 (#870)
* Return errors for #790

* Fixing lint issues

* Returning nil instead of empty struct pointer
2020-10-30 20:19:06 -04:00
juander-ux
4506380dbb
d2player/game_controls: Fix health/mana globe text locking (#882)
when you click on a either of the globes the values should appear
above them.
2020-10-29 09:59:07 -04:00
juander-ux
b1058d6085
Add labels for skill levels (#881)
* 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.
2020-10-29 09:50:15 -04:00
Tim Sarbin
ce36dec7f8
Fix background music crash issue. (#880)
* Added useful config error panic. Added window title to panic window.

* Fixed background music crash.
2020-10-28 22:34:47 -04:00
Tim Sarbin
a9d832b539
Added useful config error panic. Added window title to panic window. (#879) 2020-10-28 21:42:03 -04:00
Zaprit
f98e1267fa
Dedicated server (#871)
* 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>
2020-10-28 21:03:30 -04:00
Tim Sarbin
1a6c6b8e9f
Add panic screen (#878)
* Add panic screen

* Fixed lint error. Updated all module references
2020-10-28 21:02:12 -04:00
Thomas Christlieb
2d4c79484f
Animation mode for player should be checked (and possible changed) every tick. It needs to be changed when the player stops or starts running while follwing a path (single click, don't hold the mouse at target). Fixes #837 (#875) 2020-10-28 15:11:41 -04:00
gravestench
6e31cfb52a
migrate to ebiten v2.0 API (#860)
* migrate to ebiten v2.0 API

* fixed lint errors
2020-10-28 14:17:42 -04:00
juander-ux
79c147866e
Tooltip refactor (#872)
* 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
2020-10-28 13:54:55 -04:00
gravestench
4a62101b96
adding the rest of the data dictionary loaders (#869) 2020-10-28 13:52:15 -04:00
gravestench
f0890d83fa
add notice about linting, remove broken badge (#857) 2020-10-27 08:46:41 -04:00
gravestench
7c8583d7d4
github workflows should now fail on lint errors (#855) 2020-10-26 16:16:59 -07:00
gravestench
33368e5aa3
Lint cleanup funlen (#854)
* d2ui/button.go: refactored button state prerender to fix funlen lint error

* d2player/help/help.go: break up Load method to reduce complexity

* d2game/d2player/game_controls.go: refactored renderHUD method, fixed funlen lint error

* d2player/skilltree.go: fixed funlen lint error

* map_engine_test.go: fixed funlen lint error
2020-10-26 15:55:13 -07:00
Zaprit
7d5cd10850
Added an OnKeyUp method to the main menu to emulate retail behavior (#853)
any keyboard event will navigate from trademark screen to the main menu
2020-10-26 12:50:38 -07:00
Gürkan Kaymak
ec9c0c3d95
fixes #767, implemented deepCopy for the dcc_animation and dc6_animation (#852) 2020-10-26 09:13:08 -04:00
gravestench
7f19f7e970
another bugfix (#851) 2020-10-26 05:00:30 -07:00
gravestench
0bd774aaa6
fixed some of the remaining funlen lint errors (#850)
* 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
2020-10-26 04:39:10 -07:00
gravestench
1046fb6137
bugifx (#849) 2020-10-26 04:35:23 -07:00
gravestench
dd0c148784
fixed all gocognit lint errors (#848)
* reduced ItemFactory.NewItem complexity

* d2compression/wav.go: suppressing gocognit lint error, suppressing gocyclo lint error

* d2maprenderer/renderer.go: reducing complexity of rnderPass2 and renderPass3
2020-10-26 03:53:42 -07:00
gravestench
aa9f6be411
Lint cleanup gocyclo (#847)
* 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
2020-10-26 02:24:04 -07:00
gravestench
6f8b43f8d6
Various lint error fixes and suppressions (#846)
* 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
2020-10-26 02:04:50 -07:00
gravestench
622186e350
fixed 'dupl' lint errors (#845)
* 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
2020-10-26 00:38:18 -07:00
gravestench
815cfa09cb
fix all gosec lint errors (#844) 2020-10-25 23:38:15 -07:00
gravestench
060abdc3bd
removed globals, added nolint to tests that used globals (#843) 2020-10-25 21:06:00 -07:00
gravestench
359bcd6ef8
fixed all goimports lint errors (#842) 2020-10-25 20:55:46 -07:00
gravestench
13d5e1c4de
removed all 'lll' (line length) lint errors (#841) 2020-10-25 18:11:04 -07:00
gravestench
37235282e0
removed all 'deadcode' lint errors (#840) 2020-10-25 18:01:57 -07:00
gravestench
49c1985dcc
removed all 'structcheck' and 'unused' lint errors (#839) 2020-10-25 17:49:41 -07:00
gravestench
42a48fe03a
removed all 'whitespace' lint errors (#838) 2020-10-25 17:33:04 -07:00
gravestench
02acba231b
removed all 'wsl' lint errors (#836) 2020-10-25 17:28:40 -07:00
gravestench
1ce2af19bf
removed all 'gocritic' lint errors (#835) 2020-10-25 17:03:23 -07:00
gravestench
6b5c2a1fc5
removed all 'govet' type lint errors (#834) 2020-10-25 16:50:13 -07:00
gravestench
a1380bc264
removed all golint lint errors (#833)
* removed all 'golint' type lint errors
2020-10-25 16:23:55 -07:00
gravestench
025ee94e50
Removed all TODO's in project (#831)
* removed the rest of the magic number errors from d2game

* hotfix for bug i added in map engine test

* removed all TODO's in project, made issues on github for each one
2020-10-25 18:36:12 -04:00
Julien Ganichot
8e957c17fe
fix(run/walk): changes invalid surface for toggled state (#816) 2020-10-25 15:12:55 -04:00
Thomas Christlieb
2b469d302b
fix miniPanelGameMenu wrong rendering (#810) 2020-10-25 13:37:07 -04:00
Thomas Christlieb
bb9789d700
Red stamina bar (#809)
* Fixed a typo. Make stamina bar red wehan below 25%

* make linter happy
2020-10-25 13:15:28 -04:00
juander-ux
bbc716f682
Add close buttons to all panels (#808)
* 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.
2020-10-25 10:54:39 -04:00