* logger for d2audio & d2map
* logger for d2ui e.t.c
* d2inventory now passes on error messages
* no more importing log in d2core
* implemented #925
* added logger to part of d2networking & fixed "need to be changed" comments
* fixed lints
* fixed errors
Co-authored-by: M. Sz <mszeptuch@protonmail.com>
* 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
* 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
* 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
* 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
- Clicking the active left/right skill now opens a skill select panel.
Only the available skills for the hero, which are valid for the panel type are shown.
Clicking on a skill from the skill select panel makes it the new active skill for the hero.
- Hovering a skill in the skill select panel shows the skill name +
skill description.
- New command which learns all skills for a specific
class(not persisted to a save file yet) - e.g. `learnskills ama` will learn
skills for the Amazon class.
- Initialize HeroSkill.shallowHeroSkill struct in the hero state factory, so we can use it
when we serialize the HeroSkill to packets/game save files.
- The parsed Skill.ListRow is now a number instead of string.
Co-authored-by: Presiyan Ivanov <presiyan-ivanov@users.noreply.github.com>
* d2ui/UIFrame: Refactor into its own class
it's not useful to have the handling of frames for the
inventory/herostate/skilltree/quest panels individually in each of
those.
* d2ui/button: Fix crash when a buttonlayout was not allowing FrameChange
When AllowFrameChange is false we do not create pressedSurface. So if we
press the button the game will crash.
* d2ui/button: Allow label-only buttons
At least for the skillmenu we need buttons were the graphic size does
not match the buttonsize. So let's render the graphic in there and make
the button label only.
* d2hero/hero_state_factory: Give all heroes their class specific skills
* d2player/gamecontrols: Fix wrong inventory/stats layouts for exp chars
For Druid/Assassin the inventory frame was rendered for a 640x480
resolution. This brings it in line with all other characters.
* d2player: Add inital Skilltree panel
* d2player/game_controls: Enable skilltree
Note here, that the inventory panel and skilltree panel can overlap.
* d2player/skilltree: Add skillicon rendering
Note here, that I couldn't figure out how to render them dark if no
skillpoints are invested.
Signed-off-by: juander <juander@rumtueddeln.de>
* Casting a skill now plays the corresponding overlay(if any).
* Prevent a crash caused by nil pointer in HeroSkill deserialization, happening when
unmarshalling HeroSkill from packets as a remote client.
* Add PlayerAnimationModeNone to handle some of the Skills(e.g.
Paladin auras) having "" as animation mode.
* Joining a game as remote client now waits for map generation to finish
before rendering map or processing map entities. This is temporary hack to prevent the game from
crashing due to concurrent map read & write exception.
* Send CastSkill packet to other clients.
Co-authored-by: Presiyan Ivanov <presiyan-ivanov@users.noreply.github.com>
* 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>
* removing objects records from d2datadict
* removing Overlay singleton from d2datadict
* remove PetTypes singleton from d2datadict
* remove PlayerClass singleton from d2datadict
* removed PlrModes singleton from d2datadict
* removed Properties singleton from d2datadict
* removed ItemQuality singleton from d2datadict
* removed RarePrefix and RareSuffix singletons from d2datadict
* removed States singleton from d2datadict
* removed Runewords singleton from d2datadict
* removed Sets and SetItems singletons from d2datadict
* remoed Shrines singleton from d2datadict
* removed UniqueItems singleton from d2datadict
* removed SuperUniques singleton from d2datadict
* removed TreasureClass singleton from d2datadict
* removed UniqueAppellation singleton from d2datadict
* removed d2datadict
* removed data dict init from d2app, this has moved to asset manager init
* Remove weapons, armor, misc, itemCommon, itemTyps datadict singletons
- removed loader calls from d2app
- removed the HeroObjects singleton from `d2core/d2inventory`
- added an InventoryItemFactory in d2inventory
- package-level functions that use data records are now methods of the InventoryItemFactory
- renamed ItemGenerator in d2item to ItemFactory
- package-level functions that use records are now methods of ItemFactory
- d2map.MapEntityFactory now has an item factory instance for creating items
- fixed a bug in unique item record loader where it loaded an empty record
- added a PlayerStateFactory for creating a player state (uses the asset manager)
- updated the test inventory/equipment code in d2player to handle errors from the ItemFactory
- character select and character creation screens have a player state and inventory item factory
- updated item tests to use the item factory
* minor edit
* Removed d2datadict.Experience singleton
added a HeroStatsFactory, much like the other factories. The factory gets an
asset manager reference in order to use data records.
* removed d2datadict.AutoMagic singleton
* removed d2datadict.AutoMap singleton
* removed d2datadict.BodyLocations singleton
* removed d2datadict.Books singleton
* Removed singletons for level records
- removed loader calls in d2app
- changed type references from d2datadict to d2records
- added a `MapGenerator` in d2mapgen which uses thew asset manager and map engine
- package-level map generation functions are now MapGenerator methods
- `d2datadict.GetLevelDetails(id int)` is now a method of the RecordManager
* remove SkillCalc and MissileCalc singletons
* Removed CharStats and ItemStatCost singletons
- added an ItemStatFactory which uses the asset manager to create stats
- package-level functions for stats in d2item are now StatFactory methods
- changed type references from d2datadict to d2records
- `d2player.GetAllPlayerStates` is now a method of the `PlayerStateFactory`
* Removed DkillDesc and Skills singletons from d2datadict
- removed loader calls from d2app
- diablo2stats.Stat instances are given a reference to the factory for doing record lookups
* update the stats test to use mock a asset manager and stat factory
* fixed diablo2stats tests and diablo2item tests
* removed CompCodes singleton from d2datadict
* remove cubemain singleton from d2datadict
* removed DifficultyLevels singleton from d2datadict
* removed ElemTypes singleton from d2datadict
* removed events.go loader from d2datadict (was unused)
* removed Gems singleton from d2datadict
* removed Hireling and Inventory singletons from d2datadict
* removed MagicPrefix and MagicSuffix singletons from d2datadict
* removed ItemRatios singleton from d2datadict
* removed Missiles singleton from d2datadict
* removed MonModes singleton
* Removed all monster and npc singletons from d2datadict
- MapStamp instances now get a reference to their factory for doing record lookups
* removed SoundEntry and SoundEnviron singletons from d2datadict