1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-15 20:15:24 +00:00
Commit Graph

116 Commits

Author SHA1 Message Date
David Carrell
390f6a1234
351 - add progress handle and helper functions to ScreenLoadHandler:OnLoad to provide ability to asynchronously load data and animate the loading screen (#445)
Co-authored-by: carrelda@Davids-MacBook-Pro.local <carrelda@Davids-MacBook-Pro.local>
2020-06-24 18:46:03 -04:00
Natureknight
b60465fd6c
render the run button the UI, and allow the user to toggle it with their mouse, in addition to the R key on the keyboard (#400) (#443) 2020-06-24 15:23:38 -04:00
Tim Sarbin
d8a817eddf
fix stamp bug preventing maps from rendering properly (#441) 2020-06-24 14:35:49 -04:00
Ziemas
02605227c3
Various map entity reworks (#439)
* 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
2020-06-24 13:49:13 -04:00
Tim Sarbin
954670da5f
Fixed linting issues (#438) 2020-06-24 10:13:11 -04:00
dk
46ccce56bd
minor edits to d2map engine, added methods for converting between index and tile coordinates (#433) 2020-06-24 08:10:48 -04:00
nicholas-eden
329e2f0fab
Use closest path if path not found (#431)
When clicking on the other side of a wall or in an an inaccessible area,
route the player the closest possible node.  This allows running along
walls and matches the original closely.

Co-authored-by: Nicholas Eden <neden@zigzagame.com>
2020-06-24 08:09:00 -04:00
Tim Sarbin
a24c05efa9
Map generation and test fixes (#430)
* More mapgen updates

* Added east generation

* Added west town generation

* Fixed test errors
2020-06-24 00:04:27 -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
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
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
Tim Sarbin
4dc4654750
Fixed map stamp offset issue (#403) 2020-06-22 19:33:12 -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
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
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
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
dk
145aa92d20
hacky bugfix to keep game from crashing tf out with other languages (#383) 2020-06-21 20:45:34 -04:00
Tim Sarbin
912aaf044c
Re-tooled rendering engine (#379) 2020-06-21 18:40:37 -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
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
Tim Sarbin
e510674b42
Added more temporary mapgen. (#359) 2020-06-20 14:04:51 -04:00
Tim Sarbin
0a206ce024
Fixed issues from last merge (#346) 2020-06-20 01:06:42 -04:00
Tim Sarbin
a8c6bbec9d
Fixed walking animations and pathing bugs. (#345) 2020-06-20 00:40:49 -04:00
Tim Sarbin
7b38a9d818
Updates (#340) 2020-06-19 02:19:27 -04:00
Tim Sarbin
2da08884c4
Added multiplayer support (#336) 2020-06-18 14:11:04 -04:00
Tim Sarbin
16dc775be1
Renamed scene to screen to avoid confusion of intent. (#334) 2020-06-13 20:36:20 -04:00
Tim Sarbin
52f8cd6d0c
Initial work to separate client and server logic (#330)
* Switched to json formatted characters

* Added infrastructure for networking

* Minor updates.

* more updates for map engine/rendering

* More map engine changes and fixes
2020-06-13 18:32:09 -04:00
Robin Eklind
ff4f0b0bfa
all: use goimports to format code and fix two minor typos in comments (#326)
Typos located using misspell: https://github.com/client9/misspell

Formatting done using goimports: https://godoc.org/golang.org/x/tools/cmd/goimports
2020-04-11 14:56:47 -04:00
dk
019bb920c9
Feature pl2 asset manager (#319)
* adding pl2 as a fiel format and an asset manager for pl2 files

* adding pl2 as a file format and an asset manager for pl2 files

* pl2 asset manager and file format

* added call in main.go to load palette transforms
* removed incorrect PaletteTransformType declarations from main.go

* removingn bad resource path for palette transform

* PL2 file format added, added to asset management

PL2 files are beside palette files in the mpq
These files define palette transforms of their respective base palette.

I've bound a command to d2term (in d2asset.go)
	load_pl2 <path>

* Clean up PL2 asset stuff

removed pl2 stuff from d2datadict, didn't belong in there
removed d2term debug binding

* minor cleanup for d2pl2
2020-02-26 22:52:05 -05:00
Alex Yatskov
664b8416f1
Remove global palettes; everything goes through d2asset now (#322)
* Configuration cleanup

* Cleanup

* remove global palettes
2020-02-26 22:46:47 -05:00
nicholas-eden
1011b2f030
Add simple index to query map (#321)
`renderPass2` is looping over every entity for every frame, this updates the method so it only evaluates each entity once.

Adds ability to query by rectangle or circle.
2020-02-26 08:40:32 -05:00
Alex Yatskov
a4efd41383
File format cleanup (#320)
* Configuration cleanup

* Cleanup

* cleanup file formats

* make palettes a proper fileformat
2020-02-26 08:39:38 -05:00
Ziemas
0f7571a5b9
Render animations from their origin in composite. (#318) 2020-02-25 09:49:21 -05:00
Alex Yatskov
418c798c2c
Add RenderFromOrigin method to Animation (#317)
* Configuration cleanup

* Cleanup

* Add RenderFromOrigin option
2020-02-24 23:04:01 -05:00
Alex Yatskov
6f2c212417
Continued work on GUI (#316)
* Configuration cleanup

* Cleanup

* Continued UI work
2020-02-24 22:35:21 -05:00
Ziemas
2285c31b53
Fix wall location by removing extraneous offset (#314) 2020-02-24 13:36:12 -05:00
nicholas-eden
f6014498ba
Use missile range and subloop (#311)
Turn on blending.  Calculate target using based on range and angle of hero to click.
2020-02-23 03:23:18 -05:00
Alex Yatskov
423cef304d
Screenshot and GIF recording capability (#310)
* Configuration cleanup

* Cleanup

* Gif animation and screenshot support
2020-02-22 23:59:45 -05:00
Ziemas
e4c84c4fb9
Direction changes. (#309)
* Take directions in the range of 0-63

* Shift direction handling in animation further back

* Don't need to get the DCC direction here.

Because it was added to animation.

* Check direction is within range
2020-02-22 22:33:58 -05:00
nicholas-eden
bdfdeda67b
Add support for missiles (#308)
* 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
2020-02-22 20:44:30 -05:00
Alex Yatskov
2953d2171b
Configuration improvements (#307)
* Configuration cleanup

* Cleanup
2020-02-20 08:41:41 -05:00
Alex Yatskov
810b168ebf
Work in progress on GUI (#304)
* Work in progress on GUI refactor

* Remove WIP file

* Remove WIP style
2020-02-17 22:11:52 -05:00
Alex Yatskov
1983ec395d Cleanup error handling (#303) 2020-02-09 14:12:04 -05:00