Commit Graph

55 Commits

Author SHA1 Message Date
lord 854fce3b14
remove d2asset singleton (#726)
* 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
2020-09-12 16:51:30 -04:00
Gürkan Kaymak f4a71c72e4
lint fixes (#727) 2020-09-12 16:25:09 -04:00
lord 0218cad717
organize d2common pakage (#716)
* move music path enumerations into d2resource

* move text dictionary (.tbl) loader into d2fileformats sub-package d2tbl

* lint fix, add doc file for d2tbl

* moved data_dictionary.go into d2fileformats sub-package d2txt, added doc file

* added sub-packages d2geom for geometry-related things, and d2path for path-related things

* moved calcstring.go to d2calculation

* move bitmuncher, bitstream, stream reader/writer from d2common into sub-package d2datautils

* fix lint errors in d2datadict loaders (caused by moving stuf around in d2common)

* move size.go into d2geom

* move d2common/cache.go into sub-package d2common/d2cache

* renamed d2debugutil to d2util, moved utility functions from d2common into d2util
2020-09-08 15:58:35 -04:00
lord 0ea6bd5b92
add rare prefix+suffix loaders, d2items use rare item names (#702)
* adding loaders for rare prefix/suffix records

* switch to slices instead of maps for storing rare prefix/suffix records

* rare items now use the rare prefix/suffix names
2020-08-06 22:32:40 -04:00
lord acc4c7a13e
d2ui refactor (#699)
* fixed lint errors in button.go

* fixed lint errors in checkbox.go

* Removed d2ui singleton, fixed nearly all lint errors

- Changed `UI` struct to `UIManager`, removed singleton
- UI element provider functions are now methods of the UI Manager
- Screens now use the UI manager to create UI elements
- game panels in d2player now use the UI Manager to create UI elements
- Only the UI manager knows about "widgets"; calls to `d2ui.AddWidget` in Screen instances have been removed

* changed ui element provider methods from `Create` to `New`
2020-08-06 10:30:23 -04:00
lord ca7412aea6
removed singleton screen manager instance (#696) 2020-08-05 22:31:56 -04:00
lord 8e41133f39
lint and minor refactor of d2common (#690)
- moved contents of `d2common/math.go` into `d2math/math.go`
- removed lint errors from files in d2common
2020-08-05 00:03:33 -04:00
AndrejMijic 4a48acb8ba
Add objgroup.txt loader (#677) 2020-08-04 12:12:03 -04:00
lord 466855e5f5
remove lint errors from d2datadict (#676) 2020-08-04 11:16:06 -04:00
AndrejMijic c216ddab53
Add monpreset.txt loader (#675) 2020-08-04 09:06:33 -04:00
AndrejMijic efb554c42b
Add PlayerClass.txt loader (#667) 2020-08-02 21:26:57 -04:00
AndrejMijic 6514fd15de
Add monseq.txt loader (#664) 2020-08-01 17:55:34 -04:00
AndrejMijic 3fea5a096d
Add monequip.txt loader (#662) 2020-07-31 18:24:47 -04:00
Bojan Novković 247bda97c6
Added loaders for itemratio.txt, Overlay.txt and UniqueAppellation.txt (#660)
* Added loaders for itemratio.txt, Overlay.txt, UniqueAppellation.txt

* Adjust unique appellation loader for expansion data

* fixes: response to PR comments

* overlay.go: PR comment fixes

Co-authored-by: Bojan Novkovic <bojan.novkovic@kset.org>
2020-07-31 18:14:41 -04:00
Bojan Novković 38852d0285
added loaders for misscalc.txt and skillcalc.txt (#661)
Co-authored-by: BojanoN <bojan.novkovic@kset.org>
2020-07-31 18:00:10 -04:00
AndrejMijic 44e84c8b10
Add MonSounds.txt loader (#658) 2020-07-31 17:56:00 -04:00
AndrejMijic 05fa7d93ce
Add monlvl.txt loader (#655) 2020-07-31 15:00:09 -04:00
AndrejMijic 42cd1e1a3b
Add monumod.txt loader (#653) 2020-07-30 21:49:29 -04:00
AndrejMijic 9789372e8f
Add npc.txt loader (#650) 2020-07-30 14:12:18 -04:00
AndrejMijic c398c8f1ad
Remove teminal time scaling (#649) 2020-07-30 12:59:17 -04:00
AndrejMijic 333b8610ac
Add pettype.txt loader (#648)
* Add pettype.txt loader

* Remove go.mod replace
2020-07-30 11:31:32 -04:00
lord bfd3f1046d
D2items WIP (#646)
* wip d2items system and item properties

* added loader for TreasureClassEx.txt

* wip item spawn from treasure class records

* wip items

* add call to init item equivalencies, remove treasure class test from d2app

* made item affix records global var a map of affix codes to the records

* changed how item to item common record equivalency is determined

* changed set items records export to a map of their codes to the records, grouped property params into a struct

* changed property parameter field from calcstring to string

* fixed bug in stat value clone

* adding equipper interface as part of stat context, eventually to be used to resolve set bonus (among other things)

* made the item interface simpler, only needs name and description methods

* adding equipper interface, for anything that will equip or have active items

* handle case where min and max are swapped, removed commented code

* added property/stat resolution for magic, rare, set, and unique items

* adding item generator which can roll for items using treasure class records

* fixed item equivalency func being called in the wrong spot
2020-07-30 10:14:15 -04:00
AndrejMijic 4dc0aa0f48
Add PlrMode.txt loader (#647) 2020-07-30 09:53:41 -04:00
AndrejMijic a1ea22c81f
Add reading of ElemTypes.txt (#644) 2020-07-30 02:41:19 -04:00
Andrew Doing cec3fb91d8
Add shrines.txt loader (#642) 2020-07-29 18:03:06 -04:00
Greg Jones 50fd6608cf
d2datadict: Add books.txt loader (#640) 2020-07-29 17:26:20 -04:00
Huw Griffiths a31fb173eb
d2datadict: Add Monmode.txt loader (#638) 2020-07-29 08:38:34 -04:00
Andrew Doing 6f30dffa1c
d2datadict: Add soundenviron.txt loader (#639) 2020-07-28 16:35:22 -04:00
Huw Griffiths 78470431d6
d2datadict: Add Montype.txt loader (#637) 2020-07-28 16:34:01 -04:00
Huw Griffiths b7f8aa8e90
d2datadict: Add Monprop.txt loader (#636) 2020-07-28 07:54:05 -04:00
Huw Griffiths 35d936ac4e
d2datadict: Add runes.txt loader (#635) 2020-07-28 07:53:32 -04:00
Andrew Doing 495301a9b7
Add loading of states.txt (#633)
* Add loading of states.txt

* Lint states.go
2020-07-28 07:52:55 -04:00
Tim Sarbin b13c581beb
Unlocked map update frame rate (#632)
* Started work on shadows

* Removed fps limiter

* Fixed build info bug
2020-07-27 15:00:50 -04:00
lord 0018044c83
D2data treasure class (#631)
* added loader for TreasureClassEx.txt

* fix lint error
2020-07-27 01:16:37 -04:00
Tim Sarbin 856043d8ac
Updated music logic (#629) 2020-07-26 15:17:00 -04:00
Huw Griffiths 5e395092e7
Add qualityitems.txt loader (#622) 2020-07-25 09:37:43 -04:00
lord b13175b070
d2data item related loaders (#619)
* added loader for ItemTypes.txt

* added loader for bodylocs.txt

* lint fix for item_types loader

* adding loader for sets.txt

* minor edit

* adding loader for SetItems.txt

* added loader for automagic.txt
2020-07-24 21:56:19 -04:00
Gürkan Kaymak 7a49f3637f
lint fixes (#615) 2020-07-23 12:56:50 -04:00
Gürkan Kaymak 80e655964e
Removed some global variables (#611)
* removed some global variables

* fixed tests
2020-07-22 15:03:03 -04:00
dk ba89bf965a
removing lint errors from d2render (#598)
The edits outside of d2render or to fix the lint error for `DrawText`.
`DrawText` should be called `DrawTextf` because it formats the string.
2020-07-17 18:51:44 -04:00
dk cf6029eb95
Stat descriptions + tests, Skilldesc.txt loader (#590)
* adding ranged number type, for use in stats

* Loaded Skills.txt

* asset manager only binds terminal commands if terminal != nil

* WIP stats

* cache getter and clear methods were not implemented

* asset manager handles a nil terminal pointer

* adding skilldesc.txt loader (needs work)

* ctc stat descriptions functions working

* moving description functionality out of itemstatcost loader and into stats

* stats seem like a central part of diablo, moving into d2core.

* stats seem like a central part of diablo, moving into d2core.

* delint

* adding statlist, statlist reduction, unit tests

* minor edits to stat.go

* lint error in statlist.go

* Remove dependency on actual data from mpq files

stats unit tests now use mock data

* fixing some lint errors, formatting

Co-authored-by: Maxime Lavigne (malavv) <duguigne@gmail.com>
2020-07-17 18:50:45 -04:00
David Carrell 3bdbd5c358
rely on App to know how to navigate between screens using a callback interface with explicit methods (#592)
remove unused struct vars that were only stored in order to pass to the next screens

consolidate create game code to single method

export ScreenMode consts and SetScreenMode method to allow app to create the correct screens

Co-authored-by: carrelda <carrelda@git>
2020-07-14 13:11:23 -04:00
Maxime Lavigne (malavv) 06b80cf24f
Loaded Skills.txt (#583) 2020-07-14 06:59:49 -04:00
David Carrell cc893e4dd4
504 - removes input singleton in favor of d2interface.InputManager constructor injection (#584)
Co-authored-by: carrelda <carrelda@git>
2020-07-13 20:29:17 -04:00
dk 8c16ea2880
Properties.txt loader (#580)
* adding loader for properties.txt

* adding resource path for properties.txt

* adding call to properties loader

* typo
2020-07-13 09:02:09 -04:00
dk 3aab0515cf
Add inventory.txt loader, use the records (#573)
* adding resource entry for inventory.txt

* adding loader for inventory.txt

* adding call to inventory.txt loader in d2app

* d2game now uses the inventory.txt records for making the inventory panel
2020-07-11 11:25:34 -04:00
William d85e2bdd51
Javascript console commands (#572)
* 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>
2020-07-11 11:24:04 -04:00
Intyre db5e844aac
Removed Configuration interface (#560) 2020-07-08 09:16:16 -04:00
dk cf35285b48
abstracted d2config to an interface (still have a singleton, though) (#538) 2020-07-04 00:49:16 -04:00
dk 62b8a610c0
D2input abstraction (#532)
* abstract d2input manager/service/events/keys/buttons to interface

* abstract d2input manager/service/events/keys/buttons to interface

* fixing lint error
2020-07-03 15:09:16 -04:00