* 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>
* 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>
* 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
* adds error handling, returns early from funcs where it makes sense
* fixes build errors
* merge ballresin PR with upstream
* adds error handling, returns early from funcs where it makes sense
* fixes build errors
* merge ballresin PR with upstream
Co-authored-by: dknuth <dknuth0101@gmail.com>
* improve AssetManager implementation
Notable changes are:
* removed the individual managers inside of d2asset, only one asset manager
* AssetManager now has caches for the types of files it loads
* created a type for TextDictionary (the txt file structs)
* fixed a file path bug in d2loader Source
* fixed a asset stream bug in d2loader Asset
* d2loader.Loader now needs a d2config.Config on creation (for resolving locale files)
* updated the mpq file in d2asset test data, added test case for "sub-directory"
* added a Data method to d2asset.Asset. The data is cached on first full read.
* renamed ArchiveDataStream to DataStream in d2interface
* moved palette utility func out of d2asset and into d2util
* bugfix for MacOS mpq loader issue
* lint fixes, added data caching to filesystem asset
* adding comment for mpq asset close
* Decouple d2asset from d2render
Notable changes in d2common:
* d2dcc.Load now fully decodes the dcc and stores the directions/frames in the dcc struct
* un-exported dcc.decodeDirection, it is only used in d2dcc
* removed font interface from d2interface, we only have one font implementation
* added `Renderer` method to d2interface.Surface, animations use this to bind to a renderer and create surfaces as they need
* added `BindRenderer` method to animation interface
Notable changes in d2common/d2asset:
* **d2asset.NewAssetManager only needs to be passed a d2config.Config**, it is decoupled from d2render
* exported Animation
* Animation implementation binds to the renderer to create surfaces only on the first time it is rendered
* font, dcc, dc6 initialization logic moved out of asset_manager.go
* for dc6 and dcc animations, the process of decoding and creating render surfaces has been broken into different methods
* the d2asset.Font struct now stores font table data for initialization purposes
Notable changes in d2core/d2render:
* Surfaces store a renderer reference, this allows animations to bind to the renderer and create a surface just-in-time
**These last changes should have been a separate PR, sorry.**
Notable changes in d2core/d2ui:
* ui.NewSprite now handles creating an animation internally, only needs image and palette path as arguments
Notable Changes in d2game:
Because of the change in d2ui, all instances of this code pattern...
```golang
animation, err := screen.asset.LoadAnimation(imgPath, palettePath)
sprite, err := screen.ui.NewSprite(animation)
```
... becomes this ...
```golang
sprite, err := screen.ui.NewSprite(imgPath, palettePath)
```
* improve AssetManager implementation
Notable changes are:
* removed the individual managers inside of d2asset, only one asset manager
* AssetManager now has caches for the types of files it loads
* created a type for TextDictionary (the txt file structs)
* fixed a file path bug in d2loader Source
* fixed a asset stream bug in d2loader Asset
* d2loader.Loader now needs a d2config.Config on creation (for resolving locale files)
* updated the mpq file in d2asset test data, added test case for "sub-directory"
* added a Data method to d2asset.Asset. The data is cached on first full read.
* renamed ArchiveDataStream to DataStream in d2interface
* moved palette utility func out of d2asset and into d2util
* bugfix for MacOS mpq loader issue
* minor lint fixes
* removed obsolete interfaces from d2interface
* lint fixes, added data caching to filesystem asset
* adding comment for mpq asset close
* adding comment for mpq asset close
* export d2asset singleton
* add *d2asset.AssetManager to d2app
- d2app now has a reference to an asset manager which it will use for loading
- added asset loader methods to the asset manager
- functions in d2asset are now wrappers for asset manager methods
* add asset manager reference to audio provider
- d2app asset manager reference is now passed to audio provider
- asset manager is created in main.go for now to pass into audio provider
- CreateSoundEffect is now a method, no longer exported, uses the asset manager reference
* d2app passes asset manager refence to map engine test
* in d2asset, all calls to LoadFile replaced with call to Singleton.Loadfile
* blizzard intro and credits screen
- d2app passes reference to the asset manager to these screens
* asset manager for d2map
- adding MapStampFactory, takes an asset manager reference
- embedded MapStampFactory into the MapEngine
- LoadStamp is now a method of the MapStampFactory
* d2asset: removed LoadFileStream, LoadFile, and FileExists
* d2gui changes
- singleton now has an asset manager reference
- calls to d2asset loader functions removed
- createButton is now a method of LayoutManager
- moved LayoutEntry to its own file
* map entity factory
- Map engine has an embedded map entity factory
- Map stamp factory gets a reference to the map engine's entity factory
- Stamps are given a reference to the map engine entity factory when created
- Character select gets a map entity factory
- Embedded the stamp factory into the MapEngine
* asset manager for d2ui
- d2ui is passed an asset manager reference when created
- all calls to d2asset loader functions in d2ui now refer to the asset manager
- d2gamescreen gets a ui manager when created
- help overlay is now passed a ui manager when created
* d2gamescreen + d2player: asset manager references
added an asset manager reference to
- inventory panel + inventory grid
- mini panel
- game controls
- help overlay
- character select
- main menu
- select hero class
- hero stats panel
* Removed d2asset.LoadAnimation
all references to this function have been replaced with calls to the asset manager method
* adding asset to help overlay, bugfix for 4d59c91
* Removed d2asset.LoadFont and d2asset.LoadAnimationWithEffect
all references to these have been replaced with calls to the asset manager methods
* MapRenderer now gets an asset manager reference
* removed d2asset.LoadPalette
all references have been replaced with calls to an asset manager instance
* merged d2object with d2mapentity
d2object was only being used to create objects in the map, so the provider
function is now a method of the map entity factory. calls to d2asset have
been removed.
* removed d2asset.LoadComposite
all calls are now made to the asset manager method
* removed d2asset singleton
all singleton references have been removed, a single instance of the
asset manager is passed around the entire app
* rename Initialize to NewAssetManager
* Allow the execution of JS from the terminal when hosting a local game or playing a single game
Signed-off-by: William Claude <w.claude@thebeat.co>
* Reorganise imports on edited files
Signed-off-by: William Claude <w.claude@thebeat.co>
* Remove Reset
Signed-off-by: William Claude <w.claude@thebeat.co>
* adding comments to d2interface for linter
* moved d2render renderer interfaces and types into d2interface
* fixed most lint errors for monstats loader
* de-lint d2data wip
* d2data: resolve linting errors
* added SuperUniques data dictionary
* added a call to LoadSuperUniques() method from the main
* added a call to LoadSuperUniques() method from the main
* 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
* 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
* 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
* 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
* 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 monstats.txt data dict loader
* adding myself to contributors file
* 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 charstats datadict loader
* 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