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

550 Commits

Author SHA1 Message Date
Eric Wohltman
12ddfdf2f8
Update to Go 1.14 (#429)
* Update to Go 1.14

* Fix workflow dependency installation
2020-06-23 23:53:21 -04:00
Eric Wohltman
c7291b6f59
Linter (#427)
* Add golangci-lint config yaml and GitHub Actions workflows

* Update to Go 1.14
2020-06-23 22:15:31 -04:00
Eric Wohltman
d134c5226d
Update go.mod (#426)
Remove replace directive
2020-06-23 21:41:49 -04:00
David Carrell
37ae98d81b
Abstract away remaining ebiten references (#409)
* 337 - remove ebiten from character selection

* 337 - abstract d2input away from ebiten implementation

* WIP 337 - remove ebiten use from d2ui

* 337 - fix accidental left->right change

* 337 - fix ui button selection bugs

* 337 - fix textbox bugs

* 337 - fix scrollbar bugs

* 337 - address PR comments

* 337 - fix invalid hero selection bug

Co-authored-by: David Carrell <carrelda@Davids-MacBook-Pro.local>
2020-06-23 18:12:08 -04:00
Ripolak
f729ff6101
Feature/load misc items (#424)
* Add InventoryItemMisc struct

* Add GetMiscItemByCode function

* Implement InventoryItem interface for InventoryItemMisc

* Add rings and amulets to the example items loading.

* Fix Y of LeftHand and RightHand equipment slots.

* Add "Ripolak" name to CONTRIBUTORS

* Remove double item
2020-06-23 15:28:03 -04:00
danhale-git
897de61006
Automap corrections (#422)
* Added automap.go stub

* Handle errors in original AutoMap.txt file

* Completed AutoMapRecord struct and comments

* AutoMap loader implemented

* Update from base repo

* Cel1-4 fields replaced with a slice

* Commented out Type fields as they aren't used
2020-06-23 14:51:07 -04:00
Intyre
f119d1197c
Fix mpq wav decompression and profiler (#423)
* Fix for mpq wav decompression

* Fix for profiler
2020-06-23 14:49:46 -04:00
Ripolak
2332bd7b58
Feature/player equipment ui (#419)
* Add basic EquipmentSlot struct

* Add Load function to EquipmentSlot

* Move EquipmentSlot struct to inventory_grid.go

* Add equipmentSlots arg to ItemGrid struct

* Add basic rendering of equipment slots.

* Change rendering of equipment slots to simply use their static x and y

* Add ChangeEquippedSlot function

* Add initialization to all equipped slots types.

* Fix Y locations of equipment slots

* Move default equipment slots to a genEquipmentSlotsMap function.

* Change Item to item

* Fix coordinates

* Change usage of string to EquippedSlotType when dealing with different slots in rendering.

* Fix import error

* Remove neck example

* Add loading sprites of equipped items.

* Clean code in Inventory rendering

* Clean code in Inventory rendering

* Clean code in Inventory rendering

* Change default items that get rendered.

* Change default items that get rendered.

* Add width and height to EquipementSlot struct

* Fill in width and height to current equipment slots.

* Fix Y setting of equipment slots

* Rename variables for clean code.

* Change handling nil itemSprite to condition instead of loop return.

* Split Render function to 2 functions.

* Add TODO

* Change comment to start with capital I
2020-06-23 14:12:30 -04:00
Maxime Lavigne (malavv)
b640385623
Handles Click and Hovers on most game control elements (#413) (#418)
* Handles Click and Hovers on most game control elements.

Creates a new type of "Actionable" which includes most of the bottom
bar elements. Then handles both "Click" and "Hover" into a separate
handler function.

At the moment, hover does nothing but routes correctly. Click logs
the corresponding actionable.

Known issues:
  - Not capturing button press on click (meaning player will move).
  - Basic touch detection, could be a more fancy QuadTree like struct.
  - Since the visual frames used are not just the actionable, the actual
    x, y coordinates of the actionable need to be entered statically. Changes
    in resolution would probably affect this.

* Renaming vars for code consistency and readability
2020-06-23 12:28:05 -04:00
Gürkan Kaymak
7f4db3b874
Added call to loading SuperUniques data dict (#415)
* added SuperUniques data dictionary

* added a call to LoadSuperUniques() method from the main

* added a call to LoadSuperUniques() method from the main
2020-06-23 09:30:39 -04:00
Gürkan Kaymak
1cc5b0bfbd
added SuperUniques data dictionary (#414) 2020-06-23 09:12:35 -04:00
nicholas-eden
dd21809288
Pull go-astar code into the repo, improve perf (#411)
Copied go-astar into d2common/d2astar, made a few optimizations.  Runs
roughly 30% faster according to my benchmarking.

Added a `maxCost` param to prevent searching the entire map for a path.
This probably needs tweaked a bit, but follows the original game more
closely.

Co-authored-by: Nicholas Eden <neden@zigzagame.com>
2020-06-23 02:04:17 -04:00
danhale-git
fe0fa6f14d
Feature/cubemain (#410)
* Added automap.go stub

* Handle errors in original AutoMap.txt file

* Completed AutoMapRecord struct and comments

* AutoMap loader implemented

* Update from base repo

* Added cubemain.go stub

* Input and requirement fields

* Removed CubeRecipeRequirement added CubeRecipeResult

* Comments and some name changes

* Implemented cubemain.go

* Corrected log line
2020-06-23 02:02:35 -04:00
Tim Sarbin
c2db7ede66
Added basic map generation for first area of south town (#408)
* Map engine updates. Limited rendering to specific area.

* Added south town border generation
2020-06-23 01:05:01 -04:00
Ziemas
15b78372b2
Update textboxes in their advance function (#407)
Fixes wonky input
2020-06-22 23:51:23 -04:00
Intyre
6ed86ee660
Profiler: write to pprof directory (#405)
* Profiler: fixed flags and output to pprof directory

* Profiler: dumpheap command writes to pprof/heap.pprof
2020-06-22 22:17:54 -04:00
Stephen Horan
336c6719ee
Connection manager for cleaning up connections (#404)
* Connection manager implementation to disconnect timed out users.

* Connection manager implementation to disconnect timed out users.
2020-06-22 20:31:42 -04:00
Tim Sarbin
4dc4654750
Fixed map stamp offset issue (#403) 2020-06-22 19:33:12 -04:00
Intyre
d17db5b1d1
StreamWriter: replaced slice with bytes.Buffer (#402) 2020-06-22 18:56:20 -04:00
dk
953271b8e6
minor edits (#401)
* make game update at 25fps, ui update at max fps

* minor edits to func names, d2resource constants

* renamed `loadDictionary` to `loadTextDictionary` to avoid confusion with `LoadDataDictionary`
* updated line in main.go that calls `loadTextDictionary`
* added tokens as constants inside of `d2resource/resource_paths.go` that are used in font/language paths
* moved locale string handling stuff into it's own func, now uses tokens defined in d2resource

* minor edits to func names, d2resource constants

* renamed `loadDictionary` to `loadTextDictionary` to avoid confusion with `LoadDataDictionary`
* updated line in main.go that calls `loadTextDictionary`
* added tokens as constants inside of `d2resource/resource_paths.go` that are used in font/language paths
* moved locale string handling stuff into it's own func, now uses tokens defined in d2resource

* fix: accidentally renamed func in d2asset

* git is hard

accidentally added changes not meant for this commit
2020-06-22 17:36:45 -04:00
Intyre
0c27ae63e6
MPQ memory improvements (#399) 2020-06-22 16:01:14 -04:00
presiyan-ivanov
2835ff4cf1
Improve run/walk/neutral animation handling. Initial parsing of Level… (#372)
* Improve run/walk/neutral animation handling. Initial parsing of LevelDetail records. Support for holding mouse buttons.

- Run/walk/neutral positions now map to a different animation mode(and speed) depending if in or out of town.

- Run/walk toggle which can be activated/deactivated with R key.

- Temporary(and incorrect) loading and mapping for LevelDetails records.

- Zone change label which shows the level name from LevelDetailsRecord when the player enters a different zone.

- Allow holding mouse left/right button to repeatedly generate an action.

* Remove duplicate load of LevelDetails. Replace numbers in zone change logic with their corresponding RegionIdType

* Move zone change check at the correct place

Co-authored-by: Presiyan Ivanov <presiyan-ivanov@users.noreply.github.com>
2020-06-22 15:55:32 -04:00
Tim Sarbin
8dcec1f209
Added profiler options (#398) 2020-06-22 12:43:26 -04:00
Haashi
5e1725dd7d
385/lintissues (#391)
* camera offset for ui panels :

added maprenderer viewport to be aligned left or right

calling alignement on keyPress in game_controls

* check if already aligned

* fix bugs

-forgot to assign alignement
-defaultScreenRect instead of screenRect because of issue mentionned in original comment

* remove config.json and replace go.mod line

* removing duplicate import of d2common

replacing all dh to d2common

* remove useless breaks from switch statement

* better range when value unused + prettying import

* item_affix rewrite

using return values instead of pointer references in arguments

* ebiten deprecated calls

* small fixes
2020-06-22 11:53:44 -04:00
Haashi
711cae2d69
fix for #358 from recent PRs (#390)
* camera offset for ui panels :

added maprenderer viewport to be aligned left or right

calling alignement on keyPress in game_controls

* check if already aligned

* fix bugs

-forgot to assign alignement
-defaultScreenRect instead of screenRect because of issue mentionned in original comment

* remove config.json and replace go.mod line

* update with new renderer and escape menu
2020-06-22 09:23:56 -04:00
dk
95621a8262
make game update at 25fps, ui update at max fps (#389) 2020-06-22 00:48:51 -04:00
Tim Sarbin
e81450b9d5
Re-fix map starting location bug (#388) 2020-06-21 23:23:00 -04:00
Ziemas
75112ec736
Show special tiles in mapdebug (#386)
More useful than the floor stuff

Also method for testing if special
2020-06-21 22:14:06 -04:00
Tim Sarbin
4b6065b2bf
Fixed vertical centering for the player (#384) 2020-06-21 21:49:32 -04:00
Ziemas
8c50a014ac
Free camera option in single player (#382)
Enable toggling free camera in single player with the freecam console
command.

Handy for looking around while debugging.
2020-06-21 20:46:00 -04:00
dk
145aa92d20
hacky bugfix to keep game from crashing tf out with other languages (#383) 2020-06-21 20:45:34 -04:00
dk
3fe57700a5
adding loader for level maze details (#377) 2020-06-21 18:48:53 -04:00
William
485e60683b
Escape menu - Keyboard support and minor improvements (#374)
* Handle up/down/enter keys and reset menu on toggle

Signed-off-by: William Claude <w.claude@thebeat.co>

* Add sound when selecting an item

Signed-off-by: William Claude <w.claude@thebeat.co>

* Reorganise code and remove unused things (YAGNI)

Signed-off-by: William Claude <w.claude@thebeat.co>

* Group properties

Signed-off-by: William Claude <w.claude@thebeat.co>

* Use switch statements instead of IFs

Signed-off-by: William Claude <w.claude@thebeat.co>

* Prevent opening the escape menu over hero stats or inventory

Signed-off-by: William Claude <w.claude@thebeat.co>
2020-06-21 18:44:33 -04:00
Intyre
ec17fcf3e6
Replaced bufio.NewReader with File.Read (#375) 2020-06-21 18:43:30 -04:00
dk
ab9571b8e8
Fix: bad naming in levels.txt loader (#376)
* main, d2common: load Magic/Rare/Unique Affix

* d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

* removed debug print from item_affix.go

* changed item affix type names for clarity, removed debug print from data_dictionary

* d2common: item affix datadict and records

Item Affixes are defined in `/data/global/excel/Magic{Prefix,Suffix}.txt`
Rare and Unique Pre/Suffixes seem to be for monsters, not items.

d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

removed debug print from item_affix.go

changed item affix type names for clarity, removed debug print from data_dictionary

* reverting to pre-allocating memory for parsing txt lines

* removing the rest of the rare/unique definitions

* removing the rest of the rare/unique definitions

* mend

* adding datadict loader for levels.txt

* adding comments from PK forums in the added d2enum files

* fixed bad naming. doh!
2020-06-21 18:43:09 -04:00
dk
5260ce3c87
adding loader for LvlSub.txt (level substitution details) (#378) 2020-06-21 18:41:28 -04:00
Tim Sarbin
912aaf044c
Re-tooled rendering engine (#379) 2020-06-21 18:40:37 -04:00
dk
6eb85d673a
Feature d2datadict levels (#373)
* main, d2common: load Magic/Rare/Unique Affix

* d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

* removed debug print from item_affix.go

* changed item affix type names for clarity, removed debug print from data_dictionary

* d2common: item affix datadict and records

Item Affixes are defined in `/data/global/excel/Magic{Prefix,Suffix}.txt`
Rare and Unique Pre/Suffixes seem to be for monsters, not items.

d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

removed debug print from item_affix.go

changed item affix type names for clarity, removed debug print from data_dictionary

* reverting to pre-allocating memory for parsing txt lines

* removing the rest of the rare/unique definitions

* removing the rest of the rare/unique definitions

* mend

* adding datadict loader for levels.txt

* adding comments from PK forums in the added d2enum files
2020-06-21 16:45:22 -04:00
Maxime Lavigne (malavv)
8bdbef60ed
Added Menu on Escape Key Press (#353) (#371)
- New menu in d2player.
 - Added OnMouseMove and Advance to GameControl.
 - Pause the MapEngine when single player.
2020-06-21 16:06:52 -04:00
Haashi
7ba3cb702d
fix bug from PR#369 (#370)
* camera offset for ui panels :

added maprenderer viewport to be aligned left or right

calling alignement on keyPress in game_controls

* check if already aligned

* fix bugs

-forgot to assign alignement
-defaultScreenRect instead of screenRect because of issue mentionned in original comment

* remove config.json and replace go.mod line
2020-06-21 16:06:11 -04:00
Haashi
afe4a3a25a
camera offset for ui panels : (#369)
* camera offset for ui panels :

added maprenderer viewport to be aligned left or right

calling alignement on keyPress in game_controls

* check if already aligned
2020-06-21 15:26:07 -04:00
Dirk Puge
b95335f399
Fixed patreon to Patreon (#368) 2020-06-21 11:23:17 -04:00
Tim Sarbin
0de7516a53
Fixed entity and object position bug (#366)
* Performance improvements

* fix readbytes variable

* Fixed entity/object position bug.

* Fixed subTileY capitalization issue
2020-06-20 21:26:26 -04:00
Tim Sarbin
b9f17f433f
Performance/Memory Improvements (#365)
* Performance improvements

* fix readbytes variable
2020-06-20 21:07:36 -04:00
danhale-git
99b10b2599
Feature/automap (#364)
* Added automap.go stub

* Handle errors in original AutoMap.txt file

* Completed AutoMapRecord struct and comments

* AutoMap loader implemented
2020-06-20 19:53:29 -04:00
dk
c14f285a21
Feature d2datadict difficultylevels (#363)
* adding rules for swap files to .gitignore

* main, d2common: load Magic/Rare/Unique Affix

* d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

* removed debug print from item_affix.go

* changed item affix type names for clarity, removed debug print from data_dictionary

* d2common: item affix datadict and records

Item Affixes are defined in `/data/global/excel/Magic{Prefix,Suffix}.txt`
Rare and Unique Pre/Suffixes seem to be for monsters, not items.

d2common: item affixes only

removed Rare/Unique Prefix/Suffix as those are related to monsters, not items.

removed debug print from item_affix.go

changed item affix type names for clarity, removed debug print from data_dictionary

* reverting to pre-allocating memory for parsing txt lines

* removing the rest of the rare/unique definitions

* removing the rest of the rare/unique definitions

* adding ItemStatCost data dict loader

* adding data dict loader for difficulty levels
2020-06-20 15:59:20 -04:00
Maxime Lavigne (malavv)
07983469ed
Fixes #360 Language dictionary crash (#362)
Crashes were due to missing translation. This PR temporarily replaces the translateString calls for the default string directly.

in `select_hero_class.go` there is a level of indirection before the call to translateString, and for this reason, its `panic` call got temporarily diverted.
2020-06-20 15:14:52 -04:00
Tim Sarbin
e510674b42
Added more temporary mapgen. (#359) 2020-06-20 14:04:51 -04:00
Ripolak
5edf314b48
Feature/gems (#347)
* Add GemsRecord struct

* Implement LoadGems function.

* Add condition for loading gems for excluding a visually separating line.

* Add 'gems.txt' file to resource_paths.go

* Add call for loading gems in main.go

* Remove spaces

* Add logging for gems loading.
2020-06-20 11:54:23 -04:00
Ripolak
2a54ad955b
Feature/hirelings (#348)
* Add basic HirelingRecord struct.

* Add LoadHireling func implementation

* Add call to loading hirelings

* Fix hireling field names
2020-06-20 11:52:55 -04:00