* 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
* Set HP/Mana stats when globes are clicked
* Display HP or Mana stat when hovering over globe
* Display HP/Mana stats when hovering globe or when toggling by clicking the respective globe. Rename internal to assets and move assets package into folder.
* Adding .bmp to assets folder
* 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`
* adding debug printing boxes for entity bounds
* minor edits
- adding `spawnmon` command. currently does not have a netpacket, just for debug
- adding `GetSize` method to map entities for getting frame bounds (for debug printing)
* bug fix
* smooth camera with vectors
* add smooth cam support to map engine test
smooth cam now works in map engine test.
clicking or holding the left-mouse button will move the camera.
also works with freecam mode in single-player.
* Update ebiten_renderer.go
did not mean to edit this file
* 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
* Add PushEffect, handle effects in renderer
* Set effects instead of blend
* Stop using PushCompositeMode, use PushEffect
* Remove remaining composite mode things
The split between d2ui and d2asset Font version caused incorrect caching between the two. After looking at d2interface.Font, I saw the d2asset was the most recent and more tightly and cleanly packaged.
I therefore removed the old d2ui.Font and embedded the d2asset version in the d2ui.Label and d2ui.Button.
Looking at the code of d2ui, it would be logical to completly swap it for their d2gui version. But at least for the moment, the d2ui.Button as more functionality since it embeds a Label (instead of a font), and this label now has multiline horizontal alignement.
* moved filter constants back to d2enum
* moving key and mouse button enums into d2enum
* moving render type enum into d2enum
* moving input even priority enums into d2enum
* moving terminal enums into d2enum
* Fixes#496 using ebiten.SubImage to Render Section of a Surface.
I had to add matching functions to both animation and sprite to get it to be called
for a sprite object.
* Fixed linter warning on comments for Sprite and Animation.
* Removing what's remaining of the old Sprite re-generation and caching.
* Add PushBrightness to surface
* Highlight selectable objects
Check if mapentity is selectable. (seems reasonable)
Request objects to highlight themselves is required (idk)
* 412 - move missle code to game_client and add animation, still buggy
* mostly working casting animation that cancels path
Co-authored-by: carrelda@Davids-MacBook-Pro.local <carrelda@Davids-MacBook-Pro.local>
* First improvements
Signed-off-by: William Claude <w.claude@thebeat.co>
* Make the menu more generic
Signed-off-by: William Claude <w.claude@thebeat.co>
* Handle mouse events
Signed-off-by: William Claude <w.claude@thebeat.co>
* Remove debug statement
Signed-off-by: William Claude <w.claude@thebeat.co>
* Handle left clicks better
Signed-off-by: William Claude <w.claude@thebeat.co>
* Remove unused file
Signed-off-by: William Claude <w.claude@thebeat.co>
* Handle titles in screens
Signed-off-by: William Claude <w.claude@thebeat.co>
* Improve the menu using layouts
Signed-off-by: William Claude <w.claude@thebeat.co>
* Add support for onOff labels
Signed-off-by: William Claude <w.claude@thebeat.co>
* Mutualise title creation
Signed-off-by: William Claude <w.claude@thebeat.co>
* Add gutter and mutualise things
Signed-off-by: William Claude <w.claude@thebeat.co>
* Improve menu, mutualise a lot of things and support animated sprites
Signed-off-by: William Claude <w.claude@thebeat.co>
* Use a cfg struct instead of independent handlers
Signed-off-by: William Claude <w.claude@thebeat.co>
* Fix hardcoded value
Signed-off-by: William Claude <w.claude@thebeat.co>
* Clean things a bit
Signed-off-by: William Claude <w.claude@thebeat.co>
* Remove unused property
Signed-off-by: William Claude <w.claude@thebeat.co>
* First support for hoverable elements
Signed-off-by: William Claude <w.claude@thebeat.co>
* Add support for label selection feedback
Signed-off-by: William Claude <w.claude@thebeat.co>
* Add support options
Signed-off-by: William Claude <w.claude@thebeat.co>
* Update print statement
Signed-off-by: William Claude <w.claude@thebeat.co>
* Update rendering and clean code
Signed-off-by: William Claude <w.claude@thebeat.co>
* Remove debug things
Signed-off-by: William Claude <w.claude@thebeat.co>
* Handle hovering
Signed-off-by: William Claude <w.claude@thebeat.co>
* Support enter key for labels
Signed-off-by: William Claude <w.claude@thebeat.co>
* Attach methods to layout
Signed-off-by: William Claude <w.claude@thebeat.co>
* Move things under EscapeMenu
Signed-off-by: William Claude <w.claude@thebeat.co>
* Some renaming
Signed-off-by: William Claude <w.claude@thebeat.co>
* Clean
Signed-off-by: William Claude <w.claude@thebeat.co>
* Set hovered element ID when using the mouse
Signed-off-by: William Claude <w.claude@thebeat.co>
* Clean
Signed-off-by: William Claude <w.claude@thebeat.co>
* Delete unused file
Signed-off-by: William Claude <w.claude@thebeat.co>
* Wire save & exit with a nasty hack
Signed-off-by: William Claude <w.claude@thebeat.co>
* Remove unused file
Signed-off-by: William Claude <w.claude@thebeat.co>
* Remove dead code
Signed-off-by: William Claude <w.claude@thebeat.co>
* Reorder the code a bit
Signed-off-by: William Claude <w.claude@thebeat.co>
* Rename hoverableElement into actionableElement
Signed-off-by: William Claude <w.claude@thebeat.co>
* Prevent regenerating the label if the text didn't change
Signed-off-by: William Claude <w.claude@thebeat.co>
* Save/load hero stats and display them in stats panel.
* Load default hero state for characters created before saving stats was introduced
Co-authored-by: Presiyan Ivanov <presiyan-ivanov@users.noreply.github.com>
* refactoring escape menu to allow pop back to menu
* refactors escape menu to allow exiting the game
* fixes bug causing player to not be removed on game exit
* Use integer directions for rotating map entities
* Manage composite directly in npc
* Player manages its own composite
* Split up animation mode types
Players, monsters, objects all have their own types
* Clean up AnimatedEntity
* Rename AnimatedEntity -> Object
* Keep the object txt record on hand in Object
* 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
* 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>
* 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
* 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>
* 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
* Switched to json formatted characters
* Added infrastructure for networking
* Minor updates.
* more updates for map engine/rendering
* More map engine changes and fixes
* WIP: Add support for missiles
Break AnimatedEntity into two parts to support single and composite animations. Summon misssiles on right click.
* Break animated entity down further
Move npc only logic to npc struct, reduce duplication in map entities
* Change a bunch of int32s to int