Merge lp:~widelands-dev/widelands/list-directories-in-cpp into lp:widelands
- list-directories-in-cpp
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 9129 | ||||
Proposed branch: | lp:~widelands-dev/widelands/list-directories-in-cpp | ||||
Merge into: | lp:widelands | ||||
Diff against target: |
4547 lines (+822/-805) 197 files modified
data/scripting/mapobjects.lua (+8/-55) data/sound/wl-sound-docu.csv (+39/-38) data/tribes/atlanteans.lua (+12/-21) data/tribes/barbarians.lua (+9/-16) data/tribes/empire.lua (+10/-19) data/tribes/frisians.lua (+9/-16) data/tribes/immovables/berry_bushes/blueberry/init.lua (+4/-4) data/tribes/immovables/berry_bushes/currant_black/init.lua (+4/-4) data/tribes/immovables/berry_bushes/currant_red/init.lua (+4/-4) data/tribes/immovables/berry_bushes/desert_hackberry/init.lua (+4/-4) data/tribes/immovables/berry_bushes/juniper/init.lua (+4/-4) data/tribes/immovables/berry_bushes/raspberry/init.lua (+4/-4) data/tribes/immovables/berry_bushes/sea_buckthorn/init.lua (+4/-4) data/tribes/immovables/berry_bushes/strawberry/init.lua (+4/-4) data/tribes/ships/atlanteans/init.lua (+1/-1) data/tribes/ships/barbarians/init.lua (+1/-1) data/tribes/ships/empire/init.lua (+1/-1) data/tribes/ships/frisians/init.lua (+1/-1) data/tribes/workers/atlanteans/armorsmith/init.lua (+2/-2) data/tribes/workers/atlanteans/baker/init.lua (+2/-2) data/tribes/workers/atlanteans/blackroot_farmer/init.lua (+2/-2) data/tribes/workers/atlanteans/builder/init.lua (+2/-2) data/tribes/workers/atlanteans/carrier/init.lua (+4/-9) data/tribes/workers/atlanteans/charcoal_burner/init.lua (+2/-2) data/tribes/workers/atlanteans/farmer/init.lua (+2/-2) data/tribes/workers/atlanteans/fishbreeder/init.lua (+1/-1) data/tribes/workers/atlanteans/fisher/init.lua (+2/-2) data/tribes/workers/atlanteans/forester/init.lua (+2/-2) data/tribes/workers/atlanteans/geologist/init.lua (+2/-2) data/tribes/workers/atlanteans/horse/init.lua (+2/-2) data/tribes/workers/atlanteans/horsebreeder/init.lua (+1/-1) data/tribes/workers/atlanteans/hunter/init.lua (+2/-2) data/tribes/workers/atlanteans/miller/init.lua (+2/-2) data/tribes/workers/atlanteans/miner/init.lua (+2/-2) data/tribes/workers/atlanteans/recruit/init.lua (+1/-1) data/tribes/workers/atlanteans/sawyer/init.lua (+2/-2) data/tribes/workers/atlanteans/scout/init.lua (+1/-1) data/tribes/workers/atlanteans/shipwright/init.lua (+2/-2) data/tribes/workers/atlanteans/smelter/init.lua (+2/-2) data/tribes/workers/atlanteans/smoker/init.lua (+2/-2) data/tribes/workers/atlanteans/soldier/init.lua (+1/-1) data/tribes/workers/atlanteans/spiderbreeder/init.lua (+2/-2) data/tribes/workers/atlanteans/stonecutter/init.lua (+2/-2) data/tribes/workers/atlanteans/toolsmith/init.lua (+2/-2) data/tribes/workers/atlanteans/trainer/init.lua (+2/-2) data/tribes/workers/atlanteans/weaponsmith/init.lua (+2/-2) data/tribes/workers/atlanteans/weaver/init.lua (+2/-2) data/tribes/workers/atlanteans/woodcutter/init.lua (+3/-3) data/tribes/workers/barbarians/baker/init.lua (+2/-2) data/tribes/workers/barbarians/blacksmith/init.lua (+2/-2) data/tribes/workers/barbarians/blacksmith_master/init.lua (+2/-2) data/tribes/workers/barbarians/brewer/init.lua (+2/-2) data/tribes/workers/barbarians/brewer_master/init.lua (+2/-2) data/tribes/workers/barbarians/builder/init.lua (+2/-2) data/tribes/workers/barbarians/carrier/init.lua (+4/-9) data/tribes/workers/barbarians/cattlebreeder/init.lua (+2/-2) data/tribes/workers/barbarians/charcoal_burner/init.lua (+2/-2) data/tribes/workers/barbarians/farmer/init.lua (+2/-2) data/tribes/workers/barbarians/fisher/init.lua (+2/-2) data/tribes/workers/barbarians/gamekeeper/init.lua (+2/-2) data/tribes/workers/barbarians/gardener/init.lua (+2/-2) data/tribes/workers/barbarians/geologist/init.lua (+2/-2) data/tribes/workers/barbarians/helmsmith/init.lua (+2/-2) data/tribes/workers/barbarians/hunter/init.lua (+2/-2) data/tribes/workers/barbarians/innkeeper/init.lua (+2/-2) data/tribes/workers/barbarians/lime_burner/init.lua (+2/-2) data/tribes/workers/barbarians/lumberjack/init.lua (+3/-4) data/tribes/workers/barbarians/miner/init.lua (+2/-2) data/tribes/workers/barbarians/miner_chief/init.lua (+2/-2) data/tribes/workers/barbarians/miner_master/init.lua (+2/-2) data/tribes/workers/barbarians/ox/init.lua (+2/-2) data/tribes/workers/barbarians/ranger/init.lua (+2/-2) data/tribes/workers/barbarians/recruit/init.lua (+1/-1) data/tribes/workers/barbarians/scout/init.lua (+2/-2) data/tribes/workers/barbarians/shipwright/init.lua (+2/-2) data/tribes/workers/barbarians/smelter/init.lua (+2/-2) data/tribes/workers/barbarians/soldier/init.lua (+1/-1) data/tribes/workers/barbarians/stonemason/init.lua (+2/-2) data/tribes/workers/barbarians/trainer/init.lua (+2/-2) data/tribes/workers/barbarians/weaver/init.lua (+2/-2) data/tribes/workers/empire/armorsmith/init.lua (+2/-2) data/tribes/workers/empire/baker/init.lua (+2/-2) data/tribes/workers/empire/brewer/init.lua (+2/-2) data/tribes/workers/empire/builder/init.lua (+2/-2) data/tribes/workers/empire/carpenter/init.lua (+2/-2) data/tribes/workers/empire/carrier/init.lua (+4/-9) data/tribes/workers/empire/charcoal_burner/init.lua (+2/-2) data/tribes/workers/empire/donkey/init.lua (+2/-2) data/tribes/workers/empire/donkeybreeder/init.lua (+2/-2) data/tribes/workers/empire/farmer/init.lua (+2/-2) data/tribes/workers/empire/fisher/init.lua (+2/-2) data/tribes/workers/empire/forester/init.lua (+2/-2) data/tribes/workers/empire/geologist/init.lua (+2/-2) data/tribes/workers/empire/hunter/init.lua (+2/-2) data/tribes/workers/empire/innkeeper/init.lua (+2/-2) data/tribes/workers/empire/lumberjack/init.lua (+3/-4) data/tribes/workers/empire/miller/init.lua (+2/-2) data/tribes/workers/empire/miner/init.lua (+2/-2) data/tribes/workers/empire/miner_master/init.lua (+2/-2) data/tribes/workers/empire/pigbreeder/init.lua (+2/-2) data/tribes/workers/empire/recruit/init.lua (+1/-1) data/tribes/workers/empire/scout/init.lua (+2/-2) data/tribes/workers/empire/shepherd/init.lua (+2/-2) data/tribes/workers/empire/shipwright/init.lua (+2/-2) data/tribes/workers/empire/smelter/init.lua (+2/-2) data/tribes/workers/empire/soldier/init.lua (+1/-1) data/tribes/workers/empire/stonemason/init.lua (+2/-2) data/tribes/workers/empire/toolsmith/init.lua (+2/-2) data/tribes/workers/empire/trainer/init.lua (+2/-2) data/tribes/workers/empire/vinefarmer/init.lua (+2/-2) data/tribes/workers/empire/vintner/init.lua (+2/-2) data/tribes/workers/empire/weaponsmith/init.lua (+2/-2) data/tribes/workers/empire/weaver/init.lua (+2/-2) data/tribes/workers/frisians/baker/init.lua (+2/-2) data/tribes/workers/frisians/baker_master/init.lua (+2/-2) data/tribes/workers/frisians/beekeeper/init.lua (+2/-2) data/tribes/workers/frisians/berry_farmer/init.lua (+1/-1) data/tribes/workers/frisians/blacksmith/init.lua (+2/-2) data/tribes/workers/frisians/blacksmith_master/init.lua (+2/-2) data/tribes/workers/frisians/brewer/init.lua (+2/-2) data/tribes/workers/frisians/brewer_master/init.lua (+2/-2) data/tribes/workers/frisians/brickmaker/init.lua (+2/-2) data/tribes/workers/frisians/builder/init.lua (+2/-2) data/tribes/workers/frisians/carrier/init.lua (+4/-9) data/tribes/workers/frisians/charcoal_burner/init.lua (+2/-2) data/tribes/workers/frisians/claydigger/init.lua (+2/-2) data/tribes/workers/frisians/farmer/init.lua (+2/-2) data/tribes/workers/frisians/fisher/init.lua (+2/-2) data/tribes/workers/frisians/forester/init.lua (+1/-1) data/tribes/workers/frisians/fruit_collector/init.lua (+2/-2) data/tribes/workers/frisians/geologist/init.lua (+1/-1) data/tribes/workers/frisians/hunter/init.lua (+2/-2) data/tribes/workers/frisians/landlady/init.lua (+2/-2) data/tribes/workers/frisians/miner/init.lua (+2/-2) data/tribes/workers/frisians/miner_master/init.lua (+2/-2) data/tribes/workers/frisians/reed_farmer/init.lua (+2/-2) data/tribes/workers/frisians/reindeer/init.lua (+2/-2) data/tribes/workers/frisians/reindeer_breeder/init.lua (+2/-2) data/tribes/workers/frisians/scout/init.lua (+2/-2) data/tribes/workers/frisians/seamstress/init.lua (+2/-2) data/tribes/workers/frisians/seamstress_master/init.lua (+2/-2) data/tribes/workers/frisians/shipwright/init.lua (+2/-2) data/tribes/workers/frisians/smelter/init.lua (+2/-2) data/tribes/workers/frisians/smoker/init.lua (+2/-2) data/tribes/workers/frisians/soldier/init.lua (+4/-4) data/tribes/workers/frisians/stonemason/init.lua (+2/-2) data/tribes/workers/frisians/trainer/init.lua (+2/-2) data/tribes/workers/frisians/woodcutter/init.lua (+4/-2) data/world/critters/badger/init.lua (+1/-1) data/world/critters/brownbear/init.lua (+1/-1) data/world/critters/bunny/init.lua (+1/-1) data/world/critters/chamois/init.lua (+1/-1) data/world/critters/deer/init.lua (+1/-1) data/world/critters/duck/init.lua (+1/-1) data/world/critters/elk/init.lua (+1/-1) data/world/critters/fox/init.lua (+1/-1) data/world/critters/lynx/init.lua (+1/-1) data/world/critters/marten/init.lua (+1/-1) data/world/critters/reindeer/init.lua (+1/-1) data/world/critters/sheep/init.lua (+1/-1) data/world/critters/stag/init.lua (+1/-1) data/world/critters/wildboar/init.lua (+1/-1) data/world/critters/wisent/init.lua (+1/-1) data/world/critters/wolf/init.lua (+1/-1) data/world/immovables/grass1/init.lua (+1/-1) data/world/immovables/grass2/init.lua (+1/-1) data/world/immovables/grass3/init.lua (+1/-1) doc/sphinx/source/animations.rst (+30/-59) src/CMakeLists.txt (+0/-1) src/game_io/game_loader.cc (+2/-1) src/graphic/animation.cc (+165/-143) src/graphic/animation.h (+8/-4) src/helper.h (+0/-13) src/io/filesystem/disk_filesystem.cc (+2/-2) src/io/filesystem/disk_filesystem.h (+2/-2) src/io/filesystem/filesystem.cc (+81/-0) src/io/filesystem/filesystem.h (+20/-2) src/io/filesystem/layered_filesystem.cc (+2/-2) src/io/filesystem/layered_filesystem.h (+2/-2) src/io/filesystem/zip_filesystem.cc (+2/-2) src/io/filesystem/zip_filesystem.h (+2/-2) src/logic/map_objects/map_object.cc (+47/-18) src/logic/map_objects/map_object.h (+8/-4) src/logic/map_objects/tribes/ship.cc (+1/-1) src/logic/map_objects/tribes/tribe_descr.cc (+6/-4) src/logic/map_objects/tribes/worker_descr.cc (+3/-3) src/logic/map_objects/world/critter.cc (+1/-1) src/map_io/CMakeLists.txt (+0/-1) src/map_io/map_scripting_packet.cc (+1/-2) src/scripting/lua_path.cc (+5/-1) src/sound/fxset.cc (+9/-16) src/sound/fxset.h (+4/-2) src/sound/songset.cc (+1/-5) src/sound/sound_handler.cc (+4/-0) src/sound/sound_handler.h (+2/-0) src/wlapplication.cc (+5/-6) src/wui/load_or_save_game.cc (+2/-3) |
||||
To merge this branch: | bzr merge lp:~widelands-dev/widelands/list-directories-in-cpp | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Toni Förster | Approve | ||
Review via email: mp+366614@code.launchpad.net |
Commit message
Improve performance and memory usage when loading tribes and world
- Save memory and loading time by not listing files via Lua
- Common sequential file loading function for image and sound files
- Replace regular expressions with NumberGlob for speedup
- Only load mipmap scales that are being used
- Preload sound files and animations at default scale for existing
map objects to prevent dropping FPS at game start
Description of the change
Performance :)
I have only converted the directional animations to the new system - the remaining animations will take care of themselves once we move to Spritemaps. Converting them now would cause a lot of unnecessary extra work.
Some stats:
TRUNK:
┏━ Running Lua for world:
┃ Resources: 58ms
┃ Terrains: 85ms
┃ Immovables: 1157ms
┃ Critters: 709ms
┗━ took: 2009ms
Loading the world took 2050ms
┏━ Running Lua for tribes:
┃ Ships: 280ms
┃ Wares: 871ms
┃ Immovables: 671ms
┃ Workers: 5775ms
┃ Warehouses: 357ms
┃ Productionsites: 3167ms
┃ Trainingsites: 162ms
┃ Militarysites: 318ms
┃ Partially finished buildings: 26ms
┃ Tribe infos: 380ms
┗━ took: 12007ms
Loading the tribes took 12033ms
THIS BRANCH:
┏━ Running Lua for world:
┃ Resources: 1ms
┃ Terrains: 13ms
┃ Immovables: 172ms
┃ Critters: 163ms
┗━ took: 349ms
Loading the world took 360ms
┏━ Running Lua for tribes:
┃ Ships: 70ms
┃ Wares: 65ms
┃ Immovables: 127ms
┃ Workers: 2134ms
┃ Warehouses: 33ms
┃ Productionsites: 384ms
┃ Trainingsites: 35ms
┃ Militarysites: 55ms
┃ Partially finished buildings: 2ms
┃ Tribe infos: 60ms
┗━ took: 2965ms
Loading the tribes took 2966ms
bunnybot (widelandsofficial) wrote : | # |
Toni Förster (stonerl) wrote : | # |
I got ~100 compile warnings:
src/io/
/// Returns all files in the given 'directory' that match 'basename[
GunChleoc (gunchleoc) wrote : | # |
Eek. Should be fixed now.
kaputtnik (franku) wrote : | # |
This is a big feature and should be merged soon!
Will do some testing today :-)
kaputtnik (franku) wrote : | # |
hm, loading a 8-players save game needs much more time with this branch here. trunk is r9111, both are release builds:
stoppped by hand:
trunk: ~ 11 sec.
this branch: ~ 24 sec.
The main difference when comparing the logs, is this output:
Trunk:
Second and third phase loading Map Objects ... took 34ms
This branch:
Second and third phase loading Map Objects ... ALSA lib pcm.c:8424:
So i am not sure if the alsa-thing is the cause of the difference. This alsa underrun happens each time i load that savegame with this branch, but not when loading it in trunk.
kaputtnik (franku) wrote : | # |
When watching the console output, the output stops exactly at that line for a while. It shows the error from alsa-lib and and after some time the timestamp "took: ...ms"
Toni Förster (stonerl) wrote : | # |
Same savegame with this branch.
Second and third phase loading Map Objects ... took 37ms
Not sure what triggers the underrun on your system. The question is, is this caused by changes in this branch OR is this a problem with your system that you never noticed until this branch...
kaputtnik (franku) wrote : | # |
I get this on a slow laptop, so maybe this machine dependent. Just curious that i didn't get this with trunk.
Toni, can you compare loading the save game with trunk, so we can see if this is really 10 sec. faster? Comparing the time for the editor would also be nice.
Anyway i noticed no other issues with this branch :-) So please can someone make a code review?
GunChleoc (gunchleoc) wrote : | # |
I now pre-loading the sounds for the existing Map Objects. I don't do that in trunk, and I get a lot of stutter there at game start instead.
Do you also get the ALSA problem with Build 20?
GunChleoc (gunchleoc) wrote : | # |
I don't get the ALSA error, looks like your sound driver doesn't like one of the files.
kaputtnik (franku) wrote : | # |
with build20 i get the alsa error much earlier, when loading immovables:
┃ Immovables: 859ms
ALSA lib pcm.c:8424:
I had to create a new save game though, because the attached one is incompatible. Not sure if all buildings were erected at this time. And i have the feeling the game starts much faster than with this branch.
With current trunk i get never the alsa error, so my sound driver seems to work fine with all of the files.
Maybe related: https:/
GunChleoc (gunchleoc) wrote : | # |
I have added some debug log output to this branch so that we can find out which file is causing the problem for you. You should see something like this with your savegame:
Second and third phase loading Map Objects ... NOCOM loading sound effect: sound/animals/
NOCOM loading sound effect: world/critters/
NOCOM loading sound effect: world/critters/
NOCOM loading sound effect: world/critters/
NOCOM loading sound effect: sound/animals/
NOCOM loading sound effect: sound/animals/
NOCOM loading sound effect: sound/farm/
NOCOM loading sound effect: sound/farm/
NOCOM loading sound effect: sound/farm/
NOCOM loading sound effect: sound/hammering
NOCOM loading sound effect: sound/hammering
NOCOM loading sound effect: sound/hammering
NOCOM loading sound effect: sound/animals/
NOCOM loading sound effect: sound/animals/
NOCOM loading sound effect: sound/animals/
NOCOM loading sound effect: sound/animals/
NOCOM loading sound effect: sound/animals/
NOCOM loading sound effect: sound/animals/
NOCOM loading sound effect: sound/animals/
NOCOM loading sound effect: sound/animals/
NOCOM loading sound effect: sound/animals/
NOCOM loading sound effect: sound/animals/
NOCOM loading sound effect: sound/animals/
NOCOM loading sound effect: sound/animals/
NOCOM loading sound effect: sound/animals/
took 14653ms
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 5022. State: errored. Details: https:/
Appveyor build 4802. State: success. Details: https:/
kaputtnik (franku) wrote : | # |
hm, there is now a text conflict shown...
Text conflict in data/tribes/
kaputtnik (franku) wrote : | # |
I am on my fast(er) machine now, but here there is no also error. But after the output of
NOCOM loading sound effect: sound/hammering
the output stops for a while. On each load of the save game the stop-time is different, one time the stop lasts longer, the other time it lasts shorter (but noticeable).
Toni Förster (stonerl) wrote : | # |
The merge conflict needs fixing. Also this is not part of this branch but maybe can be foxed here.
Game: Reading Map Data ... Game: Reading Map Data took 7ms
Game: Reading Player Info ... ┏━ Running Lua for world:
Here are newlines missing.
Besides that it sped up the loading for me.
GunChleoc (gunchleoc) wrote : | # |
> the output stops for a while. On each load of the save game the stop-time is different, one time the stop lasts longer, the other time it lasts shorter (but noticeable).
It stops because Widelands is loading more stuff for starting the game that isn't producing log outputs. This has nothing to do with this branch.
The ALSA error also has nothing to do with Widelands code, but we could try reencoding the affected sound file(s). I have removed the extra log output from this branch though, so this needs to be tested and fixed in a separate branch by somebody who can reproduce it. I have opened a new bug report for this:
https:/
> The merge conflict needs fixing.
Of course it does - done :)
> Also this is not part of this branch but maybe can be foxed here.
Done.
GunChleoc (gunchleoc) wrote : | # |
Thanks a lot for the review and testing :)
@bunnybot merge
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 5043. State: failed. Details: https:/
Appveyor build 4823. State: success. Details: https:/
bunnybot (widelandsofficial) wrote : | # |
Refusing to merge, since Travis is not green. Use @bunnybot merge force for merging anyways.
Travis build 5043. State: failed. Details: https:/
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 5056. State: passed. Details: https:/
Appveyor build 4836. State: success. Details: https:/
GunChleoc (gunchleoc) wrote : | # |
@bunnybot merge
bunnybot (widelandsofficial) wrote : | # |
Error merging this proposal:
Output:
stdout:
stderr:
R data/music/
R data/music/
M data/scripting/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
R data/sound/
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 5072. State: passed. Details: https:/
Appveyor build 4852. State: failed. Details: https:/
GunChleoc (gunchleoc) wrote : | # |
@bunnybot merge
Preview Diff
1 | === renamed file 'data/music/intro_00.ogg' => 'data/music/intro.ogg' | |||
2 | === renamed file 'data/music/menu_00.ogg' => 'data/music/menu.ogg' | |||
3 | === modified file 'data/scripting/mapobjects.lua' | |||
4 | --- data/scripting/mapobjects.lua 2019-04-24 20:48:37 +0000 | |||
5 | +++ data/scripting/mapobjects.lua 2019-05-27 14:29:35 +0000 | |||
6 | @@ -21,25 +21,6 @@ | |||
7 | 21 | print(("%s: %dms"):format(preamble, ticks() - start)) | 21 | print(("%s: %dms"):format(preamble, ticks() - start)) |
8 | 22 | end | 22 | end |
9 | 23 | 23 | ||
10 | 24 | |||
11 | 25 | -- Helper function for finding animation files with varying numbering length | ||
12 | 26 | function get_animation_files(prefix) | ||
13 | 27 | local animation_files = path.list_files(prefix .. "_??.png") | ||
14 | 28 | if #animation_files < 1 then | ||
15 | 29 | animation_files = path.list_files(prefix .. "_???.png") | ||
16 | 30 | end | ||
17 | 31 | if #animation_files < 1 then | ||
18 | 32 | animation_files = path.list_files(prefix .. "_?.png") | ||
19 | 33 | end | ||
20 | 34 | return animation_files | ||
21 | 35 | end | ||
22 | 36 | |||
23 | 37 | |||
24 | 38 | -- The mipmap scales supported by the engine. | ||
25 | 39 | -- Ensure that this always matches kSupportedScales in animations.cc | ||
26 | 40 | local supported_scales = { 0.5, 1, 2, 4 } | ||
27 | 41 | |||
28 | 42 | |||
29 | 43 | -- RST | 24 | -- RST |
30 | 44 | -- .. function:: add_animation(animationtable, animationname, dirname, basename, hotspot [, fps]) | 25 | -- .. function:: add_animation(animationtable, animationname, dirname, basename, hotspot [, fps]) |
31 | 45 | -- | 26 | -- |
32 | @@ -55,8 +36,8 @@ | |||
33 | 55 | -- :arg dirname: The name of the directory where the animation image files are located. | 36 | -- :arg dirname: The name of the directory where the animation image files are located. |
34 | 56 | -- :type dirname: :class:`string` | 37 | -- :type dirname: :class:`string` |
35 | 57 | -- :arg basename: The basename of the animation files. The filenames of the | 38 | -- :arg basename: The basename of the animation files. The filenames of the |
38 | 58 | -- animation files need to have the format ``<basename>_\d{2,3}.png`` for simple | 39 | -- animation files need to have the format ``<basename>_[_\d+].png`` for simple |
39 | 59 | -- file animations, and ``<basename>_<scale>_\d{2,3}.png`` for mipmaps. | 40 | -- file animations, and ``<basename>_<scale>[_\d+].png`` for mipmaps. |
40 | 60 | -- Supported scales are ``0.5``, ``1``, ``2`` and ``4``. | 41 | -- Supported scales are ``0.5``, ``1``, ``2`` and ``4``. |
41 | 61 | -- :type basename: :class:`string` | 42 | -- :type basename: :class:`string` |
42 | 62 | -- :arg hotspot: The hotspot coordinates for blitting, e.g. ``{2, 20}``. | 43 | -- :arg hotspot: The hotspot coordinates for blitting, e.g. ``{2, 20}``. |
43 | @@ -65,30 +46,9 @@ | |||
44 | 65 | -- 1 frame, and if you need to deviate from the default frame rate. | 46 | -- 1 frame, and if you need to deviate from the default frame rate. |
45 | 66 | -- :type fps: :class:`integer` | 47 | -- :type fps: :class:`integer` |
46 | 67 | function add_animation(animationtable, animationname, dirname, basename, hotspot, fps) | 48 | function add_animation(animationtable, animationname, dirname, basename, hotspot, fps) |
47 | 68 | mipmap = {} | ||
48 | 69 | for scale_idx, current_scale in ipairs(supported_scales) do | ||
49 | 70 | local listed_files = get_animation_files(dirname .. basename .. "_" .. current_scale) | ||
50 | 71 | if #listed_files > 0 then | ||
51 | 72 | table.insert( | ||
52 | 73 | mipmap, | ||
53 | 74 | { | ||
54 | 75 | scale = current_scale, | ||
55 | 76 | files = listed_files, | ||
56 | 77 | } | ||
57 | 78 | ) | ||
58 | 79 | end | ||
59 | 80 | end | ||
60 | 81 | if #mipmap < 1 then | ||
61 | 82 | table.insert( | ||
62 | 83 | mipmap, | ||
63 | 84 | { | ||
64 | 85 | scale = 1, | ||
65 | 86 | files = get_animation_files(dirname .. basename), | ||
66 | 87 | } | ||
67 | 88 | ) | ||
68 | 89 | end | ||
69 | 90 | animationtable[animationname] = { | 49 | animationtable[animationname] = { |
71 | 91 | mipmap = mipmap, | 50 | directory = dirname, |
72 | 51 | basename = basename, | ||
73 | 92 | hotspot = hotspot, | 52 | hotspot = hotspot, |
74 | 93 | } | 53 | } |
75 | 94 | if (fps ~= nil) then | 54 | if (fps ~= nil) then |
76 | @@ -96,10 +56,8 @@ | |||
77 | 96 | end | 56 | end |
78 | 97 | end | 57 | end |
79 | 98 | 58 | ||
80 | 99 | |||
81 | 100 | |||
82 | 101 | -- RST | 59 | -- RST |
84 | 102 | -- .. function:: add_walking_animations(animationtable, animationname, dirname, basename, hotspot [, fps]) | 60 | -- .. function:: add_directional_animation(animationtable, animationname, dirname, basename, hotspot [, fps]) |
85 | 103 | -- | 61 | -- |
86 | 104 | -- Adds 6 walk or sail animations - one for each walking direction - to `animationtable`. | 62 | -- Adds 6 walk or sail animations - one for each walking direction - to `animationtable`. |
87 | 105 | -- Supports both simple animations and mipmaps. | 63 | -- Supports both simple animations and mipmaps. |
88 | @@ -123,12 +81,7 @@ | |||
89 | 123 | -- :arg fps: Frames per second. Only use this if the animation has more than | 81 | -- :arg fps: Frames per second. Only use this if the animation has more than |
90 | 124 | -- 1 frame, and if you need to deviate from the default frame rate. | 82 | -- 1 frame, and if you need to deviate from the default frame rate. |
91 | 125 | -- :type fps: :class:`integer` | 83 | -- :type fps: :class:`integer` |
100 | 126 | function add_walking_animations(animationtable, animationname, dirname, basename, hotspot, fps) | 84 | function add_directional_animation(animationtable, animationname, dirname, basename, hotspot, fps) |
101 | 127 | for idx, dir in ipairs{ "ne", "e", "se", "sw", "w", "nw" } do | 85 | add_animation(animationtable, animationname, dirname, basename, hotspot, fps) |
102 | 128 | if fps ~= nil then | 86 | animationtable[animationname]["directional"] = true |
95 | 129 | add_animation(animationtable, animationname .. "_" .. dir, dirname, basename .. "_" .. dir, hotspot, fps) | ||
96 | 130 | else | ||
97 | 131 | add_animation(animationtable, animationname .. "_" .. dir, dirname, basename .. "_" .. dir, hotspot) | ||
98 | 132 | end | ||
99 | 133 | end | ||
103 | 134 | end | 87 | end |
104 | 135 | 88 | ||
105 | === renamed file 'data/sound/animals/boar_01.ogg' => 'data/sound/animals/boar.ogg' | |||
106 | === renamed file 'data/sound/animals/coyote_01.ogg' => 'data/sound/animals/coyote_00.ogg' | |||
107 | === renamed file 'data/sound/animals/coyote_02.ogg' => 'data/sound/animals/coyote_01.ogg' | |||
108 | === renamed file 'data/sound/animals/crickets1_01.ogg' => 'data/sound/animals/crickets1_00.ogg' | |||
109 | === renamed file 'data/sound/animals/crickets2_01.ogg' => 'data/sound/animals/crickets2_00.ogg' | |||
110 | === renamed file 'data/sound/animals/elk_01.ogg' => 'data/sound/animals/elk_00.ogg' | |||
111 | === renamed file 'data/sound/animals/elk_02.ogg' => 'data/sound/animals/elk_01.ogg' | |||
112 | === renamed file 'data/sound/animals/elk_10.ogg' => 'data/sound/animals/elk_02.ogg' | |||
113 | === renamed file 'data/sound/animals/elk_11.ogg' => 'data/sound/animals/elk_03.ogg' | |||
114 | === renamed file 'data/sound/animals/frog1_00.ogg' => 'data/sound/animals/frog.ogg' | |||
115 | === renamed file 'data/sound/animals/stag_01.ogg' => 'data/sound/animals/stag_00.ogg' | |||
116 | === renamed file 'data/sound/animals/stag_02.ogg' => 'data/sound/animals/stag_01.ogg' | |||
117 | === renamed file 'data/sound/animals/stag_10.ogg' => 'data/sound/animals/stag_02.ogg' | |||
118 | === renamed file 'data/sound/animals/stag_11.ogg' => 'data/sound/animals/stag_03.ogg' | |||
119 | === renamed file 'data/sound/animals/stag_12.ogg' => 'data/sound/animals/stag_04.ogg' | |||
120 | === renamed file 'data/sound/animals/stag_13.ogg' => 'data/sound/animals/stag_05.ogg' | |||
121 | === renamed file 'data/sound/animals/wolf_01.ogg' => 'data/sound/animals/wolf_00.ogg' | |||
122 | === renamed file 'data/sound/animals/wolf_02.ogg' => 'data/sound/animals/wolf_01.ogg' | |||
123 | === renamed file 'data/sound/animals/wolf_03.ogg' => 'data/sound/animals/wolf_02.ogg' | |||
124 | === renamed file 'data/sound/animals/wolf_10.ogg' => 'data/sound/animals/wolf_03.ogg' | |||
125 | === renamed file 'data/sound/animals/wolf_11.ogg' => 'data/sound/animals/wolf_04.ogg' | |||
126 | === renamed file 'data/sound/animals/wolf_12.ogg' => 'data/sound/animals/wolf_05.ogg' | |||
127 | === renamed file 'data/sound/animals/wolf_13.ogg' => 'data/sound/animals/wolf_06.ogg' | |||
128 | === renamed file 'data/sound/animals/wolf_14.ogg' => 'data/sound/animals/wolf_07.ogg' | |||
129 | === renamed file 'data/sound/atlanteans/cutting/stonecutter_01.ogg' => 'data/sound/atlanteans/cutting/stonecutter_00.ogg' | |||
130 | === renamed file 'data/sound/atlanteans/cutting/stonecutter_02.ogg' => 'data/sound/atlanteans/cutting/stonecutter_01.ogg' | |||
131 | === renamed file 'data/sound/atlanteans/cutting/stonecutter_03.ogg' => 'data/sound/atlanteans/cutting/stonecutter_02.ogg' | |||
132 | === renamed file 'data/sound/atlanteans/goldspin_01.ogg' => 'data/sound/atlanteans/goldspin_00.ogg' | |||
133 | === renamed file 'data/sound/atlanteans/goldspin_02.ogg' => 'data/sound/atlanteans/goldspin_01.ogg' | |||
134 | === renamed file 'data/sound/atlanteans/saw/benchsaw_01.ogg' => 'data/sound/atlanteans/saw/benchsaw_00.ogg' | |||
135 | === renamed file 'data/sound/atlanteans/saw/benchsaw_02.ogg' => 'data/sound/atlanteans/saw/benchsaw_01.ogg' | |||
136 | === renamed file 'data/sound/atlanteans/saw/benchsaw_03.ogg' => 'data/sound/atlanteans/saw/benchsaw_02.ogg' | |||
137 | === renamed file 'data/sound/atlanteans/saw/sawing_01.ogg' => 'data/sound/atlanteans/saw/sawing_00.ogg' | |||
138 | === renamed file 'data/sound/atlanteans/saw/sawing_02.ogg' => 'data/sound/atlanteans/saw/sawing_01.ogg' | |||
139 | === renamed file 'data/sound/atlanteans/saw/sawing_03.ogg' => 'data/sound/atlanteans/saw/sawing_02.ogg' | |||
140 | === renamed file 'data/sound/barbarians/blackwood_01.ogg' => 'data/sound/barbarians/blackwood.ogg' | |||
141 | === renamed file 'data/sound/barbarians/mortar_01.ogg' => 'data/sound/barbarians/mortar.ogg' | |||
142 | === renamed file 'data/sound/barbarians/stonegrind_01.ogg' => 'data/sound/barbarians/stonegrind.ogg' | |||
143 | === renamed file 'data/sound/barbarians/taverns/biginn_01.ogg' => 'data/sound/barbarians/taverns/biginn_00.ogg' | |||
144 | === renamed file 'data/sound/barbarians/taverns/biginn_02.ogg' => 'data/sound/barbarians/taverns/biginn_01.ogg' | |||
145 | === removed file 'data/sound/barbarians/taverns/biginn_10.ogg' | |||
146 | 136 | Binary files data/sound/barbarians/taverns/biginn_10.ogg 2016-07-18 09:25:41 +0000 and data/sound/barbarians/taverns/biginn_10.ogg 1970-01-01 00:00:00 +0000 differ | 89 | Binary files data/sound/barbarians/taverns/biginn_10.ogg 2016-07-18 09:25:41 +0000 and data/sound/barbarians/taverns/biginn_10.ogg 1970-01-01 00:00:00 +0000 differ |
147 | === renamed file 'data/sound/barbarians/taverns/inn_01.ogg' => 'data/sound/barbarians/taverns/inn_00.ogg' | |||
148 | === renamed file 'data/sound/barbarians/taverns/inn_02.ogg' => 'data/sound/barbarians/taverns/inn_01.ogg' | |||
149 | === removed file 'data/sound/barbarians/taverns/inn_10.ogg' | |||
150 | 137 | Binary files data/sound/barbarians/taverns/inn_10.ogg 2016-07-18 09:25:41 +0000 and data/sound/barbarians/taverns/inn_10.ogg 1970-01-01 00:00:00 +0000 differ | 90 | Binary files data/sound/barbarians/taverns/inn_10.ogg 2016-07-18 09:25:41 +0000 and data/sound/barbarians/taverns/inn_10.ogg 1970-01-01 00:00:00 +0000 differ |
151 | === renamed file 'data/sound/barbarians/taverns/tavern_01.ogg' => 'data/sound/barbarians/taverns/tavern_00.ogg' | |||
152 | === renamed file 'data/sound/barbarians/taverns/tavern_02.ogg' => 'data/sound/barbarians/taverns/tavern_01.ogg' | |||
153 | === removed file 'data/sound/barbarians/taverns/tavern_10.ogg' | |||
154 | 138 | Binary files data/sound/barbarians/taverns/tavern_10.ogg 2016-07-18 09:25:41 +0000 and data/sound/barbarians/taverns/tavern_10.ogg 1970-01-01 00:00:00 +0000 differ | 91 | Binary files data/sound/barbarians/taverns/tavern_10.ogg 2016-07-18 09:25:41 +0000 and data/sound/barbarians/taverns/tavern_10.ogg 1970-01-01 00:00:00 +0000 differ |
155 | === renamed file 'data/sound/barbarians/weaver_01.ogg' => 'data/sound/barbarians/weaver.ogg' | |||
156 | === renamed file 'data/sound/click_00.ogg' => 'data/sound/click.ogg' | |||
157 | === renamed file 'data/sound/create_construction_site_00.ogg' => 'data/sound/create_construction_site.ogg' | |||
158 | === renamed file 'data/sound/empire/beerbubble_01.ogg' => 'data/sound/empire/beerbubble_00.ogg' | |||
159 | === renamed file 'data/sound/empire/beerbubble_02.ogg' => 'data/sound/empire/beerbubble_01.ogg' | |||
160 | === renamed file 'data/sound/empire/taverns/meal_01.ogg' => 'data/sound/empire/taverns/meal_00.ogg' | |||
161 | === renamed file 'data/sound/empire/taverns/meal_02.ogg' => 'data/sound/empire/taverns/meal_01.ogg' | |||
162 | === removed file 'data/sound/empire/taverns/meal_10.ogg' | |||
163 | 139 | Binary files data/sound/empire/taverns/meal_10.ogg 2016-07-18 09:25:41 +0000 and data/sound/empire/taverns/meal_10.ogg 1970-01-01 00:00:00 +0000 differ | 92 | Binary files data/sound/empire/taverns/meal_10.ogg 2016-07-18 09:25:41 +0000 and data/sound/empire/taverns/meal_10.ogg 1970-01-01 00:00:00 +0000 differ |
164 | === renamed file 'data/sound/empire/taverns/ration_01.ogg' => 'data/sound/empire/taverns/ration_00.ogg' | |||
165 | === renamed file 'data/sound/empire/taverns/ration_02.ogg' => 'data/sound/empire/taverns/ration_01.ogg' | |||
166 | === removed file 'data/sound/empire/taverns/ration_10.ogg' | |||
167 | 140 | Binary files data/sound/empire/taverns/ration_10.ogg 2016-07-18 09:25:41 +0000 and data/sound/empire/taverns/ration_10.ogg 1970-01-01 00:00:00 +0000 differ | 93 | Binary files data/sound/empire/taverns/ration_10.ogg 2016-07-18 09:25:41 +0000 and data/sound/empire/taverns/ration_10.ogg 1970-01-01 00:00:00 +0000 differ |
168 | === renamed file 'data/sound/empire/winebubble_01.ogg' => 'data/sound/empire/winebubble_00.ogg' | |||
169 | === renamed file 'data/sound/empire/winebubble_02.ogg' => 'data/sound/empire/winebubble_01.ogg' | |||
170 | === renamed file 'data/sound/farm/donkey_00.ogg' => 'data/sound/farm/donkey.ogg' | |||
171 | === renamed file 'data/sound/farm/sheep_01.ogg' => 'data/sound/farm/sheep_00.ogg' | |||
172 | === renamed file 'data/sound/farm/sheep_02.ogg' => 'data/sound/farm/sheep_01.ogg' | |||
173 | === renamed file 'data/sound/farm/sheep_03.ogg' => 'data/sound/farm/sheep_02.ogg' | |||
174 | === renamed file 'data/sound/fisher/fisher_pull_net_00.ogg' => 'data/sound/fisher/fisher_pull_net.ogg' | |||
175 | === renamed file 'data/sound/fisher/fisher_throw_net_00.ogg' => 'data/sound/fisher/fisher_throw_net.ogg' | |||
176 | === renamed file 'data/sound/hammering/geologist_hammer_00.ogg' => 'data/sound/hammering/geologist_hammer.ogg' | |||
177 | === renamed file 'data/sound/lobby_chat_00.ogg' => 'data/sound/lobby_chat.ogg' | |||
178 | === renamed file 'data/sound/lobby_freshmen_00.ogg' => 'data/sound/lobby_freshmen.ogg' | |||
179 | === renamed file 'data/sound/metal/fizzle_01.ogg' => 'data/sound/metal/fizzle.ogg' | |||
180 | === renamed file 'data/sound/metal/furnace_01.ogg' => 'data/sound/metal/furnace.ogg' | |||
181 | === renamed file 'data/sound/metal/goldping_01.ogg' => 'data/sound/metal/goldping.ogg' | |||
182 | === renamed file 'data/sound/metal/ironping_01.ogg' => 'data/sound/metal/ironping.ogg' | |||
183 | === renamed file 'data/sound/military/site_occupied_00.ogg' => 'data/sound/military/site_occupied.ogg' | |||
184 | === renamed file 'data/sound/military/under_attack_00.ogg' => 'data/sound/military/under_attack.ogg' | |||
185 | === renamed file 'data/sound/mill/weaving_01.ogg' => 'data/sound/mill/weaving.ogg' | |||
186 | === renamed file 'data/sound/smiths/sharpening_00.ogg' => 'data/sound/smiths/sharpening.ogg' | |||
187 | === removed directory 'data/sound/spoken' | |||
188 | === removed file 'data/sound/spoken/timber_00.ogg' | |||
189 | 141 | Binary files data/sound/spoken/timber_00.ogg 2008-10-19 07:47:24 +0000 and data/sound/spoken/timber_00.ogg 1970-01-01 00:00:00 +0000 differ | 94 | Binary files data/sound/spoken/timber_00.ogg 2008-10-19 07:47:24 +0000 and data/sound/spoken/timber_00.ogg 1970-01-01 00:00:00 +0000 differ |
190 | === removed file 'data/sound/spoken/timber_01.ogg' | |||
191 | 142 | Binary files data/sound/spoken/timber_01.ogg 2008-10-19 07:47:24 +0000 and data/sound/spoken/timber_01.ogg 1970-01-01 00:00:00 +0000 differ | 95 | Binary files data/sound/spoken/timber_01.ogg 2008-10-19 07:47:24 +0000 and data/sound/spoken/timber_01.ogg 1970-01-01 00:00:00 +0000 differ |
192 | === renamed file 'data/sound/stonecutting/stonecutter_00.ogg' => 'data/sound/stonecutting/stonecutter.ogg' | |||
193 | === renamed file 'data/sound/stonecutting/stonemason_00.ogg' => 'data/sound/stonecutting/stonemason.ogg' | |||
194 | === modified file 'data/sound/wl-sound-docu.csv' | |||
195 | --- data/sound/wl-sound-docu.csv 2017-02-09 13:11:36 +0000 | |||
196 | +++ data/sound/wl-sound-docu.csv 2019-05-27 14:29:35 +0000 | |||
197 | @@ -1,53 +1,54 @@ | |||
198 | 1 | Widelands Sound Documentation (toptopple’s sounds added since BZR 8019),,,,,,,,,, | 1 | Widelands Sound Documentation (toptopple’s sounds added since BZR 8019),,,,,,,,,, |
199 | 2 | There are some empty sounds to reduce the probability value of playing them below 1. You can recognize them by the file size of 3.6kB.,,,,,,,,,, | ||
200 | 2 | ,,,,,,,,,, | 3 | ,,,,,,,,,, |
201 | 3 | File Name,Format,Location,Usage,Author,License,reworked,Original File Name,Source,Orig. Format,BZR | 4 | File Name,Format,Location,Usage,Author,License,reworked,Original File Name,Source,Orig. Format,BZR |
202 | 4 | ,,,,,,,,,, | 5 | ,,,,,,,,,, |
203 | 6 | beerbubble_00.ogg,11025 – 16,sound/empire,empire.brewery,Julian Evans,CC-0,yes,338107__mentalsanityoff__beer-fermenter-gurgling-liquid-bubbles-glug.wav,http://www.freesound.org/people/MentalSanityOff/sounds/338107/,48000 – 24,8022 | ||
204 | 5 | beerbubble_01.ogg,11025 – 16,sound/empire,empire.brewery,Julian Evans,CC-0,yes,338107__mentalsanityoff__beer-fermenter-gurgling-liquid-bubbles-glug.wav,http://www.freesound.org/people/MentalSanityOff/sounds/338107/,48000 – 24,8022 | 7 | beerbubble_01.ogg,11025 – 16,sound/empire,empire.brewery,Julian Evans,CC-0,yes,338107__mentalsanityoff__beer-fermenter-gurgling-liquid-bubbles-glug.wav,http://www.freesound.org/people/MentalSanityOff/sounds/338107/,48000 – 24,8022 |
206 | 6 | beerbubble_02.ogg,11025 – 16,sound/empire,empire.brewery,Julian Evans,CC-0,yes,338107__mentalsanityoff__beer-fermenter-gurgling-liquid-bubbles-glug.wav,http://www.freesound.org/people/MentalSanityOff/sounds/338107/,48000 – 24,8022 | 8 | winebubble_00.ogg,22050 – 16,sound/empire,empire.winery,Michael Hinze,CC-0,yes,275578__hinzebeat__big-bubbles-on-water.wav,http://www.freesound.org/people/hinzebeat/sounds/275578/,44100 – 16,8022 |
207 | 7 | winebubble_01.ogg,22050 – 16,sound/empire,empire.winery,Michael Hinze,CC-0,yes,275578__hinzebeat__big-bubbles-on-water.wav,http://www.freesound.org/people/hinzebeat/sounds/275578/,44100 – 16,8022 | 9 | winebubble_01.ogg,22050 – 16,sound/empire,empire.winery,Michael Hinze,CC-0,yes,275578__hinzebeat__big-bubbles-on-water.wav,http://www.freesound.org/people/hinzebeat/sounds/275578/,44100 – 16,8022 |
228 | 8 | winebubble_02.ogg,22050 – 16,sound/empire,empire.winery,Michael Hinze,CC-0,yes,275578__hinzebeat__big-bubbles-on-water.wav,http://www.freesound.org/people/hinzebeat/sounds/275578/,44100 – 16,8022 | 10 | fizzle.ogg,11025 – 16,sound/metal,empire.smelting_works,luffy,CC-3,yes,17299__luffy__luffy-fire3alternate.wav,http://www.freesound.org/people/luffy/sounds/17299/,44100 – 16,8022 |
229 | 9 | fizzle_01.ogg,11025 – 16,sound/metal,empire.smelting_works,luffy,CC-3,yes,17299__luffy__luffy-fire3alternate.wav,http://www.freesound.org/people/luffy/sounds/17299/,44100 – 16,8022 | 11 | ironping.ogg,22050 – 16,sound/metal,empire.smelting_works,timgormly,CC-3,yes,170964__timgormly__metal-ping1.aiff,http://www.freesound.org/people/timgormly/sounds/170964/,44100 – 16,8022 |
230 | 10 | ironping_01.ogg,22050 – 16,sound/metal,empire.smelting_works,timgormly,CC-3,yes,170964__timgormly__metal-ping1.aiff,http://www.freesound.org/people/timgormly/sounds/170964/,44100 – 16,8022 | 12 | goldping.ogg,22050 – 16,sound/metal,empire.smelting_works,timgormly,CC-3,yes,170964__timgormly__metal-ping1.aiff,http://www.freesound.org/people/timgormly/sounds/170964/,44100 – 16,8022 |
231 | 11 | goldping_01.ogg,22050 – 16,sound/metal,empire.smelting_works,timgormly,CC-3,yes,170964__timgormly__metal-ping1.aiff,http://www.freesound.org/people/timgormly/sounds/170964/,44100 – 16,8022 | 13 | furnace.ogg,11025 – 16,sound/metal,barbarian.smelting_works,UNKNOWN,,yes,Fire-8.wav,UNKNOWN,22050,8022 |
232 | 12 | furnace_01.ogg,11025 – 16,sound/metal,barbarian.smelting_works,UNKNOWN,,yes,Fire-8.wav,UNKNOWN,22050,8022 | 14 | blackwood.ogg,11025 – 16,sound/barbarians,barbarian.wood_hardener,UNKNOWN,,,Creek-1.wav,UNKNOWN,11025-32,8029 |
233 | 13 | blackwood_01.ogg,11025 – 16,sound/barbarians,barbarian.wood_hardener,UNKNOWN,,,Creek-1.wav,UNKNOWN,11025-32,8029 | 15 | mortar.ogg,11025 – 16,sound/barbarians,barbarian.limekiln,qubodup,CC-0,yes,184383__qubodup__gathering-stone-resources.flac,http://www.freesound.org/people/qubodup/sounds/184383/,48000 – 16,8029 |
234 | 14 | mortar_01.ogg,11025 – 16,sound/barbarians,barbarian.limekiln,qubodup,CC-0,yes,184383__qubodup__gathering-stone-resources.flac,http://www.freesound.org/people/qubodup/sounds/184383/,48000 – 16,8029 | 16 | stonegrind.ogg,22050 – 16,sound/barbarians,barbarian.limekiln,timgormly,CC-3,yes,232102__thalamus-lab__stone-grind.wav,http://www.freesound.org/people/Thalamus_Lab/sounds/232102/,44100 – 32,8029 |
235 | 15 | stonegrind_01.ogg,22050 – 16,sound/barbarians,barbarian.limekiln,timgormly,CC-3,yes,232102__thalamus-lab__stone-grind.wav,http://www.freesound.org/people/Thalamus_Lab/sounds/232102/,44100 – 32,8029 | 17 | tavern_00.ogg,11025 – 16,sound/barbarians/taverns,,UNKNOWN,,,Dishes-21.wav,UNKNOWN,11025,8029 |
236 | 16 | tavern_01.ogg,11025 – 16,sound/barbarians/taverns,,UNKNOWN,,,Dishes-21.wav,UNKNOWN,11025,8029 | 18 | tavern_01.ogg,16000,sound/barbarians/taverns,,UNKNOWN,,,Dishes-1.wav,UNKNOWN,22050,8029 |
237 | 17 | tavern_02.ogg,16000,sound/barbarians/taverns,,UNKNOWN,,,Dishes-1.wav,UNKNOWN,22050,8029 | 19 | inn_00.ogg,22050 – 16,sound/barbarians/taverns,barbarian.inn,Eelke Dekker,CC-3,yes,192099__eelke__preparing-dishes.wav,http://www.freesound.org/people/Eelke/sounds/192099/,44100 – 32,8145 |
238 | 18 | inn_01.ogg,22050 – 16,sound/barbarians/taverns,barbarian.inn,Eelke Dekker,CC-3,yes,192099__eelke__preparing-dishes.wav,http://www.freesound.org/people/Eelke/sounds/192099/,44100 – 32,8145 | 20 | inn_01.ogg,22050 – 16,sound/barbarians/taverns,barbarian.inn,Hannebu,CC-0,yes,194806__hannebu__frying.wav,http://www.freesound.org/people/Hannebu/sounds/194806/,48000 – 24,8145 |
239 | 19 | inn_02.ogg,22050 – 16,sound/barbarians/taverns,barbarian.inn,Hannebu,CC-0,yes,194806__hannebu__frying.wav,http://www.freesound.org/people/Hannebu/sounds/194806/,48000 – 24,8145 | 21 | biginn_00.ogg,22050 – 16,sound/barbarians/taverns,barbarian.biginn,Eelke Dekker,CC-3,yes,192099__eelke__preparing-dishes.wav,http://www.freesound.org/people/Eelke/sounds/192099/,44100 – 32,8145 |
240 | 20 | biginn_01.ogg,22050 – 16,sound/barbarians/taverns,barbarian.biginn,Eelke Dekker,CC-3,yes,192099__eelke__preparing-dishes.wav,http://www.freesound.org/people/Eelke/sounds/192099/,44100 – 32,8145 | 22 | biginn_01.ogg,11025 – 16,sound/barbarians/taverns,barbarian.biginn,Mike Koenig,CC-3,yes,Glass Cookie Jar-SoundBible.com-2105585386.wav,http://soundbible.com/314-Glass-Cookie-Jar.html,32000 – 32,8145 |
241 | 21 | biginn_02.ogg,11025 – 16,sound/barbarians/taverns,barbarian.biginn,Mike Koenig,CC-3,yes,Glass Cookie Jar-SoundBible.com-2105585386.wav,http://soundbible.com/314-Glass-Cookie-Jar.html,32000 – 32,8145 | 23 | meal_00.ogg,,sound/empire/taverns,empire.biginn,DUPLICATE to inn_01.ogg,,,,,,8145 |
242 | 22 | meal_01.ogg,,sound/empire/taverns,empire.biginn,DUPLICATE to inn_01.ogg,,,,,,8145 | 24 | meal_01.ogg,22050 – 16,sound/empire/taverns,empire.biginn,UNKNOWN,,,Bottle-2.wav,UNKNOWN,22050 – 32,8145 |
243 | 23 | meal_02.ogg,22050 – 16,sound/empire/taverns,empire.biginn,UNKNOWN,,,Bottle-2.wav,UNKNOWN,22050 – 32,8145 | 25 | ration_00.ogg,,sound/empire/taverns,empire.inn,DUPLICATE to tavern_02.ogg,,,,,,8145 |
244 | 24 | ration_01.ogg,,sound/empire/taverns,empire.inn,DUPLICATE to tavern_02.ogg,,,,,,8145 | 26 | ration_01.ogg,,sound/empire/taverns,empire.inn,DUPLICATE to tavern_01.ogg,,,,,,8145 |
245 | 25 | ration_02.ogg,,sound/empire/taverns,empire.inn,DUPLICATE to tavern_01.ogg,,,,,,8145 | 27 | weaving.ogg,22050 – 32,sound/mill,"empire.weavingmill, atlanteans.weavingmill",Xavier Serra,CC-3,yes,320510__xserra__kerala-1.wav,http://www.freesound.org/people/xserra/sounds/320510/,44100 – 16,8251 |
246 | 26 | weaving_01.ogg,22050 – 32,sound/mill,"empire.weavingmill, atlanteans.weavingmill",Xavier Serra,CC-3,yes,320510__xserra__kerala-1.wav,http://www.freesound.org/people/xserra/sounds/320510/,44100 – 16,8251 | 28 | weaver.ogg,22050 – 32,sound/barbarians,barbarian.weavingmill,Yle Arkisto,CC-3,yes,368577__ylearkisto__kangaspuut-old-wooden-loom-from-1857-weaving-a-rag-rug.wav,http://www.freesound.org/people/YleArkisto/sounds/368577/,44100 – 24,8251 |
247 | 27 | weaver_01.ogg,22050 – 32,sound/barbarians,barbarian.weavingmill,Yle Arkisto,CC-3,yes,368577__ylearkisto__kangaspuut-old-wooden-loom-from-1857-weaving-a-rag-rug.wav,http://www.freesound.org/people/YleArkisto/sounds/368577/,44100 – 24,8251 | 29 | stonecutter_00.ogg,22050 – 32,sound/atlanteans/cutting,atlanteans.stonecutter,Benboncan,CC-3,yes,71823__benboncan__pickaxe-striking-rock.wav,http://www.freesound.org/people/Benboncan/sounds/71823/,44100 – 16,8251 |
248 | 28 | stonecutter_01.ogg,22050 – 32,sound/atlanteans/cutting,atlanteans.stonecutter,Benboncan,CC-3,yes,71823__benboncan__pickaxe-striking-rock.wav,http://www.freesound.org/people/Benboncan/sounds/71823/,44100 – 16,8251 | 30 | stonecutter_01.ogg,22050 – 32,sound/atlanteans/cutting,atlanteans.stonecutter,Benboncan,CC-3,yes,71823__benboncan__pickaxe-striking-rock.wav,http://www.freesound.org/people/Benboncan/sounds/71823/,44100 – 16,8251 |
249 | 29 | stonecutter_02.ogg,22050 – 32,sound/atlanteans/cutting,atlanteans.stonecutter,Benboncan,CC-3,yes,71823__benboncan__pickaxe-striking-rock.wav,http://www.freesound.org/people/Benboncan/sounds/71823/,44100 – 16,8251 | 31 | stonecutter_02.ogg,22050 – 32,sound/atlanteans/cutting,atlanteans.stonecutter,Benboncan,CC-3,yes,71823__benboncan__pickaxe-striking-rock.wav,http://www.freesound.org/people/Benboncan/sounds/71823/,44100 – 16,8251 |
251 | 30 | stonecutter_03.ogg,22050 – 32,sound/atlanteans/cutting,atlanteans.stonecutter,Benboncan,CC-3,yes,71823__benboncan__pickaxe-striking-rock.wav,http://www.freesound.org/people/Benboncan/sounds/71823/,44100 – 16,8251 | 32 | benchsaw_00.ogg,22050 – 32,sound/atlanteans/saw,atlanteans.sawmill,mauxuam,CC-0,yes,216828__mauxuam__saw-of-avalon-2.wav,http://www.freesound.org/people/mauxuam/sounds/216828/,44100 – 16,8251 |
252 | 31 | benchsaw_01.ogg,22050 – 32,sound/atlanteans/saw,atlanteans.sawmill,mauxuam,CC-0,yes,216828__mauxuam__saw-of-avalon-2.wav,http://www.freesound.org/people/mauxuam/sounds/216828/,44100 – 16,8251 | 33 | benchsaw_01.ogg,22050 – 32,sound/atlanteans/saw,atlanteans.sawmill,mauxuam,CC-0,yes,216828__mauxuam__saw-of-avalon-2.wav,http://www.freesound.org/people/mauxuam/sounds/216828/,44100 – 16,8251 |
254 | 32 | benchsaw_02.ogg,22050 – 32,sound/atlanteans/saw,atlanteans.sawmill,mauxuam,CC-0,yes,216828__mauxuam__saw-of-avalon-2.wav,http://www.freesound.org/people/mauxuam/sounds/216828/,44100 – 16,8251 | 34 | sawing_00.ogg,22050 – 32,sound/atlanteans/saw,atlanteans.woodcutter,dobroide,CC-3,yes,102844__dobroide__20100802-sawing.wav,http://www.freesound.org/people/dobroide/sounds/102844/,44100 – 16,8251 |
255 | 33 | sawing_01.ogg,22050 – 32,sound/atlanteans/saw,atlanteans.woodcutter,dobroide,CC-3,yes,102844__dobroide__20100802-sawing.wav,http://www.freesound.org/people/dobroide/sounds/102844/,44100 – 16,8251 | 35 | sawing_01.ogg,22050 – 32,sound/atlanteans/saw,atlanteans.woodcutter,dobroide,CC-3,yes,102844__dobroide__20100802-sawing.wav,http://www.freesound.org/people/dobroide/sounds/102844/,44100 – 16,8251 |
256 | 34 | sawing_02.ogg,22050 – 32,sound/atlanteans/saw,atlanteans.woodcutter,dobroide,CC-3,yes,102844__dobroide__20100802-sawing.wav,http://www.freesound.org/people/dobroide/sounds/102844/,44100 – 16,8251 | 36 | sawing_02.ogg,22050 – 32,sound/atlanteans/saw,atlanteans.woodcutter,dobroide,CC-3,yes,102844__dobroide__20100802-sawing.wav,http://www.freesound.org/people/dobroide/sounds/102844/,44100 – 16,8251 |
258 | 35 | sawing_03.ogg,22050 – 32,sound/atlanteans/saw,atlanteans.woodcutter,dobroide,CC-3,yes,102844__dobroide__20100802-sawing.wav,http://www.freesound.org/people/dobroide/sounds/102844/,44100 – 16,8251 | 37 | goldspin_00.ogg,22050 – 32,sound/atlanteans,atlanteans.goldspinner,Mike Koenig,CC-3,yes,Metal Debris Falling-SoundBible.com-238218965.wav,http://soundbible.com/1099-Metal-Debris-Falling.html,44100 – 16,8251 |
259 | 36 | goldspin_01.ogg,22050 – 32,sound/atlanteans,atlanteans.goldspinner,Mike Koenig,CC-3,yes,Metal Debris Falling-SoundBible.com-238218965.wav,http://soundbible.com/1099-Metal-Debris-Falling.html,44100 – 16,8251 | 38 | goldspin_01.ogg,22050 – 32,sound/atlanteans,atlanteans.goldspinner,Mike Koenig,CC-3,yes,Metal Debris Falling-SoundBible.com-238218965.wav,http://soundbible.com/1099-Metal-Debris-Falling.html,44100 – 16,8251 |
263 | 37 | goldspin_02.ogg,22050 – 32,sound/atlanteans,atlanteans.goldspinner,Mike Koenig,CC-3,yes,Metal Debris Falling-SoundBible.com-238218965.wav,http://soundbible.com/1099-Metal-Debris-Falling.html,44100 – 16,8251 | 39 | tree_falling_00.ogg,11025 – 16,sound/woodcutting,woodcutters,ecfike,CC-0,yes,139952__ecfike__a-tree-falling-down.wav,http://www.freesound.org/people/ecfike/sounds/139952/,44100 – 16,new |
264 | 38 | tree-falling_00.ogg,11025 – 16,sound/woodcutting,woodcutters,ecfike,CC-0,yes,139952__ecfike__a-tree-falling-down.wav,http://www.freesound.org/people/ecfike/sounds/139952/,44100 – 16,new | 40 | tree_falling_01.ogg,11025 – 16,sound/woodcutting,woodcutters,Daniel Simion,CC-3,yes,Tree_Fall_Small-Daniel_Simion-1639156552.wav,http://soundbible.com/2039-Tree-Fall-Small.html,44100 – 16,new |
262 | 39 | tree-falling_01.ogg,11025 – 16,sound/woodcutting,woodcutters,Daniel Simion,CC-3,yes,Tree_Fall_Small-Daniel_Simion-1639156552.wav,http://soundbible.com/2039-Tree-Fall-Small.html,44100 – 16,new | ||
265 | 40 | ,,,,,,,,,, | 41 | ,,,,,,,,,, |
269 | 41 | boar_01.ogg,11025 – 16,data/sound/animals,,UNKNOWN,personal,yes,Pig-SoundBible.com-1026656068.wav,http://soundbible.com/736-Pig.html,11025,8019 | 42 | boar.ogg,11025 – 16,data/sound/animals,,UNKNOWN,personal,yes,Pig-SoundBible.com-1026656068.wav,http://soundbible.com/736-Pig.html,11025,8019 |
270 | 42 | elk_01.ogg,16000,data/sound/animals,,fws.gov,PD,yes,Elk Bellowing In Forest-SoundBible.com-681308174.wav,http://soundbible.com/245-Elk-Bellowing-In-Forest.html,48000,8019 | 43 | elk_00.ogg,16000,data/sound/animals,,fws.gov,PD,yes,Elk Bellowing In Forest-SoundBible.com-681308174.wav,http://soundbible.com/245-Elk-Bellowing-In-Forest.html,48000,8019 |
271 | 43 | elk_02.ogg,22050 – 16,data/sound/animals,,fws.gov,PD,yes,Elk Bellowing In Forest 2-SoundBible.com-860406835.wav,http://soundbible.com/246-Elk-Bellowing-In-Forest-2.html,48000,8029 | 44 | elk_01.ogg,22050 – 16,data/sound/animals,,fws.gov,PD,yes,Elk Bellowing In Forest 2-SoundBible.com-860406835.wav,http://soundbible.com/246-Elk-Bellowing-In-Forest-2.html,48000,8029 |
272 | 45 | stag_00.ogg,11025 – 16,data/sound/animals,,Juan Carlos,PD,yes,Red_stag_roar-Juan_Carlos_-2004708707.wav,http://soundbible.com/2073-Red-Stag-Roar.html,44100 – 16,8019 | ||
273 | 44 | stag_01.ogg,11025 – 16,data/sound/animals,,Juan Carlos,PD,yes,Red_stag_roar-Juan_Carlos_-2004708707.wav,http://soundbible.com/2073-Red-Stag-Roar.html,44100 – 16,8019 | 46 | stag_01.ogg,11025 – 16,data/sound/animals,,Juan Carlos,PD,yes,Red_stag_roar-Juan_Carlos_-2004708707.wav,http://soundbible.com/2073-Red-Stag-Roar.html,44100 – 16,8019 |
275 | 45 | stag_02.ogg,11025 – 16,data/sound/animals,,Juan Carlos,PD,yes,Red_stag_roar-Juan_Carlos_-2004708707.wav,http://soundbible.com/2073-Red-Stag-Roar.html,44100 – 16,8019 | 47 | coyote_00.ogg,11025 – 16,data/sound/animals,,UNKNOWN,PD,yes,Coyote Call-SoundBible.com-2012388009.wav,http://soundbible.com/977-Coyote-Call.html,44100 – 16,8019 |
276 | 46 | coyote_01.ogg,11025 – 16,data/sound/animals,,UNKNOWN,PD,yes,Coyote Call-SoundBible.com-2012388009.wav,http://soundbible.com/977-Coyote-Call.html,44100 – 16,8019 | 48 | coyote_01.ogg,11025 – 16,data/sound/animals,,UNKNOWN,PD,yes,Coyote Call-SoundBible.com-2012388009.wav,http://soundbible.com/977-Coyote-Call.html,44100 – 16,8019 |
284 | 47 | coyote_02.ogg,11025 – 16,data/sound/animals,,UNKNOWN,PD,yes,Coyote Call-SoundBible.com-2012388009.wav,http://soundbible.com/977-Coyote-Call.html,44100 – 16,8019 | 49 | wolf_00.ogg,11025 – 16,data/sound/animals,,UNKNOWN,,,Howl-5.wav,UNKNOWN,11025,8019 |
285 | 48 | wolf_01.ogg,11025 – 16,data/sound/animals,,UNKNOWN,,,Howl-5.wav,UNKNOWN,11025,8019 | 50 | wolf_01.ogg,22050 – 16,data/sound/animals,,UNKNOWN,,,Howl-4.wav,UNKNOWN,22050,8019 |
286 | 49 | wolf_02.ogg,22050 – 16,data/sound/animals,,UNKNOWN,,,Howl-4.wav,UNKNOWN,22050,8019 | 51 | wolf_02.ogg,11025 – 16,data/sound/animals,,UNKNOWN,,,Howl-6.wav,UNKNOWN,11025,8019 |
287 | 50 | wolf_03.ogg,11025 – 16,data/sound/animals,,UNKNOWN,,,Howl-6.wav,UNKNOWN,11025,8019 | 52 | sheep_00.ogg,22050 – 16,data/sound/farm,,UNKNOWN,,,Sheep-3.wav,UNKNOWN,22050,8019 |
288 | 51 | sheep_01.ogg,22050 – 16,data/sound/farm,,UNKNOWN,,,Sheep-3.wav,UNKNOWN,22050,8019 | 53 | sheep_01.ogg,22050 – 16,data/sound/farm,,UNKNOWN,,,Sheep-6.wav,UNKNOWN,22050,8019 |
289 | 52 | sheep_02.ogg,22050 – 16,data/sound/farm,,UNKNOWN,,,Sheep-6.wav,UNKNOWN,22050,8019 | 54 | sheep_02.ogg,22050 – 16,data/sound/farm,,UNKNOWN,,,Sheep-2.wav,UNKNOWN,22050,8019 |
283 | 53 | sheep_03.ogg,22050 – 16,data/sound/farm,,UNKNOWN,,,Sheep-2.wav,UNKNOWN,22050,8019 | ||
290 | 54 | 55 | ||
291 | === removed file 'data/sound/woodcutting/tree-falling_10.ogg' | |||
292 | 55 | Binary files data/sound/woodcutting/tree-falling_10.ogg 2017-02-07 18:05:21 +0000 and data/sound/woodcutting/tree-falling_10.ogg 1970-01-01 00:00:00 +0000 differ | 56 | Binary files data/sound/woodcutting/tree-falling_10.ogg 2017-02-07 18:05:21 +0000 and data/sound/woodcutting/tree-falling_10.ogg 1970-01-01 00:00:00 +0000 differ |
293 | === renamed file 'data/sound/woodcutting/tree-falling_00.ogg' => 'data/sound/woodcutting/tree_falling_00.ogg' | |||
294 | === renamed file 'data/sound/woodcutting/tree-falling_01.ogg' => 'data/sound/woodcutting/tree_falling_01.ogg' | |||
295 | === renamed file 'data/sound/woodcutting/woodcutting_00.ogg' => 'data/sound/woodcutting/woodcutting.ogg' | |||
296 | === modified file 'data/tribes/atlanteans.lua' | |||
297 | --- data/tribes/atlanteans.lua 2019-05-18 13:33:00 +0000 | |||
298 | +++ data/tribes/atlanteans.lua 2019-05-27 14:29:35 +0000 | |||
299 | @@ -5,10 +5,7 @@ | |||
300 | 5 | -- --------------------- | 5 | -- --------------------- |
301 | 6 | -- | 6 | -- |
302 | 7 | -- This file contains all the units for a tribe. | 7 | -- This file contains all the units for a tribe. |
307 | 8 | 8 | -- | |
304 | 9 | dirname = path.dirname(__file__) | ||
305 | 10 | |||
306 | 11 | -- RST | ||
308 | 12 | -- .. function:: new_tribe{table} | 9 | -- .. function:: new_tribe{table} |
309 | 13 | -- | 10 | -- |
310 | 14 | -- This function adds all units to a tribe. | 11 | -- This function adds all units to a tribe. |
311 | @@ -47,31 +44,25 @@ | |||
312 | 47 | -- **ship**: The internal name of the tribe's ship. | 44 | -- **ship**: The internal name of the tribe's ship. |
313 | 48 | -- | 45 | -- |
314 | 49 | -- **port**: The internal name of the tribe's port building. This unit needs to be defined in the ``buildings`` table too. | 46 | -- **port**: The internal name of the tribe's port building. This unit needs to be defined in the ``buildings`` table too. |
315 | 47 | |||
316 | 48 | image_dirname = path.dirname(__file__) .. "images/atlanteans/" | ||
317 | 49 | |||
318 | 50 | animations = {} | ||
319 | 51 | add_animation(animations, "frontier", image_dirname, "frontier", {3, 12}) | ||
320 | 52 | add_animation(animations, "flag", image_dirname, "flag", {15, 35}, 10) | ||
321 | 53 | |||
322 | 50 | tribes:new_tribe { | 54 | tribes:new_tribe { |
323 | 51 | name = "atlanteans", | 55 | name = "atlanteans", |
338 | 52 | 56 | animations = animations, | |
325 | 53 | animations = { | ||
326 | 54 | -- Some blue fires would be fine, but just an idea | ||
327 | 55 | frontier = { | ||
328 | 56 | pictures = path.list_files(dirname .. "images/atlanteans/frontier_??.png"), | ||
329 | 57 | hotspot = { 3, 12 }, | ||
330 | 58 | }, | ||
331 | 59 | flag = { | ||
332 | 60 | -- Not just a plain color, maybe a cross or some stripes | ||
333 | 61 | pictures = path.list_files(dirname .. "images/atlanteans/flag_??.png"), | ||
334 | 62 | hotspot = { 15, 35 }, | ||
335 | 63 | fps = 10 | ||
336 | 64 | } | ||
337 | 65 | }, | ||
339 | 66 | 57 | ||
340 | 67 | -- Image file paths for this tribe's road textures | 58 | -- Image file paths for this tribe's road textures |
341 | 68 | roads = { | 59 | roads = { |
342 | 69 | busy = { | 60 | busy = { |
344 | 70 | "tribes/images/atlanteans/roadt_busy.png", | 61 | image_dirname .. "roadt_busy.png", |
345 | 71 | }, | 62 | }, |
346 | 72 | normal = { | 63 | normal = { |
349 | 73 | "tribes/images/atlanteans/roadt_normal_00.png", | 64 | image_dirname .. "roadt_normal_00.png", |
350 | 74 | "tribes/images/atlanteans/roadt_normal_01.png", | 65 | image_dirname .. "roadt_normal_01.png", |
351 | 75 | }, | 66 | }, |
352 | 76 | }, | 67 | }, |
353 | 77 | 68 | ||
354 | 78 | 69 | ||
355 | === modified file 'data/tribes/barbarians.lua' | |||
356 | --- data/tribes/barbarians.lua 2019-05-25 10:47:18 +0000 | |||
357 | +++ data/tribes/barbarians.lua 2019-05-27 14:29:35 +0000 | |||
358 | @@ -1,28 +1,21 @@ | |||
360 | 1 | dirname = path.dirname(__file__) | 1 | image_dirname = path.dirname(__file__) .. "images/barbarians/" |
361 | 2 | |||
362 | 3 | animations = {} | ||
363 | 4 | add_animation(animations, "frontier", image_dirname, "frontier", {1, 19}) | ||
364 | 5 | add_animation(animations, "flag", image_dirname, "flag", {10, 38}, 5) | ||
365 | 2 | 6 | ||
366 | 3 | tribes:new_tribe { | 7 | tribes:new_tribe { |
367 | 4 | name = "barbarians", | 8 | name = "barbarians", |
380 | 5 | 9 | animations = animations, | |
369 | 6 | animations = { | ||
370 | 7 | frontier = { | ||
371 | 8 | pictures = path.list_files(dirname .. "images/barbarians/frontier_??.png"), | ||
372 | 9 | hotspot = { 1, 19 }, | ||
373 | 10 | }, | ||
374 | 11 | flag = { | ||
375 | 12 | pictures = path.list_files(dirname .. "images/barbarians/flag_??.png"), | ||
376 | 13 | hotspot = { 10, 38 }, | ||
377 | 14 | fps = 5 | ||
378 | 15 | } | ||
379 | 16 | }, | ||
381 | 17 | 10 | ||
382 | 18 | -- Image file paths for this tribe's road textures | 11 | -- Image file paths for this tribe's road textures |
383 | 19 | roads = { | 12 | roads = { |
384 | 20 | busy = { | 13 | busy = { |
386 | 21 | "tribes/images/barbarians/roadt_busy.png", | 14 | image_dirname .. "roadt_busy.png", |
387 | 22 | }, | 15 | }, |
388 | 23 | normal = { | 16 | normal = { |
391 | 24 | "tribes/images/barbarians/roadt_normal_00.png", | 17 | image_dirname .. "roadt_normal_00.png", |
392 | 25 | "tribes/images/barbarians/roadt_normal_01.png", | 18 | image_dirname .. "roadt_normal_01.png", |
393 | 26 | }, | 19 | }, |
394 | 27 | }, | 20 | }, |
395 | 28 | 21 | ||
396 | 29 | 22 | ||
397 | === modified file 'data/tribes/empire.lua' | |||
398 | --- data/tribes/empire.lua 2019-05-25 10:47:18 +0000 | |||
399 | +++ data/tribes/empire.lua 2019-05-27 14:29:35 +0000 | |||
400 | @@ -1,31 +1,22 @@ | |||
402 | 1 | dirname = path.dirname(__file__) | 1 | image_dirname = path.dirname(__file__) .. "images/empire/" |
403 | 2 | |||
404 | 3 | animations = {} | ||
405 | 4 | add_animation(animations, "frontier", image_dirname, "frontier", {1, 19}) | ||
406 | 5 | add_animation(animations, "flag", image_dirname, "flag", {14, 38}, 10) | ||
407 | 2 | 6 | ||
408 | 3 | tribes:new_tribe { | 7 | tribes:new_tribe { |
409 | 4 | name = "empire", | 8 | name = "empire", |
424 | 5 | 9 | animations = animations, | |
411 | 6 | animations = { | ||
412 | 7 | -- No idea for the frontier. Maybe some javelins? | ||
413 | 8 | frontier = { | ||
414 | 9 | pictures = path.list_files(dirname .. "images/empire/frontier_??.png"), | ||
415 | 10 | hotspot = { 1, 19 }, | ||
416 | 11 | }, | ||
417 | 12 | -- Not just a plain color, maybe a cross or some stripes | ||
418 | 13 | flag = { | ||
419 | 14 | pictures = path.list_files(dirname .. "images/empire/flag_??.png"), | ||
420 | 15 | hotspot = { 14, 38 }, | ||
421 | 16 | fps = 10 | ||
422 | 17 | } | ||
423 | 18 | }, | ||
425 | 19 | 10 | ||
426 | 20 | -- Image file paths for this tribe's road textures | 11 | -- Image file paths for this tribe's road textures |
427 | 21 | roads = { | 12 | roads = { |
428 | 22 | busy = { | 13 | busy = { |
430 | 23 | "tribes/images/empire/roadt_busy.png", | 14 | image_dirname .. "roadt_busy.png", |
431 | 24 | }, | 15 | }, |
432 | 25 | normal = { | 16 | normal = { |
436 | 26 | "tribes/images/empire/roadt_normal_00.png", | 17 | image_dirname .. "roadt_normal_00.png", |
437 | 27 | "tribes/images/empire/roadt_normal_01.png", | 18 | image_dirname .. "roadt_normal_01.png", |
438 | 28 | "tribes/images/empire/roadt_normal_02.png", | 19 | image_dirname .. "roadt_normal_02.png", |
439 | 29 | }, | 20 | }, |
440 | 30 | }, | 21 | }, |
441 | 31 | 22 | ||
442 | 32 | 23 | ||
443 | === modified file 'data/tribes/frisians.lua' | |||
444 | --- data/tribes/frisians.lua 2019-05-25 10:47:18 +0000 | |||
445 | +++ data/tribes/frisians.lua 2019-05-27 14:29:35 +0000 | |||
446 | @@ -1,28 +1,21 @@ | |||
448 | 1 | dirname = path.dirname (__file__) | 1 | image_dirname = path.dirname(__file__) .. "images/frisians/" |
449 | 2 | |||
450 | 3 | animations = {} | ||
451 | 4 | add_animation(animations, "frontier", image_dirname, "frontier", {9, 26}) | ||
452 | 5 | add_animation(animations, "flag", image_dirname, "flag", {10, 39}, 10) | ||
453 | 2 | 6 | ||
454 | 3 | tribes:new_tribe { | 7 | tribes:new_tribe { |
455 | 4 | name = "frisians", | 8 | name = "frisians", |
468 | 5 | 9 | animations = animations, | |
457 | 6 | animations = { | ||
458 | 7 | frontier = { | ||
459 | 8 | pictures = path.list_files (dirname .. "images/frisians/frontier_??.png"), | ||
460 | 9 | hotspot = { 9, 26 }, | ||
461 | 10 | }, | ||
462 | 11 | flag = { | ||
463 | 12 | pictures = path.list_files (dirname .. "images/frisians/flag_??.png"), | ||
464 | 13 | hotspot = { 10, 39 }, | ||
465 | 14 | fps = 10, | ||
466 | 15 | } | ||
467 | 16 | }, | ||
469 | 17 | 10 | ||
470 | 18 | -- Image file paths for this tribe's road textures | 11 | -- Image file paths for this tribe's road textures |
471 | 19 | roads = { | 12 | roads = { |
472 | 20 | busy = { | 13 | busy = { |
474 | 21 | "tribes/images/frisians/roadt_busy.png", | 14 | image_dirname .. "roadt_busy.png", |
475 | 22 | }, | 15 | }, |
476 | 23 | normal = { | 16 | normal = { |
479 | 24 | "tribes/images/frisians/roadt_normal_00.png", | 17 | image_dirname .. "roadt_normal_00.png", |
480 | 25 | "tribes/images/frisians/roadt_normal_01.png", | 18 | image_dirname .. "roadt_normal_01.png", |
481 | 26 | }, | 19 | }, |
482 | 27 | }, | 20 | }, |
483 | 28 | 21 | ||
484 | 29 | 22 | ||
485 | === modified file 'data/tribes/immovables/berry_bushes/blueberry/init.lua' | |||
486 | --- data/tribes/immovables/berry_bushes/blueberry/init.lua 2019-03-02 13:56:42 +0000 | |||
487 | +++ data/tribes/immovables/berry_bushes/blueberry/init.lua 2019-05-27 14:29:35 +0000 | |||
488 | @@ -10,7 +10,7 @@ | |||
489 | 10 | } | 10 | } |
490 | 11 | 11 | ||
491 | 12 | animations = {} | 12 | animations = {} |
493 | 13 | add_animation(animations, "idle", dirname, "tiny/idle", { 6, 7 }) | 13 | add_animation(animations, "idle", dirname .. "tiny", "idle", { 6, 7 }) |
494 | 14 | 14 | ||
495 | 15 | tribes:new_immovable_type { | 15 | tribes:new_immovable_type { |
496 | 16 | msgctxt = "immovable", | 16 | msgctxt = "immovable", |
497 | @@ -31,7 +31,7 @@ | |||
498 | 31 | } | 31 | } |
499 | 32 | 32 | ||
500 | 33 | animations = {} | 33 | animations = {} |
502 | 34 | add_animation(animations, "idle", dirname, "small/idle", { 12, 13 }) | 34 | add_animation(animations, "idle", dirname .. "small", "idle", { 12, 13 }) |
503 | 35 | 35 | ||
504 | 36 | tribes:new_immovable_type { | 36 | tribes:new_immovable_type { |
505 | 37 | msgctxt = "immovable", | 37 | msgctxt = "immovable", |
506 | @@ -52,7 +52,7 @@ | |||
507 | 52 | } | 52 | } |
508 | 53 | 53 | ||
509 | 54 | animations = {} | 54 | animations = {} |
511 | 55 | add_animation(animations, "idle", dirname, "medium/idle", { 15, 16 }) | 55 | add_animation(animations, "idle", dirname .. "medium", "idle", { 15, 16 }) |
512 | 56 | 56 | ||
513 | 57 | tribes:new_immovable_type { | 57 | tribes:new_immovable_type { |
514 | 58 | msgctxt = "immovable", | 58 | msgctxt = "immovable", |
515 | @@ -73,7 +73,7 @@ | |||
516 | 73 | } | 73 | } |
517 | 74 | 74 | ||
518 | 75 | animations = {} | 75 | animations = {} |
520 | 76 | add_animation(animations, "idle", dirname, "ripe/idle", { 15, 16 }) | 76 | add_animation(animations, "idle", dirname .. "ripe", "idle", { 15, 16 }) |
521 | 77 | 77 | ||
522 | 78 | tribes:new_immovable_type { | 78 | tribes:new_immovable_type { |
523 | 79 | msgctxt = "immovable", | 79 | msgctxt = "immovable", |
524 | 80 | 80 | ||
525 | === modified file 'data/tribes/immovables/berry_bushes/currant_black/init.lua' | |||
526 | --- data/tribes/immovables/berry_bushes/currant_black/init.lua 2019-03-02 13:56:42 +0000 | |||
527 | +++ data/tribes/immovables/berry_bushes/currant_black/init.lua 2019-05-27 14:29:35 +0000 | |||
528 | @@ -8,7 +8,7 @@ | |||
529 | 8 | } | 8 | } |
530 | 9 | 9 | ||
531 | 10 | animations = {} | 10 | animations = {} |
533 | 11 | add_animation(animations, "idle", dirname, "tiny/idle", { 4, 10 }) | 11 | add_animation(animations, "idle", dirname .. "tiny", "idle", { 4, 10 }) |
534 | 12 | 12 | ||
535 | 13 | tribes:new_immovable_type { | 13 | tribes:new_immovable_type { |
536 | 14 | msgctxt = "immovable", | 14 | msgctxt = "immovable", |
537 | @@ -29,7 +29,7 @@ | |||
538 | 29 | } | 29 | } |
539 | 30 | 30 | ||
540 | 31 | animations = {} | 31 | animations = {} |
542 | 32 | add_animation(animations, "idle", dirname, "small/idle", { 8, 20 }) | 32 | add_animation(animations, "idle", dirname .. "small", "idle", { 8, 20 }) |
543 | 33 | 33 | ||
544 | 34 | tribes:new_immovable_type { | 34 | tribes:new_immovable_type { |
545 | 35 | msgctxt = "immovable", | 35 | msgctxt = "immovable", |
546 | @@ -50,7 +50,7 @@ | |||
547 | 50 | } | 50 | } |
548 | 51 | 51 | ||
549 | 52 | animations = {} | 52 | animations = {} |
551 | 53 | add_animation(animations, "idle", dirname, "medium/idle", { 13, 33 }) | 53 | add_animation(animations, "idle", dirname .. "medium", "idle", { 13, 33 }) |
552 | 54 | 54 | ||
553 | 55 | tribes:new_immovable_type { | 55 | tribes:new_immovable_type { |
554 | 56 | msgctxt = "immovable", | 56 | msgctxt = "immovable", |
555 | @@ -71,7 +71,7 @@ | |||
556 | 71 | } | 71 | } |
557 | 72 | 72 | ||
558 | 73 | animations = {} | 73 | animations = {} |
560 | 74 | add_animation(animations, "idle", dirname, "ripe/idle", { 13, 33 }) | 74 | add_animation(animations, "idle", dirname .. "ripe", "idle", { 13, 33 }) |
561 | 75 | 75 | ||
562 | 76 | tribes:new_immovable_type { | 76 | tribes:new_immovable_type { |
563 | 77 | msgctxt = "immovable", | 77 | msgctxt = "immovable", |
564 | 78 | 78 | ||
565 | === modified file 'data/tribes/immovables/berry_bushes/currant_red/init.lua' | |||
566 | --- data/tribes/immovables/berry_bushes/currant_red/init.lua 2019-03-02 13:56:42 +0000 | |||
567 | +++ data/tribes/immovables/berry_bushes/currant_red/init.lua 2019-05-27 14:29:35 +0000 | |||
568 | @@ -8,7 +8,7 @@ | |||
569 | 8 | } | 8 | } |
570 | 9 | 9 | ||
571 | 10 | animations = {} | 10 | animations = {} |
573 | 11 | add_animation(animations, "idle", dirname, "tiny/idle", { 4, 10 }) | 11 | add_animation(animations, "idle", dirname .. "tiny", "idle", { 4, 10 }) |
574 | 12 | 12 | ||
575 | 13 | tribes:new_immovable_type { | 13 | tribes:new_immovable_type { |
576 | 14 | msgctxt = "immovable", | 14 | msgctxt = "immovable", |
577 | @@ -29,7 +29,7 @@ | |||
578 | 29 | } | 29 | } |
579 | 30 | 30 | ||
580 | 31 | animations = {} | 31 | animations = {} |
582 | 32 | add_animation(animations, "idle", dirname, "small/idle", { 8, 20 }) | 32 | add_animation(animations, "idle", dirname .. "small", "idle", { 8, 20 }) |
583 | 33 | 33 | ||
584 | 34 | tribes:new_immovable_type { | 34 | tribes:new_immovable_type { |
585 | 35 | msgctxt = "immovable", | 35 | msgctxt = "immovable", |
586 | @@ -50,7 +50,7 @@ | |||
587 | 50 | } | 50 | } |
588 | 51 | 51 | ||
589 | 52 | animations = {} | 52 | animations = {} |
591 | 53 | add_animation(animations, "idle", dirname, "medium/idle", { 13, 33 }) | 53 | add_animation(animations, "idle", dirname .. "medium", "idle", { 13, 33 }) |
592 | 54 | 54 | ||
593 | 55 | tribes:new_immovable_type { | 55 | tribes:new_immovable_type { |
594 | 56 | msgctxt = "immovable", | 56 | msgctxt = "immovable", |
595 | @@ -71,7 +71,7 @@ | |||
596 | 71 | } | 71 | } |
597 | 72 | 72 | ||
598 | 73 | animations = {} | 73 | animations = {} |
600 | 74 | add_animation(animations, "idle", dirname, "ripe/idle", { 13, 33 }) | 74 | add_animation(animations, "idle", dirname .. "ripe", "idle", { 13, 33 }) |
601 | 75 | 75 | ||
602 | 76 | tribes:new_immovable_type { | 76 | tribes:new_immovable_type { |
603 | 77 | msgctxt = "immovable", | 77 | msgctxt = "immovable", |
604 | 78 | 78 | ||
605 | === modified file 'data/tribes/immovables/berry_bushes/desert_hackberry/init.lua' | |||
606 | --- data/tribes/immovables/berry_bushes/desert_hackberry/init.lua 2019-03-02 13:56:42 +0000 | |||
607 | +++ data/tribes/immovables/berry_bushes/desert_hackberry/init.lua 2019-05-27 14:29:35 +0000 | |||
608 | @@ -8,7 +8,7 @@ | |||
609 | 8 | } | 8 | } |
610 | 9 | 9 | ||
611 | 10 | animations = {} | 10 | animations = {} |
613 | 11 | add_animation(animations, "idle", dirname, "tiny/idle", { 10, 9 }) | 11 | add_animation(animations, "idle", dirname .. "tiny", "idle", { 10, 9 }) |
614 | 12 | 12 | ||
615 | 13 | tribes:new_immovable_type { | 13 | tribes:new_immovable_type { |
616 | 14 | msgctxt = "immovable", | 14 | msgctxt = "immovable", |
617 | @@ -29,7 +29,7 @@ | |||
618 | 29 | } | 29 | } |
619 | 30 | 30 | ||
620 | 31 | animations = {} | 31 | animations = {} |
622 | 32 | add_animation(animations, "idle", dirname, "small/idle", { 19, 21 }) | 32 | add_animation(animations, "idle", dirname .. "small", "idle", { 19, 21 }) |
623 | 33 | 33 | ||
624 | 34 | tribes:new_immovable_type { | 34 | tribes:new_immovable_type { |
625 | 35 | msgctxt = "immovable", | 35 | msgctxt = "immovable", |
626 | @@ -50,7 +50,7 @@ | |||
627 | 50 | } | 50 | } |
628 | 51 | 51 | ||
629 | 52 | animations = {} | 52 | animations = {} |
631 | 53 | add_animation(animations, "idle", dirname, "medium/idle", { 21, 27 }) | 53 | add_animation(animations, "idle", dirname .. "medium", "idle", { 21, 27 }) |
632 | 54 | 54 | ||
633 | 55 | tribes:new_immovable_type { | 55 | tribes:new_immovable_type { |
634 | 56 | msgctxt = "immovable", | 56 | msgctxt = "immovable", |
635 | @@ -71,7 +71,7 @@ | |||
636 | 71 | } | 71 | } |
637 | 72 | 72 | ||
638 | 73 | animations = {} | 73 | animations = {} |
640 | 74 | add_animation(animations, "idle", dirname, "ripe/idle", { 21, 27 }) | 74 | add_animation(animations, "idle", dirname .. "ripe", "idle", { 21, 27 }) |
641 | 75 | 75 | ||
642 | 76 | tribes:new_immovable_type { | 76 | tribes:new_immovable_type { |
643 | 77 | msgctxt = "immovable", | 77 | msgctxt = "immovable", |
644 | 78 | 78 | ||
645 | === modified file 'data/tribes/immovables/berry_bushes/juniper/init.lua' | |||
646 | --- data/tribes/immovables/berry_bushes/juniper/init.lua 2019-03-02 13:56:42 +0000 | |||
647 | +++ data/tribes/immovables/berry_bushes/juniper/init.lua 2019-05-27 14:29:35 +0000 | |||
648 | @@ -8,7 +8,7 @@ | |||
649 | 8 | } | 8 | } |
650 | 9 | 9 | ||
651 | 10 | animations = {} | 10 | animations = {} |
653 | 11 | add_animation(animations, "idle", dirname, "tiny/idle", { 3, 15 }) | 11 | add_animation(animations, "idle", dirname .. "tiny", "idle", { 3, 15 }) |
654 | 12 | 12 | ||
655 | 13 | tribes:new_immovable_type { | 13 | tribes:new_immovable_type { |
656 | 14 | msgctxt = "immovable", | 14 | msgctxt = "immovable", |
657 | @@ -29,7 +29,7 @@ | |||
658 | 29 | } | 29 | } |
659 | 30 | 30 | ||
660 | 31 | animations = {} | 31 | animations = {} |
662 | 32 | add_animation(animations, "idle", dirname, "small/idle", { 6, 30 }) | 32 | add_animation(animations, "idle", dirname .. "small", "idle", { 6, 30 }) |
663 | 33 | 33 | ||
664 | 34 | tribes:new_immovable_type { | 34 | tribes:new_immovable_type { |
665 | 35 | msgctxt = "immovable", | 35 | msgctxt = "immovable", |
666 | @@ -50,7 +50,7 @@ | |||
667 | 50 | } | 50 | } |
668 | 51 | 51 | ||
669 | 52 | animations = {} | 52 | animations = {} |
671 | 53 | add_animation(animations, "idle", dirname, "medium/idle", { 10, 47 }) | 53 | add_animation(animations, "idle", dirname .. "medium", "idle", { 10, 47 }) |
672 | 54 | 54 | ||
673 | 55 | tribes:new_immovable_type { | 55 | tribes:new_immovable_type { |
674 | 56 | msgctxt = "immovable", | 56 | msgctxt = "immovable", |
675 | @@ -71,7 +71,7 @@ | |||
676 | 71 | } | 71 | } |
677 | 72 | 72 | ||
678 | 73 | animations = {} | 73 | animations = {} |
680 | 74 | add_animation(animations, "idle", dirname, "ripe/idle", { 11, 49 }) | 74 | add_animation(animations, "idle", dirname .. "ripe", "idle", { 11, 49 }) |
681 | 75 | 75 | ||
682 | 76 | tribes:new_immovable_type { | 76 | tribes:new_immovable_type { |
683 | 77 | msgctxt = "immovable", | 77 | msgctxt = "immovable", |
684 | 78 | 78 | ||
685 | === modified file 'data/tribes/immovables/berry_bushes/raspberry/init.lua' | |||
686 | --- data/tribes/immovables/berry_bushes/raspberry/init.lua 2019-03-02 13:56:42 +0000 | |||
687 | +++ data/tribes/immovables/berry_bushes/raspberry/init.lua 2019-05-27 14:29:35 +0000 | |||
688 | @@ -8,7 +8,7 @@ | |||
689 | 8 | } | 8 | } |
690 | 9 | 9 | ||
691 | 10 | animations = {} | 10 | animations = {} |
693 | 11 | add_animation(animations, "idle", dirname, "tiny/idle", { 4, 7 }) | 11 | add_animation(animations, "idle", dirname .. "tiny", "idle", { 4, 7 }) |
694 | 12 | 12 | ||
695 | 13 | tribes:new_immovable_type { | 13 | tribes:new_immovable_type { |
696 | 14 | msgctxt = "immovable", | 14 | msgctxt = "immovable", |
697 | @@ -29,7 +29,7 @@ | |||
698 | 29 | } | 29 | } |
699 | 30 | 30 | ||
700 | 31 | animations = {} | 31 | animations = {} |
702 | 32 | add_animation(animations, "idle", dirname, "small/idle", { 16, 31 }) | 32 | add_animation(animations, "idle", dirname .. "small", "idle", { 16, 31 }) |
703 | 33 | 33 | ||
704 | 34 | tribes:new_immovable_type { | 34 | tribes:new_immovable_type { |
705 | 35 | msgctxt = "immovable", | 35 | msgctxt = "immovable", |
706 | @@ -50,7 +50,7 @@ | |||
707 | 50 | } | 50 | } |
708 | 51 | 51 | ||
709 | 52 | animations = {} | 52 | animations = {} |
711 | 53 | add_animation(animations, "idle", dirname, "medium/idle", { 17, 34 }) | 53 | add_animation(animations, "idle", dirname .. "medium", "idle", { 17, 34 }) |
712 | 54 | 54 | ||
713 | 55 | tribes:new_immovable_type { | 55 | tribes:new_immovable_type { |
714 | 56 | msgctxt = "immovable", | 56 | msgctxt = "immovable", |
715 | @@ -71,7 +71,7 @@ | |||
716 | 71 | } | 71 | } |
717 | 72 | 72 | ||
718 | 73 | animations = {} | 73 | animations = {} |
720 | 74 | add_animation(animations, "idle", dirname, "ripe/idle", { 17, 34 }) | 74 | add_animation(animations, "idle", dirname .. "ripe", "idle", { 17, 34 }) |
721 | 75 | 75 | ||
722 | 76 | tribes:new_immovable_type { | 76 | tribes:new_immovable_type { |
723 | 77 | msgctxt = "immovable", | 77 | msgctxt = "immovable", |
724 | 78 | 78 | ||
725 | === modified file 'data/tribes/immovables/berry_bushes/sea_buckthorn/init.lua' | |||
726 | --- data/tribes/immovables/berry_bushes/sea_buckthorn/init.lua 2019-03-02 13:56:42 +0000 | |||
727 | +++ data/tribes/immovables/berry_bushes/sea_buckthorn/init.lua 2019-05-27 14:29:35 +0000 | |||
728 | @@ -8,7 +8,7 @@ | |||
729 | 8 | } | 8 | } |
730 | 9 | 9 | ||
731 | 10 | animations = {} | 10 | animations = {} |
733 | 11 | add_animation(animations, "idle", dirname, "tiny/idle", { 9, 19 }) | 11 | add_animation(animations, "idle", dirname .. "tiny", "idle", { 9, 19 }) |
734 | 12 | 12 | ||
735 | 13 | tribes:new_immovable_type { | 13 | tribes:new_immovable_type { |
736 | 14 | msgctxt = "immovable", | 14 | msgctxt = "immovable", |
737 | @@ -29,7 +29,7 @@ | |||
738 | 29 | } | 29 | } |
739 | 30 | 30 | ||
740 | 31 | animations = {} | 31 | animations = {} |
742 | 32 | add_animation(animations, "idle", dirname, "small/idle", { 14, 32 }) | 32 | add_animation(animations, "idle", dirname .. "small", "idle", { 14, 32 }) |
743 | 33 | 33 | ||
744 | 34 | tribes:new_immovable_type { | 34 | tribes:new_immovable_type { |
745 | 35 | msgctxt = "immovable", | 35 | msgctxt = "immovable", |
746 | @@ -50,7 +50,7 @@ | |||
747 | 50 | } | 50 | } |
748 | 51 | 51 | ||
749 | 52 | animations = {} | 52 | animations = {} |
751 | 53 | add_animation(animations, "idle", dirname, "medium/idle", { 17, 40 }) | 53 | add_animation(animations, "idle", dirname .. "medium", "idle", { 17, 40 }) |
752 | 54 | 54 | ||
753 | 55 | tribes:new_immovable_type { | 55 | tribes:new_immovable_type { |
754 | 56 | msgctxt = "immovable", | 56 | msgctxt = "immovable", |
755 | @@ -71,7 +71,7 @@ | |||
756 | 71 | } | 71 | } |
757 | 72 | 72 | ||
758 | 73 | animations = {} | 73 | animations = {} |
760 | 74 | add_animation(animations, "idle", dirname, "ripe/idle", { 17, 40 }) | 74 | add_animation(animations, "idle", dirname .. "ripe", "idle", { 17, 40 }) |
761 | 75 | 75 | ||
762 | 76 | tribes:new_immovable_type { | 76 | tribes:new_immovable_type { |
763 | 77 | msgctxt = "immovable", | 77 | msgctxt = "immovable", |
764 | 78 | 78 | ||
765 | === modified file 'data/tribes/immovables/berry_bushes/strawberry/init.lua' | |||
766 | --- data/tribes/immovables/berry_bushes/strawberry/init.lua 2019-03-02 13:56:42 +0000 | |||
767 | +++ data/tribes/immovables/berry_bushes/strawberry/init.lua 2019-05-27 14:29:35 +0000 | |||
768 | @@ -8,7 +8,7 @@ | |||
769 | 8 | } | 8 | } |
770 | 9 | 9 | ||
771 | 10 | animations = {} | 10 | animations = {} |
773 | 11 | add_animation(animations, "idle", dirname, "tiny/idle", { 4, 4 }) | 11 | add_animation(animations, "idle", dirname .. "tiny", "idle", { 4, 4 }) |
774 | 12 | 12 | ||
775 | 13 | tribes:new_immovable_type { | 13 | tribes:new_immovable_type { |
776 | 14 | msgctxt = "immovable", | 14 | msgctxt = "immovable", |
777 | @@ -29,7 +29,7 @@ | |||
778 | 29 | } | 29 | } |
779 | 30 | 30 | ||
780 | 31 | animations = {} | 31 | animations = {} |
782 | 32 | add_animation(animations, "idle", dirname, "small/idle", { 12, 9 }) | 32 | add_animation(animations, "idle", dirname .. "small", "idle", { 12, 9 }) |
783 | 33 | 33 | ||
784 | 34 | tribes:new_immovable_type { | 34 | tribes:new_immovable_type { |
785 | 35 | msgctxt = "immovable", | 35 | msgctxt = "immovable", |
786 | @@ -50,7 +50,7 @@ | |||
787 | 50 | } | 50 | } |
788 | 51 | 51 | ||
789 | 52 | animations = {} | 52 | animations = {} |
791 | 53 | add_animation(animations, "idle", dirname, "medium/idle", { 21, 15 }) | 53 | add_animation(animations, "idle", dirname .. "medium", "idle", { 21, 15 }) |
792 | 54 | 54 | ||
793 | 55 | tribes:new_immovable_type { | 55 | tribes:new_immovable_type { |
794 | 56 | msgctxt = "immovable", | 56 | msgctxt = "immovable", |
795 | @@ -71,7 +71,7 @@ | |||
796 | 71 | } | 71 | } |
797 | 72 | 72 | ||
798 | 73 | animations = {} | 73 | animations = {} |
800 | 74 | add_animation(animations, "idle", dirname, "ripe/idle", { 21, 15 }) | 74 | add_animation(animations, "idle", dirname .. "ripe", "idle", { 21, 15 }) |
801 | 75 | 75 | ||
802 | 76 | tribes:new_immovable_type { | 76 | tribes:new_immovable_type { |
803 | 77 | msgctxt = "immovable", | 77 | msgctxt = "immovable", |
804 | 78 | 78 | ||
805 | === modified file 'data/tribes/ships/atlanteans/init.lua' | |||
806 | --- data/tribes/ships/atlanteans/init.lua 2017-02-12 09:10:57 +0000 | |||
807 | +++ data/tribes/ships/atlanteans/init.lua 2019-05-27 14:29:35 +0000 | |||
808 | @@ -24,7 +24,7 @@ | |||
809 | 24 | fps = 7 | 24 | fps = 7 |
810 | 25 | } | 25 | } |
811 | 26 | } | 26 | } |
813 | 27 | add_walking_animations(animations, "sail", dirname, "sail", {89, 86}, 10) | 27 | add_directional_animation(animations, "sail", dirname, "sail", {89, 86}, 10) |
814 | 28 | 28 | ||
815 | 29 | 29 | ||
816 | 30 | -- RST | 30 | -- RST |
817 | 31 | 31 | ||
818 | === modified file 'data/tribes/ships/barbarians/init.lua' | |||
819 | --- data/tribes/ships/barbarians/init.lua 2017-02-12 09:10:57 +0000 | |||
820 | +++ data/tribes/ships/barbarians/init.lua 2019-05-27 14:29:35 +0000 | |||
821 | @@ -7,7 +7,7 @@ | |||
822 | 7 | fps = 10 | 7 | fps = 10 |
823 | 8 | } | 8 | } |
824 | 9 | } | 9 | } |
826 | 10 | add_walking_animations(animations, "sail", dirname, "sail", {115, 76}, 10) | 10 | add_directional_animation(animations, "sail", dirname, "sail", {115, 76}, 10) |
827 | 11 | 11 | ||
828 | 12 | 12 | ||
829 | 13 | tribes:new_ship_type { | 13 | tribes:new_ship_type { |
830 | 14 | 14 | ||
831 | === modified file 'data/tribes/ships/empire/init.lua' | |||
832 | --- data/tribes/ships/empire/init.lua 2017-02-12 09:10:57 +0000 | |||
833 | +++ data/tribes/ships/empire/init.lua 2019-05-27 14:29:35 +0000 | |||
834 | @@ -7,7 +7,7 @@ | |||
835 | 7 | fps = 10 | 7 | fps = 10 |
836 | 8 | } | 8 | } |
837 | 9 | } | 9 | } |
839 | 10 | add_walking_animations(animations, "sail", dirname, "sail", {115, 100}, 10) | 10 | add_directional_animation(animations, "sail", dirname, "sail", {115, 100}, 10) |
840 | 11 | 11 | ||
841 | 12 | 12 | ||
842 | 13 | tribes:new_ship_type { | 13 | tribes:new_ship_type { |
843 | 14 | 14 | ||
844 | === modified file 'data/tribes/ships/frisians/init.lua' | |||
845 | --- data/tribes/ships/frisians/init.lua 2018-02-08 17:18:30 +0000 | |||
846 | +++ data/tribes/ships/frisians/init.lua 2019-05-27 14:29:35 +0000 | |||
847 | @@ -12,7 +12,7 @@ | |||
848 | 12 | fps = 7 | 12 | fps = 7 |
849 | 13 | } | 13 | } |
850 | 14 | } | 14 | } |
852 | 15 | add_walking_animations (animations, "sail", dirname, "sail", {146, 153}, 10) | 15 | add_directional_animation(animations, "sail", dirname, "sail", {146, 153}, 10) |
853 | 16 | 16 | ||
854 | 17 | tribes:new_ship_type { | 17 | tribes:new_ship_type { |
855 | 18 | name = "frisians_ship", | 18 | name = "frisians_ship", |
856 | 19 | 19 | ||
857 | === modified file 'data/tribes/workers/atlanteans/armorsmith/init.lua' | |||
858 | --- data/tribes/workers/atlanteans/armorsmith/init.lua 2017-08-30 16:46:00 +0000 | |||
859 | +++ data/tribes/workers/atlanteans/armorsmith/init.lua 2019-05-27 14:29:35 +0000 | |||
860 | @@ -21,8 +21,8 @@ | |||
861 | 21 | hotspot = { 10, 21 }, | 21 | hotspot = { 10, 21 }, |
862 | 22 | } | 22 | } |
863 | 23 | } | 23 | } |
866 | 24 | add_walking_animations(animations, "walk", dirname, "walk", {8, 23}, 10) | 24 | add_directional_animation(animations, "walk", dirname, "walk", {8, 23}, 10) |
867 | 25 | add_walking_animations(animations, "walkload", dirname, "walkload", {8, 23}, 10) | 25 | add_directional_animation(animations, "walkload", dirname, "walkload", {8, 23}, 10) |
868 | 26 | 26 | ||
869 | 27 | -- RST | 27 | -- RST |
870 | 28 | -- .. function:: new_worker_type{table} | 28 | -- .. function:: new_worker_type{table} |
871 | 29 | 29 | ||
872 | === modified file 'data/tribes/workers/atlanteans/baker/init.lua' | |||
873 | --- data/tribes/workers/atlanteans/baker/init.lua 2017-02-12 09:10:57 +0000 | |||
874 | +++ data/tribes/workers/atlanteans/baker/init.lua 2019-05-27 14:29:35 +0000 | |||
875 | @@ -6,8 +6,8 @@ | |||
876 | 6 | hotspot = { 5, 23 }, | 6 | hotspot = { 5, 23 }, |
877 | 7 | } | 7 | } |
878 | 8 | } | 8 | } |
881 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {7, 24}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {7, 24}, 10) |
882 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {9, 25}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {9, 25}, 10) |
883 | 11 | 11 | ||
884 | 12 | 12 | ||
885 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
886 | 14 | 14 | ||
887 | === modified file 'data/tribes/workers/atlanteans/blackroot_farmer/init.lua' | |||
888 | --- data/tribes/workers/atlanteans/blackroot_farmer/init.lua 2018-02-28 09:38:13 +0000 | |||
889 | +++ data/tribes/workers/atlanteans/blackroot_farmer/init.lua 2019-05-27 14:29:35 +0000 | |||
890 | @@ -21,8 +21,8 @@ | |||
891 | 21 | fps = 10 | 21 | fps = 10 |
892 | 22 | } | 22 | } |
893 | 23 | } | 23 | } |
896 | 24 | add_walking_animations(animations, "walk", dirname, "walk", {13, 24}, 10) | 24 | add_directional_animation(animations, "walk", dirname, "walk", {13, 24}, 10) |
897 | 25 | add_walking_animations(animations, "walkload", dirname, "walk", {13, 24}, 10) | 25 | add_directional_animation(animations, "walkload", dirname, "walk", {13, 24}, 10) |
898 | 26 | 26 | ||
899 | 27 | 27 | ||
900 | 28 | tribes:new_worker_type { | 28 | tribes:new_worker_type { |
901 | 29 | 29 | ||
902 | === modified file 'data/tribes/workers/atlanteans/builder/init.lua' | |||
903 | --- data/tribes/workers/atlanteans/builder/init.lua 2019-03-17 08:30:43 +0000 | |||
904 | +++ data/tribes/workers/atlanteans/builder/init.lua 2019-05-27 14:29:35 +0000 | |||
905 | @@ -16,8 +16,8 @@ | |||
906 | 16 | fps=10, | 16 | fps=10, |
907 | 17 | } | 17 | } |
908 | 18 | } | 18 | } |
911 | 19 | add_walking_animations(animations, "walk", dirname, "walk", {8, 24}, 10) | 19 | add_directional_animation(animations, "walk", dirname, "walk", {8, 24}, 10) |
912 | 20 | add_walking_animations(animations, "walkload", dirname, "walk", {8, 24}, 10) | 20 | add_directional_animation(animations, "walkload", dirname, "walk", {8, 24}, 10) |
913 | 21 | 21 | ||
914 | 22 | 22 | ||
915 | 23 | tribes:new_worker_type { | 23 | tribes:new_worker_type { |
916 | 24 | 24 | ||
917 | === modified file 'data/tribes/workers/atlanteans/carrier/init.lua' | |||
918 | --- data/tribes/workers/atlanteans/carrier/init.lua 2018-11-30 10:36:42 +0000 | |||
919 | +++ data/tribes/workers/atlanteans/carrier/init.lua 2019-05-27 14:29:35 +0000 | |||
920 | @@ -15,15 +15,10 @@ | |||
921 | 15 | 15 | ||
922 | 16 | dirname = path.dirname(__file__) | 16 | dirname = path.dirname(__file__) |
923 | 17 | 17 | ||
933 | 18 | animations = { | 18 | animations = {} |
934 | 19 | idle = { | 19 | add_animation(animations, "idle", dirname, "idle", {13, 24}, 10) |
935 | 20 | pictures = path.list_files(dirname .. "idle_??.png"), | 20 | add_directional_animation(animations, "walk", dirname, "walk", {8, 25}, 10) |
936 | 21 | hotspot = { 13, 24 }, | 21 | add_directional_animation(animations, "walkload", dirname, "walkload", {8, 25}, 10) |
928 | 22 | fps=10, | ||
929 | 23 | } | ||
930 | 24 | } | ||
931 | 25 | add_walking_animations(animations, "walk", dirname, "walk", {8, 25}, 10) | ||
932 | 26 | add_walking_animations(animations, "walkload", dirname, "walkload", {8, 25}, 10) | ||
937 | 27 | 22 | ||
938 | 28 | -- RST | 23 | -- RST |
939 | 29 | -- .. function:: new_carrier_type{table} | 24 | -- .. function:: new_carrier_type{table} |
940 | 30 | 25 | ||
941 | === modified file 'data/tribes/workers/atlanteans/charcoal_burner/init.lua' | |||
942 | --- data/tribes/workers/atlanteans/charcoal_burner/init.lua 2017-02-12 09:10:57 +0000 | |||
943 | +++ data/tribes/workers/atlanteans/charcoal_burner/init.lua 2019-05-27 14:29:35 +0000 | |||
944 | @@ -6,8 +6,8 @@ | |||
945 | 6 | hotspot = { 4, 22 } | 6 | hotspot = { 4, 22 } |
946 | 7 | } | 7 | } |
947 | 8 | } | 8 | } |
950 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {8, 22}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {8, 22}, 10) |
951 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {8, 24}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {8, 24}, 10) |
952 | 11 | 11 | ||
953 | 12 | 12 | ||
954 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
955 | 14 | 14 | ||
956 | === modified file 'data/tribes/workers/atlanteans/farmer/init.lua' | |||
957 | --- data/tribes/workers/atlanteans/farmer/init.lua 2019-03-17 07:20:58 +0000 | |||
958 | +++ data/tribes/workers/atlanteans/farmer/init.lua 2019-05-27 14:29:35 +0000 | |||
959 | @@ -21,8 +21,8 @@ | |||
960 | 21 | fps = 5 | 21 | fps = 5 |
961 | 22 | } | 22 | } |
962 | 23 | } | 23 | } |
965 | 24 | add_walking_animations(animations, "walk", dirname, "walk", {18, 23}, 10) | 24 | add_directional_animation(animations, "walk", dirname, "walk", {18, 23}, 10) |
966 | 25 | add_walking_animations(animations, "walkload", dirname, "walk", {18, 23}, 10) | 25 | add_directional_animation(animations, "walkload", dirname, "walk", {18, 23}, 10) |
967 | 26 | 26 | ||
968 | 27 | 27 | ||
969 | 28 | tribes:new_worker_type { | 28 | tribes:new_worker_type { |
970 | 29 | 29 | ||
971 | === modified file 'data/tribes/workers/atlanteans/fishbreeder/init.lua' | |||
972 | --- data/tribes/workers/atlanteans/fishbreeder/init.lua 2017-11-18 17:49:18 +0000 | |||
973 | +++ data/tribes/workers/atlanteans/fishbreeder/init.lua 2019-05-27 14:29:35 +0000 | |||
974 | @@ -11,7 +11,7 @@ | |||
975 | 11 | fps = 10 | 11 | fps = 10 |
976 | 12 | } | 12 | } |
977 | 13 | } | 13 | } |
979 | 14 | add_walking_animations(animations, "walk", dirname, "walk", {11, 23}, 20) | 14 | add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 20) |
980 | 15 | 15 | ||
981 | 16 | tribes:new_worker_type { | 16 | tribes:new_worker_type { |
982 | 17 | msgctxt = "atlanteans_worker", | 17 | msgctxt = "atlanteans_worker", |
983 | 18 | 18 | ||
984 | === modified file 'data/tribes/workers/atlanteans/fisher/init.lua' | |||
985 | --- data/tribes/workers/atlanteans/fisher/init.lua 2019-03-17 07:20:58 +0000 | |||
986 | +++ data/tribes/workers/atlanteans/fisher/init.lua 2019-05-27 14:29:35 +0000 | |||
987 | @@ -11,8 +11,8 @@ | |||
988 | 11 | fps = 10 | 11 | fps = 10 |
989 | 12 | } | 12 | } |
990 | 13 | } | 13 | } |
993 | 14 | add_walking_animations(animations, "walk", dirname, "walk", {8, 21}, 20) | 14 | add_directional_animation(animations, "walk", dirname, "walk", {8, 21}, 20) |
994 | 15 | add_walking_animations(animations, "walkload", dirname, "walkload", {8, 20}, 10) | 15 | add_directional_animation(animations, "walkload", dirname, "walkload", {8, 20}, 10) |
995 | 16 | 16 | ||
996 | 17 | 17 | ||
997 | 18 | tribes:new_worker_type { | 18 | tribes:new_worker_type { |
998 | 19 | 19 | ||
999 | === modified file 'data/tribes/workers/atlanteans/forester/init.lua' | |||
1000 | --- data/tribes/workers/atlanteans/forester/init.lua 2018-02-28 09:38:13 +0000 | |||
1001 | +++ data/tribes/workers/atlanteans/forester/init.lua 2019-05-27 14:29:35 +0000 | |||
1002 | @@ -21,8 +21,8 @@ | |||
1003 | 21 | fps = 5 | 21 | fps = 5 |
1004 | 22 | } | 22 | } |
1005 | 23 | } | 23 | } |
1008 | 24 | add_walking_animations(animations, "walk", dirname, "walk", {10, 23}, 10) | 24 | add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 10) |
1009 | 25 | add_walking_animations(animations, "walkload", dirname, "walk", {10, 23}, 10) | 25 | add_directional_animation(animations, "walkload", dirname, "walk", {10, 23}, 10) |
1010 | 26 | 26 | ||
1011 | 27 | 27 | ||
1012 | 28 | tribes:new_worker_type { | 28 | tribes:new_worker_type { |
1013 | 29 | 29 | ||
1014 | === modified file 'data/tribes/workers/atlanteans/geologist/init.lua' | |||
1015 | --- data/tribes/workers/atlanteans/geologist/init.lua 2019-03-17 07:20:58 +0000 | |||
1016 | +++ data/tribes/workers/atlanteans/geologist/init.lua 2019-05-27 14:29:35 +0000 | |||
1017 | @@ -12,8 +12,8 @@ | |||
1018 | 12 | fps = 10 | 12 | fps = 10 |
1019 | 13 | } | 13 | } |
1020 | 14 | } | 14 | } |
1023 | 15 | add_walking_animations(animations, "walk", dirname, "walk", {11, 23}, 10) | 15 | add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 10) |
1024 | 16 | add_walking_animations(animations, "walkload", dirname, "walk", {11, 23}, 10) | 16 | add_directional_animation(animations, "walkload", dirname, "walk", {11, 23}, 10) |
1025 | 17 | 17 | ||
1026 | 18 | 18 | ||
1027 | 19 | tribes:new_worker_type { | 19 | tribes:new_worker_type { |
1028 | 20 | 20 | ||
1029 | === modified file 'data/tribes/workers/atlanteans/horse/init.lua' | |||
1030 | --- data/tribes/workers/atlanteans/horse/init.lua 2019-05-18 13:04:13 +0000 | |||
1031 | +++ data/tribes/workers/atlanteans/horse/init.lua 2019-05-27 14:29:35 +0000 | |||
1032 | @@ -7,8 +7,8 @@ | |||
1033 | 7 | fps = 10 | 7 | fps = 10 |
1034 | 8 | } | 8 | } |
1035 | 9 | } | 9 | } |
1038 | 10 | add_walking_animations(animations, "walk", dirname, "walk", {19, 33}, 10) | 10 | add_directional_animation(animations, "walk", dirname, "walk", {19, 33}, 10) |
1039 | 11 | add_walking_animations(animations, "walkload", dirname, "walk", {19, 33}, 10) -- TODO(GunChleoc): Make animation | 11 | add_directional_animation(animations, "walkload", dirname, "walk", {19, 33}, 10) -- TODO(GunChleoc): Make animation |
1040 | 12 | 12 | ||
1041 | 13 | 13 | ||
1042 | 14 | tribes:new_carrier_type { | 14 | tribes:new_carrier_type { |
1043 | 15 | 15 | ||
1044 | === modified file 'data/tribes/workers/atlanteans/horsebreeder/init.lua' | |||
1045 | --- data/tribes/workers/atlanteans/horsebreeder/init.lua 2017-02-12 09:10:57 +0000 | |||
1046 | +++ data/tribes/workers/atlanteans/horsebreeder/init.lua 2019-05-27 14:29:35 +0000 | |||
1047 | @@ -6,7 +6,7 @@ | |||
1048 | 6 | hotspot = { 8, 23 }, | 6 | hotspot = { 8, 23 }, |
1049 | 7 | } | 7 | } |
1050 | 8 | } | 8 | } |
1052 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {35, 28}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {35, 28}, 10) |
1053 | 10 | 10 | ||
1054 | 11 | tribes:new_worker_type { | 11 | tribes:new_worker_type { |
1055 | 12 | msgctxt = "atlanteans_worker", | 12 | msgctxt = "atlanteans_worker", |
1056 | 13 | 13 | ||
1057 | === modified file 'data/tribes/workers/atlanteans/hunter/init.lua' | |||
1058 | --- data/tribes/workers/atlanteans/hunter/init.lua 2018-02-28 09:38:13 +0000 | |||
1059 | +++ data/tribes/workers/atlanteans/hunter/init.lua 2019-05-27 14:29:35 +0000 | |||
1060 | @@ -7,8 +7,8 @@ | |||
1061 | 7 | fps = 10 | 7 | fps = 10 |
1062 | 8 | } | 8 | } |
1063 | 9 | } | 9 | } |
1066 | 10 | add_walking_animations(animations, "walk", dirname, "walk", {14, 22}, 10) | 10 | add_directional_animation(animations, "walk", dirname, "walk", {14, 22}, 10) |
1067 | 11 | add_walking_animations(animations, "walkload", dirname, "walkload", {13, 23}, 10) | 11 | add_directional_animation(animations, "walkload", dirname, "walkload", {13, 23}, 10) |
1068 | 12 | 12 | ||
1069 | 13 | 13 | ||
1070 | 14 | tribes:new_worker_type { | 14 | tribes:new_worker_type { |
1071 | 15 | 15 | ||
1072 | === modified file 'data/tribes/workers/atlanteans/miller/init.lua' | |||
1073 | --- data/tribes/workers/atlanteans/miller/init.lua 2017-02-12 09:10:57 +0000 | |||
1074 | +++ data/tribes/workers/atlanteans/miller/init.lua 2019-05-27 14:29:35 +0000 | |||
1075 | @@ -6,8 +6,8 @@ | |||
1076 | 6 | hotspot = { 4, 22 } | 6 | hotspot = { 4, 22 } |
1077 | 7 | } | 7 | } |
1078 | 8 | } | 8 | } |
1081 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {8, 22}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {8, 22}, 10) |
1082 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {8, 24}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {8, 24}, 10) |
1083 | 11 | 11 | ||
1084 | 12 | 12 | ||
1085 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1086 | 14 | 14 | ||
1087 | === modified file 'data/tribes/workers/atlanteans/miner/init.lua' | |||
1088 | --- data/tribes/workers/atlanteans/miner/init.lua 2017-02-12 09:10:57 +0000 | |||
1089 | +++ data/tribes/workers/atlanteans/miner/init.lua 2019-05-27 14:29:35 +0000 | |||
1090 | @@ -6,8 +6,8 @@ | |||
1091 | 6 | hotspot = { 3, 23 } | 6 | hotspot = { 3, 23 } |
1092 | 7 | } | 7 | } |
1093 | 8 | } | 8 | } |
1096 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {10, 24}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {10, 24}, 10) |
1097 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {10, 24}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 24}, 10) |
1098 | 11 | 11 | ||
1099 | 12 | 12 | ||
1100 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1101 | 14 | 14 | ||
1102 | === modified file 'data/tribes/workers/atlanteans/recruit/init.lua' | |||
1103 | --- data/tribes/workers/atlanteans/recruit/init.lua 2017-05-25 20:30:41 +0000 | |||
1104 | +++ data/tribes/workers/atlanteans/recruit/init.lua 2019-05-27 14:29:35 +0000 | |||
1105 | @@ -7,7 +7,7 @@ | |||
1106 | 7 | fps = 5 | 7 | fps = 5 |
1107 | 8 | }, | 8 | }, |
1108 | 9 | } | 9 | } |
1110 | 10 | add_walking_animations(animations, "walk", dirname, "walk", {20, 30}, 10) | 10 | add_directional_animation(animations, "walk", dirname, "walk", {20, 30}, 10) |
1111 | 11 | 11 | ||
1112 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
1113 | 13 | msgctxt = "atlanteans_worker", | 13 | msgctxt = "atlanteans_worker", |
1114 | 14 | 14 | ||
1115 | === modified file 'data/tribes/workers/atlanteans/sawyer/init.lua' | |||
1116 | --- data/tribes/workers/atlanteans/sawyer/init.lua 2017-02-12 09:10:57 +0000 | |||
1117 | +++ data/tribes/workers/atlanteans/sawyer/init.lua 2019-05-27 14:29:35 +0000 | |||
1118 | @@ -6,8 +6,8 @@ | |||
1119 | 6 | hotspot = { 5, 31 } | 6 | hotspot = { 5, 31 } |
1120 | 7 | } | 7 | } |
1121 | 8 | } | 8 | } |
1124 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {16, 31}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {16, 31}, 10) |
1125 | 10 | add_walking_animations(animations, "walkload", dirname, "walk", {16, 31}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walk", {16, 31}, 10) |
1126 | 11 | 11 | ||
1127 | 12 | 12 | ||
1128 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1129 | 14 | 14 | ||
1130 | === modified file 'data/tribes/workers/atlanteans/scout/init.lua' | |||
1131 | --- data/tribes/workers/atlanteans/scout/init.lua 2018-02-28 09:38:13 +0000 | |||
1132 | +++ data/tribes/workers/atlanteans/scout/init.lua 2019-05-27 14:29:35 +0000 | |||
1133 | @@ -6,7 +6,7 @@ | |||
1134 | 6 | hotspot = { 4, 22 }, | 6 | hotspot = { 4, 22 }, |
1135 | 7 | } | 7 | } |
1136 | 8 | } | 8 | } |
1138 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {9, 25}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {9, 25}, 10) |
1139 | 10 | 10 | ||
1140 | 11 | tribes:new_worker_type { | 11 | tribes:new_worker_type { |
1141 | 12 | msgctxt = "atlanteans_worker", | 12 | msgctxt = "atlanteans_worker", |
1142 | 13 | 13 | ||
1143 | === modified file 'data/tribes/workers/atlanteans/shipwright/init.lua' | |||
1144 | --- data/tribes/workers/atlanteans/shipwright/init.lua 2019-03-17 08:30:43 +0000 | |||
1145 | +++ data/tribes/workers/atlanteans/shipwright/init.lua 2019-05-27 14:29:35 +0000 | |||
1146 | @@ -11,8 +11,8 @@ | |||
1147 | 11 | fps = 10 | 11 | fps = 10 |
1148 | 12 | } | 12 | } |
1149 | 13 | } | 13 | } |
1152 | 14 | add_walking_animations(animations, "walk", dirname, "walk", {12, 28}, 10) | 14 | add_directional_animation(animations, "walk", dirname, "walk", {12, 28}, 10) |
1153 | 15 | add_walking_animations(animations, "walkload", dirname, "walkload", {12, 28}, 10) | 15 | add_directional_animation(animations, "walkload", dirname, "walkload", {12, 28}, 10) |
1154 | 16 | 16 | ||
1155 | 17 | 17 | ||
1156 | 18 | tribes:new_worker_type { | 18 | tribes:new_worker_type { |
1157 | 19 | 19 | ||
1158 | === modified file 'data/tribes/workers/atlanteans/smelter/init.lua' | |||
1159 | --- data/tribes/workers/atlanteans/smelter/init.lua 2017-02-12 09:10:57 +0000 | |||
1160 | +++ data/tribes/workers/atlanteans/smelter/init.lua 2019-05-27 14:29:35 +0000 | |||
1161 | @@ -6,8 +6,8 @@ | |||
1162 | 6 | hotspot = { 10, 22 } | 6 | hotspot = { 10, 22 } |
1163 | 7 | } | 7 | } |
1164 | 8 | } | 8 | } |
1167 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {12, 22}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {12, 22}, 10) |
1168 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {12, 24}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {12, 24}, 10) |
1169 | 11 | 11 | ||
1170 | 12 | 12 | ||
1171 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1172 | 14 | 14 | ||
1173 | === modified file 'data/tribes/workers/atlanteans/smoker/init.lua' | |||
1174 | --- data/tribes/workers/atlanteans/smoker/init.lua 2018-08-29 11:31:58 +0000 | |||
1175 | +++ data/tribes/workers/atlanteans/smoker/init.lua 2019-05-27 14:29:35 +0000 | |||
1176 | @@ -6,8 +6,8 @@ | |||
1177 | 6 | hotspot = { 17, 22 } | 6 | hotspot = { 17, 22 } |
1178 | 7 | } | 7 | } |
1179 | 8 | } | 8 | } |
1182 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {20, 22}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {20, 22}, 10) |
1183 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {20, 24}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {20, 24}, 10) |
1184 | 11 | 11 | ||
1185 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
1186 | 13 | msgctxt = "atlanteans_worker", | 13 | msgctxt = "atlanteans_worker", |
1187 | 14 | 14 | ||
1188 | === modified file 'data/tribes/workers/atlanteans/soldier/init.lua' | |||
1189 | --- data/tribes/workers/atlanteans/soldier/init.lua 2019-05-19 09:36:33 +0000 | |||
1190 | +++ data/tribes/workers/atlanteans/soldier/init.lua 2019-05-27 14:29:35 +0000 | |||
1191 | @@ -71,7 +71,7 @@ | |||
1192 | 71 | fps = 10 | 71 | fps = 10 |
1193 | 72 | } | 72 | } |
1194 | 73 | } | 73 | } |
1196 | 74 | add_walking_animations(animations, "walk", dirname, "walk", {20, 34}, 10) | 74 | add_directional_animation(animations, "walk", dirname, "walk", {20, 34}, 10) |
1197 | 75 | 75 | ||
1198 | 76 | all_levels_atl = { | 76 | all_levels_atl = { |
1199 | 77 | min_health = 0, | 77 | min_health = 0, |
1200 | 78 | 78 | ||
1201 | === modified file 'data/tribes/workers/atlanteans/spiderbreeder/init.lua' | |||
1202 | --- data/tribes/workers/atlanteans/spiderbreeder/init.lua 2017-02-12 09:10:57 +0000 | |||
1203 | +++ data/tribes/workers/atlanteans/spiderbreeder/init.lua 2019-05-27 14:29:35 +0000 | |||
1204 | @@ -6,8 +6,8 @@ | |||
1205 | 6 | hotspot = { 8, 22 } | 6 | hotspot = { 8, 22 } |
1206 | 7 | } | 7 | } |
1207 | 8 | } | 8 | } |
1210 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {10, 22}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {10, 22}, 10) |
1211 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {10, 22}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 22}, 10) |
1212 | 11 | 11 | ||
1213 | 12 | 12 | ||
1214 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1215 | 14 | 14 | ||
1216 | === modified file 'data/tribes/workers/atlanteans/stonecutter/init.lua' | |||
1217 | --- data/tribes/workers/atlanteans/stonecutter/init.lua 2019-03-17 07:20:58 +0000 | |||
1218 | +++ data/tribes/workers/atlanteans/stonecutter/init.lua 2019-05-27 14:29:35 +0000 | |||
1219 | @@ -11,8 +11,8 @@ | |||
1220 | 11 | fps = 10 | 11 | fps = 10 |
1221 | 12 | } | 12 | } |
1222 | 13 | } | 13 | } |
1225 | 14 | add_walking_animations(animations, "walk", dirname, "walk", {10, 21}, 10) | 14 | add_directional_animation(animations, "walk", dirname, "walk", {10, 21}, 10) |
1226 | 15 | add_walking_animations(animations, "walkload", dirname, "walkload", {10, 23}, 10) | 15 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 23}, 10) |
1227 | 16 | 16 | ||
1228 | 17 | 17 | ||
1229 | 18 | tribes:new_worker_type { | 18 | tribes:new_worker_type { |
1230 | 19 | 19 | ||
1231 | === modified file 'data/tribes/workers/atlanteans/toolsmith/init.lua' | |||
1232 | --- data/tribes/workers/atlanteans/toolsmith/init.lua 2017-02-12 09:10:57 +0000 | |||
1233 | +++ data/tribes/workers/atlanteans/toolsmith/init.lua 2019-05-27 14:29:35 +0000 | |||
1234 | @@ -6,8 +6,8 @@ | |||
1235 | 6 | hotspot = { 10, 21 } | 6 | hotspot = { 10, 21 } |
1236 | 7 | } | 7 | } |
1237 | 8 | } | 8 | } |
1240 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {8, 23}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {8, 23}, 10) |
1241 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {8, 23}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {8, 23}, 10) |
1242 | 11 | 11 | ||
1243 | 12 | 12 | ||
1244 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1245 | 14 | 14 | ||
1246 | === modified file 'data/tribes/workers/atlanteans/trainer/init.lua' | |||
1247 | --- data/tribes/workers/atlanteans/trainer/init.lua 2017-02-12 09:10:57 +0000 | |||
1248 | +++ data/tribes/workers/atlanteans/trainer/init.lua 2019-05-27 14:29:35 +0000 | |||
1249 | @@ -6,8 +6,8 @@ | |||
1250 | 6 | hotspot = { 11, 21 } | 6 | hotspot = { 11, 21 } |
1251 | 7 | } | 7 | } |
1252 | 8 | } | 8 | } |
1255 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {14, 21}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {14, 21}, 10) |
1256 | 10 | add_walking_animations(animations, "walkload", dirname, "walk", {14, 21}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walk", {14, 21}, 10) |
1257 | 11 | 11 | ||
1258 | 12 | 12 | ||
1259 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1260 | 14 | 14 | ||
1261 | === modified file 'data/tribes/workers/atlanteans/weaponsmith/init.lua' | |||
1262 | --- data/tribes/workers/atlanteans/weaponsmith/init.lua 2017-02-12 09:10:57 +0000 | |||
1263 | +++ data/tribes/workers/atlanteans/weaponsmith/init.lua 2019-05-27 14:29:35 +0000 | |||
1264 | @@ -6,8 +6,8 @@ | |||
1265 | 6 | hotspot = { 10, 21 } | 6 | hotspot = { 10, 21 } |
1266 | 7 | } | 7 | } |
1267 | 8 | } | 8 | } |
1270 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {8, 23}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {8, 23}, 10) |
1271 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {8, 23}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {8, 23}, 10) |
1272 | 11 | 11 | ||
1273 | 12 | 12 | ||
1274 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1275 | 14 | 14 | ||
1276 | === modified file 'data/tribes/workers/atlanteans/weaver/init.lua' | |||
1277 | --- data/tribes/workers/atlanteans/weaver/init.lua 2017-02-12 09:10:57 +0000 | |||
1278 | +++ data/tribes/workers/atlanteans/weaver/init.lua 2019-05-27 14:29:35 +0000 | |||
1279 | @@ -6,8 +6,8 @@ | |||
1280 | 6 | hotspot = { 2, 22 } | 6 | hotspot = { 2, 22 } |
1281 | 7 | } | 7 | } |
1282 | 8 | } | 8 | } |
1285 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {6, 23}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {6, 23}, 10) |
1286 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {9, 22}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {9, 22}, 10) |
1287 | 11 | 11 | ||
1288 | 12 | 12 | ||
1289 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1290 | 14 | 14 | ||
1291 | === modified file 'data/tribes/workers/atlanteans/woodcutter/init.lua' | |||
1292 | --- data/tribes/workers/atlanteans/woodcutter/init.lua 2019-03-17 07:20:58 +0000 | |||
1293 | +++ data/tribes/workers/atlanteans/woodcutter/init.lua 2019-05-27 14:29:35 +0000 | |||
1294 | @@ -11,8 +11,8 @@ | |||
1295 | 11 | fps = 10 | 11 | fps = 10 |
1296 | 12 | } | 12 | } |
1297 | 13 | } | 13 | } |
1300 | 14 | add_walking_animations(animations, "walk", dirname, "walk", {16, 31}, 10) | 14 | add_directional_animation(animations, "walk", dirname, "walk", {16, 31}, 10) |
1301 | 15 | add_walking_animations(animations, "walkload", dirname, "walkload", {13, 29}, 10) | 15 | add_directional_animation(animations, "walkload", dirname, "walkload", {13, 29}, 10) |
1302 | 16 | 16 | ||
1303 | 17 | 17 | ||
1304 | 18 | tribes:new_worker_type { | 18 | tribes:new_worker_type { |
1305 | @@ -35,7 +35,7 @@ | |||
1306 | 35 | "walk=object", | 35 | "walk=object", |
1307 | 36 | "playsound=sound/atlanteans/saw/sawing 230", | 36 | "playsound=sound/atlanteans/saw/sawing 230", |
1308 | 37 | "animate=sawing 10000", | 37 | "animate=sawing 10000", |
1310 | 38 | "playsound=sound/woodcutting/tree-falling 130", | 38 | "playsound=sound/woodcutting/tree_falling 130", |
1311 | 39 | "callobject=fall", | 39 | "callobject=fall", |
1312 | 40 | "animate=idle 2000", | 40 | "animate=idle 2000", |
1313 | 41 | "createware=log", | 41 | "createware=log", |
1314 | 42 | 42 | ||
1315 | === modified file 'data/tribes/workers/barbarians/baker/init.lua' | |||
1316 | --- data/tribes/workers/barbarians/baker/init.lua 2017-02-12 09:10:57 +0000 | |||
1317 | +++ data/tribes/workers/barbarians/baker/init.lua 2019-05-27 14:29:35 +0000 | |||
1318 | @@ -6,8 +6,8 @@ | |||
1319 | 6 | hotspot = { 5, 23 }, | 6 | hotspot = { 5, 23 }, |
1320 | 7 | } | 7 | } |
1321 | 8 | } | 8 | } |
1324 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {7, 24}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {7, 24}, 10) |
1325 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {9, 25}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {9, 25}, 10) |
1326 | 11 | 11 | ||
1327 | 12 | 12 | ||
1328 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1329 | 14 | 14 | ||
1330 | === modified file 'data/tribes/workers/barbarians/blacksmith/init.lua' | |||
1331 | --- data/tribes/workers/barbarians/blacksmith/init.lua 2017-12-07 08:33:46 +0000 | |||
1332 | +++ data/tribes/workers/barbarians/blacksmith/init.lua 2019-05-27 14:29:35 +0000 | |||
1333 | @@ -6,8 +6,8 @@ | |||
1334 | 6 | hotspot = { 6, 28 }, | 6 | hotspot = { 6, 28 }, |
1335 | 7 | } | 7 | } |
1336 | 8 | } | 8 | } |
1339 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {11, 24}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15) |
1340 | 10 | add_walking_animations(animations, "walkload", dirname, "walk", {11, 24}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walk", {11, 24}, 15) |
1341 | 11 | 11 | ||
1342 | 12 | 12 | ||
1343 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1344 | 14 | 14 | ||
1345 | === modified file 'data/tribes/workers/barbarians/blacksmith_master/init.lua' | |||
1346 | --- data/tribes/workers/barbarians/blacksmith_master/init.lua 2017-02-12 09:10:57 +0000 | |||
1347 | +++ data/tribes/workers/barbarians/blacksmith_master/init.lua 2019-05-27 14:29:35 +0000 | |||
1348 | @@ -6,8 +6,8 @@ | |||
1349 | 6 | hotspot = { 3, 22 }, | 6 | hotspot = { 3, 22 }, |
1350 | 7 | } | 7 | } |
1351 | 8 | } | 8 | } |
1354 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {6, 22}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {6, 22}, 10) |
1355 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {9, 23}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {9, 23}, 10) |
1356 | 11 | 11 | ||
1357 | 12 | 12 | ||
1358 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1359 | 14 | 14 | ||
1360 | === modified file 'data/tribes/workers/barbarians/brewer/init.lua' | |||
1361 | --- data/tribes/workers/barbarians/brewer/init.lua 2017-12-07 08:33:46 +0000 | |||
1362 | +++ data/tribes/workers/barbarians/brewer/init.lua 2019-05-27 14:29:35 +0000 | |||
1363 | @@ -6,8 +6,8 @@ | |||
1364 | 6 | hotspot = { 7, 22 }, | 6 | hotspot = { 7, 22 }, |
1365 | 7 | } | 7 | } |
1366 | 8 | } | 8 | } |
1369 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {12, 23}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {12, 23}, 10) |
1370 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {11, 24}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {11, 24}, 10) |
1371 | 11 | 11 | ||
1372 | 12 | 12 | ||
1373 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1374 | 14 | 14 | ||
1375 | === modified file 'data/tribes/workers/barbarians/brewer_master/init.lua' | |||
1376 | --- data/tribes/workers/barbarians/brewer_master/init.lua 2017-02-12 09:10:57 +0000 | |||
1377 | +++ data/tribes/workers/barbarians/brewer_master/init.lua 2019-05-27 14:29:35 +0000 | |||
1378 | @@ -6,8 +6,8 @@ | |||
1379 | 6 | hotspot = { 8, 26 }, | 6 | hotspot = { 8, 26 }, |
1380 | 7 | } | 7 | } |
1381 | 8 | } | 8 | } |
1384 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {15, 26}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {15, 26}, 10) |
1385 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {11, 24}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {11, 24}, 10) |
1386 | 11 | 11 | ||
1387 | 12 | 12 | ||
1388 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1389 | 14 | 14 | ||
1390 | === modified file 'data/tribes/workers/barbarians/builder/init.lua' | |||
1391 | --- data/tribes/workers/barbarians/builder/init.lua 2019-04-24 06:32:02 +0000 | |||
1392 | +++ data/tribes/workers/barbarians/builder/init.lua 2019-05-27 14:29:35 +0000 | |||
1393 | @@ -7,8 +7,8 @@ | |||
1394 | 7 | path = "sound/hammering/hammering", | 7 | path = "sound/hammering/hammering", |
1395 | 8 | priority = 64 | 8 | priority = 64 |
1396 | 9 | } | 9 | } |
1399 | 10 | add_walking_animations(animations, "walk", dirname, "walk", {7, 22}, 10) | 10 | add_directional_animation(animations, "walk", dirname, "walk", {7, 22}, 10) |
1400 | 11 | add_walking_animations(animations, "walkload", dirname, "walk", {7, 22}, 10) | 11 | add_directional_animation(animations, "walkload", dirname, "walk", {7, 22}, 10) |
1401 | 12 | 12 | ||
1402 | 13 | 13 | ||
1403 | 14 | tribes:new_worker_type { | 14 | tribes:new_worker_type { |
1404 | 15 | 15 | ||
1405 | === modified file 'data/tribes/workers/barbarians/carrier/init.lua' | |||
1406 | --- data/tribes/workers/barbarians/carrier/init.lua 2017-02-12 09:10:57 +0000 | |||
1407 | +++ data/tribes/workers/barbarians/carrier/init.lua 2019-05-27 14:29:35 +0000 | |||
1408 | @@ -1,14 +1,9 @@ | |||
1409 | 1 | dirname = path.dirname(__file__) | 1 | dirname = path.dirname(__file__) |
1410 | 2 | 2 | ||
1420 | 3 | animations = { | 3 | animations = {} |
1421 | 4 | idle = { | 4 | add_animation(animations, "idle", dirname, "idle", {14, 21}, 5) |
1422 | 5 | pictures = path.list_files(dirname .. "idle_??.png"), | 5 | add_directional_animation(animations, "walk", dirname, "walk", {9, 19}, 10) |
1423 | 6 | hotspot = { 14, 21 }, | 6 | add_directional_animation(animations, "walkload", dirname, "walkload", {7, 22}, 10) |
1415 | 7 | fps = 5 | ||
1416 | 8 | } | ||
1417 | 9 | } | ||
1418 | 10 | add_walking_animations(animations, "walk", dirname, "walk", {9, 19}, 10) | ||
1419 | 11 | add_walking_animations(animations, "walkload", dirname, "walkload", {7, 22}, 10) | ||
1424 | 12 | 7 | ||
1425 | 13 | 8 | ||
1426 | 14 | tribes:new_carrier_type { | 9 | tribes:new_carrier_type { |
1427 | 15 | 10 | ||
1428 | === modified file 'data/tribes/workers/barbarians/cattlebreeder/init.lua' | |||
1429 | --- data/tribes/workers/barbarians/cattlebreeder/init.lua 2017-02-12 09:10:57 +0000 | |||
1430 | +++ data/tribes/workers/barbarians/cattlebreeder/init.lua 2019-05-27 14:29:35 +0000 | |||
1431 | @@ -6,8 +6,8 @@ | |||
1432 | 6 | hotspot = { 3, 21 }, | 6 | hotspot = { 3, 21 }, |
1433 | 7 | } | 7 | } |
1434 | 8 | } | 8 | } |
1437 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {42, 30}, 20) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {42, 30}, 20) |
1438 | 10 | add_walking_animations(animations, "walkload", dirname, "walk", {42, 30}, 20) | 10 | add_directional_animation(animations, "walkload", dirname, "walk", {42, 30}, 20) |
1439 | 11 | 11 | ||
1440 | 12 | 12 | ||
1441 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1442 | 14 | 14 | ||
1443 | === modified file 'data/tribes/workers/barbarians/charcoal_burner/init.lua' | |||
1444 | --- data/tribes/workers/barbarians/charcoal_burner/init.lua 2017-02-12 09:10:57 +0000 | |||
1445 | +++ data/tribes/workers/barbarians/charcoal_burner/init.lua 2019-05-27 14:29:35 +0000 | |||
1446 | @@ -6,8 +6,8 @@ | |||
1447 | 6 | hotspot = { 6, 22 }, | 6 | hotspot = { 6, 22 }, |
1448 | 7 | } | 7 | } |
1449 | 8 | } | 8 | } |
1452 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {8, 22}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {8, 22}, 10) |
1453 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {9, 23}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {9, 23}, 10) |
1454 | 11 | 11 | ||
1455 | 12 | 12 | ||
1456 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1457 | 14 | 14 | ||
1458 | === modified file 'data/tribes/workers/barbarians/farmer/init.lua' | |||
1459 | --- data/tribes/workers/barbarians/farmer/init.lua 2019-03-17 07:20:58 +0000 | |||
1460 | +++ data/tribes/workers/barbarians/farmer/init.lua 2019-05-27 14:29:35 +0000 | |||
1461 | @@ -21,8 +21,8 @@ | |||
1462 | 21 | fps = 5 | 21 | fps = 5 |
1463 | 22 | } | 22 | } |
1464 | 23 | } | 23 | } |
1467 | 24 | add_walking_animations(animations, "walk", dirname, "walk", {18, 23}, 10) | 24 | add_directional_animation(animations, "walk", dirname, "walk", {18, 23}, 10) |
1468 | 25 | add_walking_animations(animations, "walkload", dirname, "walkload", {16, 23}, 10) | 25 | add_directional_animation(animations, "walkload", dirname, "walkload", {16, 23}, 10) |
1469 | 26 | 26 | ||
1470 | 27 | 27 | ||
1471 | 28 | tribes:new_worker_type { | 28 | tribes:new_worker_type { |
1472 | 29 | 29 | ||
1473 | === modified file 'data/tribes/workers/barbarians/fisher/init.lua' | |||
1474 | --- data/tribes/workers/barbarians/fisher/init.lua 2019-03-17 07:20:58 +0000 | |||
1475 | +++ data/tribes/workers/barbarians/fisher/init.lua 2019-05-27 14:29:35 +0000 | |||
1476 | @@ -11,8 +11,8 @@ | |||
1477 | 11 | fps = 10 | 11 | fps = 10 |
1478 | 12 | } | 12 | } |
1479 | 13 | } | 13 | } |
1482 | 14 | add_walking_animations(animations, "walk", dirname, "walk", {10, 38}, 10) | 14 | add_directional_animation(animations, "walk", dirname, "walk", {10, 38}, 10) |
1483 | 15 | add_walking_animations(animations, "walkload", dirname, "walk", {10, 38}, 10) | 15 | add_directional_animation(animations, "walkload", dirname, "walk", {10, 38}, 10) |
1484 | 16 | 16 | ||
1485 | 17 | 17 | ||
1486 | 18 | tribes:new_worker_type { | 18 | tribes:new_worker_type { |
1487 | 19 | 19 | ||
1488 | === modified file 'data/tribes/workers/barbarians/gamekeeper/init.lua' | |||
1489 | --- data/tribes/workers/barbarians/gamekeeper/init.lua 2017-11-18 21:01:55 +0000 | |||
1490 | +++ data/tribes/workers/barbarians/gamekeeper/init.lua 2019-05-27 14:29:35 +0000 | |||
1491 | @@ -16,8 +16,8 @@ | |||
1492 | 16 | fps = 5 | 16 | fps = 5 |
1493 | 17 | } | 17 | } |
1494 | 18 | } | 18 | } |
1497 | 19 | add_walking_animations(animations, "walk", dirname, "walk", {15, 22}, 10) | 19 | add_directional_animation(animations, "walk", dirname, "walk", {15, 22}, 10) |
1498 | 20 | add_walking_animations(animations, "walkload", dirname, "walkload", {15, 22}) | 20 | add_directional_animation(animations, "walkload", dirname, "walkload", {15, 22}) |
1499 | 21 | 21 | ||
1500 | 22 | 22 | ||
1501 | 23 | tribes:new_worker_type { | 23 | tribes:new_worker_type { |
1502 | 24 | 24 | ||
1503 | === modified file 'data/tribes/workers/barbarians/gardener/init.lua' | |||
1504 | --- data/tribes/workers/barbarians/gardener/init.lua 2019-05-19 11:25:28 +0000 | |||
1505 | +++ data/tribes/workers/barbarians/gardener/init.lua 2019-05-27 14:29:35 +0000 | |||
1506 | @@ -16,8 +16,8 @@ | |||
1507 | 16 | fps = 5 | 16 | fps = 5 |
1508 | 17 | } | 17 | } |
1509 | 18 | } | 18 | } |
1512 | 19 | add_walking_animations(animations, "walk", dirname, "walk", {8, 23}, 10) | 19 | add_directional_animation(animations, "walk", dirname, "walk", {8, 23}, 10) |
1513 | 20 | add_walking_animations(animations, "walkload", dirname, "walkload", {7, 23}, 10) | 20 | add_directional_animation(animations, "walkload", dirname, "walkload", {7, 23}, 10) |
1514 | 21 | 21 | ||
1515 | 22 | 22 | ||
1516 | 23 | tribes:new_worker_type { | 23 | tribes:new_worker_type { |
1517 | 24 | 24 | ||
1518 | === modified file 'data/tribes/workers/barbarians/geologist/init.lua' | |||
1519 | --- data/tribes/workers/barbarians/geologist/init.lua 2019-03-17 07:20:58 +0000 | |||
1520 | +++ data/tribes/workers/barbarians/geologist/init.lua 2019-05-27 14:29:35 +0000 | |||
1521 | @@ -12,8 +12,8 @@ | |||
1522 | 12 | fps = 10 | 12 | fps = 10 |
1523 | 13 | } | 13 | } |
1524 | 14 | } | 14 | } |
1527 | 15 | add_walking_animations(animations, "walk", dirname, "walk", {9, 21}, 10) | 15 | add_directional_animation(animations, "walk", dirname, "walk", {9, 21}, 10) |
1528 | 16 | add_walking_animations(animations, "walkload", dirname, "walk", {9, 21}, 10) | 16 | add_directional_animation(animations, "walkload", dirname, "walk", {9, 21}, 10) |
1529 | 17 | 17 | ||
1530 | 18 | 18 | ||
1531 | 19 | tribes:new_worker_type { | 19 | tribes:new_worker_type { |
1532 | 20 | 20 | ||
1533 | === modified file 'data/tribes/workers/barbarians/helmsmith/init.lua' | |||
1534 | --- data/tribes/workers/barbarians/helmsmith/init.lua 2017-02-12 09:10:57 +0000 | |||
1535 | +++ data/tribes/workers/barbarians/helmsmith/init.lua 2019-05-27 14:29:35 +0000 | |||
1536 | @@ -6,8 +6,8 @@ | |||
1537 | 6 | hotspot = { 4, 21 } | 6 | hotspot = { 4, 21 } |
1538 | 7 | } | 7 | } |
1539 | 8 | } | 8 | } |
1542 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {9, 21}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {9, 21}, 10) |
1543 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {7, 21}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {7, 21}, 10) |
1544 | 11 | 11 | ||
1545 | 12 | 12 | ||
1546 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1547 | 14 | 14 | ||
1548 | === modified file 'data/tribes/workers/barbarians/hunter/init.lua' | |||
1549 | --- data/tribes/workers/barbarians/hunter/init.lua 2018-02-28 09:38:13 +0000 | |||
1550 | +++ data/tribes/workers/barbarians/hunter/init.lua 2019-05-27 14:29:35 +0000 | |||
1551 | @@ -7,8 +7,8 @@ | |||
1552 | 7 | fps = 10 | 7 | fps = 10 |
1553 | 8 | } | 8 | } |
1554 | 9 | } | 9 | } |
1557 | 10 | add_walking_animations(animations, "walk", dirname, "walk", {6, 26}, 10) | 10 | add_directional_animation(animations, "walk", dirname, "walk", {6, 26}, 10) |
1558 | 11 | add_walking_animations(animations, "walkload", dirname, "walkload", {6, 26}, 10) | 11 | add_directional_animation(animations, "walkload", dirname, "walkload", {6, 26}, 10) |
1559 | 12 | 12 | ||
1560 | 13 | 13 | ||
1561 | 14 | tribes:new_worker_type { | 14 | tribes:new_worker_type { |
1562 | 15 | 15 | ||
1563 | === modified file 'data/tribes/workers/barbarians/innkeeper/init.lua' | |||
1564 | --- data/tribes/workers/barbarians/innkeeper/init.lua 2017-02-12 09:10:57 +0000 | |||
1565 | +++ data/tribes/workers/barbarians/innkeeper/init.lua 2019-05-27 14:29:35 +0000 | |||
1566 | @@ -6,8 +6,8 @@ | |||
1567 | 6 | hotspot = { 9, 24 } | 6 | hotspot = { 9, 24 } |
1568 | 7 | } | 7 | } |
1569 | 8 | } | 8 | } |
1572 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {10, 23}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 10) |
1573 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {10, 24}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 24}, 10) |
1574 | 11 | 11 | ||
1575 | 12 | 12 | ||
1576 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1577 | 14 | 14 | ||
1578 | === modified file 'data/tribes/workers/barbarians/lime_burner/init.lua' | |||
1579 | --- data/tribes/workers/barbarians/lime_burner/init.lua 2017-02-12 09:10:57 +0000 | |||
1580 | +++ data/tribes/workers/barbarians/lime_burner/init.lua 2019-05-27 14:29:35 +0000 | |||
1581 | @@ -6,8 +6,8 @@ | |||
1582 | 6 | hotspot = { 4, 23 }, | 6 | hotspot = { 4, 23 }, |
1583 | 7 | } | 7 | } |
1584 | 8 | } | 8 | } |
1587 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {7, 23}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {7, 23}, 10) |
1588 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {8, 27}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {8, 27}, 10) |
1589 | 11 | 11 | ||
1590 | 12 | 12 | ||
1591 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1592 | 14 | 14 | ||
1593 | === modified file 'data/tribes/workers/barbarians/lumberjack/init.lua' | |||
1594 | --- data/tribes/workers/barbarians/lumberjack/init.lua 2019-03-17 07:20:58 +0000 | |||
1595 | +++ data/tribes/workers/barbarians/lumberjack/init.lua 2019-05-27 14:29:35 +0000 | |||
1596 | @@ -12,8 +12,8 @@ | |||
1597 | 12 | fps = 10 | 12 | fps = 10 |
1598 | 13 | } | 13 | } |
1599 | 14 | } | 14 | } |
1602 | 15 | add_walking_animations(animations, "walk", dirname, "walk", {10, 22}, 10) | 15 | add_directional_animation(animations, "walk", dirname, "walk", {10, 22}, 10) |
1603 | 16 | add_walking_animations(animations, "walkload", dirname, "walkload", {10, 21}, 10) | 16 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 21}, 10) |
1604 | 17 | 17 | ||
1605 | 18 | 18 | ||
1606 | 19 | tribes:new_worker_type { | 19 | tribes:new_worker_type { |
1607 | @@ -36,8 +36,7 @@ | |||
1608 | 36 | "walk=object", | 36 | "walk=object", |
1609 | 37 | "playsound=sound/woodcutting/woodcutting 255", | 37 | "playsound=sound/woodcutting/woodcutting 255", |
1610 | 38 | "animate=hacking 10000", | 38 | "animate=hacking 10000", |
1613 | 39 | -- "playsound=sound/spoken timber 192", | 39 | "playsound=sound/woodcutting/tree_falling 130", |
1612 | 40 | "playsound=sound/woodcutting/tree-falling 130", | ||
1614 | 41 | "callobject=fall", | 40 | "callobject=fall", |
1615 | 42 | "animate=idle 2000", | 41 | "animate=idle 2000", |
1616 | 43 | "createware=log", | 42 | "createware=log", |
1617 | 44 | 43 | ||
1618 | === modified file 'data/tribes/workers/barbarians/miner/init.lua' | |||
1619 | --- data/tribes/workers/barbarians/miner/init.lua 2017-02-12 09:10:57 +0000 | |||
1620 | +++ data/tribes/workers/barbarians/miner/init.lua 2019-05-27 14:29:35 +0000 | |||
1621 | @@ -6,8 +6,8 @@ | |||
1622 | 6 | hotspot = { 3, 24 } | 6 | hotspot = { 3, 24 } |
1623 | 7 | } | 7 | } |
1624 | 8 | } | 8 | } |
1627 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {9, 25}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {9, 25}, 10) |
1628 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {6, 23}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {6, 23}, 10) |
1629 | 11 | 11 | ||
1630 | 12 | 12 | ||
1631 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1632 | 14 | 14 | ||
1633 | === modified file 'data/tribes/workers/barbarians/miner_chief/init.lua' | |||
1634 | --- data/tribes/workers/barbarians/miner_chief/init.lua 2017-02-12 09:10:57 +0000 | |||
1635 | +++ data/tribes/workers/barbarians/miner_chief/init.lua 2019-05-27 14:29:35 +0000 | |||
1636 | @@ -6,8 +6,8 @@ | |||
1637 | 6 | hotspot = { 3, 24 } | 6 | hotspot = { 3, 24 } |
1638 | 7 | } | 7 | } |
1639 | 8 | } | 8 | } |
1642 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {9, 25}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {9, 25}, 10) |
1643 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {6, 23}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {6, 23}, 10) |
1644 | 11 | 11 | ||
1645 | 12 | 12 | ||
1646 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1647 | 14 | 14 | ||
1648 | === modified file 'data/tribes/workers/barbarians/miner_master/init.lua' | |||
1649 | --- data/tribes/workers/barbarians/miner_master/init.lua 2017-02-12 09:10:57 +0000 | |||
1650 | +++ data/tribes/workers/barbarians/miner_master/init.lua 2019-05-27 14:29:35 +0000 | |||
1651 | @@ -6,8 +6,8 @@ | |||
1652 | 6 | hotspot = { 2, 24 } | 6 | hotspot = { 2, 24 } |
1653 | 7 | } | 7 | } |
1654 | 8 | } | 8 | } |
1657 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {9, 25}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {9, 25}, 10) |
1658 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {6, 23}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {6, 23}, 10) |
1659 | 11 | 11 | ||
1660 | 12 | 12 | ||
1661 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1662 | 14 | 14 | ||
1663 | === modified file 'data/tribes/workers/barbarians/ox/init.lua' | |||
1664 | --- data/tribes/workers/barbarians/ox/init.lua 2019-05-18 13:04:13 +0000 | |||
1665 | +++ data/tribes/workers/barbarians/ox/init.lua 2019-05-27 14:29:35 +0000 | |||
1666 | @@ -8,8 +8,8 @@ | |||
1667 | 8 | } | 8 | } |
1668 | 9 | } | 9 | } |
1669 | 10 | -- TODO(GunChleoc): Make real oxen animations | 10 | -- TODO(GunChleoc): Make real oxen animations |
1672 | 11 | add_walking_animations(animations, "walk", dirname, "walk", {21, 31}, 20) | 11 | add_directional_animation(animations, "walk", dirname, "walk", {21, 31}, 20) |
1673 | 12 | add_walking_animations(animations, "walkload", dirname, "walk", {21, 31}, 10) | 12 | add_directional_animation(animations, "walkload", dirname, "walk", {21, 31}, 10) |
1674 | 13 | 13 | ||
1675 | 14 | 14 | ||
1676 | 15 | tribes:new_carrier_type { | 15 | tribes:new_carrier_type { |
1677 | 16 | 16 | ||
1678 | === modified file 'data/tribes/workers/barbarians/ranger/init.lua' | |||
1679 | --- data/tribes/workers/barbarians/ranger/init.lua 2018-02-28 09:38:13 +0000 | |||
1680 | +++ data/tribes/workers/barbarians/ranger/init.lua 2019-05-27 14:29:35 +0000 | |||
1681 | @@ -21,8 +21,8 @@ | |||
1682 | 21 | fps = 5 | 21 | fps = 5 |
1683 | 22 | } | 22 | } |
1684 | 23 | } | 23 | } |
1687 | 24 | add_walking_animations(animations, "walk", dirname, "walk", {11, 23}, 10) | 24 | add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 10) |
1688 | 25 | add_walking_animations(animations, "walkload", dirname, "walkload", {11, 23}) | 25 | add_directional_animation(animations, "walkload", dirname, "walkload", {11, 23}) |
1689 | 26 | 26 | ||
1690 | 27 | 27 | ||
1691 | 28 | tribes:new_worker_type { | 28 | tribes:new_worker_type { |
1692 | 29 | 29 | ||
1693 | === modified file 'data/tribes/workers/barbarians/recruit/init.lua' | |||
1694 | --- data/tribes/workers/barbarians/recruit/init.lua 2018-04-12 07:50:05 +0000 | |||
1695 | +++ data/tribes/workers/barbarians/recruit/init.lua 2019-05-27 14:29:35 +0000 | |||
1696 | @@ -2,7 +2,7 @@ | |||
1697 | 2 | 2 | ||
1698 | 3 | animations = {} | 3 | animations = {} |
1699 | 4 | add_animation(animations, "idle", dirname, "idle", {16, 30}, 5) | 4 | add_animation(animations, "idle", dirname, "idle", {16, 30}, 5) |
1701 | 5 | add_walking_animations(animations, "walk", dirname, "walk", {16, 30}, 10) | 5 | add_directional_animation(animations, "walk", dirname, "walk", {16, 30}, 10) |
1702 | 6 | 6 | ||
1703 | 7 | 7 | ||
1704 | 8 | tribes:new_worker_type { | 8 | tribes:new_worker_type { |
1705 | 9 | 9 | ||
1706 | === modified file 'data/tribes/workers/barbarians/scout/init.lua' | |||
1707 | --- data/tribes/workers/barbarians/scout/init.lua 2018-02-28 09:38:13 +0000 | |||
1708 | +++ data/tribes/workers/barbarians/scout/init.lua 2019-05-27 14:29:35 +0000 | |||
1709 | @@ -6,8 +6,8 @@ | |||
1710 | 6 | hotspot = { 4, 23 }, | 6 | hotspot = { 4, 23 }, |
1711 | 7 | } | 7 | } |
1712 | 8 | } | 8 | } |
1715 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {9, 25}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {9, 25}, 10) |
1716 | 10 | add_walking_animations(animations, "walkload", dirname, "walk", {9, 25}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walk", {9, 25}, 10) |
1717 | 11 | 11 | ||
1718 | 12 | 12 | ||
1719 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1720 | 14 | 14 | ||
1721 | === modified file 'data/tribes/workers/barbarians/shipwright/init.lua' | |||
1722 | --- data/tribes/workers/barbarians/shipwright/init.lua 2019-04-24 06:32:02 +0000 | |||
1723 | +++ data/tribes/workers/barbarians/shipwright/init.lua 2019-05-27 14:29:35 +0000 | |||
1724 | @@ -7,8 +7,8 @@ | |||
1725 | 7 | path = "sound/hammering/hammering", | 7 | path = "sound/hammering/hammering", |
1726 | 8 | priority = 64 | 8 | priority = 64 |
1727 | 9 | } | 9 | } |
1730 | 10 | add_walking_animations(animations, "walk", dirname, "walk", {9, 24}, 10) | 10 | add_directional_animation(animations, "walk", dirname, "walk", {9, 24}, 10) |
1731 | 11 | add_walking_animations(animations, "walkload", dirname, "walkload", {11, 22}, 10) | 11 | add_directional_animation(animations, "walkload", dirname, "walkload", {11, 22}, 10) |
1732 | 12 | 12 | ||
1733 | 13 | 13 | ||
1734 | 14 | tribes:new_worker_type { | 14 | tribes:new_worker_type { |
1735 | 15 | 15 | ||
1736 | === modified file 'data/tribes/workers/barbarians/smelter/init.lua' | |||
1737 | --- data/tribes/workers/barbarians/smelter/init.lua 2017-02-12 09:10:57 +0000 | |||
1738 | +++ data/tribes/workers/barbarians/smelter/init.lua 2019-05-27 14:29:35 +0000 | |||
1739 | @@ -6,8 +6,8 @@ | |||
1740 | 6 | hotspot = { 7, 21 } | 6 | hotspot = { 7, 21 } |
1741 | 7 | } | 7 | } |
1742 | 8 | } | 8 | } |
1745 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {18, 25}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {18, 25}, 10) |
1746 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {8, 27}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {8, 27}, 10) |
1747 | 11 | 11 | ||
1748 | 12 | 12 | ||
1749 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1750 | 14 | 14 | ||
1751 | === modified file 'data/tribes/workers/barbarians/soldier/init.lua' | |||
1752 | --- data/tribes/workers/barbarians/soldier/init.lua 2019-05-19 09:36:33 +0000 | |||
1753 | +++ data/tribes/workers/barbarians/soldier/init.lua 2019-05-27 14:29:35 +0000 | |||
1754 | @@ -57,7 +57,7 @@ | |||
1755 | 57 | fps = 20 | 57 | fps = 20 |
1756 | 58 | }, | 58 | }, |
1757 | 59 | } | 59 | } |
1759 | 60 | add_walking_animations(animations, "walk", dirname, "walk", {16, 31}, 10) | 60 | add_directional_animation(animations, "walk", dirname, "walk", {16, 31}, 10) |
1760 | 61 | 61 | ||
1761 | 62 | all_levels_bar = { | 62 | all_levels_bar = { |
1762 | 63 | min_health = 0, | 63 | min_health = 0, |
1763 | 64 | 64 | ||
1764 | === modified file 'data/tribes/workers/barbarians/stonemason/init.lua' | |||
1765 | --- data/tribes/workers/barbarians/stonemason/init.lua 2019-03-17 07:20:58 +0000 | |||
1766 | +++ data/tribes/workers/barbarians/stonemason/init.lua 2019-05-27 14:29:35 +0000 | |||
1767 | @@ -12,8 +12,8 @@ | |||
1768 | 12 | fps = 10 | 12 | fps = 10 |
1769 | 13 | } | 13 | } |
1770 | 14 | } | 14 | } |
1773 | 15 | add_walking_animations(animations, "walk", dirname, "walk", {9, 24}, 10) | 15 | add_directional_animation(animations, "walk", dirname, "walk", {9, 24}, 10) |
1774 | 16 | add_walking_animations(animations, "walkload", dirname, "walkload", {7, 22}, 10) | 16 | add_directional_animation(animations, "walkload", dirname, "walkload", {7, 22}, 10) |
1775 | 17 | 17 | ||
1776 | 18 | 18 | ||
1777 | 19 | tribes:new_worker_type { | 19 | tribes:new_worker_type { |
1778 | 20 | 20 | ||
1779 | === modified file 'data/tribes/workers/barbarians/trainer/init.lua' | |||
1780 | --- data/tribes/workers/barbarians/trainer/init.lua 2017-02-12 09:10:57 +0000 | |||
1781 | +++ data/tribes/workers/barbarians/trainer/init.lua 2019-05-27 14:29:35 +0000 | |||
1782 | @@ -6,8 +6,8 @@ | |||
1783 | 6 | hotspot = { 4, 23 } | 6 | hotspot = { 4, 23 } |
1784 | 7 | } | 7 | } |
1785 | 8 | } | 8 | } |
1788 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {8, 23}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {8, 23}, 10) |
1789 | 10 | add_walking_animations(animations, "walkload", dirname, "walk", {8, 23}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walk", {8, 23}, 10) |
1790 | 11 | 11 | ||
1791 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
1792 | 13 | msgctxt = "barbarians_worker", | 13 | msgctxt = "barbarians_worker", |
1793 | 14 | 14 | ||
1794 | === modified file 'data/tribes/workers/barbarians/weaver/init.lua' | |||
1795 | --- data/tribes/workers/barbarians/weaver/init.lua 2017-02-12 09:10:57 +0000 | |||
1796 | +++ data/tribes/workers/barbarians/weaver/init.lua 2019-05-27 14:29:35 +0000 | |||
1797 | @@ -6,8 +6,8 @@ | |||
1798 | 6 | hotspot = { 5, 22 } | 6 | hotspot = { 5, 22 } |
1799 | 7 | } | 7 | } |
1800 | 8 | } | 8 | } |
1803 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {7, 23}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {7, 23}, 10) |
1804 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {11, 28}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {11, 28}, 10) |
1805 | 11 | 11 | ||
1806 | 12 | 12 | ||
1807 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1808 | 14 | 14 | ||
1809 | === modified file 'data/tribes/workers/empire/armorsmith/init.lua' | |||
1810 | --- data/tribes/workers/empire/armorsmith/init.lua 2017-02-12 09:10:57 +0000 | |||
1811 | +++ data/tribes/workers/empire/armorsmith/init.lua 2019-05-27 14:29:35 +0000 | |||
1812 | @@ -6,8 +6,8 @@ | |||
1813 | 6 | hotspot = { 8, 24 } | 6 | hotspot = { 8, 24 } |
1814 | 7 | } | 7 | } |
1815 | 8 | } | 8 | } |
1818 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {8, 24}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {8, 24}, 10) |
1819 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {8, 24}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {8, 24}, 10) |
1820 | 11 | 11 | ||
1821 | 12 | 12 | ||
1822 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1823 | 14 | 14 | ||
1824 | === modified file 'data/tribes/workers/empire/baker/init.lua' | |||
1825 | --- data/tribes/workers/empire/baker/init.lua 2017-02-12 09:10:57 +0000 | |||
1826 | +++ data/tribes/workers/empire/baker/init.lua 2019-05-27 14:29:35 +0000 | |||
1827 | @@ -6,8 +6,8 @@ | |||
1828 | 6 | hotspot = { 5, 26 } | 6 | hotspot = { 5, 26 } |
1829 | 7 | } | 7 | } |
1830 | 8 | } | 8 | } |
1833 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {14, 27}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {14, 27}, 10) |
1834 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {14, 27}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {14, 27}, 10) |
1835 | 11 | 11 | ||
1836 | 12 | 12 | ||
1837 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1838 | 14 | 14 | ||
1839 | === modified file 'data/tribes/workers/empire/brewer/init.lua' | |||
1840 | --- data/tribes/workers/empire/brewer/init.lua 2017-02-12 09:10:57 +0000 | |||
1841 | +++ data/tribes/workers/empire/brewer/init.lua 2019-05-27 14:29:35 +0000 | |||
1842 | @@ -6,8 +6,8 @@ | |||
1843 | 6 | hotspot = { 8, 24 } | 6 | hotspot = { 8, 24 } |
1844 | 7 | } | 7 | } |
1845 | 8 | } | 8 | } |
1848 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {14, 24}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {14, 24}, 10) |
1849 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {10, 22}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 22}, 10) |
1850 | 11 | 11 | ||
1851 | 12 | 12 | ||
1852 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1853 | 14 | 14 | ||
1854 | === modified file 'data/tribes/workers/empire/builder/init.lua' | |||
1855 | --- data/tribes/workers/empire/builder/init.lua 2019-03-17 08:30:43 +0000 | |||
1856 | +++ data/tribes/workers/empire/builder/init.lua 2019-05-27 14:29:35 +0000 | |||
1857 | @@ -16,8 +16,8 @@ | |||
1858 | 16 | fps = 10 | 16 | fps = 10 |
1859 | 17 | } | 17 | } |
1860 | 18 | } | 18 | } |
1863 | 19 | add_walking_animations(animations, "walk", dirname, "walk", {11, 23}, 10) | 19 | add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 10) |
1864 | 20 | add_walking_animations(animations, "walkload", dirname, "walk", {11, 23}, 10) | 20 | add_directional_animation(animations, "walkload", dirname, "walk", {11, 23}, 10) |
1865 | 21 | 21 | ||
1866 | 22 | 22 | ||
1867 | 23 | tribes:new_worker_type { | 23 | tribes:new_worker_type { |
1868 | 24 | 24 | ||
1869 | === modified file 'data/tribes/workers/empire/carpenter/init.lua' | |||
1870 | --- data/tribes/workers/empire/carpenter/init.lua 2017-02-12 09:10:57 +0000 | |||
1871 | +++ data/tribes/workers/empire/carpenter/init.lua 2019-05-27 14:29:35 +0000 | |||
1872 | @@ -6,8 +6,8 @@ | |||
1873 | 6 | hotspot = { 7, 29 } | 6 | hotspot = { 7, 29 } |
1874 | 7 | } | 7 | } |
1875 | 8 | } | 8 | } |
1878 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {11, 30}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {11, 30}, 10) |
1879 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {11, 24}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {11, 24}, 10) |
1880 | 11 | 11 | ||
1881 | 12 | 12 | ||
1882 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1883 | 14 | 14 | ||
1884 | === modified file 'data/tribes/workers/empire/carrier/init.lua' | |||
1885 | --- data/tribes/workers/empire/carrier/init.lua 2017-02-12 09:10:57 +0000 | |||
1886 | +++ data/tribes/workers/empire/carrier/init.lua 2019-05-27 14:29:35 +0000 | |||
1887 | @@ -1,14 +1,9 @@ | |||
1888 | 1 | dirname = path.dirname(__file__) | 1 | dirname = path.dirname(__file__) |
1889 | 2 | 2 | ||
1899 | 3 | animations = { | 3 | animations = {} |
1900 | 4 | idle = { | 4 | add_animation(animations, "idle", dirname, "idle", {7, 22}, 10) |
1901 | 5 | pictures = path.list_files(dirname .. "idle_??.png"), | 5 | add_directional_animation(animations, "walk", dirname, "walk", {7, 20}, 10) |
1902 | 6 | hotspot = { 7, 22 }, | 6 | add_directional_animation(animations, "walkload", dirname, "walkload", {8, 22}, 10) |
1894 | 7 | fps = 10 | ||
1895 | 8 | } | ||
1896 | 9 | } | ||
1897 | 10 | add_walking_animations(animations, "walk", dirname, "walk", {7, 20}, 10) | ||
1898 | 11 | add_walking_animations(animations, "walkload", dirname, "walkload", {8, 22}, 10) | ||
1903 | 12 | 7 | ||
1904 | 13 | 8 | ||
1905 | 14 | tribes:new_carrier_type { | 9 | tribes:new_carrier_type { |
1906 | 15 | 10 | ||
1907 | === modified file 'data/tribes/workers/empire/charcoal_burner/init.lua' | |||
1908 | --- data/tribes/workers/empire/charcoal_burner/init.lua 2017-02-12 09:10:57 +0000 | |||
1909 | +++ data/tribes/workers/empire/charcoal_burner/init.lua 2019-05-27 14:29:35 +0000 | |||
1910 | @@ -6,8 +6,8 @@ | |||
1911 | 6 | hotspot = { 11, 23 } | 6 | hotspot = { 11, 23 } |
1912 | 7 | } | 7 | } |
1913 | 8 | } | 8 | } |
1916 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {21, 28}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {21, 28}, 10) |
1917 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {17, 27}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {17, 27}, 10) |
1918 | 11 | 11 | ||
1919 | 12 | 12 | ||
1920 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1921 | 14 | 14 | ||
1922 | === modified file 'data/tribes/workers/empire/donkey/init.lua' | |||
1923 | --- data/tribes/workers/empire/donkey/init.lua 2019-05-18 13:04:13 +0000 | |||
1924 | +++ data/tribes/workers/empire/donkey/init.lua 2019-05-27 14:29:35 +0000 | |||
1925 | @@ -7,8 +7,8 @@ | |||
1926 | 7 | fps = 10 | 7 | fps = 10 |
1927 | 8 | } | 8 | } |
1928 | 9 | } | 9 | } |
1931 | 10 | add_walking_animations(animations, "walk", dirname, "walk", {14, 25}, 10) | 10 | add_directional_animation(animations, "walk", dirname, "walk", {14, 25}, 10) |
1932 | 11 | add_walking_animations(animations, "walkload", dirname, "walk", {14, 25}, 10) -- TODO(GunChleoc): Make animation | 11 | add_directional_animation(animations, "walkload", dirname, "walk", {14, 25}, 10) -- TODO(GunChleoc): Make animation |
1933 | 12 | 12 | ||
1934 | 13 | 13 | ||
1935 | 14 | tribes:new_carrier_type { | 14 | tribes:new_carrier_type { |
1936 | 15 | 15 | ||
1937 | === modified file 'data/tribes/workers/empire/donkeybreeder/init.lua' | |||
1938 | --- data/tribes/workers/empire/donkeybreeder/init.lua 2017-02-12 09:10:57 +0000 | |||
1939 | +++ data/tribes/workers/empire/donkeybreeder/init.lua 2019-05-27 14:29:35 +0000 | |||
1940 | @@ -6,8 +6,8 @@ | |||
1941 | 6 | hotspot = { 19, 23 }, | 6 | hotspot = { 19, 23 }, |
1942 | 7 | } | 7 | } |
1943 | 8 | } | 8 | } |
1946 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {28, 26}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {28, 26}, 10) |
1947 | 10 | add_walking_animations(animations, "walkload", dirname, "walk", {28, 26}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walk", {28, 26}, 10) |
1948 | 11 | 11 | ||
1949 | 12 | 12 | ||
1950 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
1951 | 14 | 14 | ||
1952 | === modified file 'data/tribes/workers/empire/farmer/init.lua' | |||
1953 | --- data/tribes/workers/empire/farmer/init.lua 2019-03-17 07:20:58 +0000 | |||
1954 | +++ data/tribes/workers/empire/farmer/init.lua 2019-05-27 14:29:35 +0000 | |||
1955 | @@ -21,8 +21,8 @@ | |||
1956 | 21 | fps = 5 | 21 | fps = 5 |
1957 | 22 | } | 22 | } |
1958 | 23 | } | 23 | } |
1961 | 24 | add_walking_animations(animations, "walk", dirname, "walk", {18, 24}, 10) | 24 | add_directional_animation(animations, "walk", dirname, "walk", {18, 24}, 10) |
1962 | 25 | add_walking_animations(animations, "walkload", dirname, "walk", {18, 24}, 10) | 25 | add_directional_animation(animations, "walkload", dirname, "walk", {18, 24}, 10) |
1963 | 26 | 26 | ||
1964 | 27 | 27 | ||
1965 | 28 | tribes:new_worker_type { | 28 | tribes:new_worker_type { |
1966 | 29 | 29 | ||
1967 | === modified file 'data/tribes/workers/empire/fisher/init.lua' | |||
1968 | --- data/tribes/workers/empire/fisher/init.lua 2019-03-17 07:20:58 +0000 | |||
1969 | +++ data/tribes/workers/empire/fisher/init.lua 2019-05-27 14:29:35 +0000 | |||
1970 | @@ -11,8 +11,8 @@ | |||
1971 | 11 | fps = 10, | 11 | fps = 10, |
1972 | 12 | } | 12 | } |
1973 | 13 | } | 13 | } |
1976 | 14 | add_walking_animations(animations, "walk", dirname, "walk", {10, 38}, 20) | 14 | add_directional_animation(animations, "walk", dirname, "walk", {10, 38}, 20) |
1977 | 15 | add_walking_animations(animations, "walkload", dirname, "walk", {10, 38}, 20) | 15 | add_directional_animation(animations, "walkload", dirname, "walk", {10, 38}, 20) |
1978 | 16 | 16 | ||
1979 | 17 | 17 | ||
1980 | 18 | tribes:new_worker_type { | 18 | tribes:new_worker_type { |
1981 | 19 | 19 | ||
1982 | === modified file 'data/tribes/workers/empire/forester/init.lua' | |||
1983 | --- data/tribes/workers/empire/forester/init.lua 2018-02-28 09:38:13 +0000 | |||
1984 | +++ data/tribes/workers/empire/forester/init.lua 2019-05-27 14:29:35 +0000 | |||
1985 | @@ -21,8 +21,8 @@ | |||
1986 | 21 | fps = 5 | 21 | fps = 5 |
1987 | 22 | } | 22 | } |
1988 | 23 | } | 23 | } |
1991 | 24 | add_walking_animations(animations, "walk", dirname, "walk", {10, 23}, 10) | 24 | add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 10) |
1992 | 25 | add_walking_animations(animations, "walkload", dirname, "walk", {10, 23}, 10) | 25 | add_directional_animation(animations, "walkload", dirname, "walk", {10, 23}, 10) |
1993 | 26 | 26 | ||
1994 | 27 | 27 | ||
1995 | 28 | tribes:new_worker_type { | 28 | tribes:new_worker_type { |
1996 | 29 | 29 | ||
1997 | === modified file 'data/tribes/workers/empire/geologist/init.lua' | |||
1998 | --- data/tribes/workers/empire/geologist/init.lua 2019-03-17 07:20:58 +0000 | |||
1999 | +++ data/tribes/workers/empire/geologist/init.lua 2019-05-27 14:29:35 +0000 | |||
2000 | @@ -12,8 +12,8 @@ | |||
2001 | 12 | fps = 10 | 12 | fps = 10 |
2002 | 13 | } | 13 | } |
2003 | 14 | } | 14 | } |
2006 | 15 | add_walking_animations(animations, "walk", dirname, "walk", {9, 21}, 10) | 15 | add_directional_animation(animations, "walk", dirname, "walk", {9, 21}, 10) |
2007 | 16 | add_walking_animations(animations, "walkload", dirname, "walk", {9, 21}, 10) | 16 | add_directional_animation(animations, "walkload", dirname, "walk", {9, 21}, 10) |
2008 | 17 | 17 | ||
2009 | 18 | 18 | ||
2010 | 19 | tribes:new_worker_type { | 19 | tribes:new_worker_type { |
2011 | 20 | 20 | ||
2012 | === modified file 'data/tribes/workers/empire/hunter/init.lua' | |||
2013 | --- data/tribes/workers/empire/hunter/init.lua 2017-11-18 21:08:26 +0000 | |||
2014 | +++ data/tribes/workers/empire/hunter/init.lua 2019-05-27 14:29:35 +0000 | |||
2015 | @@ -7,8 +7,8 @@ | |||
2016 | 7 | fps = 10 | 7 | fps = 10 |
2017 | 8 | } | 8 | } |
2018 | 9 | } | 9 | } |
2021 | 10 | add_walking_animations(animations, "walk", dirname, "walk", {9, 32}, 10) | 10 | add_directional_animation(animations, "walk", dirname, "walk", {9, 32}, 10) |
2022 | 11 | add_walking_animations(animations, "walkload", dirname, "walkload", {9, 32}, 10) | 11 | add_directional_animation(animations, "walkload", dirname, "walkload", {9, 32}, 10) |
2023 | 12 | 12 | ||
2024 | 13 | 13 | ||
2025 | 14 | tribes:new_worker_type { | 14 | tribes:new_worker_type { |
2026 | 15 | 15 | ||
2027 | === modified file 'data/tribes/workers/empire/innkeeper/init.lua' | |||
2028 | --- data/tribes/workers/empire/innkeeper/init.lua 2017-02-12 09:10:57 +0000 | |||
2029 | +++ data/tribes/workers/empire/innkeeper/init.lua 2019-05-27 14:29:35 +0000 | |||
2030 | @@ -6,8 +6,8 @@ | |||
2031 | 6 | hotspot = { 4, 26 }, | 6 | hotspot = { 4, 26 }, |
2032 | 7 | } | 7 | } |
2033 | 8 | } | 8 | } |
2036 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {6, 26}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {6, 26}, 10) |
2037 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {6, 26}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {6, 26}, 10) |
2038 | 11 | 11 | ||
2039 | 12 | 12 | ||
2040 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
2041 | 14 | 14 | ||
2042 | === modified file 'data/tribes/workers/empire/lumberjack/init.lua' | |||
2043 | --- data/tribes/workers/empire/lumberjack/init.lua 2019-03-17 07:20:58 +0000 | |||
2044 | +++ data/tribes/workers/empire/lumberjack/init.lua 2019-05-27 14:29:35 +0000 | |||
2045 | @@ -12,8 +12,8 @@ | |||
2046 | 12 | fps = 10 | 12 | fps = 10 |
2047 | 13 | } | 13 | } |
2048 | 14 | } | 14 | } |
2051 | 15 | add_walking_animations(animations, "walk", dirname, "walk", {9, 22}, 10) | 15 | add_directional_animation(animations, "walk", dirname, "walk", {9, 22}, 10) |
2052 | 16 | add_walking_animations(animations, "walkload", dirname, "walkload", {9, 22}, 10) | 16 | add_directional_animation(animations, "walkload", dirname, "walkload", {9, 22}, 10) |
2053 | 17 | 17 | ||
2054 | 18 | 18 | ||
2055 | 19 | tribes:new_worker_type { | 19 | tribes:new_worker_type { |
2056 | @@ -36,8 +36,7 @@ | |||
2057 | 36 | "walk=object", | 36 | "walk=object", |
2058 | 37 | "playsound=sound/woodcutting/fast_woodcutting 250", | 37 | "playsound=sound/woodcutting/fast_woodcutting 250", |
2059 | 38 | "animate=hacking 10000", | 38 | "animate=hacking 10000", |
2062 | 39 | -- "playsound=sound/spoken/timber 156", | 39 | "playsound=sound/woodcutting/tree_falling 130", |
2061 | 40 | "playsound=sound/woodcutting/tree-falling 130", | ||
2063 | 41 | "callobject=fall", | 40 | "callobject=fall", |
2064 | 42 | "animate=idle 2000", | 41 | "animate=idle 2000", |
2065 | 43 | "createware=log", | 42 | "createware=log", |
2066 | 44 | 43 | ||
2067 | === modified file 'data/tribes/workers/empire/miller/init.lua' | |||
2068 | --- data/tribes/workers/empire/miller/init.lua 2017-02-12 09:10:57 +0000 | |||
2069 | +++ data/tribes/workers/empire/miller/init.lua 2019-05-27 14:29:35 +0000 | |||
2070 | @@ -6,8 +6,8 @@ | |||
2071 | 6 | hotspot = { 5, 23 } | 6 | hotspot = { 5, 23 } |
2072 | 7 | } | 7 | } |
2073 | 8 | } | 8 | } |
2076 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {8, 24}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {8, 24}, 10) |
2077 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {8, 24}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {8, 24}, 10) |
2078 | 11 | 11 | ||
2079 | 12 | 12 | ||
2080 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
2081 | 14 | 14 | ||
2082 | === modified file 'data/tribes/workers/empire/miner/init.lua' | |||
2083 | --- data/tribes/workers/empire/miner/init.lua 2017-02-12 09:10:57 +0000 | |||
2084 | +++ data/tribes/workers/empire/miner/init.lua 2019-05-27 14:29:35 +0000 | |||
2085 | @@ -6,8 +6,8 @@ | |||
2086 | 6 | hotspot = { 3, 23 } | 6 | hotspot = { 3, 23 } |
2087 | 7 | } | 7 | } |
2088 | 8 | } | 8 | } |
2091 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {9, 24}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {9, 24}, 10) |
2092 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {7, 24}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {7, 24}, 10) |
2093 | 11 | 11 | ||
2094 | 12 | 12 | ||
2095 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
2096 | 14 | 14 | ||
2097 | === modified file 'data/tribes/workers/empire/miner_master/init.lua' | |||
2098 | --- data/tribes/workers/empire/miner_master/init.lua 2017-02-12 09:10:57 +0000 | |||
2099 | +++ data/tribes/workers/empire/miner_master/init.lua 2019-05-27 14:29:35 +0000 | |||
2100 | @@ -6,8 +6,8 @@ | |||
2101 | 6 | hotspot = { 7, 22 } | 6 | hotspot = { 7, 22 } |
2102 | 7 | } | 7 | } |
2103 | 8 | } | 8 | } |
2106 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {11, 22}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {11, 22}, 10) |
2107 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {10, 22}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 22}, 10) |
2108 | 11 | 11 | ||
2109 | 12 | 12 | ||
2110 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
2111 | 14 | 14 | ||
2112 | === modified file 'data/tribes/workers/empire/pigbreeder/init.lua' | |||
2113 | --- data/tribes/workers/empire/pigbreeder/init.lua 2017-02-12 09:10:57 +0000 | |||
2114 | +++ data/tribes/workers/empire/pigbreeder/init.lua 2019-05-27 14:29:35 +0000 | |||
2115 | @@ -6,8 +6,8 @@ | |||
2116 | 6 | hotspot = { 16, 29 }, | 6 | hotspot = { 16, 29 }, |
2117 | 7 | } | 7 | } |
2118 | 8 | } | 8 | } |
2121 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {27, 29}, 20) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {27, 29}, 20) |
2122 | 10 | add_walking_animations(animations, "walkload", dirname, "walk", {27, 29}, 20) | 10 | add_directional_animation(animations, "walkload", dirname, "walk", {27, 29}, 20) |
2123 | 11 | 11 | ||
2124 | 12 | 12 | ||
2125 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
2126 | 14 | 14 | ||
2127 | === modified file 'data/tribes/workers/empire/recruit/init.lua' | |||
2128 | --- data/tribes/workers/empire/recruit/init.lua 2017-05-25 21:24:54 +0000 | |||
2129 | +++ data/tribes/workers/empire/recruit/init.lua 2019-05-27 14:29:35 +0000 | |||
2130 | @@ -7,7 +7,7 @@ | |||
2131 | 7 | fps = 5 | 7 | fps = 5 |
2132 | 8 | }, | 8 | }, |
2133 | 9 | } | 9 | } |
2135 | 10 | add_walking_animations(animations, "walk", dirname, "walk", {10, 30}, 10) | 10 | add_directional_animation(animations, "walk", dirname, "walk", {10, 30}, 10) |
2136 | 11 | 11 | ||
2137 | 12 | 12 | ||
2138 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
2139 | 14 | 14 | ||
2140 | === modified file 'data/tribes/workers/empire/scout/init.lua' | |||
2141 | --- data/tribes/workers/empire/scout/init.lua 2018-02-28 09:38:13 +0000 | |||
2142 | +++ data/tribes/workers/empire/scout/init.lua 2019-05-27 14:29:35 +0000 | |||
2143 | @@ -6,8 +6,8 @@ | |||
2144 | 6 | hotspot = { 4, 22 }, | 6 | hotspot = { 4, 22 }, |
2145 | 7 | } | 7 | } |
2146 | 8 | } | 8 | } |
2149 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {9, 24}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {9, 24}, 10) |
2150 | 10 | add_walking_animations(animations, "walkload", dirname, "walk", {9, 24}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walk", {9, 24}, 10) |
2151 | 11 | 11 | ||
2152 | 12 | 12 | ||
2153 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
2154 | 14 | 14 | ||
2155 | === modified file 'data/tribes/workers/empire/shepherd/init.lua' | |||
2156 | --- data/tribes/workers/empire/shepherd/init.lua 2017-02-12 09:10:57 +0000 | |||
2157 | +++ data/tribes/workers/empire/shepherd/init.lua 2019-05-27 14:29:35 +0000 | |||
2158 | @@ -6,8 +6,8 @@ | |||
2159 | 6 | hotspot = { 16, 29 }, | 6 | hotspot = { 16, 29 }, |
2160 | 7 | } | 7 | } |
2161 | 8 | } | 8 | } |
2164 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {26, 30}, 20) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {26, 30}, 20) |
2165 | 10 | add_walking_animations(animations, "walkload", dirname, "walk", {26, 30}, 20) | 10 | add_directional_animation(animations, "walkload", dirname, "walk", {26, 30}, 20) |
2166 | 11 | 11 | ||
2167 | 12 | 12 | ||
2168 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
2169 | 14 | 14 | ||
2170 | === modified file 'data/tribes/workers/empire/shipwright/init.lua' | |||
2171 | --- data/tribes/workers/empire/shipwright/init.lua 2019-03-17 08:30:43 +0000 | |||
2172 | +++ data/tribes/workers/empire/shipwright/init.lua 2019-05-27 14:29:35 +0000 | |||
2173 | @@ -15,8 +15,8 @@ | |||
2174 | 15 | fps = 10 | 15 | fps = 10 |
2175 | 16 | } | 16 | } |
2176 | 17 | } | 17 | } |
2179 | 18 | add_walking_animations(animations, "walk", dirname, "walk", {11, 24}, 10) | 18 | add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 10) |
2180 | 19 | add_walking_animations(animations, "walkload", dirname, "walkload", {9, 22}, 10) | 19 | add_directional_animation(animations, "walkload", dirname, "walkload", {9, 22}, 10) |
2181 | 20 | 20 | ||
2182 | 21 | 21 | ||
2183 | 22 | tribes:new_worker_type { | 22 | tribes:new_worker_type { |
2184 | 23 | 23 | ||
2185 | === modified file 'data/tribes/workers/empire/smelter/init.lua' | |||
2186 | --- data/tribes/workers/empire/smelter/init.lua 2017-02-12 09:10:57 +0000 | |||
2187 | +++ data/tribes/workers/empire/smelter/init.lua 2019-05-27 14:29:35 +0000 | |||
2188 | @@ -6,8 +6,8 @@ | |||
2189 | 6 | hotspot = { 4, 23 } | 6 | hotspot = { 4, 23 } |
2190 | 7 | } | 7 | } |
2191 | 8 | } | 8 | } |
2194 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {18, 25}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {18, 25}, 10) |
2195 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {8, 22}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {8, 22}, 10) |
2196 | 11 | 11 | ||
2197 | 12 | 12 | ||
2198 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
2199 | 14 | 14 | ||
2200 | === modified file 'data/tribes/workers/empire/soldier/init.lua' | |||
2201 | --- data/tribes/workers/empire/soldier/init.lua 2019-05-19 09:36:33 +0000 | |||
2202 | +++ data/tribes/workers/empire/soldier/init.lua 2019-05-27 14:29:35 +0000 | |||
2203 | @@ -57,7 +57,7 @@ | |||
2204 | 57 | fps = 10 | 57 | fps = 10 |
2205 | 58 | } | 58 | } |
2206 | 59 | } | 59 | } |
2208 | 60 | add_walking_animations(animations, "walk", dirname, "walk", {10, 36}, 10) | 60 | add_directional_animation(animations, "walk", dirname, "walk", {10, 36}, 10) |
2209 | 61 | 61 | ||
2210 | 62 | all_levels_emp = { | 62 | all_levels_emp = { |
2211 | 63 | min_health = 0, | 63 | min_health = 0, |
2212 | 64 | 64 | ||
2213 | === modified file 'data/tribes/workers/empire/stonemason/init.lua' | |||
2214 | --- data/tribes/workers/empire/stonemason/init.lua 2019-03-17 07:20:58 +0000 | |||
2215 | +++ data/tribes/workers/empire/stonemason/init.lua 2019-05-27 14:29:35 +0000 | |||
2216 | @@ -12,8 +12,8 @@ | |||
2217 | 12 | fps = 10 | 12 | fps = 10 |
2218 | 13 | } | 13 | } |
2219 | 14 | } | 14 | } |
2222 | 15 | add_walking_animations(animations, "walk", dirname, "walk", {9, 22}, 10) | 15 | add_directional_animation(animations, "walk", dirname, "walk", {9, 22}, 10) |
2223 | 16 | add_walking_animations(animations, "walkload", dirname, "walkload", {8, 25}, 10) | 16 | add_directional_animation(animations, "walkload", dirname, "walkload", {8, 25}, 10) |
2224 | 17 | 17 | ||
2225 | 18 | 18 | ||
2226 | 19 | tribes:new_worker_type { | 19 | tribes:new_worker_type { |
2227 | 20 | 20 | ||
2228 | === modified file 'data/tribes/workers/empire/toolsmith/init.lua' | |||
2229 | --- data/tribes/workers/empire/toolsmith/init.lua 2017-02-12 09:10:57 +0000 | |||
2230 | +++ data/tribes/workers/empire/toolsmith/init.lua 2019-05-27 14:29:35 +0000 | |||
2231 | @@ -6,8 +6,8 @@ | |||
2232 | 6 | hotspot = { 8, 24 } | 6 | hotspot = { 8, 24 } |
2233 | 7 | } | 7 | } |
2234 | 8 | } | 8 | } |
2237 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {8, 24}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {8, 24}, 10) |
2238 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {8, 24}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {8, 24}, 10) |
2239 | 11 | 11 | ||
2240 | 12 | 12 | ||
2241 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
2242 | 14 | 14 | ||
2243 | === modified file 'data/tribes/workers/empire/trainer/init.lua' | |||
2244 | --- data/tribes/workers/empire/trainer/init.lua 2017-02-12 09:10:57 +0000 | |||
2245 | +++ data/tribes/workers/empire/trainer/init.lua 2019-05-27 14:29:35 +0000 | |||
2246 | @@ -6,8 +6,8 @@ | |||
2247 | 6 | hotspot = { 6, 23 } | 6 | hotspot = { 6, 23 } |
2248 | 7 | } | 7 | } |
2249 | 8 | } | 8 | } |
2252 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {9, 23}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {9, 23}, 10) |
2253 | 10 | add_walking_animations(animations, "walkload", dirname, "walk", {9, 23}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walk", {9, 23}, 10) |
2254 | 11 | 11 | ||
2255 | 12 | 12 | ||
2256 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
2257 | 14 | 14 | ||
2258 | === modified file 'data/tribes/workers/empire/vinefarmer/init.lua' | |||
2259 | --- data/tribes/workers/empire/vinefarmer/init.lua 2018-02-28 09:38:13 +0000 | |||
2260 | +++ data/tribes/workers/empire/vinefarmer/init.lua 2019-05-27 14:29:35 +0000 | |||
2261 | @@ -21,8 +21,8 @@ | |||
2262 | 21 | fps = 10 | 21 | fps = 10 |
2263 | 22 | } | 22 | } |
2264 | 23 | } | 23 | } |
2267 | 24 | add_walking_animations(animations, "walk", dirname, "walk", {8, 23}, 10) | 24 | add_directional_animation(animations, "walk", dirname, "walk", {8, 23}, 10) |
2268 | 25 | add_walking_animations(animations, "walkload", dirname, "walkload", {8, 24}, 10) | 25 | add_directional_animation(animations, "walkload", dirname, "walkload", {8, 24}, 10) |
2269 | 26 | 26 | ||
2270 | 27 | 27 | ||
2271 | 28 | tribes:new_worker_type { | 28 | tribes:new_worker_type { |
2272 | 29 | 29 | ||
2273 | === modified file 'data/tribes/workers/empire/vintner/init.lua' | |||
2274 | --- data/tribes/workers/empire/vintner/init.lua 2017-02-12 09:10:57 +0000 | |||
2275 | +++ data/tribes/workers/empire/vintner/init.lua 2019-05-27 14:29:35 +0000 | |||
2276 | @@ -7,8 +7,8 @@ | |||
2277 | 7 | hotspot = { 12, 24 } | 7 | hotspot = { 12, 24 } |
2278 | 8 | } | 8 | } |
2279 | 9 | } | 9 | } |
2282 | 10 | add_walking_animations(animations, "walk", dirname, "walk", {12, 24}, 10) | 10 | add_directional_animation(animations, "walk", dirname, "walk", {12, 24}, 10) |
2283 | 11 | add_walking_animations(animations, "walkload", dirname, "walk", {12, 24}, 10) | 11 | add_directional_animation(animations, "walkload", dirname, "walk", {12, 24}, 10) |
2284 | 12 | 12 | ||
2285 | 13 | 13 | ||
2286 | 14 | tribes:new_worker_type { | 14 | tribes:new_worker_type { |
2287 | 15 | 15 | ||
2288 | === modified file 'data/tribes/workers/empire/weaponsmith/init.lua' | |||
2289 | --- data/tribes/workers/empire/weaponsmith/init.lua 2017-02-12 09:10:57 +0000 | |||
2290 | +++ data/tribes/workers/empire/weaponsmith/init.lua 2019-05-27 14:29:35 +0000 | |||
2291 | @@ -6,8 +6,8 @@ | |||
2292 | 6 | hotspot = { 8, 24 } | 6 | hotspot = { 8, 24 } |
2293 | 7 | } | 7 | } |
2294 | 8 | } | 8 | } |
2297 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {8, 24}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {8, 24}, 10) |
2298 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {8, 24}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {8, 24}, 10) |
2299 | 11 | 11 | ||
2300 | 12 | 12 | ||
2301 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
2302 | 14 | 14 | ||
2303 | === modified file 'data/tribes/workers/empire/weaver/init.lua' | |||
2304 | --- data/tribes/workers/empire/weaver/init.lua 2017-02-12 09:10:57 +0000 | |||
2305 | +++ data/tribes/workers/empire/weaver/init.lua 2019-05-27 14:29:35 +0000 | |||
2306 | @@ -6,8 +6,8 @@ | |||
2307 | 6 | hotspot = { 4, 24 }, | 6 | hotspot = { 4, 24 }, |
2308 | 7 | } | 7 | } |
2309 | 8 | } | 8 | } |
2312 | 9 | add_walking_animations(animations, "walk", dirname, "walk", {6, 26}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {6, 26}, 10) |
2313 | 10 | add_walking_animations(animations, "walkload", dirname, "walkload", {6, 26}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {6, 26}, 10) |
2314 | 11 | 11 | ||
2315 | 12 | 12 | ||
2316 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
2317 | 14 | 14 | ||
2318 | === modified file 'data/tribes/workers/frisians/baker/init.lua' | |||
2319 | --- data/tribes/workers/frisians/baker/init.lua 2018-11-30 10:27:21 +0000 | |||
2320 | +++ data/tribes/workers/frisians/baker/init.lua 2019-05-27 14:29:35 +0000 | |||
2321 | @@ -6,8 +6,8 @@ | |||
2322 | 6 | hotspot = {8, 23}, | 6 | hotspot = {8, 23}, |
2323 | 7 | } | 7 | } |
2324 | 8 | } | 8 | } |
2327 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {11, 23}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 15) |
2328 | 10 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2329 | 11 | 11 | ||
2330 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2331 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2332 | 14 | 14 | ||
2333 | === modified file 'data/tribes/workers/frisians/baker_master/init.lua' | |||
2334 | --- data/tribes/workers/frisians/baker_master/init.lua 2018-11-30 10:27:21 +0000 | |||
2335 | +++ data/tribes/workers/frisians/baker_master/init.lua 2019-05-27 14:29:35 +0000 | |||
2336 | @@ -6,8 +6,8 @@ | |||
2337 | 6 | hotspot = {8, 23}, | 6 | hotspot = {8, 23}, |
2338 | 7 | } | 7 | } |
2339 | 8 | } | 8 | } |
2342 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {11, 23}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 15) |
2343 | 10 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2344 | 11 | 11 | ||
2345 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2346 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2347 | 14 | 14 | ||
2348 | === modified file 'data/tribes/workers/frisians/beekeeper/init.lua' | |||
2349 | --- data/tribes/workers/frisians/beekeeper/init.lua 2018-11-30 10:27:21 +0000 | |||
2350 | +++ data/tribes/workers/frisians/beekeeper/init.lua 2019-05-27 14:29:35 +0000 | |||
2351 | @@ -11,8 +11,8 @@ | |||
2352 | 11 | fps = 50 | 11 | fps = 50 |
2353 | 12 | } | 12 | } |
2354 | 13 | } | 13 | } |
2357 | 14 | add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15) | 14 | add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15) |
2358 | 15 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 15 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2359 | 16 | 16 | ||
2360 | 17 | tribes:new_worker_type { | 17 | tribes:new_worker_type { |
2361 | 18 | msgctxt = "frisians_worker", | 18 | msgctxt = "frisians_worker", |
2362 | 19 | 19 | ||
2363 | === modified file 'data/tribes/workers/frisians/berry_farmer/init.lua' | |||
2364 | --- data/tribes/workers/frisians/berry_farmer/init.lua 2018-03-25 18:28:00 +0000 | |||
2365 | +++ data/tribes/workers/frisians/berry_farmer/init.lua 2019-05-27 14:29:35 +0000 | |||
2366 | @@ -21,7 +21,7 @@ | |||
2367 | 21 | fps = 10 | 21 | fps = 10 |
2368 | 22 | } | 22 | } |
2369 | 23 | } | 23 | } |
2371 | 24 | add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15) | 24 | add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15) |
2372 | 25 | 25 | ||
2373 | 26 | tribes:new_worker_type { | 26 | tribes:new_worker_type { |
2374 | 27 | msgctxt = "frisians_worker", | 27 | msgctxt = "frisians_worker", |
2375 | 28 | 28 | ||
2376 | === modified file 'data/tribes/workers/frisians/blacksmith/init.lua' | |||
2377 | --- data/tribes/workers/frisians/blacksmith/init.lua 2018-11-30 10:27:21 +0000 | |||
2378 | +++ data/tribes/workers/frisians/blacksmith/init.lua 2019-05-27 14:29:35 +0000 | |||
2379 | @@ -6,8 +6,8 @@ | |||
2380 | 6 | hotspot = {8, 23}, | 6 | hotspot = {8, 23}, |
2381 | 7 | } | 7 | } |
2382 | 8 | } | 8 | } |
2385 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {11, 23}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 15) |
2386 | 10 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2387 | 11 | 11 | ||
2388 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2389 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2390 | 14 | 14 | ||
2391 | === modified file 'data/tribes/workers/frisians/blacksmith_master/init.lua' | |||
2392 | --- data/tribes/workers/frisians/blacksmith_master/init.lua 2018-11-30 10:27:21 +0000 | |||
2393 | +++ data/tribes/workers/frisians/blacksmith_master/init.lua 2019-05-27 14:29:35 +0000 | |||
2394 | @@ -6,8 +6,8 @@ | |||
2395 | 6 | hotspot = {8, 23}, | 6 | hotspot = {8, 23}, |
2396 | 7 | } | 7 | } |
2397 | 8 | } | 8 | } |
2400 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {11, 23}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 15) |
2401 | 10 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2402 | 11 | 11 | ||
2403 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2404 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2405 | 14 | 14 | ||
2406 | === modified file 'data/tribes/workers/frisians/brewer/init.lua' | |||
2407 | --- data/tribes/workers/frisians/brewer/init.lua 2018-11-30 10:27:21 +0000 | |||
2408 | +++ data/tribes/workers/frisians/brewer/init.lua 2019-05-27 14:29:35 +0000 | |||
2409 | @@ -6,8 +6,8 @@ | |||
2410 | 6 | hotspot = {8, 23}, | 6 | hotspot = {8, 23}, |
2411 | 7 | } | 7 | } |
2412 | 8 | } | 8 | } |
2415 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15) |
2416 | 10 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2417 | 11 | 11 | ||
2418 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2419 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2420 | 14 | 14 | ||
2421 | === modified file 'data/tribes/workers/frisians/brewer_master/init.lua' | |||
2422 | --- data/tribes/workers/frisians/brewer_master/init.lua 2018-11-30 10:27:21 +0000 | |||
2423 | +++ data/tribes/workers/frisians/brewer_master/init.lua 2019-05-27 14:29:35 +0000 | |||
2424 | @@ -6,8 +6,8 @@ | |||
2425 | 6 | hotspot = {8, 23}, | 6 | hotspot = {8, 23}, |
2426 | 7 | } | 7 | } |
2427 | 8 | } | 8 | } |
2430 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15) |
2431 | 10 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2432 | 11 | 11 | ||
2433 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2434 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2435 | 14 | 14 | ||
2436 | === modified file 'data/tribes/workers/frisians/brickmaker/init.lua' | |||
2437 | --- data/tribes/workers/frisians/brickmaker/init.lua 2018-11-30 10:27:21 +0000 | |||
2438 | +++ data/tribes/workers/frisians/brickmaker/init.lua 2019-05-27 14:29:35 +0000 | |||
2439 | @@ -6,8 +6,8 @@ | |||
2440 | 6 | hotspot = {8, 23}, | 6 | hotspot = {8, 23}, |
2441 | 7 | }, | 7 | }, |
2442 | 8 | } | 8 | } |
2445 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {13, 23}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {13, 23}, 15) |
2446 | 10 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 23}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 23}, 15) |
2447 | 11 | 11 | ||
2448 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2449 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2450 | 14 | 14 | ||
2451 | === modified file 'data/tribes/workers/frisians/builder/init.lua' | |||
2452 | --- data/tribes/workers/frisians/builder/init.lua 2019-03-17 08:30:43 +0000 | |||
2453 | +++ data/tribes/workers/frisians/builder/init.lua 2019-05-27 14:29:35 +0000 | |||
2454 | @@ -16,8 +16,8 @@ | |||
2455 | 16 | fps = 10 | 16 | fps = 10 |
2456 | 17 | } | 17 | } |
2457 | 18 | } | 18 | } |
2460 | 19 | add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15) | 19 | add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15) |
2461 | 20 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 24}, 15) | 20 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 24}, 15) |
2462 | 21 | 21 | ||
2463 | 22 | tribes:new_worker_type { | 22 | tribes:new_worker_type { |
2464 | 23 | msgctxt = "frisians_worker", | 23 | msgctxt = "frisians_worker", |
2465 | 24 | 24 | ||
2466 | === modified file 'data/tribes/workers/frisians/carrier/init.lua' | |||
2467 | --- data/tribes/workers/frisians/carrier/init.lua 2018-02-06 11:17:48 +0000 | |||
2468 | +++ data/tribes/workers/frisians/carrier/init.lua 2019-05-27 14:29:35 +0000 | |||
2469 | @@ -1,14 +1,9 @@ | |||
2470 | 1 | dirname = path.dirname (__file__) | 1 | dirname = path.dirname (__file__) |
2471 | 2 | 2 | ||
2481 | 3 | animations = { | 3 | animations = {} |
2482 | 4 | idle = { | 4 | add_animation(animations, "idle", dirname, "idle", {17, 18}, 10) |
2483 | 5 | pictures = path.list_files (dirname .. "idle_???.png"), | 5 | add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15) |
2484 | 6 | hotspot = {17, 18}, | 6 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2476 | 7 | fps = 10 | ||
2477 | 8 | }, | ||
2478 | 9 | } | ||
2479 | 10 | add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15) | ||
2480 | 11 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | ||
2485 | 12 | 7 | ||
2486 | 13 | tribes:new_carrier_type { | 8 | tribes:new_carrier_type { |
2487 | 14 | msgctxt = "frisians_worker", | 9 | msgctxt = "frisians_worker", |
2488 | 15 | 10 | ||
2489 | === modified file 'data/tribes/workers/frisians/charcoal_burner/init.lua' | |||
2490 | --- data/tribes/workers/frisians/charcoal_burner/init.lua 2018-11-30 10:27:21 +0000 | |||
2491 | +++ data/tribes/workers/frisians/charcoal_burner/init.lua 2019-05-27 14:29:35 +0000 | |||
2492 | @@ -6,8 +6,8 @@ | |||
2493 | 6 | hotspot = {8, 23}, | 6 | hotspot = {8, 23}, |
2494 | 7 | } | 7 | } |
2495 | 8 | } | 8 | } |
2498 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15) |
2499 | 10 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2500 | 11 | 11 | ||
2501 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2502 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2503 | 14 | 14 | ||
2504 | === modified file 'data/tribes/workers/frisians/claydigger/init.lua' | |||
2505 | --- data/tribes/workers/frisians/claydigger/init.lua 2018-11-30 10:27:21 +0000 | |||
2506 | +++ data/tribes/workers/frisians/claydigger/init.lua 2019-05-27 14:29:35 +0000 | |||
2507 | @@ -11,8 +11,8 @@ | |||
2508 | 11 | fps = 20 | 11 | fps = 20 |
2509 | 12 | } | 12 | } |
2510 | 13 | } | 13 | } |
2513 | 14 | add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15) | 14 | add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15) |
2514 | 15 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 15 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2515 | 16 | 16 | ||
2516 | 17 | tribes:new_worker_type { | 17 | tribes:new_worker_type { |
2517 | 18 | msgctxt = "frisians_worker", | 18 | msgctxt = "frisians_worker", |
2518 | 19 | 19 | ||
2519 | === modified file 'data/tribes/workers/frisians/farmer/init.lua' | |||
2520 | --- data/tribes/workers/frisians/farmer/init.lua 2018-11-30 10:27:21 +0000 | |||
2521 | +++ data/tribes/workers/frisians/farmer/init.lua 2019-05-27 14:29:35 +0000 | |||
2522 | @@ -21,8 +21,8 @@ | |||
2523 | 21 | fps = 10 | 21 | fps = 10 |
2524 | 22 | } | 22 | } |
2525 | 23 | } | 23 | } |
2528 | 24 | add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15) | 24 | add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15) |
2529 | 25 | add_walking_animations (animations, "walkload", dirname, "walkload", {16, 26}, 15) | 25 | add_directional_animation(animations, "walkload", dirname, "walkload", {16, 26}, 15) |
2530 | 26 | 26 | ||
2531 | 27 | tribes:new_worker_type { | 27 | tribes:new_worker_type { |
2532 | 28 | msgctxt = "frisians_worker", | 28 | msgctxt = "frisians_worker", |
2533 | 29 | 29 | ||
2534 | === modified file 'data/tribes/workers/frisians/fisher/init.lua' | |||
2535 | --- data/tribes/workers/frisians/fisher/init.lua 2018-11-30 10:27:21 +0000 | |||
2536 | +++ data/tribes/workers/frisians/fisher/init.lua 2019-05-27 14:29:35 +0000 | |||
2537 | @@ -16,8 +16,8 @@ | |||
2538 | 16 | fps = 10 | 16 | fps = 10 |
2539 | 17 | } | 17 | } |
2540 | 18 | } | 18 | } |
2543 | 19 | add_walking_animations (animations, "walk", dirname, "walk", {13, 25}, 15) | 19 | add_directional_animation(animations, "walk", dirname, "walk", {13, 25}, 15) |
2544 | 20 | add_walking_animations (animations, "walkload", dirname, "walkload", {13, 26}, 15) | 20 | add_directional_animation(animations, "walkload", dirname, "walkload", {13, 26}, 15) |
2545 | 21 | 21 | ||
2546 | 22 | tribes:new_worker_type { | 22 | tribes:new_worker_type { |
2547 | 23 | msgctxt = "frisians_worker", | 23 | msgctxt = "frisians_worker", |
2548 | 24 | 24 | ||
2549 | === modified file 'data/tribes/workers/frisians/forester/init.lua' | |||
2550 | --- data/tribes/workers/frisians/forester/init.lua 2018-03-25 18:28:00 +0000 | |||
2551 | +++ data/tribes/workers/frisians/forester/init.lua 2019-05-27 14:29:35 +0000 | |||
2552 | @@ -21,7 +21,7 @@ | |||
2553 | 21 | fps = 10 | 21 | fps = 10 |
2554 | 22 | } | 22 | } |
2555 | 23 | } | 23 | } |
2557 | 24 | add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15) | 24 | add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15) |
2558 | 25 | 25 | ||
2559 | 26 | tribes:new_worker_type { | 26 | tribes:new_worker_type { |
2560 | 27 | msgctxt = "frisians_worker", | 27 | msgctxt = "frisians_worker", |
2561 | 28 | 28 | ||
2562 | === modified file 'data/tribes/workers/frisians/fruit_collector/init.lua' | |||
2563 | --- data/tribes/workers/frisians/fruit_collector/init.lua 2018-11-30 10:27:21 +0000 | |||
2564 | +++ data/tribes/workers/frisians/fruit_collector/init.lua 2019-05-27 14:29:35 +0000 | |||
2565 | @@ -12,8 +12,8 @@ | |||
2566 | 12 | fps = 10 | 12 | fps = 10 |
2567 | 13 | } | 13 | } |
2568 | 14 | } | 14 | } |
2571 | 15 | add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15) | 15 | add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15) |
2572 | 16 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 16 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2573 | 17 | 17 | ||
2574 | 18 | tribes:new_worker_type { | 18 | tribes:new_worker_type { |
2575 | 19 | msgctxt = "frisians_worker", | 19 | msgctxt = "frisians_worker", |
2576 | 20 | 20 | ||
2577 | === modified file 'data/tribes/workers/frisians/geologist/init.lua' | |||
2578 | --- data/tribes/workers/frisians/geologist/init.lua 2018-03-25 18:28:00 +0000 | |||
2579 | +++ data/tribes/workers/frisians/geologist/init.lua 2019-05-27 14:29:35 +0000 | |||
2580 | @@ -12,7 +12,7 @@ | |||
2581 | 12 | fps = 10 | 12 | fps = 10 |
2582 | 13 | } | 13 | } |
2583 | 14 | } | 14 | } |
2585 | 15 | add_walking_animations (animations, "walk", dirname, "walk", {11, 23}, 15) | 15 | add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 15) |
2586 | 16 | 16 | ||
2587 | 17 | tribes:new_worker_type { | 17 | tribes:new_worker_type { |
2588 | 18 | msgctxt = "frisians_worker", | 18 | msgctxt = "frisians_worker", |
2589 | 19 | 19 | ||
2590 | === modified file 'data/tribes/workers/frisians/hunter/init.lua' | |||
2591 | --- data/tribes/workers/frisians/hunter/init.lua 2018-11-30 10:27:21 +0000 | |||
2592 | +++ data/tribes/workers/frisians/hunter/init.lua 2019-05-27 14:29:35 +0000 | |||
2593 | @@ -7,8 +7,8 @@ | |||
2594 | 7 | fps = 10 | 7 | fps = 10 |
2595 | 8 | } | 8 | } |
2596 | 9 | } | 9 | } |
2599 | 10 | add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15) | 10 | add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15) |
2600 | 11 | add_walking_animations (animations, "walkload", dirname, "walkload", {11, 26}, 15) | 11 | add_directional_animation(animations, "walkload", dirname, "walkload", {11, 26}, 15) |
2601 | 12 | 12 | ||
2602 | 13 | tribes:new_worker_type { | 13 | tribes:new_worker_type { |
2603 | 14 | msgctxt = "frisians_worker", | 14 | msgctxt = "frisians_worker", |
2604 | 15 | 15 | ||
2605 | === modified file 'data/tribes/workers/frisians/landlady/init.lua' | |||
2606 | --- data/tribes/workers/frisians/landlady/init.lua 2018-11-30 10:27:21 +0000 | |||
2607 | +++ data/tribes/workers/frisians/landlady/init.lua 2019-05-27 14:29:35 +0000 | |||
2608 | @@ -6,8 +6,8 @@ | |||
2609 | 6 | hotspot = {9, 23}, | 6 | hotspot = {9, 23}, |
2610 | 7 | } | 7 | } |
2611 | 8 | } | 8 | } |
2614 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15) |
2615 | 10 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2616 | 11 | 11 | ||
2617 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2618 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2619 | 14 | 14 | ||
2620 | === modified file 'data/tribes/workers/frisians/miner/init.lua' | |||
2621 | --- data/tribes/workers/frisians/miner/init.lua 2018-11-30 10:27:21 +0000 | |||
2622 | +++ data/tribes/workers/frisians/miner/init.lua 2019-05-27 14:29:35 +0000 | |||
2623 | @@ -6,8 +6,8 @@ | |||
2624 | 6 | hotspot = {8, 24}, | 6 | hotspot = {8, 24}, |
2625 | 7 | } | 7 | } |
2626 | 8 | } | 8 | } |
2629 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {10, 24}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {10, 24}, 15) |
2630 | 10 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2631 | 11 | 11 | ||
2632 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2633 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2634 | 14 | 14 | ||
2635 | === modified file 'data/tribes/workers/frisians/miner_master/init.lua' | |||
2636 | --- data/tribes/workers/frisians/miner_master/init.lua 2018-11-30 10:27:21 +0000 | |||
2637 | +++ data/tribes/workers/frisians/miner_master/init.lua 2019-05-27 14:29:35 +0000 | |||
2638 | @@ -6,8 +6,8 @@ | |||
2639 | 6 | hotspot = {8, 24}, | 6 | hotspot = {8, 24}, |
2640 | 7 | } | 7 | } |
2641 | 8 | } | 8 | } |
2644 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {10, 24}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {10, 24}, 15) |
2645 | 10 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2646 | 11 | 11 | ||
2647 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2648 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2649 | 14 | 14 | ||
2650 | === modified file 'data/tribes/workers/frisians/reed_farmer/init.lua' | |||
2651 | --- data/tribes/workers/frisians/reed_farmer/init.lua 2019-05-19 11:25:28 +0000 | |||
2652 | +++ data/tribes/workers/frisians/reed_farmer/init.lua 2019-05-27 14:29:35 +0000 | |||
2653 | @@ -21,8 +21,8 @@ | |||
2654 | 21 | fps = 10 | 21 | fps = 10 |
2655 | 22 | } | 22 | } |
2656 | 23 | } | 23 | } |
2659 | 24 | add_walking_animations (animations, "walk", dirname, "walk", {10, 24}, 15) | 24 | add_directional_animation(animations, "walk", dirname, "walk", {10, 24}, 15) |
2660 | 25 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 25 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2661 | 26 | 26 | ||
2662 | 27 | tribes:new_worker_type { | 27 | tribes:new_worker_type { |
2663 | 28 | msgctxt = "frisians_worker", | 28 | msgctxt = "frisians_worker", |
2664 | 29 | 29 | ||
2665 | === modified file 'data/tribes/workers/frisians/reindeer/init.lua' | |||
2666 | --- data/tribes/workers/frisians/reindeer/init.lua 2019-05-18 13:04:13 +0000 | |||
2667 | +++ data/tribes/workers/frisians/reindeer/init.lua 2019-05-27 14:29:35 +0000 | |||
2668 | @@ -8,8 +8,8 @@ | |||
2669 | 8 | } | 8 | } |
2670 | 9 | } | 9 | } |
2671 | 10 | 10 | ||
2674 | 11 | add_walking_animations (animations, "walk", dirname, "walk", {21, 43}, 20) | 11 | add_directional_animation(animations, "walk", dirname, "walk", {21, 43}, 20) |
2675 | 12 | add_walking_animations (animations, "walkload", dirname, "walk", {21, 43}, 20) | 12 | add_directional_animation(animations, "walkload", dirname, "walk", {21, 43}, 20) |
2676 | 13 | 13 | ||
2677 | 14 | tribes:new_carrier_type { | 14 | tribes:new_carrier_type { |
2678 | 15 | msgctxt = "frisians_worker", | 15 | msgctxt = "frisians_worker", |
2679 | 16 | 16 | ||
2680 | === modified file 'data/tribes/workers/frisians/reindeer_breeder/init.lua' | |||
2681 | --- data/tribes/workers/frisians/reindeer_breeder/init.lua 2018-11-30 10:27:21 +0000 | |||
2682 | +++ data/tribes/workers/frisians/reindeer_breeder/init.lua 2019-05-27 14:29:35 +0000 | |||
2683 | @@ -6,8 +6,8 @@ | |||
2684 | 6 | hotspot = {8, 23}, | 6 | hotspot = {8, 23}, |
2685 | 7 | } | 7 | } |
2686 | 8 | } | 8 | } |
2689 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 10) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 10) |
2690 | 10 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 10) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 10) |
2691 | 11 | 11 | ||
2692 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2693 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2694 | 14 | 14 | ||
2695 | === modified file 'data/tribes/workers/frisians/scout/init.lua' | |||
2696 | --- data/tribes/workers/frisians/scout/init.lua 2018-11-30 10:27:21 +0000 | |||
2697 | +++ data/tribes/workers/frisians/scout/init.lua 2019-05-27 14:29:35 +0000 | |||
2698 | @@ -6,8 +6,8 @@ | |||
2699 | 6 | hotspot = {8, 23}, | 6 | hotspot = {8, 23}, |
2700 | 7 | } | 7 | } |
2701 | 8 | } | 8 | } |
2704 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {11, 23}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {11, 23}, 15) |
2705 | 10 | add_walking_animations (animations, "walkload", dirname, "walkload", {12, 26}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {12, 26}, 15) |
2706 | 11 | 11 | ||
2707 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2708 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2709 | 14 | 14 | ||
2710 | === modified file 'data/tribes/workers/frisians/seamstress/init.lua' | |||
2711 | --- data/tribes/workers/frisians/seamstress/init.lua 2018-11-30 10:27:21 +0000 | |||
2712 | +++ data/tribes/workers/frisians/seamstress/init.lua 2019-05-27 14:29:35 +0000 | |||
2713 | @@ -6,8 +6,8 @@ | |||
2714 | 6 | hotspot = {9, 23}, | 6 | hotspot = {9, 23}, |
2715 | 7 | } | 7 | } |
2716 | 8 | } | 8 | } |
2719 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15) |
2720 | 10 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2721 | 11 | 11 | ||
2722 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2723 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2724 | 14 | 14 | ||
2725 | === modified file 'data/tribes/workers/frisians/seamstress_master/init.lua' | |||
2726 | --- data/tribes/workers/frisians/seamstress_master/init.lua 2018-11-30 10:27:21 +0000 | |||
2727 | +++ data/tribes/workers/frisians/seamstress_master/init.lua 2019-05-27 14:29:35 +0000 | |||
2728 | @@ -6,8 +6,8 @@ | |||
2729 | 6 | hotspot = {21, 25}, | 6 | hotspot = {21, 25}, |
2730 | 7 | } | 7 | } |
2731 | 8 | } | 8 | } |
2734 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15) |
2735 | 10 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2736 | 11 | 11 | ||
2737 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2738 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2739 | 14 | 14 | ||
2740 | === modified file 'data/tribes/workers/frisians/shipwright/init.lua' | |||
2741 | --- data/tribes/workers/frisians/shipwright/init.lua 2019-03-17 08:30:43 +0000 | |||
2742 | +++ data/tribes/workers/frisians/shipwright/init.lua 2019-05-27 14:29:35 +0000 | |||
2743 | @@ -15,8 +15,8 @@ | |||
2744 | 15 | fps = 10 | 15 | fps = 10 |
2745 | 16 | } | 16 | } |
2746 | 17 | } | 17 | } |
2749 | 18 | add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15) | 18 | add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15) |
2750 | 19 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 19 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2751 | 20 | 20 | ||
2752 | 21 | tribes:new_worker_type { | 21 | tribes:new_worker_type { |
2753 | 22 | msgctxt = "frisians_worker", | 22 | msgctxt = "frisians_worker", |
2754 | 23 | 23 | ||
2755 | === modified file 'data/tribes/workers/frisians/smelter/init.lua' | |||
2756 | --- data/tribes/workers/frisians/smelter/init.lua 2018-11-30 10:27:21 +0000 | |||
2757 | +++ data/tribes/workers/frisians/smelter/init.lua 2019-05-27 14:29:35 +0000 | |||
2758 | @@ -6,8 +6,8 @@ | |||
2759 | 6 | hotspot = {8, 23}, | 6 | hotspot = {8, 23}, |
2760 | 7 | } | 7 | } |
2761 | 8 | } | 8 | } |
2764 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {13, 23}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {13, 23}, 15) |
2765 | 10 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2766 | 11 | 11 | ||
2767 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2768 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2769 | 14 | 14 | ||
2770 | === modified file 'data/tribes/workers/frisians/smoker/init.lua' | |||
2771 | --- data/tribes/workers/frisians/smoker/init.lua 2018-11-30 10:27:21 +0000 | |||
2772 | +++ data/tribes/workers/frisians/smoker/init.lua 2019-05-27 14:29:35 +0000 | |||
2773 | @@ -6,8 +6,8 @@ | |||
2774 | 6 | hotspot = {8, 23}, | 6 | hotspot = {8, 23}, |
2775 | 7 | } | 7 | } |
2776 | 8 | } | 8 | } |
2779 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {10, 23}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {10, 23}, 15) |
2780 | 10 | add_walking_animations (animations, "walkload", dirname, "walk", {10, 26}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walk", {10, 26}, 15) |
2781 | 11 | 11 | ||
2782 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2783 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2784 | 14 | 14 | ||
2785 | === modified file 'data/tribes/workers/frisians/soldier/init.lua' | |||
2786 | --- data/tribes/workers/frisians/soldier/init.lua 2019-05-19 09:25:06 +0000 | |||
2787 | +++ data/tribes/workers/frisians/soldier/init.lua 2019-05-27 14:29:35 +0000 | |||
2788 | @@ -347,10 +347,10 @@ | |||
2789 | 347 | fps = 10 | 347 | fps = 10 |
2790 | 348 | }, | 348 | }, |
2791 | 349 | } | 349 | } |
2796 | 350 | add_walking_animations (animations, "walk", dirname, "rookie/walk", {7, 24}, 15) | 350 | add_directional_animation(animations, "walk", dirname .. "rookie", "walk", {7, 24}, 15) |
2797 | 351 | add_walking_animations (animations, "health_walk", dirname, "helm/walk", {7, 25}, 15) | 351 | add_directional_animation(animations, "health_walk", dirname .. "helm", "walk", {7, 25}, 15) |
2798 | 352 | add_walking_animations (animations, "attack_walk", dirname, "sword/walk", {8, 24}, 15) | 352 | add_directional_animation(animations, "attack_walk", dirname .. "sword", "walk", {8, 24}, 15) |
2799 | 353 | add_walking_animations (animations, "hero_walk", dirname, "hero/walk", {8, 25}, 15) | 353 | add_directional_animation(animations, "hero_walk", dirname .. "hero", "walk", {8, 25}, 15) |
2800 | 354 | 354 | ||
2801 | 355 | -- convenience definitions so we don´t have to repeat this table for every single entry below | 355 | -- convenience definitions so we don´t have to repeat this table for every single entry below |
2802 | 356 | fri_health = { | 356 | fri_health = { |
2803 | 357 | 357 | ||
2804 | === modified file 'data/tribes/workers/frisians/stonemason/init.lua' | |||
2805 | --- data/tribes/workers/frisians/stonemason/init.lua 2018-11-30 10:27:21 +0000 | |||
2806 | +++ data/tribes/workers/frisians/stonemason/init.lua 2019-05-27 14:29:35 +0000 | |||
2807 | @@ -11,8 +11,8 @@ | |||
2808 | 11 | fps = 10 | 11 | fps = 10 |
2809 | 12 | } | 12 | } |
2810 | 13 | } | 13 | } |
2813 | 14 | add_walking_animations (animations, "walk", dirname, "walk", {11, 24}, 15) | 14 | add_directional_animation(animations, "walk", dirname, "walk", {11, 24}, 15) |
2814 | 15 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 26}, 15) | 15 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 26}, 15) |
2815 | 16 | 16 | ||
2816 | 17 | tribes:new_worker_type { | 17 | tribes:new_worker_type { |
2817 | 18 | msgctxt = "frisians_worker", | 18 | msgctxt = "frisians_worker", |
2818 | 19 | 19 | ||
2819 | === modified file 'data/tribes/workers/frisians/trainer/init.lua' | |||
2820 | --- data/tribes/workers/frisians/trainer/init.lua 2018-11-30 10:27:21 +0000 | |||
2821 | +++ data/tribes/workers/frisians/trainer/init.lua 2019-05-27 14:29:35 +0000 | |||
2822 | @@ -6,8 +6,8 @@ | |||
2823 | 6 | hotspot = {8, 23}, | 6 | hotspot = {8, 23}, |
2824 | 7 | } | 7 | } |
2825 | 8 | } | 8 | } |
2828 | 9 | add_walking_animations (animations, "walk", dirname, "walk", {10, 24}, 15) | 9 | add_directional_animation(animations, "walk", dirname, "walk", {10, 24}, 15) |
2829 | 10 | add_walking_animations (animations, "walkload", dirname, "walkload", {10, 25}, 15) | 10 | add_directional_animation(animations, "walkload", dirname, "walkload", {10, 25}, 15) |
2830 | 11 | 11 | ||
2831 | 12 | tribes:new_worker_type { | 12 | tribes:new_worker_type { |
2832 | 13 | msgctxt = "frisians_worker", | 13 | msgctxt = "frisians_worker", |
2833 | 14 | 14 | ||
2834 | === modified file 'data/tribes/workers/frisians/woodcutter/init.lua' | |||
2835 | --- data/tribes/workers/frisians/woodcutter/init.lua 2018-11-30 10:27:21 +0000 | |||
2836 | +++ data/tribes/workers/frisians/woodcutter/init.lua 2019-05-27 14:29:35 +0000 | |||
2837 | @@ -12,8 +12,8 @@ | |||
2838 | 12 | fps = 10 | 12 | fps = 10 |
2839 | 13 | } | 13 | } |
2840 | 14 | } | 14 | } |
2843 | 15 | add_walking_animations (animations, "walk", dirname, "walk", {16, 23}, 15) | 15 | add_directional_animation(animations, "walk", dirname, "walk", {16, 23}, 15) |
2844 | 16 | add_walking_animations (animations, "walkload", dirname, "walkload", {12, 26}, 15) | 16 | add_directional_animation(animations, "walkload", dirname, "walkload", {12, 26}, 15) |
2845 | 17 | 17 | ||
2846 | 18 | tribes:new_worker_type { | 18 | tribes:new_worker_type { |
2847 | 19 | msgctxt = "frisians_worker", | 19 | msgctxt = "frisians_worker", |
2848 | @@ -33,7 +33,9 @@ | |||
2849 | 33 | harvest = { | 33 | harvest = { |
2850 | 34 | "findobject=attrib:tree radius:10", | 34 | "findobject=attrib:tree radius:10", |
2851 | 35 | "walk=object", | 35 | "walk=object", |
2852 | 36 | "playsound=sound/woodcutting/woodcutting 255", | ||
2853 | 36 | "animate=hacking 10000", | 37 | "animate=hacking 10000", |
2854 | 38 | "playsound=sound/woodcutting/tree_falling 130", | ||
2855 | 37 | "callobject=fall", | 39 | "callobject=fall", |
2856 | 38 | "animate=idle 2000", | 40 | "animate=idle 2000", |
2857 | 39 | "createware=log", | 41 | "createware=log", |
2858 | 40 | 42 | ||
2859 | === modified file 'data/world/critters/badger/init.lua' | |||
2860 | --- data/world/critters/badger/init.lua 2017-09-03 09:39:39 +0000 | |||
2861 | +++ data/world/critters/badger/init.lua 2019-05-27 14:29:35 +0000 | |||
2862 | @@ -19,7 +19,7 @@ | |||
2863 | 19 | }, | 19 | }, |
2864 | 20 | } | 20 | } |
2865 | 21 | 21 | ||
2867 | 22 | add_walking_animations(animations, "walk", dirname, "walk", {13, 15}, 20) | 22 | add_directional_animation(animations, "walk", dirname, "walk", {13, 15}, 20) |
2868 | 23 | 23 | ||
2869 | 24 | -- RST | 24 | -- RST |
2870 | 25 | -- .. function:: new_critter_type{table} | 25 | -- .. function:: new_critter_type{table} |
2871 | 26 | 26 | ||
2872 | === modified file 'data/world/critters/brownbear/init.lua' | |||
2873 | --- data/world/critters/brownbear/init.lua 2017-02-12 09:10:57 +0000 | |||
2874 | +++ data/world/critters/brownbear/init.lua 2019-05-27 14:29:35 +0000 | |||
2875 | @@ -8,7 +8,7 @@ | |||
2876 | 8 | }, | 8 | }, |
2877 | 9 | } | 9 | } |
2878 | 10 | 10 | ||
2880 | 11 | add_walking_animations(animations, "walk", dirname, "walk", {24, 24}, 4) | 11 | add_directional_animation(animations, "walk", dirname, "walk", {24, 24}, 4) |
2881 | 12 | 12 | ||
2882 | 13 | world:new_critter_type{ | 13 | world:new_critter_type{ |
2883 | 14 | name = "brownbear", | 14 | name = "brownbear", |
2884 | 15 | 15 | ||
2885 | === modified file 'data/world/critters/bunny/init.lua' | |||
2886 | --- data/world/critters/bunny/init.lua 2017-02-12 09:10:57 +0000 | |||
2887 | +++ data/world/critters/bunny/init.lua 2019-05-27 14:29:35 +0000 | |||
2888 | @@ -7,7 +7,7 @@ | |||
2889 | 7 | }, | 7 | }, |
2890 | 8 | } | 8 | } |
2891 | 9 | 9 | ||
2893 | 10 | add_walking_animations(animations, "walk", dirname, "walk", {5, 9}, 4) | 10 | add_directional_animation(animations, "walk", dirname, "walk", {5, 9}, 4) |
2894 | 11 | 11 | ||
2895 | 12 | world:new_critter_type{ | 12 | world:new_critter_type{ |
2896 | 13 | name = "bunny", | 13 | name = "bunny", |
2897 | 14 | 14 | ||
2898 | === modified file 'data/world/critters/chamois/init.lua' | |||
2899 | --- data/world/critters/chamois/init.lua 2017-02-12 09:10:57 +0000 | |||
2900 | +++ data/world/critters/chamois/init.lua 2019-05-27 14:29:35 +0000 | |||
2901 | @@ -8,7 +8,7 @@ | |||
2902 | 8 | }, | 8 | }, |
2903 | 9 | } | 9 | } |
2904 | 10 | 10 | ||
2906 | 11 | add_walking_animations(animations, "walk", dirname, "walk", {11, 20}, 20) | 11 | add_directional_animation(animations, "walk", dirname, "walk", {11, 20}, 20) |
2907 | 12 | 12 | ||
2908 | 13 | world:new_critter_type{ | 13 | world:new_critter_type{ |
2909 | 14 | name = "chamois", | 14 | name = "chamois", |
2910 | 15 | 15 | ||
2911 | === modified file 'data/world/critters/deer/init.lua' | |||
2912 | --- data/world/critters/deer/init.lua 2017-02-12 09:10:57 +0000 | |||
2913 | +++ data/world/critters/deer/init.lua 2019-05-27 14:29:35 +0000 | |||
2914 | @@ -8,7 +8,7 @@ | |||
2915 | 8 | }, | 8 | }, |
2916 | 9 | } | 9 | } |
2917 | 10 | 10 | ||
2919 | 11 | add_walking_animations(animations, "walk", dirname, "walk", {15, 25}, 20) | 11 | add_directional_animation(animations, "walk", dirname, "walk", {15, 25}, 20) |
2920 | 12 | 12 | ||
2921 | 13 | world:new_critter_type{ | 13 | world:new_critter_type{ |
2922 | 14 | name = "deer", | 14 | name = "deer", |
2923 | 15 | 15 | ||
2924 | === modified file 'data/world/critters/duck/init.lua' | |||
2925 | --- data/world/critters/duck/init.lua 2019-03-17 08:30:43 +0000 | |||
2926 | +++ data/world/critters/duck/init.lua 2019-05-27 14:29:35 +0000 | |||
2927 | @@ -11,7 +11,7 @@ | |||
2928 | 11 | }, | 11 | }, |
2929 | 12 | } | 12 | } |
2930 | 13 | 13 | ||
2932 | 14 | add_walking_animations(animations, "walk", dirname, "walk", {5, 10}) | 14 | add_directional_animation(animations, "walk", dirname, "walk", {5, 10}) |
2933 | 15 | 15 | ||
2934 | 16 | world:new_critter_type{ | 16 | world:new_critter_type{ |
2935 | 17 | name = "duck", | 17 | name = "duck", |
2936 | 18 | 18 | ||
2937 | === modified file 'data/world/critters/elk/init.lua' | |||
2938 | --- data/world/critters/elk/init.lua 2019-03-17 08:30:43 +0000 | |||
2939 | +++ data/world/critters/elk/init.lua 2019-05-27 14:29:35 +0000 | |||
2940 | @@ -12,7 +12,7 @@ | |||
2941 | 12 | }, | 12 | }, |
2942 | 13 | } | 13 | } |
2943 | 14 | 14 | ||
2945 | 15 | add_walking_animations(animations, "walk", dirname, "walk", {21, 34}, 20) | 15 | add_directional_animation(animations, "walk", dirname, "walk", {21, 34}, 20) |
2946 | 16 | 16 | ||
2947 | 17 | world:new_critter_type{ | 17 | world:new_critter_type{ |
2948 | 18 | name = "elk", | 18 | name = "elk", |
2949 | 19 | 19 | ||
2950 | === modified file 'data/world/critters/fox/init.lua' | |||
2951 | --- data/world/critters/fox/init.lua 2019-03-17 08:30:43 +0000 | |||
2952 | +++ data/world/critters/fox/init.lua 2019-05-27 14:29:35 +0000 | |||
2953 | @@ -12,7 +12,7 @@ | |||
2954 | 12 | }, | 12 | }, |
2955 | 13 | } | 13 | } |
2956 | 14 | 14 | ||
2958 | 15 | add_walking_animations(animations, "walk", dirname, "walk", {11, 14}, 20) | 15 | add_directional_animation(animations, "walk", dirname, "walk", {11, 14}, 20) |
2959 | 16 | 16 | ||
2960 | 17 | world:new_critter_type{ | 17 | world:new_critter_type{ |
2961 | 18 | name = "fox", | 18 | name = "fox", |
2962 | 19 | 19 | ||
2963 | === modified file 'data/world/critters/lynx/init.lua' | |||
2964 | --- data/world/critters/lynx/init.lua 2017-02-12 09:10:57 +0000 | |||
2965 | +++ data/world/critters/lynx/init.lua 2019-05-27 14:29:35 +0000 | |||
2966 | @@ -8,7 +8,7 @@ | |||
2967 | 8 | }, | 8 | }, |
2968 | 9 | } | 9 | } |
2969 | 10 | 10 | ||
2971 | 11 | add_walking_animations(animations, "walk", dirname, "walk", {11, 21}, 20) | 11 | add_directional_animation(animations, "walk", dirname, "walk", {11, 21}, 20) |
2972 | 12 | 12 | ||
2973 | 13 | 13 | ||
2974 | 14 | world:new_critter_type{ | 14 | world:new_critter_type{ |
2975 | 15 | 15 | ||
2976 | === modified file 'data/world/critters/marten/init.lua' | |||
2977 | --- data/world/critters/marten/init.lua 2017-02-12 09:10:57 +0000 | |||
2978 | +++ data/world/critters/marten/init.lua 2019-05-27 14:29:35 +0000 | |||
2979 | @@ -8,7 +8,7 @@ | |||
2980 | 8 | }, | 8 | }, |
2981 | 9 | } | 9 | } |
2982 | 10 | 10 | ||
2984 | 11 | add_walking_animations(animations, "walk", dirname, "walk", {15, 14}, 20) | 11 | add_directional_animation(animations, "walk", dirname, "walk", {15, 14}, 20) |
2985 | 12 | 12 | ||
2986 | 13 | world:new_critter_type{ | 13 | world:new_critter_type{ |
2987 | 14 | name = "marten", | 14 | name = "marten", |
2988 | 15 | 15 | ||
2989 | === modified file 'data/world/critters/reindeer/init.lua' | |||
2990 | --- data/world/critters/reindeer/init.lua 2017-02-12 09:10:57 +0000 | |||
2991 | +++ data/world/critters/reindeer/init.lua 2019-05-27 14:29:35 +0000 | |||
2992 | @@ -8,7 +8,7 @@ | |||
2993 | 8 | }, | 8 | }, |
2994 | 9 | } | 9 | } |
2995 | 10 | 10 | ||
2997 | 11 | add_walking_animations(animations, "walk", dirname, "walk", {25, 30}, 20) | 11 | add_directional_animation(animations, "walk", dirname, "walk", {25, 30}, 20) |
2998 | 12 | 12 | ||
2999 | 13 | 13 | ||
3000 | 14 | world:new_critter_type{ | 14 | world:new_critter_type{ |
3001 | 15 | 15 | ||
3002 | === modified file 'data/world/critters/sheep/init.lua' | |||
3003 | --- data/world/critters/sheep/init.lua 2019-03-17 08:30:43 +0000 | |||
3004 | +++ data/world/critters/sheep/init.lua 2019-05-27 14:29:35 +0000 | |||
3005 | @@ -11,7 +11,7 @@ | |||
3006 | 11 | }, | 11 | }, |
3007 | 12 | } | 12 | } |
3008 | 13 | 13 | ||
3010 | 14 | add_walking_animations(animations, "walk", dirname, "walk", {15, 25}, 20) | 14 | add_directional_animation(animations, "walk", dirname, "walk", {15, 25}, 20) |
3011 | 15 | 15 | ||
3012 | 16 | world:new_critter_type{ | 16 | world:new_critter_type{ |
3013 | 17 | name = "sheep", | 17 | name = "sheep", |
3014 | 18 | 18 | ||
3015 | === modified file 'data/world/critters/stag/init.lua' | |||
3016 | --- data/world/critters/stag/init.lua 2019-03-17 08:30:43 +0000 | |||
3017 | +++ data/world/critters/stag/init.lua 2019-05-27 14:29:35 +0000 | |||
3018 | @@ -12,7 +12,7 @@ | |||
3019 | 12 | }, | 12 | }, |
3020 | 13 | } | 13 | } |
3021 | 14 | 14 | ||
3023 | 15 | add_walking_animations(animations, "walk", dirname, "walk", {25, 30}, 20) | 15 | add_directional_animation(animations, "walk", dirname, "walk", {25, 30}, 20) |
3024 | 16 | 16 | ||
3025 | 17 | world:new_critter_type{ | 17 | world:new_critter_type{ |
3026 | 18 | name = "stag", | 18 | name = "stag", |
3027 | 19 | 19 | ||
3028 | === modified file 'data/world/critters/wildboar/init.lua' | |||
3029 | --- data/world/critters/wildboar/init.lua 2019-03-17 08:30:43 +0000 | |||
3030 | +++ data/world/critters/wildboar/init.lua 2019-05-27 14:29:35 +0000 | |||
3031 | @@ -11,7 +11,7 @@ | |||
3032 | 11 | }, | 11 | }, |
3033 | 12 | } | 12 | } |
3034 | 13 | 13 | ||
3036 | 14 | add_walking_animations(animations, "walk", dirname, "walk", {20, 22}, 20) | 14 | add_directional_animation(animations, "walk", dirname, "walk", {20, 22}, 20) |
3037 | 15 | 15 | ||
3038 | 16 | world:new_critter_type{ | 16 | world:new_critter_type{ |
3039 | 17 | name = "wildboar", | 17 | name = "wildboar", |
3040 | 18 | 18 | ||
3041 | === modified file 'data/world/critters/wisent/init.lua' | |||
3042 | --- data/world/critters/wisent/init.lua 2017-02-12 09:10:57 +0000 | |||
3043 | +++ data/world/critters/wisent/init.lua 2019-05-27 14:29:35 +0000 | |||
3044 | @@ -8,7 +8,7 @@ | |||
3045 | 8 | }, | 8 | }, |
3046 | 9 | } | 9 | } |
3047 | 10 | 10 | ||
3049 | 11 | add_walking_animations(animations, "walk", dirname, "walk", {24, 32}, 20) | 11 | add_directional_animation(animations, "walk", dirname, "walk", {24, 32}, 20) |
3050 | 12 | 12 | ||
3051 | 13 | world:new_critter_type{ | 13 | world:new_critter_type{ |
3052 | 14 | name = "wisent", | 14 | name = "wisent", |
3053 | 15 | 15 | ||
3054 | === modified file 'data/world/critters/wolf/init.lua' | |||
3055 | --- data/world/critters/wolf/init.lua 2019-03-17 08:30:43 +0000 | |||
3056 | +++ data/world/critters/wolf/init.lua 2019-05-27 14:29:35 +0000 | |||
3057 | @@ -12,7 +12,7 @@ | |||
3058 | 12 | }, | 12 | }, |
3059 | 13 | } | 13 | } |
3060 | 14 | 14 | ||
3062 | 15 | add_walking_animations(animations, "walk", dirname, "walk", {19, 19}, 20) | 15 | add_directional_animation(animations, "walk", dirname, "walk", {19, 19}, 20) |
3063 | 16 | 16 | ||
3064 | 17 | world:new_critter_type{ | 17 | world:new_critter_type{ |
3065 | 18 | name = "wolf", | 18 | name = "wolf", |
3066 | 19 | 19 | ||
3067 | === modified file 'data/world/immovables/grass1/init.lua' | |||
3068 | --- data/world/immovables/grass1/init.lua 2019-03-17 08:30:43 +0000 | |||
3069 | +++ data/world/immovables/grass1/init.lua 2019-05-27 14:29:35 +0000 | |||
3070 | @@ -12,7 +12,7 @@ | |||
3071 | 12 | pictures = path.list_files(dirname .. "idle.png"), | 12 | pictures = path.list_files(dirname .. "idle.png"), |
3072 | 13 | hotspot = { 10, 20 }, | 13 | hotspot = { 10, 20 }, |
3073 | 14 | sound_effect = { | 14 | sound_effect = { |
3075 | 15 | path = "sound/animals/frog1", | 15 | path = "sound/animals/frog", |
3076 | 16 | }, | 16 | }, |
3077 | 17 | }, | 17 | }, |
3078 | 18 | } | 18 | } |
3079 | 19 | 19 | ||
3080 | === modified file 'data/world/immovables/grass2/init.lua' | |||
3081 | --- data/world/immovables/grass2/init.lua 2019-03-17 08:30:43 +0000 | |||
3082 | +++ data/world/immovables/grass2/init.lua 2019-05-27 14:29:35 +0000 | |||
3083 | @@ -12,7 +12,7 @@ | |||
3084 | 12 | pictures = path.list_files(dirname .. "idle.png"), | 12 | pictures = path.list_files(dirname .. "idle.png"), |
3085 | 13 | hotspot = { 10, 16 }, | 13 | hotspot = { 10, 16 }, |
3086 | 14 | sound_effect = { | 14 | sound_effect = { |
3088 | 15 | path = "sound/animals/frog1", | 15 | path = "sound/animals/frog", |
3089 | 16 | }, | 16 | }, |
3090 | 17 | }, | 17 | }, |
3091 | 18 | } | 18 | } |
3092 | 19 | 19 | ||
3093 | === modified file 'data/world/immovables/grass3/init.lua' | |||
3094 | --- data/world/immovables/grass3/init.lua 2019-03-17 08:30:43 +0000 | |||
3095 | +++ data/world/immovables/grass3/init.lua 2019-05-27 14:29:35 +0000 | |||
3096 | @@ -12,7 +12,7 @@ | |||
3097 | 12 | pictures = path.list_files(dirname .. "idle.png"), | 12 | pictures = path.list_files(dirname .. "idle.png"), |
3098 | 13 | hotspot = { 10, 11 }, | 13 | hotspot = { 10, 11 }, |
3099 | 14 | sound_effect = { | 14 | sound_effect = { |
3101 | 15 | path = "sound/animals/frog1", | 15 | path = "sound/animals/frog", |
3102 | 16 | }, | 16 | }, |
3103 | 17 | }, | 17 | }, |
3104 | 18 | } | 18 | } |
3105 | 19 | 19 | ||
3106 | === modified file 'doc/sphinx/source/animations.rst' | |||
3107 | --- doc/sphinx/source/animations.rst 2019-05-11 13:48:12 +0000 | |||
3108 | +++ doc/sphinx/source/animations.rst 2019-05-27 14:29:35 +0000 | |||
3109 | @@ -19,7 +19,8 @@ | |||
3110 | 19 | 19 | ||
3111 | 20 | animations = { | 20 | animations = { |
3112 | 21 | idle = { | 21 | idle = { |
3114 | 22 | files = path.list_files(path.dirname(__file__) .. "idle_??.png"), | 22 | directory = path.dirname(__file__), |
3115 | 23 | basename = "idle", | ||
3116 | 23 | hotspot = { 5, 7 }, | 24 | hotspot = { 5, 7 }, |
3117 | 24 | fps = 4, | 25 | fps = 4, |
3118 | 25 | sound_effect = { | 26 | sound_effect = { |
3119 | @@ -28,7 +29,14 @@ | |||
3120 | 28 | }, | 29 | }, |
3121 | 29 | representative_frame = 3, | 30 | representative_frame = 3, |
3122 | 30 | }, | 31 | }, |
3124 | 31 | working = ... | 32 | walk = { |
3125 | 33 | directory = path.dirname(__file__), | ||
3126 | 34 | basename = "walk", | ||
3127 | 35 | hotspot = { 5, 7 }, | ||
3128 | 36 | fps = 4, | ||
3129 | 37 | directional = true | ||
3130 | 38 | }, | ||
3131 | 39 | ... | ||
3132 | 32 | } | 40 | } |
3133 | 33 | 41 | ||
3134 | 34 | Let's have a detailed look at the ``idle`` animation: | 42 | Let's have a detailed look at the ``idle`` animation: |
3135 | @@ -36,11 +44,23 @@ | |||
3136 | 36 | **idle** | 44 | **idle** |
3137 | 37 | *Mandatory*. This is the name of the animation. The animation can then be referenced by this name e.g. if you want to trigger it in a production program. | 45 | *Mandatory*. This is the name of the animation. The animation can then be referenced by this name e.g. if you want to trigger it in a production program. |
3138 | 38 | 46 | ||
3141 | 39 | **files** | 47 | **directory** |
3142 | 40 | *Mandatory*. A template for the image names. Our example will pick up any image from ``idle_00.png`` through ``idle_99.png`` in the specified directory path -- the current path in our example. These images can optionally have corresponding player color mask images called ``idle_00_pc.png`` through ``idle_99_pc.png``. Make sure to include leading 0's in the file names and to have consistent length -- we support 1, 2 and 3 digit numbers in an animation. | 48 | *Mandatory*. The directory where the animation image files are located. |
3143 | 49 | |||
3144 | 50 | **basename** | ||
3145 | 51 | *Mandatory*. The filename prefix for the image files. Our example will pick up any image from ``idle_00.png`` through ``idle_99.png`` in the specified directory path -- the current path in our example. These images can optionally have corresponding player color mask images called ``idle_00_pc.png`` through ``idle_99_pc.png``. Make sure to include leading 0's in the file names and to have consistent length -- we support 1, 2 and 3 digit numbers in an animation. | ||
3146 | 52 | If your animation contains only one file, you can also call it ``idle.png`` (and ``idle_pc.png`` for the player color mask) without ``_`` or any numbers in the file name. | ||
3147 | 53 | |||
3148 | 54 | We support *mipmaps* for animations. They allow us to provide the same image in different resolutions for optimum rendering quality. | ||
3149 | 55 | For using mipmaps, simply name your files accordingly, and the engine will pick them up. e.g. ``idle_0.5_00.png`` will be rendered at scale ``0.5``, and ``idle_1_00.png`` will be rendered at the neutral scale ``1``. | ||
3150 | 56 | The scale of ``1`` is mandatory, and other supported scales are ``0.5``, ``2`` and ``4``. | ||
3151 | 41 | 57 | ||
3152 | 42 | **pictures** | 58 | **pictures** |
3154 | 43 | *DEPRECATED*. The same as ``files``. | 59 | *DEPRECATED*. This is older code that is slowly being phased out - do not use this parameter. |
3155 | 60 | A table with full directory and file names. | ||
3156 | 61 | |||
3157 | 62 | **directional** | ||
3158 | 63 | *Optional*. If this is ``true``, indicates to the engine that this is a directional animation. In our example, the engine will create a set of 6 animations called ``"walk_ne"``, ``"walk_e"``, ``"walk_se"``, ``"walk_sw"``, ``"walk_w"``, and ``"walk_nw"``. See :ref:`animations_directional` below. | ||
3159 | 44 | 64 | ||
3160 | 45 | **hotspot** | 65 | **hotspot** |
3161 | 46 | *Mandatory*. Hotspots define a place on a graphic image through its *x* and *y* coordinates that can be used as a handle or reference point to provide control over positioning the image on the map. For example, hotspots help carriers stay on the road, and control the positioning of the wares they carry. Increase ``x`` to shift the animation to the left and ``y`` to shift it upwards. | 66 | *Mandatory*. Hotspots define a place on a graphic image through its *x* and *y* coordinates that can be used as a handle or reference point to provide control over positioning the image on the map. For example, hotspots help carriers stay on the road, and control the positioning of the wares they carry. Increase ``x`` to shift the animation to the left and ``y`` to shift it upwards. |
3162 | @@ -56,56 +76,7 @@ | |||
3163 | 56 | * **255:** Always play | 76 | * **255:** Always play |
3164 | 57 | 77 | ||
3165 | 58 | 78 | ||
3216 | 59 | Mipmaps | 79 | .. _animations_directional: |
3167 | 60 | ------- | ||
3168 | 61 | |||
3169 | 62 | We support mipmaps for animations. They allow us to provide the same image in different | ||
3170 | 63 | resolutions for optimum rendering quality. Let's look at an example with a mipmap ``idle`` animation and a normal ``build`` animation: | ||
3171 | 64 | |||
3172 | 65 | .. code-block:: lua | ||
3173 | 66 | |||
3174 | 67 | animations = { | ||
3175 | 68 | idle = { | ||
3176 | 69 | mipmap = { | ||
3177 | 70 | { | ||
3178 | 71 | scale = 0.5, | ||
3179 | 72 | files = path.list_files(dirname .. "idle_0.5_??.png"), | ||
3180 | 73 | }, | ||
3181 | 74 | { | ||
3182 | 75 | scale = 1, | ||
3183 | 76 | files = path.list_files(dirname .. "idle_1_??.png"), | ||
3184 | 77 | }, | ||
3185 | 78 | { | ||
3186 | 79 | scale = 2, | ||
3187 | 80 | files = path.list_files(dirname .. "idle_2_??.png"), | ||
3188 | 81 | }, | ||
3189 | 82 | { | ||
3190 | 83 | scale = 4, | ||
3191 | 84 | files = path.list_files(dirname .. "idle_4_??.png"), | ||
3192 | 85 | } | ||
3193 | 86 | }, | ||
3194 | 87 | hotspot = { 5, 7 }, | ||
3195 | 88 | fps = 4, | ||
3196 | 89 | sound_effect = { | ||
3197 | 90 | directory = "sound/foo", | ||
3198 | 91 | name = "bar", | ||
3199 | 92 | }, | ||
3200 | 93 | }, | ||
3201 | 94 | build = { | ||
3202 | 95 | files = path.list_files(dirname .. "build_??.png"), | ||
3203 | 96 | hotspot = { 5, 7 }, | ||
3204 | 97 | } | ||
3205 | 98 | }, | ||
3206 | 99 | |||
3207 | 100 | The scale of ``1`` is mandatory, and other supported scales are ``0.5``, ``2`` | ||
3208 | 101 | and ``4``. | ||
3209 | 102 | The base table should no longer contain the ``files`` entry | ||
3210 | 103 | when you're using a mipmap. | ||
3211 | 104 | Each mimap entry must define the ``files`` and the ``scale``. | ||
3212 | 105 | See also :ref:`animations_converting_formats`. | ||
3213 | 106 | |||
3214 | 107 | **representative_frame** | ||
3215 | 108 | *Optional*. Choose the animation frame that will be displayed in messages and in the encyclopedia as a representative image. Default is 0. | ||
3217 | 109 | 80 | ||
3218 | 110 | Directional Animations | 81 | Directional Animations |
3219 | 111 | ---------------------- | 82 | ---------------------- |
3220 | @@ -126,7 +97,7 @@ | |||
3221 | 126 | --------------------- | 97 | --------------------- |
3222 | 127 | 98 | ||
3223 | 128 | In order to cut down on the manual coding needed, we provide the convenience functions | 99 | In order to cut down on the manual coding needed, we provide the convenience functions |
3225 | 129 | :any:`add_animation` for static animations and :any:`add_walking_animations` for walking | 100 | :any:`add_animation` for static animations and :any:`add_directional_animation` for walking |
3226 | 130 | animations, both of which will also detect mipmaps automatically. | 101 | animations, both of which will also detect mipmaps automatically. |
3227 | 131 | The corresponding ``.lua`` script file is included centrally when the tribe or world | 102 | The corresponding ``.lua`` script file is included centrally when the tribe or world |
3228 | 132 | loading is started, so you won't need to include it again. Example: | 103 | loading is started, so you won't need to include it again. Example: |
3229 | @@ -142,10 +113,10 @@ | |||
3230 | 142 | add_animation(animations, "idle", dirname, "idle", {16, 30}, 5) | 113 | add_animation(animations, "idle", dirname, "idle", {16, 30}, 5) |
3231 | 143 | 114 | ||
3232 | 144 | -- Add animations for the 6 directions with hotspot = {16, 30} and fps = 10 | 115 | -- Add animations for the 6 directions with hotspot = {16, 30} and fps = 10 |
3234 | 145 | add_walking_animations(animations, "walk", dirname, "walk", {16, 30}, 10) | 116 | add_directional_animation(animations, "walk", dirname, "walk", {16, 30}, 10) |
3235 | 146 | 117 | ||
3236 | 147 | -- Add a "walkload" animation. The animation hasn't been created yet in this example, so we reuse the files for the "walk" animation. | 118 | -- Add a "walkload" animation. The animation hasn't been created yet in this example, so we reuse the files for the "walk" animation. |
3238 | 148 | add_walking_animations(animations, "walkload", dirname, "walk", {16, 30}, 10) | 119 | add_directional_animation(animations, "walkload", dirname, "walk", {16, 30}, 10) |
3239 | 149 | 120 | ||
3240 | 150 | 121 | ||
3241 | 151 | tribes:new_worker_type { | 122 | tribes:new_worker_type { |
3242 | @@ -191,7 +162,7 @@ | |||
3243 | 191 | MipmapMaker accepts high-resolution images as input files (they should be at least 4 times the in-game size) | 162 | MipmapMaker accepts high-resolution images as input files (they should be at least 4 times the in-game size) |
3244 | 192 | and creates correctly named mipmap images for all supported scales for each animation, e.g.: | 163 | and creates correctly named mipmap images for all supported scales for each animation, e.g.: |
3245 | 193 | 164 | ||
3247 | 194 | java MipmapMaker ~/widelands/data/tribes/workers/fancytribe/diligentworker walk_se 2 true true true 4.0 | 165 | ``java MipmapMaker ~/widelands/data/tribes/workers/fancytribe/diligentworker walk_se 2 true true true 4.0`` |
3248 | 195 | 166 | ||
3249 | 196 | MipmapMaker is documented in ``widelands-media/graphics/tools/Graphics Tools (Java)/Readme``. | 167 | MipmapMaker is documented in ``widelands-media/graphics/tools/Graphics Tools (Java)/Readme``. |
3250 | 197 | 168 | ||
3251 | 198 | 169 | ||
3252 | === modified file 'src/CMakeLists.txt' | |||
3253 | --- src/CMakeLists.txt 2019-05-12 07:45:59 +0000 | |||
3254 | +++ src/CMakeLists.txt 2019-05-27 14:29:35 +0000 | |||
3255 | @@ -107,7 +107,6 @@ | |||
3256 | 107 | graphic | 107 | graphic |
3257 | 108 | graphic_fonthandler | 108 | graphic_fonthandler |
3258 | 109 | graphic_text | 109 | graphic_text |
3259 | 110 | helper | ||
3260 | 111 | io_filesystem | 110 | io_filesystem |
3261 | 112 | logic | 111 | logic |
3262 | 113 | logic_exceptions | 112 | logic_exceptions |
3263 | 114 | 113 | ||
3264 | === modified file 'src/game_io/game_loader.cc' | |||
3265 | --- src/game_io/game_loader.cc 2019-02-23 11:00:49 +0000 | |||
3266 | +++ src/game_io/game_loader.cc 2019-05-27 14:29:35 +0000 | |||
3267 | @@ -93,7 +93,8 @@ | |||
3268 | 93 | log("Game: Reading Scenario Tribes took %ums\n", timer.ms_since_last_query()); | 93 | log("Game: Reading Scenario Tribes took %ums\n", timer.ms_since_last_query()); |
3269 | 94 | } | 94 | } |
3270 | 95 | 95 | ||
3272 | 96 | log("Game: Reading Player Info ... "); | 96 | // This also triggers loading the world and tribes, so we need a newline at the end of the log output |
3273 | 97 | log("Game: Reading Player Info ...\n"); | ||
3274 | 97 | { | 98 | { |
3275 | 98 | GamePlayerInfoPacket p; | 99 | GamePlayerInfoPacket p; |
3276 | 99 | p.read(fs_, game_); | 100 | p.read(fs_, game_); |
3277 | 100 | 101 | ||
3278 | === modified file 'src/graphic/animation.cc' | |||
3279 | --- src/graphic/animation.cc 2019-05-04 09:59:51 +0000 | |||
3280 | +++ src/graphic/animation.cc 2019-05-27 14:29:35 +0000 | |||
3281 | @@ -31,13 +31,13 @@ | |||
3282 | 31 | #include "base/i18n.h" | 31 | #include "base/i18n.h" |
3283 | 32 | #include "base/log.h" | 32 | #include "base/log.h" |
3284 | 33 | #include "base/macros.h" | 33 | #include "base/macros.h" |
3285 | 34 | #include "base/wexception.h" | ||
3286 | 35 | #include "graphic/diranimations.h" | 34 | #include "graphic/diranimations.h" |
3287 | 36 | #include "graphic/graphic.h" | 35 | #include "graphic/graphic.h" |
3288 | 37 | #include "graphic/image.h" | 36 | #include "graphic/image.h" |
3289 | 38 | #include "graphic/image_cache.h" | 37 | #include "graphic/image_cache.h" |
3290 | 39 | #include "graphic/playercolor.h" | 38 | #include "graphic/playercolor.h" |
3291 | 40 | #include "graphic/texture.h" | 39 | #include "graphic/texture.h" |
3292 | 40 | #include "io/filesystem/filesystem.h" | ||
3293 | 41 | #include "io/filesystem/layered_filesystem.h" | 41 | #include "io/filesystem/layered_filesystem.h" |
3294 | 42 | #include "logic/game_data_error.h" | 42 | #include "logic/game_data_error.h" |
3295 | 43 | #include "scripting/lua_table.h" | 43 | #include "scripting/lua_table.h" |
3296 | @@ -56,25 +56,36 @@ | |||
3297 | 56 | class NonPackedAnimation : public Animation { | 56 | class NonPackedAnimation : public Animation { |
3298 | 57 | public: | 57 | public: |
3299 | 58 | struct MipMapEntry { | 58 | struct MipMapEntry { |
3301 | 59 | explicit MipMapEntry(float scale, const LuaTable& table); | 59 | explicit MipMapEntry(std::vector<std::string> files); |
3302 | 60 | |||
3303 | 61 | // Loads the graphics if they are not yet loaded. | ||
3304 | 62 | void ensure_graphics_are_loaded() const; | ||
3305 | 63 | |||
3306 | 64 | // Load the needed graphics from disk. | ||
3307 | 65 | void load_graphics(); | ||
3308 | 66 | |||
3309 | 67 | void blit(uint32_t idx, const Rectf& source_rect, const Rectf& destination_rect, const RGBColor* clr, Surface* target) const; | ||
3310 | 60 | 68 | ||
3311 | 61 | // Whether this image set has player color masks provided | 69 | // Whether this image set has player color masks provided |
3312 | 62 | bool has_playercolor_masks; | 70 | bool has_playercolor_masks; |
3313 | 63 | 71 | ||
3314 | 64 | // Image files on disk | 72 | // Image files on disk |
3315 | 65 | std::vector<std::string> image_files; | 73 | std::vector<std::string> image_files; |
3316 | 74 | |||
3317 | 75 | // Loaded images for each frame | ||
3318 | 76 | std::vector<const Image*> frames; | ||
3319 | 77 | |||
3320 | 78 | private: | ||
3321 | 66 | // Player color mask files on disk | 79 | // Player color mask files on disk |
3322 | 67 | std::vector<std::string> playercolor_mask_image_files; | 80 | std::vector<std::string> playercolor_mask_image_files; |
3323 | 68 | 81 | ||
3324 | 69 | // Loaded images for each frame | ||
3325 | 70 | std::vector<const Image*> frames; | ||
3326 | 71 | // Loaded player color mask images for each frame | 82 | // Loaded player color mask images for each frame |
3327 | 72 | std::vector<const Image*> playercolor_mask_frames; | 83 | std::vector<const Image*> playercolor_mask_frames; |
3328 | 73 | }; | 84 | }; |
3329 | 74 | 85 | ||
3330 | 75 | ~NonPackedAnimation() override { | 86 | ~NonPackedAnimation() override { |
3331 | 76 | } | 87 | } |
3333 | 77 | explicit NonPackedAnimation(const LuaTable& table); | 88 | explicit NonPackedAnimation(const LuaTable& table, const std::string& basename); |
3334 | 78 | 89 | ||
3335 | 79 | // Implements Animation. | 90 | // Implements Animation. |
3336 | 80 | float height() const override; | 91 | float height() const override; |
3337 | @@ -90,8 +101,8 @@ | |||
3338 | 90 | const Rectf& source_rect, | 101 | const Rectf& source_rect, |
3339 | 91 | const Rectf& destination_rect, | 102 | const Rectf& destination_rect, |
3340 | 92 | const RGBColor* clr, | 103 | const RGBColor* clr, |
3343 | 93 | Surface* target, | 104 | Surface* target, float scale) const override; |
3344 | 94 | float scale) const override; | 105 | void load_default_scale_and_sounds() const override; |
3345 | 95 | 106 | ||
3346 | 96 | private: | 107 | private: |
3347 | 97 | float find_best_scale(float scale) const; | 108 | float find_best_scale(float scale) const; |
3348 | @@ -100,12 +111,6 @@ | |||
3349 | 100 | // What if the game runs very slowly or very quickly? | 111 | // What if the game runs very slowly or very quickly? |
3350 | 101 | void trigger_sound(uint32_t framenumber, const Widelands::Coords& coords) const override; | 112 | void trigger_sound(uint32_t framenumber, const Widelands::Coords& coords) const override; |
3351 | 102 | 113 | ||
3352 | 103 | // Loads the graphics if they are not yet loaded. | ||
3353 | 104 | void ensure_graphics_are_loaded() const; | ||
3354 | 105 | |||
3355 | 106 | // Load the needed graphics from disk. | ||
3356 | 107 | void load_graphics(); | ||
3357 | 108 | |||
3358 | 109 | uint32_t current_frame(uint32_t time) const; | 114 | uint32_t current_frame(uint32_t time) const; |
3359 | 110 | 115 | ||
3360 | 111 | uint32_t frametime_; | 116 | uint32_t frametime_; |
3361 | @@ -126,22 +131,17 @@ | |||
3362 | 126 | bool play_once_; | 131 | bool play_once_; |
3363 | 127 | }; | 132 | }; |
3364 | 128 | 133 | ||
3378 | 129 | NonPackedAnimation::MipMapEntry::MipMapEntry(float scale, const LuaTable& table) | 134 | /* |
3379 | 130 | : has_playercolor_masks(false) { | 135 | ============================================================================== |
3380 | 131 | if (scale <= 0.0f) { | 136 | |
3381 | 132 | throw wexception( | 137 | NonPackedAnimation::MipMapEntry IMPLEMENTATION |
3382 | 133 | "Animation scales must be positive numbers. Found %.2f", static_cast<double>(scale)); | 138 | |
3383 | 134 | } | 139 | ============================================================================== |
3384 | 135 | 140 | */ | |
3385 | 136 | // TODO(GunChleoc): We want to rename these from "pictures" to "files", because we'll have | 141 | |
3386 | 137 | // spritesheets etc. in the future, and this naming will be clearer. We don't want to convert | 142 | NonPackedAnimation::MipMapEntry::MipMapEntry(std::vector<std::string> files) : has_playercolor_masks(false), image_files(files) { |
3374 | 138 | // them in bulk right now though - it will take care of itself as we convert to mipmaps. | ||
3375 | 139 | image_files = (table.has_key("files") ? table.get_table("files") : table.get_table("pictures")) | ||
3376 | 140 | ->array_entries<std::string>(); | ||
3377 | 141 | |||
3387 | 142 | if (image_files.empty()) { | 143 | if (image_files.empty()) { |
3390 | 143 | throw wexception("Animation without image files. For a scale of 1.0, the template should " | 144 | throw Widelands::GameDataError("Animation without image files. For a scale of 1.0, the template should look similar to this:" |
3389 | 144 | "look similar to this:" | ||
3391 | 145 | " 'directory/idle_1_??.png' for 'directory/idle_1_00.png' etc."); | 145 | " 'directory/idle_1_??.png' for 'directory/idle_1_00.png' etc."); |
3392 | 146 | } | 146 | } |
3393 | 147 | 147 | ||
3394 | @@ -151,18 +151,84 @@ | |||
3395 | 151 | has_playercolor_masks = true; | 151 | has_playercolor_masks = true; |
3396 | 152 | playercolor_mask_image_files.push_back(image_file); | 152 | playercolor_mask_image_files.push_back(image_file); |
3397 | 153 | } else if (has_playercolor_masks) { | 153 | } else if (has_playercolor_masks) { |
3399 | 154 | throw wexception("Animation is missing player color file: %s", image_file.c_str()); | 154 | throw Widelands::GameDataError("Animation is missing player color file: %s", image_file.c_str()); |
3400 | 155 | } | 155 | } |
3401 | 156 | } | 156 | } |
3402 | 157 | 157 | ||
3403 | 158 | assert(!image_files.empty()); | 158 | assert(!image_files.empty()); |
3409 | 159 | assert(playercolor_mask_image_files.size() == image_files.size() || | 159 | assert(playercolor_mask_image_files.size() == image_files.size() || playercolor_mask_image_files.empty()); |
3410 | 160 | playercolor_mask_image_files.empty()); | 160 | } |
3411 | 161 | } | 161 | |
3412 | 162 | 162 | // Loads the graphics if they are not yet loaded. | |
3413 | 163 | NonPackedAnimation::NonPackedAnimation(const LuaTable& table) | 163 | void NonPackedAnimation::MipMapEntry::ensure_graphics_are_loaded() const { |
3414 | 164 | if (frames.empty()) { | ||
3415 | 165 | const_cast<MipMapEntry*>(this)->load_graphics(); | ||
3416 | 166 | } | ||
3417 | 167 | } | ||
3418 | 168 | |||
3419 | 169 | // Load the needed graphics from disk. | ||
3420 | 170 | void NonPackedAnimation::MipMapEntry::load_graphics() { | ||
3421 | 171 | if (image_files.empty()) { | ||
3422 | 172 | throw Widelands::GameDataError("animation without image files."); | ||
3423 | 173 | } | ||
3424 | 174 | if (playercolor_mask_image_files.size() && playercolor_mask_image_files.size() != image_files.size()) { | ||
3425 | 175 | throw Widelands::GameDataError("animation has %" PRIuS " frames but playercolor mask has %" PRIuS " frames. First image is %s", | ||
3426 | 176 | image_files.size(), playercolor_mask_image_files.size(), image_files.front().c_str()); | ||
3427 | 177 | } | ||
3428 | 178 | |||
3429 | 179 | for (const std::string& filename : image_files) { | ||
3430 | 180 | const Image* image = g_gr->images().get(filename); | ||
3431 | 181 | if (frames.size() && | ||
3432 | 182 | (frames.front()->width() != image->width() || frames.front()->height() != image->height())) { | ||
3433 | 183 | throw Widelands::GameDataError("wrong size: (%u, %u) for file %s, should be (%u, %u) like the first frame", | ||
3434 | 184 | image->width(), image->height(), filename.c_str(), frames.front()->width(), | ||
3435 | 185 | frames.front()->height()); | ||
3436 | 186 | } | ||
3437 | 187 | frames.push_back(image); | ||
3438 | 188 | } | ||
3439 | 189 | |||
3440 | 190 | for (const std::string& filename : playercolor_mask_image_files) { | ||
3441 | 191 | // TODO(unknown): Do not load playercolor mask as opengl texture or use it as | ||
3442 | 192 | // opengl texture. | ||
3443 | 193 | const Image* pc_image = g_gr->images().get(filename); | ||
3444 | 194 | if (frames.front()->width() != pc_image->width() || frames.front()->height() != pc_image->height()) { | ||
3445 | 195 | throw Widelands::GameDataError("playercolor mask %s has wrong size: (%u, %u), should " | ||
3446 | 196 | "be (%u, %u) like the animation frame", | ||
3447 | 197 | filename.c_str(), pc_image->width(), pc_image->height(), frames.front()->width(), | ||
3448 | 198 | frames.front()->height()); | ||
3449 | 199 | } | ||
3450 | 200 | playercolor_mask_frames.push_back(pc_image); | ||
3451 | 201 | } | ||
3452 | 202 | } | ||
3453 | 203 | |||
3454 | 204 | void NonPackedAnimation::MipMapEntry::blit(uint32_t idx, | ||
3455 | 205 | const Rectf& source_rect, | ||
3456 | 206 | const Rectf& destination_rect, | ||
3457 | 207 | const RGBColor* clr, | ||
3458 | 208 | Surface* target) const { | ||
3459 | 209 | assert(!frames.empty()); | ||
3460 | 210 | assert(target); | ||
3461 | 211 | assert(idx < frames.size()); | ||
3462 | 212 | |||
3463 | 213 | if (!has_playercolor_masks || clr == nullptr) { | ||
3464 | 214 | target->blit(destination_rect, *frames.at(idx), source_rect, 1., BlendMode::UseAlpha); | ||
3465 | 215 | } else { | ||
3466 | 216 | target->blit_blended( | ||
3467 | 217 | destination_rect, *frames.at(idx), *playercolor_mask_frames.at(idx), source_rect, *clr); | ||
3468 | 218 | } | ||
3469 | 219 | } | ||
3470 | 220 | |||
3471 | 221 | /* | ||
3472 | 222 | ============================================================================== | ||
3473 | 223 | |||
3474 | 224 | NonPackedAnimation IMPLEMENTATION | ||
3475 | 225 | |||
3476 | 226 | ============================================================================== | ||
3477 | 227 | */ | ||
3478 | 228 | |||
3479 | 229 | NonPackedAnimation::NonPackedAnimation(const LuaTable& table, const std::string& basename) | ||
3480 | 164 | : Animation(table.has_key("representative_frame") ? table.get_int("representative_frame") : 0), | 230 | : Animation(table.has_key("representative_frame") ? table.get_int("representative_frame") : 0), |
3482 | 165 | frametime_(FRAME_LENGTH), | 231 | frametime_(FRAME_LENGTH), |
3483 | 166 | hotspot_(table.get_vector<std::string, int>("hotspot")), | 232 | hotspot_(table.get_vector<std::string, int>("hotspot")), |
3484 | 167 | sound_effect_(kNoSoundEffect), | 233 | sound_effect_(kNoSoundEffect), |
3485 | 168 | sound_priority_(kFxPriorityLowest), | 234 | sound_priority_(kFxPriorityLowest), |
3486 | @@ -190,36 +256,47 @@ | |||
3487 | 190 | play_once_ = table.get_bool("play_once"); | 256 | play_once_ = table.get_bool("play_once"); |
3488 | 191 | } | 257 | } |
3489 | 192 | 258 | ||
3509 | 193 | if (table.has_key("mipmap")) { | 259 | // Get image files |
3510 | 194 | std::unique_ptr<LuaTable> mipmaps_table = table.get_table("mipmap"); | 260 | if (table.has_key("pictures")) { |
3511 | 195 | for (const int key : mipmaps_table->keys<int>()) { | 261 | // TODO(GunChleoc): Old code - remove this option once conversion has been completed |
3512 | 196 | std::unique_ptr<LuaTable> current_scale_table = mipmaps_table->get_table(key); | 262 | mipmaps_.insert(std::make_pair( |
3513 | 197 | const float current_scale = current_scale_table->get_double("scale"); | 263 | 1.0f, |
3514 | 198 | if (kSupportedScales.count(current_scale) != 1) { | 264 | std::unique_ptr<MipMapEntry>(new MipMapEntry(table.get_table("pictures")->array_entries<std::string>())))); |
3496 | 199 | std::string supported_scales = ""; | ||
3497 | 200 | for (const float supported_scale : kSupportedScales) { | ||
3498 | 201 | supported_scales = | ||
3499 | 202 | (boost::format("%s %.1f") % supported_scales % supported_scale).str(); | ||
3500 | 203 | } | ||
3501 | 204 | throw wexception( | ||
3502 | 205 | "Animation has unsupported scale '%.2f' in mipmap - supported scales are:%s", | ||
3503 | 206 | static_cast<double>(current_scale), supported_scales.c_str()); | ||
3504 | 207 | } | ||
3505 | 208 | mipmaps_.insert(std::make_pair( | ||
3506 | 209 | current_scale, | ||
3507 | 210 | std::unique_ptr<MipMapEntry>(new MipMapEntry(current_scale, *current_scale_table)))); | ||
3508 | 211 | } | ||
3515 | 212 | } else { | 265 | } else { |
3518 | 213 | mipmaps_.insert( | 266 | if (basename.empty() || !table.has_key("directory")) { |
3519 | 214 | std::make_pair(1.0f, std::unique_ptr<MipMapEntry>(new MipMapEntry(1.0f, table)))); | 267 | throw Widelands::GameDataError("Animation did not define both a basename and a directory for its image files"); |
3520 | 268 | } | ||
3521 | 269 | const std::string directory = table.get_string("directory"); | ||
3522 | 270 | |||
3523 | 271 | // List files for the given scale, and if we have any, add a mipmap entry for them. | ||
3524 | 272 | auto add_scale = [this, basename, directory](float scale_as_float, const std::string& scale_as_string) { | ||
3525 | 273 | std::vector<std::string> filenames = g_fs->get_sequential_files(directory, basename + scale_as_string, "png"); | ||
3526 | 274 | if (!filenames.empty()) { | ||
3527 | 275 | mipmaps_.insert(std::make_pair(scale_as_float, std::unique_ptr<MipMapEntry>(new MipMapEntry(filenames)))); | ||
3528 | 276 | } | ||
3529 | 277 | }; | ||
3530 | 278 | add_scale(0.5f, "_0.5"); | ||
3531 | 279 | add_scale(1.0f, "_1"); | ||
3532 | 280 | add_scale(2.0f, "_2"); | ||
3533 | 281 | add_scale(4.0f, "_4"); | ||
3534 | 282 | |||
3535 | 283 | if (mipmaps_.count(1.0f) == 0) { | ||
3536 | 284 | // There might be only 1 scale | ||
3537 | 285 | add_scale(1.0f, ""); | ||
3538 | 286 | if (mipmaps_.count(1.0f) == 0) { | ||
3539 | 287 | // No files found at all | ||
3540 | 288 | throw Widelands::GameDataError( | ||
3541 | 289 | "Animation in directory '%s' with basename '%s' has no images for mandatory scale '1' in mipmap - supported scales are: 0.5, 1, 2, 4", directory.c_str(), basename.c_str()); | ||
3542 | 290 | } | ||
3543 | 291 | } | ||
3544 | 215 | } | 292 | } |
3545 | 216 | 293 | ||
3547 | 217 | // Frames | 294 | // Frames and FPS |
3548 | 218 | nr_frames_ = mipmaps_.begin()->second->image_files.size(); | 295 | nr_frames_ = mipmaps_.begin()->second->image_files.size(); |
3549 | 219 | if (table.has_key("fps")) { | 296 | if (table.has_key("fps")) { |
3550 | 220 | if (nr_frames_ == 1) { | 297 | if (nr_frames_ == 1) { |
3553 | 221 | throw wexception("Animation with one picture %s must not have 'fps'", | 298 | throw Widelands::GameDataError( |
3554 | 222 | mipmaps_.begin()->second->image_files[0].c_str()); | 299 | "Animation with one picture %s must not have 'fps'", mipmaps_.begin()->second->image_files.front().c_str()); |
3555 | 223 | } | 300 | } |
3556 | 224 | frametime_ = 1000 / get_positive_int(table, "fps"); | 301 | frametime_ = 1000 / get_positive_int(table, "fps"); |
3557 | 225 | } | 302 | } |
3558 | @@ -234,22 +311,22 @@ | |||
3559 | 234 | const bool should_have_playercolor = mipmaps_.begin()->second->has_playercolor_masks; | 311 | const bool should_have_playercolor = mipmaps_.begin()->second->has_playercolor_masks; |
3560 | 235 | for (const auto& mipmap : mipmaps_) { | 312 | for (const auto& mipmap : mipmaps_) { |
3561 | 236 | if (mipmap.second->image_files.size() != nr_frames_) { | 313 | if (mipmap.second->image_files.size() != nr_frames_) { |
3566 | 237 | throw wexception( | 314 | throw Widelands::GameDataError("Mismatched number of images for different scales in animation table: %" PRIuS " vs. %u at scale %.2f", |
3567 | 238 | "Mismatched number of images for different scales in animation table: %" PRIuS | 315 | mipmap.second->image_files.size(), |
3568 | 239 | " vs. %u at scale %.2f", | 316 | nr_frames_, |
3569 | 240 | mipmap.second->image_files.size(), nr_frames_, static_cast<double>(mipmap.first)); | 317 | static_cast<double>(mipmap.first)); |
3570 | 241 | } | 318 | } |
3571 | 242 | if (mipmap.second->has_playercolor_masks != should_have_playercolor) { | 319 | if (mipmap.second->has_playercolor_masks != should_have_playercolor) { |
3575 | 243 | throw wexception( | 320 | throw Widelands::GameDataError("Mismatched existence of player colors in animation table for scales %.2f and %.2f", |
3576 | 244 | "Mismatched existence of player colors in animation table for scales %.2f and %.2f", | 321 | static_cast<double>(mipmaps_.begin()->first), |
3577 | 245 | static_cast<double>(mipmaps_.begin()->first), static_cast<double>(mipmap.first)); | 322 | static_cast<double>(mipmap.first)); |
3578 | 246 | } | 323 | } |
3579 | 247 | } | 324 | } |
3580 | 248 | if (mipmaps_.count(1.0f) != 1) { | 325 | if (mipmaps_.count(1.0f) != 1) { |
3582 | 249 | throw wexception("All animations must provide images for the neutral scale (1.0)"); | 326 | throw Widelands::GameDataError("All animations must provide images for the neutral scale (1.0)"); |
3583 | 250 | } | 327 | } |
3584 | 251 | } catch (const LuaError& e) { | 328 | } catch (const LuaError& e) { |
3586 | 252 | throw wexception("Error in animation table: %s", e.what()); | 329 | throw Widelands::GameDataError("Error in animation table: %s", e.what()); |
3587 | 253 | } | 330 | } |
3588 | 254 | } | 331 | } |
3589 | 255 | 332 | ||
3590 | @@ -266,59 +343,10 @@ | |||
3591 | 266 | return result; | 343 | return result; |
3592 | 267 | } | 344 | } |
3593 | 268 | 345 | ||
3594 | 269 | void NonPackedAnimation::ensure_graphics_are_loaded() const { | ||
3595 | 270 | if (mipmaps_.begin()->second->frames.empty()) { | ||
3596 | 271 | const_cast<NonPackedAnimation*>(this)->load_graphics(); | ||
3597 | 272 | } | ||
3598 | 273 | } | ||
3599 | 274 | |||
3600 | 275 | void NonPackedAnimation::load_graphics() { | ||
3601 | 276 | for (const auto& entry : mipmaps_) { | ||
3602 | 277 | MipMapEntry* mipmap = entry.second.get(); | ||
3603 | 278 | |||
3604 | 279 | if (mipmap->image_files.empty()) { | ||
3605 | 280 | throw wexception("animation without image files at promised scale %.2f.", | ||
3606 | 281 | static_cast<double>(entry.first)); | ||
3607 | 282 | } | ||
3608 | 283 | if (mipmap->playercolor_mask_image_files.size() && | ||
3609 | 284 | mipmap->playercolor_mask_image_files.size() != mipmap->image_files.size()) { | ||
3610 | 285 | throw wexception("animation has %" PRIuS " frames but playercolor mask has %" PRIuS | ||
3611 | 286 | " frames for scale %.2f", | ||
3612 | 287 | mipmap->image_files.size(), mipmap->playercolor_mask_image_files.size(), | ||
3613 | 288 | static_cast<double>(entry.first)); | ||
3614 | 289 | } | ||
3615 | 290 | |||
3616 | 291 | for (const std::string& filename : mipmap->image_files) { | ||
3617 | 292 | const Image* image = g_gr->images().get(filename); | ||
3618 | 293 | if (mipmap->frames.size() && (mipmap->frames[0]->width() != image->width() || | ||
3619 | 294 | mipmap->frames[0]->height() != image->height())) { | ||
3620 | 295 | throw wexception("wrong size: (%u, %u), should be (%u, %u) like the first frame", | ||
3621 | 296 | image->width(), image->height(), mipmap->frames[0]->width(), | ||
3622 | 297 | mipmap->frames[0]->height()); | ||
3623 | 298 | } | ||
3624 | 299 | mipmap->frames.push_back(image); | ||
3625 | 300 | } | ||
3626 | 301 | |||
3627 | 302 | for (const std::string& filename : mipmap->playercolor_mask_image_files) { | ||
3628 | 303 | // TODO(unknown): Do not load playercolor mask as opengl texture or use it as | ||
3629 | 304 | // opengl texture. | ||
3630 | 305 | const Image* pc_image = g_gr->images().get(filename); | ||
3631 | 306 | if (mipmap->frames[0]->width() != pc_image->width() || | ||
3632 | 307 | mipmap->frames[0]->height() != pc_image->height()) { | ||
3633 | 308 | // TODO(unknown): see bug #1324642 | ||
3634 | 309 | throw wexception("playercolor mask has wrong size: (%u, %u), should " | ||
3635 | 310 | "be (%u, %u) like the animation frame", | ||
3636 | 311 | pc_image->width(), pc_image->height(), mipmap->frames[0]->width(), | ||
3637 | 312 | mipmap->frames[0]->height()); | ||
3638 | 313 | } | ||
3639 | 314 | mipmap->playercolor_mask_frames.push_back(pc_image); | ||
3640 | 315 | } | ||
3641 | 316 | } | ||
3642 | 317 | } | ||
3643 | 318 | |||
3644 | 319 | float NonPackedAnimation::height() const { | 346 | float NonPackedAnimation::height() const { |
3647 | 320 | ensure_graphics_are_loaded(); | 347 | const MipMapEntry& mipmap = *mipmaps_.at(1.0f); |
3648 | 321 | return mipmaps_.at(1.0f)->frames.at(0)->height(); | 348 | mipmap.ensure_graphics_are_loaded(); |
3649 | 349 | return mipmap.frames.front()->height(); | ||
3650 | 322 | } | 350 | } |
3651 | 323 | 351 | ||
3652 | 324 | uint16_t NonPackedAnimation::nr_frames() const { | 352 | uint16_t NonPackedAnimation::nr_frames() const { |
3653 | @@ -368,8 +396,9 @@ | |||
3654 | 368 | } | 396 | } |
3655 | 369 | 397 | ||
3656 | 370 | Rectf NonPackedAnimation::source_rectangle(const int percent_from_bottom, float scale) const { | 398 | Rectf NonPackedAnimation::source_rectangle(const int percent_from_bottom, float scale) const { |
3659 | 371 | ensure_graphics_are_loaded(); | 399 | const MipMapEntry& mipmap = *mipmaps_.at(find_best_scale(scale)); |
3660 | 372 | const Image* first_frame = mipmaps_.at(find_best_scale(scale))->frames.at(0); | 400 | mipmap.ensure_graphics_are_loaded(); |
3661 | 401 | const Image* first_frame = mipmap.frames.front(); | ||
3662 | 373 | const float h = percent_from_bottom * first_frame->height() / 100; | 402 | const float h = percent_from_bottom * first_frame->height() / 100; |
3663 | 374 | // Using floor for pixel perfect positioning | 403 | // Using floor for pixel perfect positioning |
3664 | 375 | return Rectf(0.f, std::floor(first_frame->height() - h), first_frame->width(), h); | 404 | return Rectf(0.f, std::floor(first_frame->height() - h), first_frame->width(), h); |
3665 | @@ -378,7 +407,6 @@ | |||
3666 | 378 | Rectf NonPackedAnimation::destination_rectangle(const Vector2f& position, | 407 | Rectf NonPackedAnimation::destination_rectangle(const Vector2f& position, |
3667 | 379 | const Rectf& source_rect, | 408 | const Rectf& source_rect, |
3668 | 380 | const float scale) const { | 409 | const float scale) const { |
3669 | 381 | ensure_graphics_are_loaded(); | ||
3670 | 382 | const float best_scale = find_best_scale(scale); | 410 | const float best_scale = find_best_scale(scale); |
3671 | 383 | return Rectf(position.x - (hotspot_.x - source_rect.x / best_scale) * scale, | 411 | return Rectf(position.x - (hotspot_.x - source_rect.x / best_scale) * scale, |
3672 | 384 | position.y - (hotspot_.y - source_rect.y / best_scale) * scale, | 412 | position.y - (hotspot_.y - source_rect.y / best_scale) * scale, |
3673 | @@ -390,23 +418,18 @@ | |||
3674 | 390 | const Rectf& source_rect, | 418 | const Rectf& source_rect, |
3675 | 391 | const Rectf& destination_rect, | 419 | const Rectf& destination_rect, |
3676 | 392 | const RGBColor* clr, | 420 | const RGBColor* clr, |
3691 | 393 | Surface* target, | 421 | Surface* target, float scale) const { |
3692 | 394 | float scale) const { | 422 | mipmaps_.at(find_best_scale(scale))->blit(current_frame(time), source_rect, destination_rect, clr, target); |
3679 | 395 | ensure_graphics_are_loaded(); | ||
3680 | 396 | assert(target); | ||
3681 | 397 | const uint32_t idx = current_frame(time); | ||
3682 | 398 | assert(idx < nr_frames()); | ||
3683 | 399 | |||
3684 | 400 | const MipMapEntry& mipmap = *mipmaps_.at(find_best_scale(scale)); | ||
3685 | 401 | if (!mipmap.has_playercolor_masks || clr == nullptr) { | ||
3686 | 402 | target->blit(destination_rect, *mipmap.frames.at(idx), source_rect, 1., BlendMode::UseAlpha); | ||
3687 | 403 | } else { | ||
3688 | 404 | target->blit_blended(destination_rect, *mipmap.frames.at(idx), | ||
3689 | 405 | *mipmap.playercolor_mask_frames.at(idx), source_rect, *clr); | ||
3690 | 406 | } | ||
3693 | 407 | trigger_sound(time, coords); | 423 | trigger_sound(time, coords); |
3694 | 408 | } | 424 | } |
3695 | 409 | 425 | ||
3696 | 426 | void NonPackedAnimation::load_default_scale_and_sounds() const { | ||
3697 | 427 | mipmaps_.at(1.0f)->ensure_graphics_are_loaded(); | ||
3698 | 428 | if (sound_effect_ != kNoSoundEffect && !SoundHandler::is_backend_disabled()) { | ||
3699 | 429 | g_sh->load_fx(SoundType::kAmbient, sound_effect_); | ||
3700 | 430 | } | ||
3701 | 431 | } | ||
3702 | 432 | |||
3703 | 410 | } // namespace | 433 | } // namespace |
3704 | 411 | 434 | ||
3705 | 412 | /* | 435 | /* |
3706 | @@ -434,13 +457,12 @@ | |||
3707 | 434 | 457 | ||
3708 | 435 | ============================================================================== | 458 | ============================================================================== |
3709 | 436 | */ | 459 | */ |
3713 | 437 | 460 | uint32_t AnimationManager::load(const LuaTable& table, const std::string& basename) { | |
3714 | 438 | uint32_t AnimationManager::load(const LuaTable& table) { | 461 | animations_.push_back(std::unique_ptr<Animation>(new NonPackedAnimation(table, basename))); |
3712 | 439 | animations_.push_back(std::unique_ptr<Animation>(new NonPackedAnimation(table))); | ||
3715 | 440 | return animations_.size(); | 462 | return animations_.size(); |
3716 | 441 | } | 463 | } |
3719 | 442 | uint32_t AnimationManager::load(const std::string& map_object_name, const LuaTable& table) { | 464 | uint32_t AnimationManager::load(const std::string& map_object_name, const LuaTable& table, const std::string& basename) { |
3720 | 443 | animations_.push_back(std::unique_ptr<Animation>(new NonPackedAnimation(table))); | 465 | animations_.push_back(std::unique_ptr<Animation>(new NonPackedAnimation(table, basename))); |
3721 | 444 | const size_t result = animations_.size(); | 466 | const size_t result = animations_.size(); |
3722 | 445 | representative_animations_by_map_object_name_.insert(std::make_pair(map_object_name, result)); | 467 | representative_animations_by_map_object_name_.insert(std::make_pair(map_object_name, result)); |
3723 | 446 | return result; | 468 | return result; |
3724 | @@ -448,7 +470,7 @@ | |||
3725 | 448 | 470 | ||
3726 | 449 | const Animation& AnimationManager::get_animation(uint32_t id) const { | 471 | const Animation& AnimationManager::get_animation(uint32_t id) const { |
3727 | 450 | if (!id || id > animations_.size()) | 472 | if (!id || id > animations_.size()) |
3729 | 451 | throw wexception("Requested unknown animation with id: %i", id); | 473 | throw Widelands::GameDataError("Requested unknown animation with id: %i", id); |
3730 | 452 | 474 | ||
3731 | 453 | return *animations_[id - 1]; | 475 | return *animations_[id - 1]; |
3732 | 454 | } | 476 | } |
3733 | 455 | 477 | ||
3734 | === modified file 'src/graphic/animation.h' | |||
3735 | --- src/graphic/animation.h 2019-05-04 09:59:51 +0000 | |||
3736 | +++ src/graphic/animation.h 2019-05-27 14:29:35 +0000 | |||
3737 | @@ -94,8 +94,10 @@ | |||
3738 | 94 | const Rectf& source_rect, | 94 | const Rectf& source_rect, |
3739 | 95 | const Rectf& destination_rect, | 95 | const Rectf& destination_rect, |
3740 | 96 | const RGBColor* clr, | 96 | const RGBColor* clr, |
3743 | 97 | Surface* target, | 97 | Surface* target, float scale) const = 0; |
3744 | 98 | float scale) const = 0; | 98 | |
3745 | 99 | /// Load animation images into memory for default scale. | ||
3746 | 100 | virtual void load_default_scale_and_sounds() const = 0; | ||
3747 | 99 | 101 | ||
3748 | 100 | protected: | 102 | protected: |
3749 | 101 | /// Play the sound effect associated with this animation at the given time. | 103 | /// Play the sound effect associated with this animation at the given time. |
3750 | @@ -118,14 +120,16 @@ | |||
3751 | 118 | /** | 120 | /** |
3752 | 119 | * Loads an animation, graphics sound and everything from a Lua table. | 121 | * Loads an animation, graphics sound and everything from a Lua table. |
3753 | 120 | * | 122 | * |
3754 | 123 | * The 'basename' is the filename prefix for loading the images, e.g. "idle" or "walk_ne". | ||
3755 | 124 | * | ||
3756 | 121 | * The Lua table must contain a table 'pictures' with image paths and a 'hotspot' table. | 125 | * The Lua table must contain a table 'pictures' with image paths and a 'hotspot' table. |
3757 | 122 | * | 126 | * |
3758 | 123 | * Optional parameters in the Lua table are 'fps' and 'sound_effect'. | 127 | * Optional parameters in the Lua table are 'fps' and 'sound_effect'. |
3759 | 124 | */ | 128 | */ |
3761 | 125 | uint32_t load(const LuaTable& table); | 129 | uint32_t load(const LuaTable& table, const std::string& basename); |
3762 | 126 | /// Same as above, but this animation will be used for getting a representative image by map | 130 | /// Same as above, but this animation will be used for getting a representative image by map |
3763 | 127 | /// object name | 131 | /// object name |
3765 | 128 | uint32_t load(const std::string& map_object_name, const LuaTable& table); | 132 | uint32_t load(const std::string& map_object_name, const LuaTable& table, const std::string& basename); |
3766 | 129 | 133 | ||
3767 | 130 | /// Returns the animation with the given ID or throws an exception if it is | 134 | /// Returns the animation with the given ID or throws an exception if it is |
3768 | 131 | /// unknown. | 135 | /// unknown. |
3769 | 132 | 136 | ||
3770 | === modified file 'src/helper.h' | |||
3771 | --- src/helper.h 2019-02-23 11:00:49 +0000 | |||
3772 | +++ src/helper.h 2019-05-27 14:29:35 +0000 | |||
3773 | @@ -41,17 +41,4 @@ | |||
3774 | 41 | /// lines. | 41 | /// lines. |
3775 | 42 | std::vector<std::string> split_string(const std::string&, char const* separators); | 42 | std::vector<std::string> split_string(const std::string&, char const* separators); |
3776 | 43 | 43 | ||
3777 | 44 | // A functional container filtering (by copying the values). Returns a new | ||
3778 | 45 | // ContainerType that contains all values where 'test' returned true. | ||
3779 | 46 | template <typename ContainerType, class UnaryPredicate> | ||
3780 | 47 | ContainerType filter(const ContainerType& container, UnaryPredicate test) { | ||
3781 | 48 | ContainerType filtered; | ||
3782 | 49 | for (const auto& entry : container) { | ||
3783 | 50 | if (!test(entry)) { | ||
3784 | 51 | continue; | ||
3785 | 52 | } | ||
3786 | 53 | filtered.insert(entry); | ||
3787 | 54 | } | ||
3788 | 55 | return filtered; | ||
3789 | 56 | } | ||
3790 | 57 | #endif // end of include guard: WL_HELPER_H | 44 | #endif // end of include guard: WL_HELPER_H |
3791 | 58 | 45 | ||
3792 | === modified file 'src/io/filesystem/disk_filesystem.cc' | |||
3793 | --- src/io/filesystem/disk_filesystem.cc 2019-02-23 11:00:49 +0000 | |||
3794 | +++ src/io/filesystem/disk_filesystem.cc 2019-05-27 14:29:35 +0000 | |||
3795 | @@ -76,7 +76,7 @@ | |||
3796 | 76 | return true; | 76 | return true; |
3797 | 77 | } | 77 | } |
3798 | 78 | 78 | ||
3800 | 79 | std::set<std::string> RealFSImpl::list_directory(const std::string& path) { | 79 | FilenameSet RealFSImpl::list_directory(const std::string& path) const { |
3801 | 80 | #ifdef _WIN32 | 80 | #ifdef _WIN32 |
3802 | 81 | std::string buf; | 81 | std::string buf; |
3803 | 82 | struct _finddata_t c_file; | 82 | struct _finddata_t c_file; |
3804 | @@ -152,7 +152,7 @@ | |||
3805 | 152 | * \e can't exist then) | 152 | * \e can't exist then) |
3806 | 153 | */ | 153 | */ |
3807 | 154 | // TODO(unknown): Can this be rewritten to just using exceptions? Should it? | 154 | // TODO(unknown): Can this be rewritten to just using exceptions? Should it? |
3809 | 155 | bool RealFSImpl::file_exists(const std::string& path) { | 155 | bool RealFSImpl::file_exists(const std::string& path) const { |
3810 | 156 | return FileSystemPath(canonicalize_name(path)).exists_; | 156 | return FileSystemPath(canonicalize_name(path)).exists_; |
3811 | 157 | } | 157 | } |
3812 | 158 | 158 | ||
3813 | 159 | 159 | ||
3814 | === modified file 'src/io/filesystem/disk_filesystem.h' | |||
3815 | --- src/io/filesystem/disk_filesystem.h 2019-02-23 11:00:49 +0000 | |||
3816 | +++ src/io/filesystem/disk_filesystem.h 2019-05-27 14:29:35 +0000 | |||
3817 | @@ -30,10 +30,10 @@ | |||
3818 | 30 | public: | 30 | public: |
3819 | 31 | explicit RealFSImpl(const std::string& Directory); | 31 | explicit RealFSImpl(const std::string& Directory); |
3820 | 32 | 32 | ||
3822 | 33 | std::set<std::string> list_directory(const std::string& path) override; | 33 | FilenameSet list_directory(const std::string& path) const override; |
3823 | 34 | 34 | ||
3824 | 35 | bool is_writable() const override; | 35 | bool is_writable() const override; |
3826 | 36 | bool file_exists(const std::string& path) override; | 36 | bool file_exists(const std::string& path) const override; |
3827 | 37 | bool is_directory(const std::string& path) override; | 37 | bool is_directory(const std::string& path) override; |
3828 | 38 | void ensure_directory_exists(const std::string& fs_dirname) override; | 38 | void ensure_directory_exists(const std::string& fs_dirname) override; |
3829 | 39 | void make_directory(const std::string& fs_dirname) override; | 39 | void make_directory(const std::string& fs_dirname) override; |
3830 | 40 | 40 | ||
3831 | === modified file 'src/io/filesystem/filesystem.cc' | |||
3832 | --- src/io/filesystem/filesystem.cc 2019-03-12 20:55:44 +0000 | |||
3833 | +++ src/io/filesystem/filesystem.cc 2019-05-27 14:29:35 +0000 | |||
3834 | @@ -34,7 +34,9 @@ | |||
3835 | 34 | 34 | ||
3836 | 35 | // We have to add Boost to this block to make codecheck happy | 35 | // We have to add Boost to this block to make codecheck happy |
3837 | 36 | #include <boost/algorithm/string/predicate.hpp> | 36 | #include <boost/algorithm/string/predicate.hpp> |
3838 | 37 | #include <boost/algorithm/string/replace.hpp> | ||
3839 | 37 | #include <boost/format.hpp> | 38 | #include <boost/format.hpp> |
3840 | 39 | #include <boost/lexical_cast.hpp> | ||
3841 | 38 | #ifdef _WIN32 | 40 | #ifdef _WIN32 |
3842 | 39 | #include <direct.h> | 41 | #include <direct.h> |
3843 | 40 | #include <io.h> | 42 | #include <io.h> |
3844 | @@ -81,6 +83,54 @@ | |||
3845 | 81 | const std::vector<std::string> illegal_filename_characters{ | 83 | const std::vector<std::string> illegal_filename_characters{ |
3846 | 82 | "<", ">", ":", "\"", "|", "?", "*", "/", "\\", | 84 | "<", ">", ":", "\"", "|", "?", "*", "/", "\\", |
3847 | 83 | }; | 85 | }; |
3848 | 86 | |||
3849 | 87 | /// A class that makes iteration over filename_?.* templates easy. It is much faster than using regex. | ||
3850 | 88 | class NumberGlob { | ||
3851 | 89 | public: | ||
3852 | 90 | explicit NumberGlob(const std::string& file_template); | ||
3853 | 91 | |||
3854 | 92 | /// If there is a next filename, puts it in 's' and returns true. | ||
3855 | 93 | bool next(std::string* s); | ||
3856 | 94 | |||
3857 | 95 | private: | ||
3858 | 96 | std::string template_; | ||
3859 | 97 | std::string format_; | ||
3860 | 98 | std::string to_replace_; | ||
3861 | 99 | uint32_t current_; | ||
3862 | 100 | uint32_t max_; | ||
3863 | 101 | |||
3864 | 102 | DISALLOW_COPY_AND_ASSIGN(NumberGlob); | ||
3865 | 103 | }; | ||
3866 | 104 | |||
3867 | 105 | /** | ||
3868 | 106 | * Implementation for NumberGlob. | ||
3869 | 107 | */ | ||
3870 | 108 | NumberGlob::NumberGlob(const std::string& file_template) : template_(file_template), current_(0) { | ||
3871 | 109 | int nchars = count(file_template.begin(), file_template.end(), '?'); | ||
3872 | 110 | format_ = "%0" + boost::lexical_cast<std::string>(nchars) + "i"; | ||
3873 | 111 | |||
3874 | 112 | max_ = 1; | ||
3875 | 113 | for (int i = 0; i < nchars; ++i) { | ||
3876 | 114 | max_ *= 10; | ||
3877 | 115 | to_replace_ += "?"; | ||
3878 | 116 | } | ||
3879 | 117 | max_ -= 1; | ||
3880 | 118 | } | ||
3881 | 119 | |||
3882 | 120 | bool NumberGlob::next(std::string* s) { | ||
3883 | 121 | if (current_ > max_) { | ||
3884 | 122 | return false; | ||
3885 | 123 | } | ||
3886 | 124 | |||
3887 | 125 | if (max_) { | ||
3888 | 126 | *s = boost::replace_last_copy( | ||
3889 | 127 | template_, to_replace_, (boost::format(format_) % current_).str()); | ||
3890 | 128 | } else { | ||
3891 | 129 | *s = template_; | ||
3892 | 130 | } | ||
3893 | 131 | ++current_; | ||
3894 | 132 | return true; | ||
3895 | 133 | } | ||
3896 | 84 | } // namespace | 134 | } // namespace |
3897 | 85 | 135 | ||
3898 | 86 | /** | 136 | /** |
3899 | @@ -261,6 +311,37 @@ | |||
3900 | 261 | return homedir; | 311 | return homedir; |
3901 | 262 | } | 312 | } |
3902 | 263 | 313 | ||
3903 | 314 | // Returning a vector rather than a set because animations need the indices | ||
3904 | 315 | std::vector<std::string> FileSystem::get_sequential_files(const std::string& directory, const std::string& basename, const std::string& extension) const { | ||
3905 | 316 | std::vector<std::string> result; | ||
3906 | 317 | |||
3907 | 318 | auto get_files = [this, directory, basename, extension](const std::string& number_template) { | ||
3908 | 319 | std::vector<std::string> files; | ||
3909 | 320 | const std::string filename_template = directory + file_separator() + basename + number_template + "." + extension; | ||
3910 | 321 | |||
3911 | 322 | NumberGlob glob(filename_template); | ||
3912 | 323 | std::string filename; | ||
3913 | 324 | while (glob.next(&filename)) { | ||
3914 | 325 | if (!file_exists(filename)) { | ||
3915 | 326 | break; | ||
3916 | 327 | } | ||
3917 | 328 | files.push_back(filename); | ||
3918 | 329 | } | ||
3919 | 330 | return files; | ||
3920 | 331 | }; | ||
3921 | 332 | result = get_files(""); | ||
3922 | 333 | if (result.empty()) { | ||
3923 | 334 | result = get_files("_?"); | ||
3924 | 335 | } | ||
3925 | 336 | if (result.empty()) { | ||
3926 | 337 | result = get_files("_??"); | ||
3927 | 338 | } | ||
3928 | 339 | if (result.empty()) { | ||
3929 | 340 | result = get_files("_???"); | ||
3930 | 341 | } | ||
3931 | 342 | return result; | ||
3932 | 343 | } | ||
3933 | 344 | |||
3934 | 264 | /** | 345 | /** |
3935 | 265 | * Split a string into components separated by a certain character. | 346 | * Split a string into components separated by a certain character. |
3936 | 266 | * | 347 | * |
3937 | 267 | 348 | ||
3938 | === modified file 'src/io/filesystem/filesystem.h' | |||
3939 | --- src/io/filesystem/filesystem.h 2019-02-23 11:00:49 +0000 | |||
3940 | +++ src/io/filesystem/filesystem.h 2019-05-27 14:29:35 +0000 | |||
3941 | @@ -50,11 +50,11 @@ | |||
3942 | 50 | } | 50 | } |
3943 | 51 | 51 | ||
3944 | 52 | // Returns all files and directories (full path) in the given directory 'directory'. | 52 | // Returns all files and directories (full path) in the given directory 'directory'. |
3946 | 53 | virtual std::set<std::string> list_directory(const std::string& directory) = 0; | 53 | virtual FilenameSet list_directory(const std::string& directory) const = 0; |
3947 | 54 | 54 | ||
3948 | 55 | virtual bool is_writable() const = 0; | 55 | virtual bool is_writable() const = 0; |
3949 | 56 | virtual bool is_directory(const std::string& path) = 0; | 56 | virtual bool is_directory(const std::string& path) = 0; |
3951 | 57 | virtual bool file_exists(const std::string& path) = 0; | 57 | virtual bool file_exists(const std::string& path) const = 0; |
3952 | 58 | 58 | ||
3953 | 59 | virtual void* load(const std::string& fname, size_t& length) = 0; | 59 | virtual void* load(const std::string& fname, size_t& length) = 0; |
3954 | 60 | 60 | ||
3955 | @@ -132,6 +132,24 @@ | |||
3956 | 132 | static std::string filename_without_ext(const char* n); | 132 | static std::string filename_without_ext(const char* n); |
3957 | 133 | static std::string get_homedir(); | 133 | static std::string get_homedir(); |
3958 | 134 | 134 | ||
3959 | 135 | |||
3960 | 136 | /// Return the files in the given 'directory' that match the condition in 'test', i.e. 'test' returned 'true' for their filenames. | ||
3961 | 137 | template <class UnaryPredicate> | ||
3962 | 138 | FilenameSet filter_directory(const std::string& directory, UnaryPredicate test) const { | ||
3963 | 139 | FilenameSet result = list_directory(directory); | ||
3964 | 140 | for (auto it = result.begin(); it != result.end();) { | ||
3965 | 141 | if (!test(*it)) { | ||
3966 | 142 | it = result.erase(it); | ||
3967 | 143 | } else { | ||
3968 | 144 | ++it; | ||
3969 | 145 | } | ||
3970 | 146 | } | ||
3971 | 147 | return result; | ||
3972 | 148 | } | ||
3973 | 149 | |||
3974 | 150 | /// Returns all files in the given 'directory' that match 'basename' followed by 1-3 numbers, followed by '.', followed by 'extension' | ||
3975 | 151 | std::vector<std::string> get_sequential_files(const std::string& directory, const std::string& basename, const std::string& extension) const; | ||
3976 | 152 | |||
3977 | 135 | virtual unsigned long long disk_space() = 0; | 153 | virtual unsigned long long disk_space() = 0; |
3978 | 136 | 154 | ||
3979 | 137 | protected: | 155 | protected: |
3980 | 138 | 156 | ||
3981 | === modified file 'src/io/filesystem/layered_filesystem.cc' | |||
3982 | --- src/io/filesystem/layered_filesystem.cc 2019-02-23 11:00:49 +0000 | |||
3983 | +++ src/io/filesystem/layered_filesystem.cc 2019-05-27 14:29:35 +0000 | |||
3984 | @@ -59,7 +59,7 @@ | |||
3985 | 59 | * | 59 | * |
3986 | 60 | * Returns the number of files found. | 60 | * Returns the number of files found. |
3987 | 61 | */ | 61 | */ |
3989 | 62 | std::set<std::string> LayeredFileSystem::list_directory(const std::string& path) { | 62 | FilenameSet LayeredFileSystem::list_directory(const std::string& path) const { |
3990 | 63 | std::set<std::string> results; | 63 | std::set<std::string> results; |
3991 | 64 | FilenameSet files; | 64 | FilenameSet files; |
3992 | 65 | // Check home system first | 65 | // Check home system first |
3993 | @@ -81,7 +81,7 @@ | |||
3994 | 81 | /** | 81 | /** |
3995 | 82 | * Returns true if the file can be found in at least one of the sub-filesystems | 82 | * Returns true if the file can be found in at least one of the sub-filesystems |
3996 | 83 | */ | 83 | */ |
3998 | 84 | bool LayeredFileSystem::file_exists(const std::string& path) { | 84 | bool LayeredFileSystem::file_exists(const std::string& path) const { |
3999 | 85 | if (home_ && home_->file_exists(path)) | 85 | if (home_ && home_->file_exists(path)) |
4000 | 86 | return true; | 86 | return true; |
4001 | 87 | for (auto it = filesystems_.rbegin(); it != filesystems_.rend(); ++it) | 87 | for (auto it = filesystems_.rbegin(); it != filesystems_.rend(); ++it) |
4002 | 88 | 88 | ||
4003 | === modified file 'src/io/filesystem/layered_filesystem.h' | |||
4004 | --- src/io/filesystem/layered_filesystem.h 2019-02-23 11:00:49 +0000 | |||
4005 | +++ src/io/filesystem/layered_filesystem.h 2019-05-27 14:29:35 +0000 | |||
4006 | @@ -56,10 +56,10 @@ | |||
4007 | 56 | // files). Take ownership of the given filesystem. | 56 | // files). Take ownership of the given filesystem. |
4008 | 57 | void set_home_file_system(FileSystem*); | 57 | void set_home_file_system(FileSystem*); |
4009 | 58 | 58 | ||
4011 | 59 | std::set<std::string> list_directory(const std::string& path) override; | 59 | FilenameSet list_directory(const std::string& path) const override; |
4012 | 60 | 60 | ||
4013 | 61 | bool is_writable() const override; | 61 | bool is_writable() const override; |
4015 | 62 | bool file_exists(const std::string& path) override; | 62 | bool file_exists(const std::string& path) const override; |
4016 | 63 | bool is_directory(const std::string& path) override; | 63 | bool is_directory(const std::string& path) override; |
4017 | 64 | void ensure_directory_exists(const std::string& fs_dirname) override; | 64 | void ensure_directory_exists(const std::string& fs_dirname) override; |
4018 | 65 | void make_directory(const std::string& fs_dirname) override; | 65 | void make_directory(const std::string& fs_dirname) override; |
4019 | 66 | 66 | ||
4020 | === modified file 'src/io/filesystem/zip_filesystem.cc' | |||
4021 | --- src/io/filesystem/zip_filesystem.cc 2019-02-23 11:00:49 +0000 | |||
4022 | +++ src/io/filesystem/zip_filesystem.cc 2019-05-27 14:29:35 +0000 | |||
4023 | @@ -154,7 +154,7 @@ | |||
4024 | 154 | * pathname) in the results. There doesn't seem to be an even remotely | 154 | * pathname) in the results. There doesn't seem to be an even remotely |
4025 | 155 | * cross-platform way of doing this | 155 | * cross-platform way of doing this |
4026 | 156 | */ | 156 | */ |
4028 | 157 | std::set<std::string> ZipFilesystem::list_directory(const std::string& path_in) { | 157 | FilenameSet ZipFilesystem::list_directory(const std::string& path_in) const { |
4029 | 158 | assert(path_in.size()); // prevent invalid read below | 158 | assert(path_in.size()); // prevent invalid read below |
4030 | 159 | 159 | ||
4031 | 160 | std::string path = basedir_in_zip_file_; | 160 | std::string path = basedir_in_zip_file_; |
4032 | @@ -197,7 +197,7 @@ | |||
4033 | 197 | * Returns true if the given file exists, and false if it doesn't. | 197 | * Returns true if the given file exists, and false if it doesn't. |
4034 | 198 | * Also returns false if the pathname is invalid | 198 | * Also returns false if the pathname is invalid |
4035 | 199 | */ | 199 | */ |
4037 | 200 | bool ZipFilesystem::file_exists(const std::string& path) { | 200 | bool ZipFilesystem::file_exists(const std::string& path) const { |
4038 | 201 | try { | 201 | try { |
4039 | 202 | unzGoToFirstFile(zip_file_->read_handle()); | 202 | unzGoToFirstFile(zip_file_->read_handle()); |
4040 | 203 | } catch (...) { | 203 | } catch (...) { |
4041 | 204 | 204 | ||
4042 | === modified file 'src/io/filesystem/zip_filesystem.h' | |||
4043 | --- src/io/filesystem/zip_filesystem.h 2019-02-23 11:00:49 +0000 | |||
4044 | +++ src/io/filesystem/zip_filesystem.h 2019-05-27 14:29:35 +0000 | |||
4045 | @@ -38,10 +38,10 @@ | |||
4046 | 38 | 38 | ||
4047 | 39 | bool is_writable() const override; | 39 | bool is_writable() const override; |
4048 | 40 | 40 | ||
4050 | 41 | std::set<std::string> list_directory(const std::string& path) override; | 41 | FilenameSet list_directory(const std::string& path) const override; |
4051 | 42 | 42 | ||
4052 | 43 | bool is_directory(const std::string& path) override; | 43 | bool is_directory(const std::string& path) override; |
4054 | 44 | bool file_exists(const std::string& path) override; | 44 | bool file_exists(const std::string& path) const override; |
4055 | 45 | 45 | ||
4056 | 46 | void* load(const std::string& fname, size_t& length) override; | 46 | void* load(const std::string& fname, size_t& length) override; |
4057 | 47 | 47 | ||
4058 | 48 | 48 | ||
4059 | === modified file 'src/logic/map_objects/map_object.cc' | |||
4060 | --- src/logic/map_objects/map_object.cc 2019-05-26 17:21:15 +0000 | |||
4061 | +++ src/logic/map_objects/map_object.cc 2019-05-27 14:29:35 +0000 | |||
4062 | @@ -44,6 +44,10 @@ | |||
4063 | 44 | #include "map_io/map_object_loader.h" | 44 | #include "map_io/map_object_loader.h" |
4064 | 45 | #include "map_io/map_object_saver.h" | 45 | #include "map_io/map_object_saver.h" |
4065 | 46 | 46 | ||
4066 | 47 | namespace { | ||
4067 | 48 | char const* const animation_direction_names[6] = {"_ne", "_e", "_se", "_sw", "_w", "_nw"}; | ||
4068 | 49 | } // namespace | ||
4069 | 50 | |||
4070 | 47 | namespace Widelands { | 51 | namespace Widelands { |
4071 | 48 | 52 | ||
4072 | 49 | CmdDestroyMapObject::CmdDestroyMapObject(uint32_t const t, MapObject& o) | 53 | CmdDestroyMapObject::CmdDestroyMapObject(uint32_t const t, MapObject& o) |
4073 | @@ -239,15 +243,7 @@ | |||
4074 | 239 | init_descname, | 243 | init_descname, |
4075 | 240 | table.has_key("helptext_script") ? table.get_string("helptext_script") : "") { | 244 | table.has_key("helptext_script") ? table.get_string("helptext_script") : "") { |
4076 | 241 | if (table.has_key("animations")) { | 245 | if (table.has_key("animations")) { |
4086 | 242 | std::unique_ptr<LuaTable> anims(table.get_table("animations")); | 246 | add_animations(*table.get_table("animations")); |
4078 | 243 | for (const std::string& animation : anims->keys<std::string>()) { | ||
4079 | 244 | if (animation == "idle") { | ||
4080 | 245 | add_animation( | ||
4081 | 246 | animation, g_gr->animations().load(init_name, *anims->get_table(animation))); | ||
4082 | 247 | } else { | ||
4083 | 248 | add_animation(animation, g_gr->animations().load(*anims->get_table(animation))); | ||
4084 | 249 | } | ||
4085 | 250 | } | ||
4087 | 251 | if (!is_animation_known("idle")) { | 247 | if (!is_animation_known("idle")) { |
4088 | 252 | throw GameDataError( | 248 | throw GameDataError( |
4089 | 253 | "Map object %s has animations but no idle animation", init_name.c_str()); | 249 | "Map object %s has animations but no idle animation", init_name.c_str()); |
4090 | @@ -275,20 +271,43 @@ | |||
4091 | 275 | } | 271 | } |
4092 | 276 | 272 | ||
4093 | 277 | /** | 273 | /** |
4095 | 278 | * Add this animation for this map object under this name | 274 | * Add all animations for this map object |
4096 | 279 | */ | 275 | */ |
4102 | 280 | void MapObjectDescr::add_animation(const std::string& animname, uint32_t const anim) { | 276 | void MapObjectDescr::add_animations(const LuaTable& table) { |
4103 | 281 | if (is_animation_known(animname)) { | 277 | for (const std::string& animname : table.keys<std::string>()) { |
4104 | 282 | throw GameDataError("Tried to add already existing animation \"%s\"", animname.c_str()); | 278 | try { |
4105 | 283 | } else { | 279 | std::unique_ptr<LuaTable> anim = table.get_table(animname); |
4106 | 284 | anims_.insert(std::pair<std::string, uint32_t>(animname, anim)); | 280 | // TODO(GunChleoc): Require basename after conversion has been completed |
4107 | 281 | const std::string basename = anim->has_key<std::string>("basename") ? anim->get_string("basename") : ""; | ||
4108 | 282 | const bool is_directional = anim->has_key<std::string>("directional") ? anim->get_bool("directional") : false; | ||
4109 | 283 | if (is_directional) { | ||
4110 | 284 | for (int dir = 1; dir <= 6; ++dir) { | ||
4111 | 285 | const std::string directional_animname = animname + animation_direction_names[dir - 1]; | ||
4112 | 286 | if (is_animation_known(directional_animname)) { | ||
4113 | 287 | throw GameDataError("Tried to add already existing directional animation '%s\'", directional_animname.c_str()); | ||
4114 | 288 | } | ||
4115 | 289 | const std::string directional_basename = basename + animation_direction_names[dir - 1]; | ||
4116 | 290 | anims_.insert(std::pair<std::string, uint32_t>(directional_animname, g_gr->animations().load(*anim, directional_basename))); | ||
4117 | 291 | } | ||
4118 | 292 | } else { | ||
4119 | 293 | if (is_animation_known(animname)) { | ||
4120 | 294 | throw GameDataError("Tried to add already existing animation '%s'", animname.c_str()); | ||
4121 | 295 | } | ||
4122 | 296 | if (animname == "idle") { | ||
4123 | 297 | anims_.insert(std::pair<std::string, uint32_t>(animname, g_gr->animations().load(name_, *anim, basename))); | ||
4124 | 298 | } else { | ||
4125 | 299 | anims_.insert(std::pair<std::string, uint32_t>(animname, g_gr->animations().load(*anim, basename))); | ||
4126 | 300 | } | ||
4127 | 301 | } | ||
4128 | 302 | } catch (const std::exception& e) { | ||
4129 | 303 | throw GameDataError("Error loading animation for map object '%s': %s", name().c_str(), e.what()); | ||
4130 | 304 | } | ||
4131 | 285 | } | 305 | } |
4132 | 286 | } | 306 | } |
4133 | 287 | 307 | ||
4136 | 288 | void MapObjectDescr::add_directional_animation(DirAnimations* anims, const std::string& prefix) { | 308 | void MapObjectDescr::assign_directional_animation(DirAnimations* anims, const std::string& basename) { |
4135 | 289 | static char const* const dirstrings[6] = {"ne", "e", "se", "sw", "w", "nw"}; | ||
4137 | 290 | for (int32_t dir = 1; dir <= 6; ++dir) { | 309 | for (int32_t dir = 1; dir <= 6; ++dir) { |
4139 | 291 | const std::string anim_name = prefix + std::string("_") + dirstrings[dir - 1]; | 310 | const std::string anim_name = basename + animation_direction_names[dir - 1]; |
4140 | 292 | try { | 311 | try { |
4141 | 293 | anims->set_animation(dir, get_animation(anim_name, nullptr)); | 312 | anims->set_animation(dir, get_animation(anim_name, nullptr)); |
4142 | 294 | } catch (const GameDataError& e) { | 313 | } catch (const GameDataError& e) { |
4143 | @@ -318,6 +337,12 @@ | |||
4144 | 318 | NEVER_HERE(); | 337 | NEVER_HERE(); |
4145 | 319 | } | 338 | } |
4146 | 320 | 339 | ||
4147 | 340 | void MapObjectDescr::load_graphics() const { | ||
4148 | 341 | for (const auto& temp_anim : anims_) { | ||
4149 | 342 | g_gr->animations().get_animation(temp_anim.second).load_default_scale_and_sounds(); | ||
4150 | 343 | } | ||
4151 | 344 | } | ||
4152 | 345 | |||
4153 | 321 | const Image* MapObjectDescr::representative_image(const RGBColor* player_color) const { | 346 | const Image* MapObjectDescr::representative_image(const RGBColor* player_color) const { |
4154 | 322 | if (is_animation_known("idle")) { | 347 | if (is_animation_known("idle")) { |
4155 | 323 | return g_gr->animations().get_representative_image( | 348 | return g_gr->animations().get_representative_image( |
4156 | @@ -639,8 +664,12 @@ | |||
4157 | 639 | * configured. | 664 | * configured. |
4158 | 640 | * | 665 | * |
4159 | 641 | * Derived functions must call ancestor's function in the appropriate place. | 666 | * Derived functions must call ancestor's function in the appropriate place. |
4160 | 667 | * | ||
4161 | 668 | * We also preload some animation graphics here to prevent jitter at game start. | ||
4162 | 642 | */ | 669 | */ |
4163 | 643 | void MapObject::Loader::load_finish() { | 670 | void MapObject::Loader::load_finish() { |
4164 | 671 | MapObject& mo = get<MapObject>(); | ||
4165 | 672 | mo.descr().load_graphics(); | ||
4166 | 644 | } | 673 | } |
4167 | 645 | 674 | ||
4168 | 646 | /** | 675 | /** |
4169 | 647 | 676 | ||
4170 | === modified file 'src/logic/map_objects/map_object.h' | |||
4171 | --- src/logic/map_objects/map_object.h 2019-05-11 13:48:12 +0000 | |||
4172 | +++ src/logic/map_objects/map_object.h 2019-05-27 14:29:35 +0000 | |||
4173 | @@ -129,11 +129,9 @@ | |||
4174 | 129 | std::string get_animation_name(uint32_t) const; ///< needed for save, debug | 129 | std::string get_animation_name(uint32_t) const; ///< needed for save, debug |
4175 | 130 | 130 | ||
4176 | 131 | bool is_animation_known(const std::string& name) const; | 131 | bool is_animation_known(const std::string& name) const; |
4177 | 132 | void add_animation(const std::string& name, uint32_t anim); | ||
4178 | 133 | 132 | ||
4182 | 134 | /// Sets the directional animations in 'anims' with the animations | 133 | /// Preload animation graphics at default scale |
4183 | 135 | /// '<prefix>_(ne|e|se|sw|w|nw)'. | 134 | void load_graphics() const; |
4181 | 136 | void add_directional_animation(DirAnimations* anims, const std::string& prefix); | ||
4184 | 137 | 135 | ||
4185 | 138 | /// Returns the image for the first frame of the idle animation if the MapObject has animations, | 136 | /// Returns the image for the first frame of the idle animation if the MapObject has animations, |
4186 | 139 | /// nullptr otherwise | 137 | /// nullptr otherwise |
4187 | @@ -154,7 +152,13 @@ | |||
4188 | 154 | const std::set<uint32_t>& allowed_special); | 152 | const std::set<uint32_t>& allowed_special); |
4189 | 155 | void add_attribute(uint32_t attr); | 153 | void add_attribute(uint32_t attr); |
4190 | 156 | 154 | ||
4191 | 155 | /// Sets the directional animations in 'anims' with the animations | ||
4192 | 156 | /// '<basename>_(ne|e|se|sw|w|nw)'. | ||
4193 | 157 | void assign_directional_animation(DirAnimations* anims, const std::string& basename); | ||
4194 | 158 | |||
4195 | 157 | private: | 159 | private: |
4196 | 160 | void add_animations(const LuaTable& table); | ||
4197 | 161 | |||
4198 | 158 | /// Throws an exception if the MapObjectDescr has no representative image | 162 | /// Throws an exception if the MapObjectDescr has no representative image |
4199 | 159 | void check_representative_image(); | 163 | void check_representative_image(); |
4200 | 160 | 164 | ||
4201 | 161 | 165 | ||
4202 | === modified file 'src/logic/map_objects/tribes/ship.cc' | |||
4203 | --- src/logic/map_objects/tribes/ship.cc 2019-05-27 05:37:03 +0000 | |||
4204 | +++ src/logic/map_objects/tribes/ship.cc 2019-05-27 14:29:35 +0000 | |||
4205 | @@ -114,7 +114,7 @@ | |||
4206 | 114 | i18n::Textdomain td("tribes"); | 114 | i18n::Textdomain td("tribes"); |
4207 | 115 | 115 | ||
4208 | 116 | // Read the sailing animations | 116 | // Read the sailing animations |
4210 | 117 | add_directional_animation(&sail_anims_, "sail"); | 117 | assign_directional_animation(&sail_anims_, "sail"); |
4211 | 118 | 118 | ||
4212 | 119 | capacity_ = table.has_key("capacity") ? table.get_int("capacity") : 20; | 119 | capacity_ = table.has_key("capacity") ? table.get_int("capacity") : 20; |
4213 | 120 | } | 120 | } |
4214 | 121 | 121 | ||
4215 | === modified file 'src/logic/map_objects/tribes/tribe_descr.cc' | |||
4216 | --- src/logic/map_objects/tribes/tribe_descr.cc 2019-05-18 13:33:00 +0000 | |||
4217 | +++ src/logic/map_objects/tribes/tribe_descr.cc 2019-05-27 14:29:35 +0000 | |||
4218 | @@ -63,10 +63,12 @@ | |||
4219 | 63 | initializations_ = info.initializations; | 63 | initializations_ = info.initializations; |
4220 | 64 | 64 | ||
4221 | 65 | std::unique_ptr<LuaTable> items_table = table.get_table("animations"); | 65 | std::unique_ptr<LuaTable> items_table = table.get_table("animations"); |
4226 | 66 | frontier_animation_id_ = g_gr->animations().load( | 66 | { |
4227 | 67 | name_ + std::string("_frontier"), *items_table->get_table("frontier")); | 67 | std::unique_ptr<LuaTable> animations_table = items_table->get_table("frontier"); |
4228 | 68 | flag_animation_id_ = | 68 | frontier_animation_id_ = g_gr->animations().load(name_ + std::string("_frontier"), *animations_table, animations_table->get_string("basename")); |
4229 | 69 | g_gr->animations().load(name_ + std::string("_flag"), *items_table->get_table("flag")); | 69 | animations_table = items_table->get_table("flag"); |
4230 | 70 | flag_animation_id_ = g_gr->animations().load(name_ + std::string("_frontier"), *animations_table, animations_table->get_string("basename")); | ||
4231 | 71 | } | ||
4232 | 70 | 72 | ||
4233 | 71 | items_table = table.get_table("roads"); | 73 | items_table = table.get_table("roads"); |
4234 | 72 | const auto load_roads = [&items_table]( | 74 | const auto load_roads = [&items_table]( |
4235 | 73 | 75 | ||
4236 | === modified file 'src/logic/map_objects/tribes/worker_descr.cc' | |||
4237 | --- src/logic/map_objects/tribes/worker_descr.cc 2019-05-22 11:23:14 +0000 | |||
4238 | +++ src/logic/map_objects/tribes/worker_descr.cc 2019-05-27 14:29:35 +0000 | |||
4239 | @@ -92,13 +92,13 @@ | |||
4240 | 92 | } | 92 | } |
4241 | 93 | 93 | ||
4242 | 94 | // Read the walking animations | 94 | // Read the walking animations |
4244 | 95 | add_directional_animation(&walk_anims_, "walk"); | 95 | assign_directional_animation(&walk_anims_, "walk"); |
4245 | 96 | 96 | ||
4246 | 97 | // Many workers don't carry wares, so they have no walkload animation. | 97 | // Many workers don't carry wares, so they have no walkload animation. |
4247 | 98 | std::unique_ptr<LuaTable> anims(table.get_table("animations")); | 98 | std::unique_ptr<LuaTable> anims(table.get_table("animations")); |
4248 | 99 | anims->do_not_warn_about_unaccessed_keys(); | 99 | anims->do_not_warn_about_unaccessed_keys(); |
4251 | 100 | if (anims->has_key("walkload_e")) { | 100 | if (is_animation_known("walkload_e")) { |
4252 | 101 | add_directional_animation(&walkload_anims_, "walkload"); | 101 | assign_directional_animation(&walkload_anims_, "walkload"); |
4253 | 102 | } | 102 | } |
4254 | 103 | 103 | ||
4255 | 104 | // Read programs | 104 | // Read programs |
4256 | 105 | 105 | ||
4257 | === modified file 'src/logic/map_objects/world/critter.cc' | |||
4258 | --- src/logic/map_objects/world/critter.cc 2019-04-26 12:46:40 +0000 | |||
4259 | +++ src/logic/map_objects/world/critter.cc 2019-05-27 14:29:35 +0000 | |||
4260 | @@ -101,7 +101,7 @@ | |||
4261 | 101 | const World& world) | 101 | const World& world) |
4262 | 102 | : BobDescr(init_descname, MapObjectType::CRITTER, MapObjectDescr::OwnerType::kWorld, table), | 102 | : BobDescr(init_descname, MapObjectType::CRITTER, MapObjectDescr::OwnerType::kWorld, table), |
4263 | 103 | editor_category_(nullptr) { | 103 | editor_category_(nullptr) { |
4265 | 104 | add_directional_animation(&walk_anims_, "walk"); | 104 | assign_directional_animation(&walk_anims_, "walk"); |
4266 | 105 | 105 | ||
4267 | 106 | add_attributes( | 106 | add_attributes( |
4268 | 107 | table.get_table("attributes")->array_entries<std::string>(), std::set<uint32_t>()); | 107 | table.get_table("attributes")->array_entries<std::string>(), std::set<uint32_t>()); |
4269 | 108 | 108 | ||
4270 | === modified file 'src/map_io/CMakeLists.txt' | |||
4271 | --- src/map_io/CMakeLists.txt 2019-05-05 18:53:14 +0000 | |||
4272 | +++ src/map_io/CMakeLists.txt 2019-05-27 14:29:35 +0000 | |||
4273 | @@ -103,7 +103,6 @@ | |||
4274 | 103 | graphic_minimap_renderer | 103 | graphic_minimap_renderer |
4275 | 104 | graphic_playercolor | 104 | graphic_playercolor |
4276 | 105 | graphic_surface | 105 | graphic_surface |
4277 | 106 | helper | ||
4278 | 107 | io_fileread | 106 | io_fileread |
4279 | 108 | io_filesystem | 107 | io_filesystem |
4280 | 109 | logic | 108 | logic |
4281 | 110 | 109 | ||
4282 | === modified file 'src/map_io/map_scripting_packet.cc' | |||
4283 | --- src/map_io/map_scripting_packet.cc 2019-02-23 11:00:49 +0000 | |||
4284 | +++ src/map_io/map_scripting_packet.cc 2019-05-27 14:29:35 +0000 | |||
4285 | @@ -24,7 +24,6 @@ | |||
4286 | 24 | #include <boost/algorithm/string/predicate.hpp> | 24 | #include <boost/algorithm/string/predicate.hpp> |
4287 | 25 | 25 | ||
4288 | 26 | #include "base/macros.h" | 26 | #include "base/macros.h" |
4289 | 27 | #include "helper.h" | ||
4290 | 28 | #include "io/fileread.h" | 27 | #include "io/fileread.h" |
4291 | 29 | #include "io/filewrite.h" | 28 | #include "io/filewrite.h" |
4292 | 30 | #include "logic/editor_game_base.h" | 29 | #include "logic/editor_game_base.h" |
4293 | @@ -43,7 +42,7 @@ | |||
4294 | 43 | void write_lua_dir(FileSystem& target_fs, FileSystem* map_fs, const std::string& path) { | 42 | void write_lua_dir(FileSystem& target_fs, FileSystem* map_fs, const std::string& path) { |
4295 | 44 | assert(map_fs); | 43 | assert(map_fs); |
4296 | 45 | target_fs.ensure_directory_exists(path); | 44 | target_fs.ensure_directory_exists(path); |
4298 | 46 | for (const std::string& script : filter(map_fs->list_directory(path), [](const std::string& fn) { | 45 | for (const std::string& script : map_fs->filter_directory(path, [](const std::string& fn) { |
4299 | 47 | return boost::ends_with(fn, ".lua"); | 46 | return boost::ends_with(fn, ".lua"); |
4300 | 48 | })) { | 47 | })) { |
4301 | 49 | size_t length; | 48 | size_t length; |
4302 | 50 | 49 | ||
4303 | === modified file 'src/scripting/lua_path.cc' | |||
4304 | --- src/scripting/lua_path.cc 2019-02-23 11:00:49 +0000 | |||
4305 | +++ src/scripting/lua_path.cc 2019-05-27 14:29:35 +0000 | |||
4306 | @@ -30,6 +30,8 @@ | |||
4307 | 30 | namespace { | 30 | namespace { |
4308 | 31 | 31 | ||
4309 | 32 | /// A class that makes iteration over filename_?.png templates easy. | 32 | /// A class that makes iteration over filename_?.png templates easy. |
4310 | 33 | // TODO(GunChleoc): Code duplication with g_fs->get_sequential_files. | ||
4311 | 34 | // Get rid of this and list_files when conversion to spritemaps has been done. | ||
4312 | 33 | class NumberGlob { | 35 | class NumberGlob { |
4313 | 34 | public: | 36 | public: |
4314 | 35 | explicit NumberGlob(const std::string& file_template); | 37 | explicit NumberGlob(const std::string& file_template); |
4315 | @@ -132,10 +134,11 @@ | |||
4316 | 132 | /* RST | 134 | /* RST |
4317 | 133 | .. function:: list_files(filename_template) | 135 | .. function:: list_files(filename_template) |
4318 | 134 | 136 | ||
4320 | 135 | Lists the full path for all files that fit the template pattern. | 137 | **DEPRECATED**. Lists the full path for all files that fit the template pattern. |
4321 | 136 | Use ? as placeholders for numbers, e.g. 'directory/idle\_??.png' will list | 138 | Use ? as placeholders for numbers, e.g. 'directory/idle\_??.png' will list |
4322 | 137 | 'directory/idle_00.png', 'directory/idle_01.png' etc, and | 139 | 'directory/idle_00.png', 'directory/idle_01.png' etc, and |
4323 | 138 | 'directory/idle.png' will just list 'directory/idle.png'. | 140 | 'directory/idle.png' will just list 'directory/idle.png'. |
4324 | 141 | Lua Tables need lots of memory, so only use this when you have to. | ||
4325 | 139 | 142 | ||
4326 | 140 | :type filename_template: class:`string` | 143 | :type filename_template: class:`string` |
4327 | 141 | :arg filename_template: The filename template to use for the listing. | 144 | :arg filename_template: The filename template to use for the listing. |
4328 | @@ -165,6 +168,7 @@ | |||
4329 | 165 | .. function:: list_directory(filename) | 168 | .. function:: list_directory(filename) |
4330 | 166 | 169 | ||
4331 | 167 | Returns all file names contained in the given directory. | 170 | Returns all file names contained in the given directory. |
4332 | 171 | Lua Tables need lots of memory, so only use this when you have to. | ||
4333 | 168 | 172 | ||
4334 | 169 | :type filename: class:`string` | 173 | :type filename: class:`string` |
4335 | 170 | :arg filename: The directory to read. | 174 | :arg filename: The directory to read. |
4336 | 171 | 175 | ||
4337 | === modified file 'src/sound/fxset.cc' | |||
4338 | --- src/sound/fxset.cc 2019-04-24 06:01:37 +0000 | |||
4339 | +++ src/sound/fxset.cc 2019-05-27 14:29:35 +0000 | |||
4340 | @@ -36,25 +36,15 @@ | |||
4341 | 36 | * \param random: Randomize the time last played a bit to prevent sound onslaught at game start | 36 | * \param random: Randomize the time last played a bit to prevent sound onslaught at game start |
4342 | 37 | */ | 37 | */ |
4343 | 38 | FXset::FXset(const std::string& path, uint32_t random) : last_used_(random % 2000) { | 38 | FXset::FXset(const std::string& path, uint32_t random) : last_used_(random % 2000) { |
4357 | 39 | // Check directory | 39 | const std::string dirname = FileSystem::fs_dirname(path.c_str()); |
4358 | 40 | std::string directory = FileSystem::fs_dirname(path); | 40 | const std::string basename = FileSystem::fs_filename(path.c_str()); |
4359 | 41 | if (!g_fs->is_directory(directory)) { | 41 | paths_ = g_fs->get_sequential_files(dirname, basename, "ogg"); |
4347 | 42 | throw Widelands::GameDataError( | ||
4348 | 43 | "SoundHandler: Can't load files from %s, not a directory!", directory.c_str()); | ||
4349 | 44 | } | ||
4350 | 45 | |||
4351 | 46 | // Find files | ||
4352 | 47 | std::string base_filename = FileSystem::fs_filename(path.c_str()); | ||
4353 | 48 | boost::regex re(base_filename + "_\\d+\\.ogg"); | ||
4354 | 49 | paths_ = filter(g_fs->list_directory(directory), [&re](const std::string& fn) { | ||
4355 | 50 | return boost::regex_match(FileSystem::fs_filename(fn.c_str()), re); | ||
4356 | 51 | }); | ||
4360 | 52 | 42 | ||
4361 | 53 | // Ensure that we have at least 1 file | 43 | // Ensure that we have at least 1 file |
4362 | 54 | if (paths_.empty()) { | 44 | if (paths_.empty()) { |
4363 | 55 | throw Widelands::GameDataError( | 45 | throw Widelands::GameDataError( |
4364 | 56 | "FXset: No files matching the pattern '%s_<numbers>.ogg' found in directory %s\n", | 46 | "FXset: No files matching the pattern '%s_<numbers>.ogg' found in directory %s\n", |
4366 | 57 | base_filename.c_str(), directory.c_str()); | 47 | basename.c_str(), dirname.c_str()); |
4367 | 58 | } | 48 | } |
4368 | 59 | 49 | ||
4369 | 60 | #ifndef NDEBUG | 50 | #ifndef NDEBUG |
4370 | @@ -81,7 +71,7 @@ | |||
4371 | 81 | return SDL_GetTicks() - last_used_; | 71 | return SDL_GetTicks() - last_used_; |
4372 | 82 | } | 72 | } |
4373 | 83 | 73 | ||
4375 | 84 | Mix_Chunk* FXset::get_fx(uint32_t random) { | 74 | void FXset::load_sound_files() { |
4376 | 85 | if (!paths_.empty()) { | 75 | if (!paths_.empty()) { |
4377 | 86 | // Load sounds from paths if this FX hasn't been played yet | 76 | // Load sounds from paths if this FX hasn't been played yet |
4378 | 87 | for (const std::string& path : paths_) { | 77 | for (const std::string& path : paths_) { |
4379 | @@ -91,8 +81,11 @@ | |||
4380 | 91 | // We don't need the paths any more | 81 | // We don't need the paths any more |
4381 | 92 | paths_.clear(); | 82 | paths_.clear(); |
4382 | 93 | } | 83 | } |
4383 | 94 | |||
4384 | 95 | assert(paths_.empty()); | 84 | assert(paths_.empty()); |
4385 | 85 | } | ||
4386 | 86 | |||
4387 | 87 | Mix_Chunk* FXset::get_fx(uint32_t random) { | ||
4388 | 88 | load_sound_files(); | ||
4389 | 96 | 89 | ||
4390 | 97 | if (fxs_.empty()) { | 90 | if (fxs_.empty()) { |
4391 | 98 | return nullptr; | 91 | return nullptr; |
4392 | 99 | 92 | ||
4393 | === modified file 'src/sound/fxset.h' | |||
4394 | --- src/sound/fxset.h 2019-04-24 06:01:37 +0000 | |||
4395 | +++ src/sound/fxset.h 2019-05-27 14:29:35 +0000 | |||
4396 | @@ -20,7 +20,6 @@ | |||
4397 | 20 | #ifndef WL_SOUND_FXSET_H | 20 | #ifndef WL_SOUND_FXSET_H |
4398 | 21 | #define WL_SOUND_FXSET_H | 21 | #define WL_SOUND_FXSET_H |
4399 | 22 | 22 | ||
4400 | 23 | #include <set> | ||
4401 | 24 | #include <string> | 23 | #include <string> |
4402 | 25 | #include <vector> | 24 | #include <vector> |
4403 | 26 | 25 | ||
4404 | @@ -49,6 +48,9 @@ | |||
4405 | 49 | */ | 48 | */ |
4406 | 50 | Mix_Chunk* get_fx(uint32_t random); | 49 | Mix_Chunk* get_fx(uint32_t random); |
4407 | 51 | 50 | ||
4408 | 51 | /// Load the sound files into memory | ||
4409 | 52 | void load_sound_files(); | ||
4410 | 53 | |||
4411 | 52 | private: | 54 | private: |
4412 | 53 | /** Load an audio file into memory. | 55 | /** Load an audio file into memory. |
4413 | 54 | * \param path the effect to be loaded | 56 | * \param path the effect to be loaded |
4414 | @@ -69,7 +71,7 @@ | |||
4415 | 69 | * This will be cleared when the effects have been loaded into memory by \ref get_fx on first | 71 | * This will be cleared when the effects have been loaded into memory by \ref get_fx on first |
4416 | 70 | * play. | 72 | * play. |
4417 | 71 | */ | 73 | */ |
4419 | 72 | std::set<std::string> paths_; | 74 | std::vector<std::string> paths_; |
4420 | 73 | 75 | ||
4421 | 74 | /// The collection of sound effects, to be loaded on demand | 76 | /// The collection of sound effects, to be loaded on demand |
4422 | 75 | std::vector<Mix_Chunk*> fxs_; | 77 | std::vector<Mix_Chunk*> fxs_; |
4423 | 76 | 78 | ||
4424 | === modified file 'src/sound/songset.cc' | |||
4425 | --- src/sound/songset.cc 2019-04-24 06:01:37 +0000 | |||
4426 | +++ src/sound/songset.cc 2019-05-27 14:29:35 +0000 | |||
4427 | @@ -33,11 +33,7 @@ | |||
4428 | 33 | Songset::Songset(const std::string& dir, const std::string& basename) | 33 | Songset::Songset(const std::string& dir, const std::string& basename) |
4429 | 34 | : m_(nullptr), rwops_(nullptr) { | 34 | : m_(nullptr), rwops_(nullptr) { |
4430 | 35 | assert(g_fs); | 35 | assert(g_fs); |
4436 | 36 | FilenameSet files = filter(g_fs->list_directory(dir), [&basename](const std::string& fn) { | 36 | std::vector<std::string> files = g_fs->get_sequential_files(dir, basename, "ogg"); |
4432 | 37 | const std::string only_filename = FileSystem::fs_filename(fn.c_str()); | ||
4433 | 38 | return boost::starts_with(only_filename, basename) && boost::ends_with(only_filename, ".ogg"); | ||
4434 | 39 | }); | ||
4435 | 40 | |||
4437 | 41 | for (const std::string& filename : files) { | 37 | for (const std::string& filename : files) { |
4438 | 42 | assert(!g_fs->is_directory(filename)); | 38 | assert(!g_fs->is_directory(filename)); |
4439 | 43 | add_song(filename); | 39 | add_song(filename); |
4440 | 44 | 40 | ||
4441 | === modified file 'src/sound/sound_handler.cc' | |||
4442 | --- src/sound/sound_handler.cc 2019-04-24 06:01:37 +0000 | |||
4443 | +++ src/sound/sound_handler.cc 2019-05-27 14:29:35 +0000 | |||
4444 | @@ -412,6 +412,10 @@ | |||
4445 | 412 | } | 412 | } |
4446 | 413 | } | 413 | } |
4447 | 414 | 414 | ||
4448 | 415 | void SoundHandler::load_fx(SoundType type, FxId id) { | ||
4449 | 416 | fxs_[type][id]->load_sound_files(); | ||
4450 | 417 | } | ||
4451 | 418 | |||
4452 | 415 | /// Removes the given FXset from memory | 419 | /// Removes the given FXset from memory |
4453 | 416 | void SoundHandler::remove_fx_set(SoundType type) { | 420 | void SoundHandler::remove_fx_set(SoundType type) { |
4454 | 417 | fxs_.erase(type); | 421 | fxs_.erase(type); |
4455 | 418 | 422 | ||
4456 | === modified file 'src/sound/sound_handler.h' | |||
4457 | --- src/sound/sound_handler.h 2019-04-24 06:01:37 +0000 | |||
4458 | +++ src/sound/sound_handler.h 2019-05-27 14:29:35 +0000 | |||
4459 | @@ -180,6 +180,8 @@ | |||
4460 | 180 | uint8_t priority = kFxPriorityAlwaysPlay, | 180 | uint8_t priority = kFxPriorityAlwaysPlay, |
4461 | 181 | int32_t stereo_position = kStereoCenter, | 181 | int32_t stereo_position = kStereoCenter, |
4462 | 182 | int distance = 0); | 182 | int distance = 0); |
4463 | 183 | // Trigger loading of the sound files for the given effect. | ||
4464 | 184 | void load_fx(SoundType type, FxId id); | ||
4465 | 183 | void remove_fx_set(SoundType type); | 185 | void remove_fx_set(SoundType type); |
4466 | 184 | 186 | ||
4467 | 185 | void register_songs(const std::string& dir, const std::string& basename); | 187 | void register_songs(const std::string& dir, const std::string& basename); |
4468 | 186 | 188 | ||
4469 | === modified file 'src/wlapplication.cc' | |||
4470 | --- src/wlapplication.cc 2019-05-13 06:04:34 +0000 | |||
4471 | +++ src/wlapplication.cc 2019-05-27 14:29:35 +0000 | |||
4472 | @@ -55,7 +55,6 @@ | |||
4473 | 55 | #include "graphic/default_resolution.h" | 55 | #include "graphic/default_resolution.h" |
4474 | 56 | #include "graphic/font_handler.h" | 56 | #include "graphic/font_handler.h" |
4475 | 57 | #include "graphic/text/font_set.h" | 57 | #include "graphic/text/font_set.h" |
4476 | 58 | #include "helper.h" | ||
4477 | 59 | #include "io/filesystem/disk_filesystem.h" | 58 | #include "io/filesystem/disk_filesystem.h" |
4478 | 60 | #include "io/filesystem/filesystem_exceptions.h" | 59 | #include "io/filesystem/filesystem_exceptions.h" |
4479 | 61 | #include "io/filesystem/layered_filesystem.h" | 60 | #include "io/filesystem/layered_filesystem.h" |
4480 | @@ -1500,7 +1499,7 @@ | |||
4481 | 1500 | */ | 1499 | */ |
4482 | 1501 | void WLApplication::cleanup_replays() { | 1500 | void WLApplication::cleanup_replays() { |
4483 | 1502 | for (const std::string& filename : | 1501 | for (const std::string& filename : |
4485 | 1503 | filter(g_fs->list_directory(kReplayDir), [](const std::string& fn) { | 1502 | g_fs->filter_directory(kReplayDir, [](const std::string& fn) { |
4486 | 1504 | return boost::ends_with( | 1503 | return boost::ends_with( |
4487 | 1505 | fn, (boost::format("%s%s") % kReplayExtension % kSyncstreamExtension).str()); | 1504 | fn, (boost::format("%s%s") % kReplayExtension % kSyncstreamExtension).str()); |
4488 | 1506 | })) { | 1505 | })) { |
4489 | @@ -1521,7 +1520,7 @@ | |||
4490 | 1521 | */ | 1520 | */ |
4491 | 1522 | void WLApplication::cleanup_ai_files() { | 1521 | void WLApplication::cleanup_ai_files() { |
4492 | 1523 | for (const std::string& filename : | 1522 | for (const std::string& filename : |
4494 | 1524 | filter(g_fs->list_directory(kAiDir), [](const std::string& fn) { | 1523 | g_fs->filter_directory(kAiDir, [](const std::string& fn) { |
4495 | 1525 | return boost::ends_with(fn, kAiExtension) || boost::contains(fn, "ai_player"); | 1524 | return boost::ends_with(fn, kAiExtension) || boost::contains(fn, "ai_player"); |
4496 | 1526 | })) { | 1525 | })) { |
4497 | 1527 | if (is_autogenerated_and_expired(filename, kAIFilesKeepAroundTime)) { | 1526 | if (is_autogenerated_and_expired(filename, kAIFilesKeepAroundTime)) { |
4498 | @@ -1541,7 +1540,7 @@ | |||
4499 | 1541 | */ | 1540 | */ |
4500 | 1542 | void WLApplication::cleanup_temp_files() { | 1541 | void WLApplication::cleanup_temp_files() { |
4501 | 1543 | for (const std::string& filename : | 1542 | for (const std::string& filename : |
4503 | 1544 | filter(g_fs->list_directory(kTempFileDir), | 1543 | g_fs->filter_directory(kTempFileDir, |
4504 | 1545 | [](const std::string& fn) { return boost::ends_with(fn, kTempFileExtension); })) { | 1544 | [](const std::string& fn) { return boost::ends_with(fn, kTempFileExtension); })) { |
4505 | 1546 | if (is_autogenerated_and_expired(filename, kTempFilesKeepAroundTime)) { | 1545 | if (is_autogenerated_and_expired(filename, kTempFilesKeepAroundTime)) { |
4506 | 1547 | log("Deleting old temp file: %s\n", filename.c_str()); | 1546 | log("Deleting old temp file: %s\n", filename.c_str()); |
4507 | @@ -1559,7 +1558,7 @@ | |||
4508 | 1559 | * Recursively delete temporary backup files in a given directory | 1558 | * Recursively delete temporary backup files in a given directory |
4509 | 1560 | */ | 1559 | */ |
4510 | 1561 | void WLApplication::cleanup_temp_backups(std::string dir) { | 1560 | void WLApplication::cleanup_temp_backups(std::string dir) { |
4512 | 1562 | for (const std::string& filename : filter(g_fs->list_directory(dir), [](const std::string& fn) { | 1561 | for (const std::string& filename : g_fs->filter_directory(dir, [](const std::string& fn) { |
4513 | 1563 | return boost::ends_with(fn, kTempBackupExtension); | 1562 | return boost::ends_with(fn, kTempBackupExtension); |
4514 | 1564 | })) { | 1563 | })) { |
4515 | 1565 | if (is_autogenerated_and_expired(filename, kTempBackupsKeepAroundTime)) { | 1564 | if (is_autogenerated_and_expired(filename, kTempBackupsKeepAroundTime)) { |
4516 | @@ -1573,7 +1572,7 @@ | |||
4517 | 1573 | } | 1572 | } |
4518 | 1574 | } | 1573 | } |
4519 | 1575 | // recursively delete in subdirs | 1574 | // recursively delete in subdirs |
4521 | 1576 | for (const std::string& dirname : filter(g_fs->list_directory(dir), [](const std::string& fn) { | 1575 | for (const std::string& dirname : g_fs->filter_directory(dir, [](const std::string& fn) { |
4522 | 1577 | return g_fs->is_directory(fn) && | 1576 | return g_fs->is_directory(fn) && |
4523 | 1578 | // avoid searching within savegames/maps/backups that were created | 1577 | // avoid searching within savegames/maps/backups that were created |
4524 | 1579 | // as directories instead of zipfiles | 1578 | // as directories instead of zipfiles |
4525 | 1580 | 1579 | ||
4526 | === modified file 'src/wui/load_or_save_game.cc' | |||
4527 | --- src/wui/load_or_save_game.cc 2019-05-26 17:21:15 +0000 | |||
4528 | +++ src/wui/load_or_save_game.cc 2019-05-27 14:29:35 +0000 | |||
4529 | @@ -367,16 +367,15 @@ | |||
4530 | 367 | table_.clear(); | 367 | table_.clear(); |
4531 | 368 | 368 | ||
4532 | 369 | FilenameSet gamefiles; | 369 | FilenameSet gamefiles; |
4533 | 370 | |||
4534 | 371 | if (filetype_ == FileType::kReplay) { | 370 | if (filetype_ == FileType::kReplay) { |
4536 | 372 | gamefiles = filter(g_fs->list_directory(kReplayDir), [](const std::string& fn) { | 371 | gamefiles = g_fs->filter_directory(kReplayDir, [](const std::string& fn) { |
4537 | 373 | return boost::algorithm::ends_with(fn, kReplayExtension); | 372 | return boost::algorithm::ends_with(fn, kReplayExtension); |
4538 | 374 | }); | 373 | }); |
4539 | 375 | // Update description column title for replays | 374 | // Update description column title for replays |
4540 | 376 | table_.set_column_tooltip(2, show_filenames_ ? _("Filename: Map name (start of replay)") : | 375 | table_.set_column_tooltip(2, show_filenames_ ? _("Filename: Map name (start of replay)") : |
4541 | 377 | _("Map name (start of replay)")); | 376 | _("Map name (start of replay)")); |
4542 | 378 | } else { | 377 | } else { |
4544 | 379 | gamefiles = filter(g_fs->list_directory(kSaveDir), [](const std::string& fn) { | 378 | gamefiles = g_fs->filter_directory(kSaveDir, [](const std::string& fn) { |
4545 | 380 | return boost::algorithm::ends_with(fn, kSavegameExtension); | 379 | return boost::algorithm::ends_with(fn, kSavegameExtension); |
4546 | 381 | }); | 380 | }); |
4547 | 382 | } | 381 | } |
Continuous integration builds have changed state:
Travis build 4826. State: failed. Details: https:/ /travis- ci.org/ widelands/ widelands/ builds/ 525572046. /ci.appveyor. com/project/ widelands- dev/widelands/ build/_ widelands_ dev_widelands_ list_directorie s_in_cpp- 4607.
Appveyor build 4607. State: success. Details: https:/