Commit Graph

26 Commits

Author SHA1 Message Date
juliancoffee
328e865ed3 Add asset_tweak macros 2021-08-03 16:31:13 +03:00
juliancoffee
2ce09af2d8 Remove redundant serial_test crate 2021-08-03 16:31:13 +03:00
juliancoffee
30ebf04e96 Add ability to specify directory in asset_tweak 2021-08-03 16:31:13 +03:00
juliancoffee
99d0c2cb95 Remove clone() for creating new tweak file 2021-08-03 16:31:13 +03:00
juliancoffee
846233367f Introduce helper functions and deduplicate docs 2021-08-03 16:31:13 +03:00
Benoît du Garreau
110b9742b7 Add a feature to optionnally disable hot-reloading 2021-07-06 00:27:09 +02:00
juliancoffee
15d83e65cc Remove load_expect_dir as it's misused
- load_expect_dir while expected to fail on erros, fails only on
filesystem errors and only on root directory.
This commit replaces this function with `read_expect_dir` which returns iterator
which loads all files and panics if can't load them.
2021-07-05 20:14:26 +03:00
juliancoffee
33a37a8857 Run asset_tweak tests separately
+ Make parse_all_ron_files_to_value panic-friendly. Remove unwraps
to unwrap_or_else with panic message.
2021-07-04 19:31:57 +03:00
eckso
4f66bff54a Fix #1158 - Add a test that all the .ron manifests parse 2021-07-03 18:11:04 +00:00
juliancoffee
d92d54f8ad Better error signaling in assets::load_dir_expect 2021-06-30 21:06:06 +03:00
Benoît du Garreau
1cba7db9b6 Update assets_manager to 0.5 2021-06-26 12:05:40 +02:00
Joshua Barretto
747ef50a58 Removed .jpeg as valid image format (to encourage consistency) 2021-06-18 12:42:08 +01:00
Joshua Barretto
0265da1074 Added support for JPEG backgrounds 2021-06-18 12:27:39 +01:00
Marcel Märtens
4167621f5d Change the version number to 0.10 2021-06-12 10:14:07 +02:00
juliancoffee
1dd621a56f serialize AssetTweakWrapper<T>, not just T
asset_tweak::tweak_expect_or_create works by writing default data to
file and then read it as asset.
the problem is that it was writing T, and read AssetTweakWrapper<T>
which are different types.

Tests didn't handle case when you will load data back so bug was hidden.
2021-06-08 22:39:51 +03:00
juliancoffee
cb7a41c72d put serde behind feature gate 2021-06-08 14:03:15 +03:00
juliancoffee
df2c3a4950 Fix find_root() search in case if .git isn't dir 2021-06-08 13:34:46 +03:00
juliancoffee
8f86f474e8 place asset_tweak behind a feature 2021-06-08 13:34:41 +03:00
juliancoffee
3c34301947 More tests, support only assets/tweak directory
- Use `serial_test` because tests can't run in parallel as both of them
are accessing fs.
- Take only filename, use hardcoded `assets/tweak` to keep it simple and
support .gitignore
2021-06-08 13:31:27 +03:00
juliancoffee
7533f4d17b add asset_tweak_or_create that will create file 2021-06-08 13:31:27 +03:00
juliancoffee
8a157b8410 New tweak_expect fn to tweak values from .ron
- Function to tweak values via temporary hot-reloaded .ron files
2021-06-08 13:31:27 +03:00
Marcel
607f8b289b Merge branch 'alphyr/guess_image_format' into 'master'
Guess image format from file extension

See merge request veloren/veloren!2260
2021-05-12 18:41:22 +00:00
juliancoffee
2035c041f9 add authors 2021-05-09 13:12:26 +03:00
juliancoffee
359a46d6f2 Fix tests
1) Use more correct way to look for `assets` dir
2) Rename veloren_common::assets to veloren_common_assets in doc-tests
2021-05-09 13:12:26 +03:00
juliancoffee
9af0b6dd12 Search for assets in workspace root 2021-05-09 13:12:26 +03:00
juliancoffee
735e8ab4ec Extract common/src/assets.rs to own crate
This gives us ability to use assets-related code in i18n without
depending on whole veloren-common
2021-05-09 13:12:26 +03:00