Merge lp:~widelands-dev/widelands/representative_image_in_font_renderer into lp:widelands
- representative_image_in_font_renderer
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 9094 | ||||
Proposed branch: | lp:~widelands-dev/widelands/representative_image_in_font_renderer | ||||
Merge into: | lp:widelands | ||||
Diff against target: |
1348 lines (+229/-92) 53 files modified
data/campaigns/atl01.wmf/scripting/mission_thread.lua (+2/-3) data/campaigns/atl01.wmf/scripting/texts.lua (+2/-2) data/campaigns/bar01.wmf/scripting/texts.lua (+10/-10) data/scripting/editor/editor_help.lua (+1/-1) data/scripting/editor/terrain_help.lua (+1/-1) data/scripting/editor/tree_help.lua (+1/-1) data/scripting/richtext.lua (+41/-1) data/tribes/immovables/resi/atlanteans/init.lua (+10/-0) data/tribes/immovables/resi/barbarians/init.lua (+10/-0) data/tribes/immovables/resi/empire/init.lua (+10/-0) data/tribes/immovables/resi/frisians/init.lua (+10/-0) data/tribes/immovables/shipconstruction_atlanteans/init.lua (+2/-1) data/tribes/immovables/shipconstruction_barbarians/init.lua (+2/-1) data/tribes/immovables/shipconstruction_empire/init.lua (+2/-1) data/tribes/immovables/shipconstruction_frisians/init.lua (+2/-1) data/tribes/scripting/help/building_help.lua (+3/-3) data/tribes/scripting/help/immovable_help.lua (+1/-1) data/world/immovables/trees/alder/init.lua (+1/-0) data/world/immovables/trees/aspen/init.lua (+1/-0) data/world/immovables/trees/beech/init.lua (+1/-0) data/world/immovables/trees/birch/init.lua (+1/-0) data/world/immovables/trees/cirrus/init.lua (+1/-0) data/world/immovables/trees/larch/init.lua (+1/-0) data/world/immovables/trees/liana/init.lua (+1/-0) data/world/immovables/trees/maple/init.lua (+1/-0) data/world/immovables/trees/mushroom_dark/init.lua (+1/-0) data/world/immovables/trees/mushroom_green/init.lua (+1/-0) data/world/immovables/trees/mushroom_red/init.lua (+1/-0) data/world/immovables/trees/oak/init.lua (+1/-0) data/world/immovables/trees/palm_borassus/init.lua (+1/-0) data/world/immovables/trees/palm_coconut/init.lua (+1/-0) data/world/immovables/trees/palm_date/init.lua (+1/-0) data/world/immovables/trees/palm_oil/init.lua (+1/-0) data/world/immovables/trees/palm_roystonea/init.lua (+1/-0) data/world/immovables/trees/rowan/init.lua (+1/-0) data/world/immovables/trees/spruce/init.lua (+1/-0) data/world/immovables/trees/twine/init.lua (+1/-0) data/world/immovables/trees/umbrella_green/init.lua (+1/-0) data/world/immovables/trees/umbrella_red/init.lua (+1/-0) doc/sphinx/source/animations.rst (+3/-0) src/graphic/animation.cc (+22/-9) src/graphic/animation.h (+8/-3) src/graphic/text/rt_parse.cc (+5/-2) src/graphic/text/rt_render.cc (+35/-17) src/logic/map_objects/immovable.cc (+10/-0) src/logic/map_objects/map_object.cc (+7/-6) src/logic/map_objects/map_object.h (+0/-4) src/logic/map_objects/tribes/building.cc (+2/-4) src/logic/map_objects/tribes/tribe_descr.cc (+2/-2) src/logic/map_objects/tribes/worker.cc (+2/-3) src/scripting/lua_map.cc (+0/-13) src/scripting/lua_map.h (+0/-1) src/website/map_object_info.cc (+1/-1) |
||||
To merge this branch: | bzr merge lp:~widelands-dev/widelands/representative_image_in_font_renderer | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Benedikt Straub | Approve | ||
GunChleoc | Needs Resubmitting | ||
Review via email: mp+363781@code.launchpad.net |
Commit message
Add support for representative images to the font renderer
Description of the change
This is the second step in a series to improve graphics quality in Widelands, hopefully for Build 21.
1. Implement support for Mipmaps
2. Add support to the font renderer
3. Implement spritesheets, otherwise the number of files will explode
4. Implement compressed spritemaps, otherwise the filesize will explode.
This is only feasible for immovables.
5. Re-export everything from Blender
bunnybot (widelandsofficial) wrote : | # |
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 4719. State: errored. Details: https:/
Appveyor build 4505. State: success. Details: https:/
GunChleoc (gunchleoc) wrote : | # |
Build animations are broken
GunChleoc (gunchleoc) wrote : | # |
Found the bug
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 4747. State: passed. Details: https:/
Appveyor build 4532. State: success. Details: https:/
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 4809. State: errored. Details: https:/
Appveyor build 4590. State: success. Details: https:/
Benedikt Straub (nordfriese) wrote : | # |
Code LGTM. Tested briefly, no issues seen.
GunChleoc (gunchleoc) wrote : | # |
The inputqueues again
@bunnybot merge force
Toni Förster (stonerl) wrote : | # |
I know this has been merged already, but I get a compile warning since this is in trunk.
src/graphic/
GunChleoc (gunchleoc) wrote : | # |
I just noticed this in the font_size-lua branch too and have fixed it there.
Preview Diff
1 | === modified file 'data/campaigns/atl01.wmf/scripting/mission_thread.lua' | |||
2 | --- data/campaigns/atl01.wmf/scripting/mission_thread.lua 2018-12-13 17:36:58 +0000 | |||
3 | +++ data/campaigns/atl01.wmf/scripting/mission_thread.lua 2019-05-03 18:29:53 +0000 | |||
4 | @@ -3,8 +3,7 @@ | |||
5 | 3 | -- ======================================================================= | 3 | -- ======================================================================= |
6 | 4 | 4 | ||
7 | 5 | function send_building_lost_message(f) | 5 | function send_building_lost_message(f) |
10 | 6 | local icon = f.immovable.descr.representative_image | 6 | local message = building_lost(f.immovable.descr.name) |
9 | 7 | local message = building_lost(icon) | ||
11 | 8 | send_message( | 7 | send_message( |
12 | 9 | p1, | 8 | p1, |
13 | 10 | message.title, | 9 | message.title, |
14 | @@ -12,7 +11,7 @@ | |||
15 | 12 | { | 11 | { |
16 | 13 | field = f, | 12 | field = f, |
17 | 14 | popup = false, | 13 | popup = false, |
19 | 15 | icon = icon, | 14 | icon = f.immovable.descr.icon_name, |
20 | 16 | message.title | 15 | message.title |
21 | 17 | } | 16 | } |
22 | 18 | ) | 17 | ) |
23 | 19 | 18 | ||
24 | === modified file 'data/campaigns/atl01.wmf/scripting/texts.lua' | |||
25 | --- data/campaigns/atl01.wmf/scripting/texts.lua 2017-12-09 19:06:07 +0000 | |||
26 | +++ data/campaigns/atl01.wmf/scripting/texts.lua 2019-05-03 18:29:53 +0000 | |||
27 | @@ -480,11 +480,11 @@ | |||
28 | 480 | } | 480 | } |
29 | 481 | } | 481 | } |
30 | 482 | 482 | ||
32 | 483 | function building_lost(icon) | 483 | function building_lost(buildingname) |
33 | 484 | set_textdomain("scenario_atl01.wmf") | 484 | set_textdomain("scenario_atl01.wmf") |
34 | 485 | return { | 485 | return { |
35 | 486 | -- TRANSLATORS: Short message title. Translate as "Lost!" if you don't have enough space. | 486 | -- TRANSLATORS: Short message title. Translate as "Lost!" if you don't have enough space. |
36 | 487 | title = pgettext("message_short_title", "Building lost!"), | 487 | title = pgettext("message_short_title", "Building lost!"), |
38 | 488 | text = li_image(icon, _"We lost a building to the ocean!") | 488 | text = li_object(buildingname, _"We lost a building to the ocean!") |
39 | 489 | } | 489 | } |
40 | 490 | end | 490 | end |
41 | 491 | 491 | ||
42 | === modified file 'data/campaigns/bar01.wmf/scripting/texts.lua' | |||
43 | --- data/campaigns/bar01.wmf/scripting/texts.lua 2018-09-02 11:44:52 +0000 | |||
44 | +++ data/campaigns/bar01.wmf/scripting/texts.lua 2019-05-03 18:29:53 +0000 | |||
45 | @@ -43,16 +43,16 @@ | |||
46 | 43 | body = objective_text(_"Build coal and iron mines", | 43 | body = objective_text(_"Build coal and iron mines", |
47 | 44 | li(_"Build a coal mine and an iron mine.") .. | 44 | li(_"Build a coal mine and an iron mine.") .. |
48 | 45 | li_arrow(_"To do so, place a flag up on the mountain’s flank to the east (on mountain terrain though, not mountain meadow). When you click on the new flag, you can send geologists there. Because the flag is on a mountain, the geologists will search for ores; otherwise, they would search for water. Then build a mine for both kinds of resources that they will find, choosing the appropriate mine to be built:") .. | 45 | li_arrow(_"To do so, place a flag up on the mountain’s flank to the east (on mountain terrain though, not mountain meadow). When you click on the new flag, you can send geologists there. Because the flag is on a mountain, the geologists will search for ores; otherwise, they would search for water. Then build a mine for both kinds of resources that they will find, choosing the appropriate mine to be built:") .. |
59 | 46 | li_image(wl.Game():get_immovable_description("barbarians_resi_coal_1").representative_image, _"a bit of coal") .. | 46 | li_object("barbarians_resi_coal_1", _"a bit of coal") .. |
60 | 47 | li_image(wl.Game():get_immovable_description("barbarians_resi_coal_2").representative_image, _"a lot of coal") .. | 47 | li_object("barbarians_resi_coal_2", _"a lot of coal") .. |
61 | 48 | li_image(wl.Game():get_immovable_description("barbarians_resi_iron_1").representative_image, _"a bit of iron") .. | 48 | li_object("barbarians_resi_iron_1", _"a bit of iron") .. |
62 | 49 | li_image(wl.Game():get_immovable_description("barbarians_resi_iron_2").representative_image, _"a lot of iron") .. | 49 | li_object("barbarians_resi_iron_2", _"a lot of iron") .. |
63 | 50 | li_image(wl.Game():get_immovable_description("barbarians_resi_gold_1").representative_image, _"a bit of gold") .. | 50 | li_object("barbarians_resi_gold_1", _"a bit of gold") .. |
64 | 51 | li_image(wl.Game():get_immovable_description("barbarians_resi_gold_2").representative_image, _"a lot of gold") .. | 51 | li_object("barbarians_resi_gold_2", _"a lot of gold") .. |
65 | 52 | li_image(wl.Game():get_immovable_description("barbarians_resi_stones_1").representative_image, _"a bit of granite") .. | 52 | li_object("barbarians_resi_stones_1", _"a bit of granite") .. |
66 | 53 | li_image(wl.Game():get_immovable_description("barbarians_resi_stones_2").representative_image, _"a lot of granite") .. | 53 | li_object("barbarians_resi_stones_2", _"a lot of granite") .. |
67 | 54 | li_image(wl.Game():get_immovable_description("barbarians_resi_water").representative_image, _"water") .. | 54 | li_object("barbarians_resi_water", _"water") .. |
68 | 55 | li_image(wl.Game():get_immovable_description("barbarians_resi_none").representative_image, _"nothing was found here") .. | 55 | li_object("barbarians_resi_none", _"nothing was found here") .. |
69 | 56 | p(_[[Mines can only be built on mountain terrain. Suitable places for mines are displayed as orange mine symbols.]])) | 56 | p(_[[Mines can only be built on mountain terrain. Suitable places for mines are displayed as orange mine symbols.]])) |
70 | 57 | } | 57 | } |
71 | 58 | 58 | ||
72 | 59 | 59 | ||
73 | === modified file 'data/scripting/editor/editor_help.lua' | |||
74 | --- data/scripting/editor/editor_help.lua 2016-10-19 09:00:29 +0000 | |||
75 | +++ data/scripting/editor/editor_help.lua 2019-05-03 18:29:53 +0000 | |||
76 | @@ -32,7 +32,7 @@ | |||
77 | 32 | result[counter] = { | 32 | result[counter] = { |
78 | 33 | name = immovable.name, | 33 | name = immovable.name, |
79 | 34 | title = immovable.species, | 34 | title = immovable.species, |
81 | 35 | icon = immovable.representative_image, | 35 | icon = immovable.icon_name, |
82 | 36 | script = "scripting/editor/tree_help.lua", | 36 | script = "scripting/editor/tree_help.lua", |
83 | 37 | script_parameters = {[1] = immovable.name} | 37 | script_parameters = {[1] = immovable.name} |
84 | 38 | } | 38 | } |
85 | 39 | 39 | ||
86 | === modified file 'data/scripting/editor/terrain_help.lua' | |||
87 | --- data/scripting/editor/terrain_help.lua 2018-01-10 16:21:50 +0000 | |||
88 | +++ data/scripting/editor/terrain_help.lua 2019-05-03 18:29:53 +0000 | |||
89 | @@ -59,7 +59,7 @@ | |||
90 | 59 | 59 | ||
91 | 60 | local tree_string = "" | 60 | local tree_string = "" |
92 | 61 | for k,v in ipairs(tree_list) do | 61 | for k,v in ipairs(tree_list) do |
94 | 62 | tree_string = tree_string .. li_image(v.tree.representative_image, | 62 | tree_string = tree_string .. li_object(v.tree.name, |
95 | 63 | v.tree.species .. ("<br>%2.1f%%"):bformat(100 * v.probability)) .. vspace(3) | 63 | v.tree.species .. ("<br>%2.1f%%"):bformat(100 * v.probability)) .. vspace(3) |
96 | 64 | end | 64 | end |
97 | 65 | 65 | ||
98 | 66 | 66 | ||
99 | === modified file 'data/scripting/editor/tree_help.lua' | |||
100 | --- data/scripting/editor/tree_help.lua 2018-01-10 16:21:50 +0000 | |||
101 | +++ data/scripting/editor/tree_help.lua 2019-05-03 18:29:53 +0000 | |||
102 | @@ -13,7 +13,7 @@ | |||
103 | 13 | set_textdomain("widelands_editor") | 13 | set_textdomain("widelands_editor") |
104 | 14 | local world = wl.World(); | 14 | local world = wl.World(); |
105 | 15 | local tree = wl.Editor():get_immovable_description(tree_name) | 15 | local tree = wl.Editor():get_immovable_description(tree_name) |
107 | 16 | local result = li_image(tree.representative_image, "") | 16 | local result = li_object(tree.name, "") |
108 | 17 | 17 | ||
109 | 18 | -- TRANSLATORS: A header in the editor help. Terrains preferred by a type of tree. | 18 | -- TRANSLATORS: A header in the editor help. Terrains preferred by a type of tree. |
110 | 19 | result = result .. vspace(3) .. h2(vspace(12) .. _"Preferred terrains") .. vspace(3) | 19 | result = result .. vspace(3) .. h2(vspace(12) .. _"Preferred terrains") .. vspace(3) |
111 | 20 | 20 | ||
112 | === modified file 'data/scripting/richtext.lua' | |||
113 | --- data/scripting/richtext.lua 2018-03-24 13:51:48 +0000 | |||
114 | +++ data/scripting/richtext.lua 2019-05-03 18:29:53 +0000 | |||
115 | @@ -402,7 +402,6 @@ | |||
116 | 402 | return li("→", text) | 402 | return li("→", text) |
117 | 403 | end | 403 | end |
118 | 404 | 404 | ||
119 | 405 | |||
120 | 406 | -- RST | 405 | -- RST |
121 | 407 | -- .. function:: li_image(imagepath, text) | 406 | -- .. function:: li_image(imagepath, text) |
122 | 408 | -- | 407 | -- |
123 | @@ -424,6 +423,26 @@ | |||
124 | 424 | ) | 423 | ) |
125 | 425 | end | 424 | end |
126 | 426 | 425 | ||
127 | 426 | -- RST | ||
128 | 427 | -- .. function:: li_object(name, text) | ||
129 | 428 | -- | ||
130 | 429 | -- Places a paragraph of text to the right of an image representing the given map object | ||
131 | 430 | -- | ||
132 | 431 | -- :arg name: the name of the map object to be represented by an image | ||
133 | 432 | -- :type name: :class:`string` | ||
134 | 433 | -- | ||
135 | 434 | -- :arg text: the text to be placed next to the image | ||
136 | 435 | -- :type text: :class:`string` | ||
137 | 436 | -- | ||
138 | 437 | -- :returns: the text wrapped in a paragraph and placed next to the image, the outer tag is a div. | ||
139 | 438 | |||
140 | 439 | function li_object(name, text) | ||
141 | 440 | return | ||
142 | 441 | div("width=100%", | ||
143 | 442 | div("float=left padding_r=6", p(img_object(name))) .. | ||
144 | 443 | p(text) | ||
145 | 444 | ) | ||
146 | 445 | end | ||
147 | 427 | 446 | ||
148 | 428 | -- RST | 447 | -- RST |
149 | 429 | -- :ref:`Return to index<richtext.lua>` | 448 | -- :ref:`Return to index<richtext.lua>` |
150 | @@ -455,6 +474,27 @@ | |||
151 | 455 | end | 474 | end |
152 | 456 | end | 475 | end |
153 | 457 | 476 | ||
154 | 477 | -- RST | ||
155 | 478 | -- .. function:: img_object(object[, attributes = nil]) | ||
156 | 479 | -- | ||
157 | 480 | -- Creates a richtest image tag for the given map object type. See also :any:`li_object`. | ||
158 | 481 | -- | ||
159 | 482 | -- :arg name: the name of the map object. | ||
160 | 483 | -- :type name: :class:`string` | ||
161 | 484 | -- :arg attributes: see the :ref:`img tag's documentation <rt_tags_img>` | ||
162 | 485 | -- for a list of attributes and their descriptions. | ||
163 | 486 | -- :type attributes: :class:`string` | ||
164 | 487 | -- | ||
165 | 488 | -- :returns: the img tag. | ||
166 | 489 | |||
167 | 490 | function img_object(name, attributes) | ||
168 | 491 | if attributes then | ||
169 | 492 | return "<img object=" .. name .. " " .. attributes .. ">" | ||
170 | 493 | else | ||
171 | 494 | return "<img object=" .. name .. ">" | ||
172 | 495 | end | ||
173 | 496 | end | ||
174 | 497 | |||
175 | 458 | 498 | ||
176 | 459 | -- RST | 499 | -- RST |
177 | 460 | -- :ref:`Return to index<richtext.lua>` | 500 | -- :ref:`Return to index<richtext.lua>` |
178 | 461 | 501 | ||
179 | === modified file 'data/tribes/immovables/resi/atlanteans/init.lua' | |||
180 | --- data/tribes/immovables/resi/atlanteans/init.lua 2018-09-10 06:25:11 +0000 | |||
181 | +++ data/tribes/immovables/resi/atlanteans/init.lua 2019-05-03 18:29:53 +0000 | |||
182 | @@ -6,6 +6,7 @@ | |||
183 | 6 | -- TRANSLATORS: This is a resource name used in lists of resources | 6 | -- TRANSLATORS: This is a resource name used in lists of resources |
184 | 7 | descname = pgettext("immovable", "Resources: None"), | 7 | descname = pgettext("immovable", "Resources: None"), |
185 | 8 | helptext_script = dirname .. "../helptexts/none.lua", | 8 | helptext_script = dirname .. "../helptexts/none.lua", |
186 | 9 | icon = dirname .. "pics/none_0.png", | ||
187 | 9 | attributes = { "resi" }, | 10 | attributes = { "resi" }, |
188 | 10 | programs = { | 11 | programs = { |
189 | 11 | program = { | 12 | program = { |
190 | @@ -28,6 +29,7 @@ | |||
191 | 28 | -- TRANSLATORS: This is a resource name used in lists of resources | 29 | -- TRANSLATORS: This is a resource name used in lists of resources |
192 | 29 | descname = pgettext("immovable", "Resources: Water Vein"), | 30 | descname = pgettext("immovable", "Resources: Water Vein"), |
193 | 30 | helptext_script = dirname .. "../helptexts/water.lua", | 31 | helptext_script = dirname .. "../helptexts/water.lua", |
194 | 32 | icon = dirname .. "pics/water_0.png", | ||
195 | 31 | attributes = { "resi" }, | 33 | attributes = { "resi" }, |
196 | 32 | programs = { | 34 | programs = { |
197 | 33 | program = { | 35 | program = { |
198 | @@ -51,6 +53,7 @@ | |||
199 | 51 | -- TRANSLATORS: This is a resource name used in lists of resources | 53 | -- TRANSLATORS: This is a resource name used in lists of resources |
200 | 52 | descname = pgettext("immovable", "Resources: Coal Vein"), | 54 | descname = pgettext("immovable", "Resources: Coal Vein"), |
201 | 53 | helptext_script = dirname .. "../helptexts/coal_1.lua", | 55 | helptext_script = dirname .. "../helptexts/coal_1.lua", |
202 | 56 | icon = dirname .. "pics/coal_1_0.png", | ||
203 | 54 | attributes = { "resi" }, | 57 | attributes = { "resi" }, |
204 | 55 | programs = { | 58 | programs = { |
205 | 56 | program = { | 59 | program = { |
206 | @@ -74,6 +77,7 @@ | |||
207 | 74 | -- TRANSLATORS: This is a resource name used in lists of resources | 77 | -- TRANSLATORS: This is a resource name used in lists of resources |
208 | 75 | descname = pgettext("immovable", "Resources: Gold Vein"), | 78 | descname = pgettext("immovable", "Resources: Gold Vein"), |
209 | 76 | helptext_script = dirname .. "../helptexts/gold_1.lua", | 79 | helptext_script = dirname .. "../helptexts/gold_1.lua", |
210 | 80 | icon = dirname .. "pics/gold_1_0.png", | ||
211 | 77 | attributes = { "resi" }, | 81 | attributes = { "resi" }, |
212 | 78 | programs = { | 82 | programs = { |
213 | 79 | program = { | 83 | program = { |
214 | @@ -97,6 +101,7 @@ | |||
215 | 97 | -- TRANSLATORS: This is a resource name used in lists of resources | 101 | -- TRANSLATORS: This is a resource name used in lists of resources |
216 | 98 | descname = pgettext("immovable", "Resources: Iron Vein"), | 102 | descname = pgettext("immovable", "Resources: Iron Vein"), |
217 | 99 | helptext_script = dirname .. "../helptexts/iron_1.lua", | 103 | helptext_script = dirname .. "../helptexts/iron_1.lua", |
218 | 104 | icon = dirname .. "pics/iron_1_0.png", | ||
219 | 100 | attributes = { "resi" }, | 105 | attributes = { "resi" }, |
220 | 101 | programs = { | 106 | programs = { |
221 | 102 | program = { | 107 | program = { |
222 | @@ -120,6 +125,7 @@ | |||
223 | 120 | -- TRANSLATORS: This is a resource name used in lists of resources | 125 | -- TRANSLATORS: This is a resource name used in lists of resources |
224 | 121 | descname = pgettext("immovable", "Resources: Some Stones"), | 126 | descname = pgettext("immovable", "Resources: Some Stones"), |
225 | 122 | helptext_script = dirname .. "../helptexts/stones_1.lua", | 127 | helptext_script = dirname .. "../helptexts/stones_1.lua", |
226 | 128 | icon = dirname .. "pics/stones_1_0.png", | ||
227 | 123 | attributes = { "resi" }, | 129 | attributes = { "resi" }, |
228 | 124 | programs = { | 130 | programs = { |
229 | 125 | program = { | 131 | program = { |
230 | @@ -143,6 +149,7 @@ | |||
231 | 143 | -- TRANSLATORS: This is a resource name used in lists of resources | 149 | -- TRANSLATORS: This is a resource name used in lists of resources |
232 | 144 | descname = pgettext("immovable", "Resources: Main Coal Vein"), | 150 | descname = pgettext("immovable", "Resources: Main Coal Vein"), |
233 | 145 | helptext_script = dirname .. "../helptexts/coal_2.lua", | 151 | helptext_script = dirname .. "../helptexts/coal_2.lua", |
234 | 152 | icon = dirname .. "pics/coal_2_0.png", | ||
235 | 146 | attributes = { "resi" }, | 153 | attributes = { "resi" }, |
236 | 147 | programs = { | 154 | programs = { |
237 | 148 | program = { | 155 | program = { |
238 | @@ -166,6 +173,7 @@ | |||
239 | 166 | -- TRANSLATORS: This is a resource name used in lists of resources | 173 | -- TRANSLATORS: This is a resource name used in lists of resources |
240 | 167 | descname = pgettext("immovable", "Resources: Main Gold Vein"), | 174 | descname = pgettext("immovable", "Resources: Main Gold Vein"), |
241 | 168 | helptext_script = dirname .. "../helptexts/gold_2.lua", | 175 | helptext_script = dirname .. "../helptexts/gold_2.lua", |
242 | 176 | icon = dirname .. "pics/gold_2_0.png", | ||
243 | 169 | attributes = { "resi" }, | 177 | attributes = { "resi" }, |
244 | 170 | programs = { | 178 | programs = { |
245 | 171 | program = { | 179 | program = { |
246 | @@ -189,6 +197,7 @@ | |||
247 | 189 | -- TRANSLATORS: This is a resource name used in lists of resources | 197 | -- TRANSLATORS: This is a resource name used in lists of resources |
248 | 190 | descname = pgettext("immovable", "Resources: Main Iron Vein"), | 198 | descname = pgettext("immovable", "Resources: Main Iron Vein"), |
249 | 191 | helptext_script = dirname .. "../helptexts/iron_2.lua", | 199 | helptext_script = dirname .. "../helptexts/iron_2.lua", |
250 | 200 | icon = dirname .. "pics/iron_2_0.png", | ||
251 | 192 | attributes = { "resi" }, | 201 | attributes = { "resi" }, |
252 | 193 | programs = { | 202 | programs = { |
253 | 194 | program = { | 203 | program = { |
254 | @@ -212,6 +221,7 @@ | |||
255 | 212 | -- TRANSLATORS: This is a resource name used in lists of resources | 221 | -- TRANSLATORS: This is a resource name used in lists of resources |
256 | 213 | descname = pgettext("immovable", "Resources: A Lot of Stones"), | 222 | descname = pgettext("immovable", "Resources: A Lot of Stones"), |
257 | 214 | helptext_script = dirname .. "../helptexts/stones_2.lua", | 223 | helptext_script = dirname .. "../helptexts/stones_2.lua", |
258 | 224 | icon = dirname .. "pics/stones_2_0.png", | ||
259 | 215 | attributes = { "resi" }, | 225 | attributes = { "resi" }, |
260 | 216 | programs = { | 226 | programs = { |
261 | 217 | program = { | 227 | program = { |
262 | 218 | 228 | ||
263 | === modified file 'data/tribes/immovables/resi/barbarians/init.lua' | |||
264 | --- data/tribes/immovables/resi/barbarians/init.lua 2018-09-01 10:50:00 +0000 | |||
265 | +++ data/tribes/immovables/resi/barbarians/init.lua 2019-05-03 18:29:53 +0000 | |||
266 | @@ -6,6 +6,7 @@ | |||
267 | 6 | -- TRANSLATORS: This is a resource name used in lists of resources | 6 | -- TRANSLATORS: This is a resource name used in lists of resources |
268 | 7 | descname = pgettext("immovable", "Resources: None"), | 7 | descname = pgettext("immovable", "Resources: None"), |
269 | 8 | helptext_script = dirname .. "../helptexts/none.lua", | 8 | helptext_script = dirname .. "../helptexts/none.lua", |
270 | 9 | icon = dirname .. "pics/none.png", | ||
271 | 9 | attributes = { "resi" }, | 10 | attributes = { "resi" }, |
272 | 10 | programs = { | 11 | programs = { |
273 | 11 | program = { | 12 | program = { |
274 | @@ -28,6 +29,7 @@ | |||
275 | 28 | -- TRANSLATORS: This is a resource name used in lists of resources | 29 | -- TRANSLATORS: This is a resource name used in lists of resources |
276 | 29 | descname = pgettext("immovable", "Resources: Water Vein"), | 30 | descname = pgettext("immovable", "Resources: Water Vein"), |
277 | 30 | helptext_script = dirname .. "../helptexts/water.lua", | 31 | helptext_script = dirname .. "../helptexts/water.lua", |
278 | 32 | icon = dirname .. "pics/water.png", | ||
279 | 31 | attributes = { "resi" }, | 33 | attributes = { "resi" }, |
280 | 32 | programs = { | 34 | programs = { |
281 | 33 | program = { | 35 | program = { |
282 | @@ -50,6 +52,7 @@ | |||
283 | 50 | -- TRANSLATORS: This is a resource name used in lists of resources | 52 | -- TRANSLATORS: This is a resource name used in lists of resources |
284 | 51 | descname = pgettext("immovable", "Resources: Coal Vein"), | 53 | descname = pgettext("immovable", "Resources: Coal Vein"), |
285 | 52 | helptext_script = dirname .. "../helptexts/coal_1.lua", | 54 | helptext_script = dirname .. "../helptexts/coal_1.lua", |
286 | 55 | icon = dirname .. "pics/coal_1.png", | ||
287 | 53 | attributes = { "resi" }, | 56 | attributes = { "resi" }, |
288 | 54 | programs = { | 57 | programs = { |
289 | 55 | program = { | 58 | program = { |
290 | @@ -72,6 +75,7 @@ | |||
291 | 72 | -- TRANSLATORS: This is a resource name used in lists of resources | 75 | -- TRANSLATORS: This is a resource name used in lists of resources |
292 | 73 | descname = pgettext("immovable", "Resources: Gold Vein"), | 76 | descname = pgettext("immovable", "Resources: Gold Vein"), |
293 | 74 | helptext_script = dirname .. "../helptexts/gold_1.lua", | 77 | helptext_script = dirname .. "../helptexts/gold_1.lua", |
294 | 78 | icon = dirname .. "pics/gold_1.png", | ||
295 | 75 | attributes = { "resi" }, | 79 | attributes = { "resi" }, |
296 | 76 | programs = { | 80 | programs = { |
297 | 77 | program = { | 81 | program = { |
298 | @@ -94,6 +98,7 @@ | |||
299 | 94 | -- TRANSLATORS: This is a resource name used in lists of resources | 98 | -- TRANSLATORS: This is a resource name used in lists of resources |
300 | 95 | descname = pgettext("immovable", "Resources: Iron Vein"), | 99 | descname = pgettext("immovable", "Resources: Iron Vein"), |
301 | 96 | helptext_script = dirname .. "../helptexts/iron_1.lua", | 100 | helptext_script = dirname .. "../helptexts/iron_1.lua", |
302 | 101 | icon = dirname .. "pics/iron_1.png", | ||
303 | 97 | attributes = { "resi" }, | 102 | attributes = { "resi" }, |
304 | 98 | programs = { | 103 | programs = { |
305 | 99 | program = { | 104 | program = { |
306 | @@ -116,6 +121,7 @@ | |||
307 | 116 | -- TRANSLATORS: This is a resource name used in lists of resources | 121 | -- TRANSLATORS: This is a resource name used in lists of resources |
308 | 117 | descname = pgettext("immovable", "Resources: Some Stones"), | 122 | descname = pgettext("immovable", "Resources: Some Stones"), |
309 | 118 | helptext_script = dirname .. "../helptexts/stones_1.lua", | 123 | helptext_script = dirname .. "../helptexts/stones_1.lua", |
310 | 124 | icon = dirname .. "pics/stones_1.png", | ||
311 | 119 | attributes = { "resi" }, | 125 | attributes = { "resi" }, |
312 | 120 | programs = { | 126 | programs = { |
313 | 121 | program = { | 127 | program = { |
314 | @@ -138,6 +144,7 @@ | |||
315 | 138 | -- TRANSLATORS: This is a resource name used in lists of resources | 144 | -- TRANSLATORS: This is a resource name used in lists of resources |
316 | 139 | descname = pgettext("immovable", "Resources: Main Coal Vein"), | 145 | descname = pgettext("immovable", "Resources: Main Coal Vein"), |
317 | 140 | helptext_script = dirname .. "../helptexts/coal_2.lua", | 146 | helptext_script = dirname .. "../helptexts/coal_2.lua", |
318 | 147 | icon = dirname .. "pics/coal_2.png", | ||
319 | 141 | attributes = { "resi" }, | 148 | attributes = { "resi" }, |
320 | 142 | programs = { | 149 | programs = { |
321 | 143 | program = { | 150 | program = { |
322 | @@ -160,6 +167,7 @@ | |||
323 | 160 | -- TRANSLATORS: This is a resource name used in lists of resources | 167 | -- TRANSLATORS: This is a resource name used in lists of resources |
324 | 161 | descname = pgettext("immovable", "Resources: Main Gold Vein"), | 168 | descname = pgettext("immovable", "Resources: Main Gold Vein"), |
325 | 162 | helptext_script = dirname .. "../helptexts/gold_2.lua", | 169 | helptext_script = dirname .. "../helptexts/gold_2.lua", |
326 | 170 | icon = dirname .. "pics/gold_2.png", | ||
327 | 163 | attributes = { "resi" }, | 171 | attributes = { "resi" }, |
328 | 164 | programs = { | 172 | programs = { |
329 | 165 | program = { | 173 | program = { |
330 | @@ -182,6 +190,7 @@ | |||
331 | 182 | -- TRANSLATORS: This is a resource name used in lists of resources | 190 | -- TRANSLATORS: This is a resource name used in lists of resources |
332 | 183 | descname = pgettext("immovable", "Resources: Main Iron Vein"), | 191 | descname = pgettext("immovable", "Resources: Main Iron Vein"), |
333 | 184 | helptext_script = dirname .. "../helptexts/iron_2.lua", | 192 | helptext_script = dirname .. "../helptexts/iron_2.lua", |
334 | 193 | icon = dirname .. "pics/iron_2.png", | ||
335 | 185 | attributes = { "resi" }, | 194 | attributes = { "resi" }, |
336 | 186 | programs = { | 195 | programs = { |
337 | 187 | program = { | 196 | program = { |
338 | @@ -204,6 +213,7 @@ | |||
339 | 204 | -- TRANSLATORS: This is a resource name used in lists of resources | 213 | -- TRANSLATORS: This is a resource name used in lists of resources |
340 | 205 | descname = pgettext("immovable", "Resources: A Lot of Stones"), | 214 | descname = pgettext("immovable", "Resources: A Lot of Stones"), |
341 | 206 | helptext_script = dirname .. "../helptexts/stones_2.lua", | 215 | helptext_script = dirname .. "../helptexts/stones_2.lua", |
342 | 216 | icon = dirname .. "pics/stones_2.png", | ||
343 | 207 | attributes = { "resi" }, | 217 | attributes = { "resi" }, |
344 | 208 | programs = { | 218 | programs = { |
345 | 209 | program = { | 219 | program = { |
346 | 210 | 220 | ||
347 | === modified file 'data/tribes/immovables/resi/empire/init.lua' | |||
348 | --- data/tribes/immovables/resi/empire/init.lua 2018-09-01 10:50:00 +0000 | |||
349 | +++ data/tribes/immovables/resi/empire/init.lua 2019-05-03 18:29:53 +0000 | |||
350 | @@ -6,6 +6,7 @@ | |||
351 | 6 | -- TRANSLATORS: This is a resource name used in lists of resources | 6 | -- TRANSLATORS: This is a resource name used in lists of resources |
352 | 7 | descname = pgettext("immovable", "Resources: None"), | 7 | descname = pgettext("immovable", "Resources: None"), |
353 | 8 | helptext_script = dirname .. "../helptexts/none.lua", | 8 | helptext_script = dirname .. "../helptexts/none.lua", |
354 | 9 | icon = dirname .. "pics/none.png", | ||
355 | 9 | attributes = { "resi" }, | 10 | attributes = { "resi" }, |
356 | 10 | programs = { | 11 | programs = { |
357 | 11 | program = { | 12 | program = { |
358 | @@ -28,6 +29,7 @@ | |||
359 | 28 | -- TRANSLATORS: This is a resource name used in lists of resources | 29 | -- TRANSLATORS: This is a resource name used in lists of resources |
360 | 29 | descname = pgettext("immovable", "Resources: Water Vein"), | 30 | descname = pgettext("immovable", "Resources: Water Vein"), |
361 | 30 | helptext_script = dirname .. "../helptexts/water.lua", | 31 | helptext_script = dirname .. "../helptexts/water.lua", |
362 | 32 | icon = dirname .. "pics/water.png", | ||
363 | 31 | attributes = { "resi" }, | 33 | attributes = { "resi" }, |
364 | 32 | programs = { | 34 | programs = { |
365 | 33 | program = { | 35 | program = { |
366 | @@ -50,6 +52,7 @@ | |||
367 | 50 | -- TRANSLATORS: This is a resource name used in lists of resources | 52 | -- TRANSLATORS: This is a resource name used in lists of resources |
368 | 51 | descname = pgettext("immovable", "Resources: Coal Vein"), | 53 | descname = pgettext("immovable", "Resources: Coal Vein"), |
369 | 52 | helptext_script = dirname .. "../helptexts/coal_1.lua", | 54 | helptext_script = dirname .. "../helptexts/coal_1.lua", |
370 | 55 | icon = dirname .. "pics/coal_1.png", | ||
371 | 53 | attributes = { "resi" }, | 56 | attributes = { "resi" }, |
372 | 54 | programs = { | 57 | programs = { |
373 | 55 | program = { | 58 | program = { |
374 | @@ -72,6 +75,7 @@ | |||
375 | 72 | -- TRANSLATORS: This is a resource name used in lists of resources | 75 | -- TRANSLATORS: This is a resource name used in lists of resources |
376 | 73 | descname = pgettext("immovable", "Resources: Gold Vein"), | 76 | descname = pgettext("immovable", "Resources: Gold Vein"), |
377 | 74 | helptext_script = dirname .. "../helptexts/gold_1.lua", | 77 | helptext_script = dirname .. "../helptexts/gold_1.lua", |
378 | 78 | icon = dirname .. "pics/gold_1.png", | ||
379 | 75 | attributes = { "resi" }, | 79 | attributes = { "resi" }, |
380 | 76 | programs = { | 80 | programs = { |
381 | 77 | program = { | 81 | program = { |
382 | @@ -94,6 +98,7 @@ | |||
383 | 94 | -- TRANSLATORS: This is a resource name used in lists of resources | 98 | -- TRANSLATORS: This is a resource name used in lists of resources |
384 | 95 | descname = pgettext("immovable", "Resources: Iron Vein"), | 99 | descname = pgettext("immovable", "Resources: Iron Vein"), |
385 | 96 | helptext_script = dirname .. "../helptexts/iron_1.lua", | 100 | helptext_script = dirname .. "../helptexts/iron_1.lua", |
386 | 101 | icon = dirname .. "pics/iron_1.png", | ||
387 | 97 | attributes = { "resi" }, | 102 | attributes = { "resi" }, |
388 | 98 | programs = { | 103 | programs = { |
389 | 99 | program = { | 104 | program = { |
390 | @@ -116,6 +121,7 @@ | |||
391 | 116 | -- TRANSLATORS: This is a resource name used in lists of resources | 121 | -- TRANSLATORS: This is a resource name used in lists of resources |
392 | 117 | descname = pgettext("immovable", "Resources: Some Stones"), | 122 | descname = pgettext("immovable", "Resources: Some Stones"), |
393 | 118 | helptext_script = dirname .. "../helptexts/stones_1.lua", | 123 | helptext_script = dirname .. "../helptexts/stones_1.lua", |
394 | 124 | icon = dirname .. "pics/stones_1.png", | ||
395 | 119 | attributes = { "resi" }, | 125 | attributes = { "resi" }, |
396 | 120 | programs = { | 126 | programs = { |
397 | 121 | program = { | 127 | program = { |
398 | @@ -138,6 +144,7 @@ | |||
399 | 138 | -- TRANSLATORS: This is a resource name used in lists of resources | 144 | -- TRANSLATORS: This is a resource name used in lists of resources |
400 | 139 | descname = pgettext("immovable", "Resources: Main Coal Vein"), | 145 | descname = pgettext("immovable", "Resources: Main Coal Vein"), |
401 | 140 | helptext_script = dirname .. "../helptexts/coal_2.lua", | 146 | helptext_script = dirname .. "../helptexts/coal_2.lua", |
402 | 147 | icon = dirname .. "pics/coal_2.png", | ||
403 | 141 | attributes = { "resi" }, | 148 | attributes = { "resi" }, |
404 | 142 | programs = { | 149 | programs = { |
405 | 143 | program = { | 150 | program = { |
406 | @@ -160,6 +167,7 @@ | |||
407 | 160 | -- TRANSLATORS: This is a resource name used in lists of resources | 167 | -- TRANSLATORS: This is a resource name used in lists of resources |
408 | 161 | descname = pgettext("immovable", "Resources: Main Gold Vein"), | 168 | descname = pgettext("immovable", "Resources: Main Gold Vein"), |
409 | 162 | helptext_script = dirname .. "../helptexts/gold_2.lua", | 169 | helptext_script = dirname .. "../helptexts/gold_2.lua", |
410 | 170 | icon = dirname .. "pics/gold_2.png", | ||
411 | 163 | attributes = { "resi" }, | 171 | attributes = { "resi" }, |
412 | 164 | programs = { | 172 | programs = { |
413 | 165 | program = { | 173 | program = { |
414 | @@ -182,6 +190,7 @@ | |||
415 | 182 | -- TRANSLATORS: This is a resource name used in lists of resources | 190 | -- TRANSLATORS: This is a resource name used in lists of resources |
416 | 183 | descname = pgettext("immovable", "Resources: Main Iron Vein"), | 191 | descname = pgettext("immovable", "Resources: Main Iron Vein"), |
417 | 184 | helptext_script = dirname .. "../helptexts/iron_2.lua", | 192 | helptext_script = dirname .. "../helptexts/iron_2.lua", |
418 | 193 | icon = dirname .. "pics/iron_2.png", | ||
419 | 185 | attributes = { "resi" }, | 194 | attributes = { "resi" }, |
420 | 186 | programs = { | 195 | programs = { |
421 | 187 | program = { | 196 | program = { |
422 | @@ -204,6 +213,7 @@ | |||
423 | 204 | -- TRANSLATORS: This is a resource name used in lists of resources | 213 | -- TRANSLATORS: This is a resource name used in lists of resources |
424 | 205 | descname = pgettext("immovable", "Resources: A Lot of Stones"), | 214 | descname = pgettext("immovable", "Resources: A Lot of Stones"), |
425 | 206 | helptext_script = dirname .. "../helptexts/stones_2.lua", | 215 | helptext_script = dirname .. "../helptexts/stones_2.lua", |
426 | 216 | icon = dirname .. "pics/stones_2.png", | ||
427 | 207 | attributes = { "resi" }, | 217 | attributes = { "resi" }, |
428 | 208 | programs = { | 218 | programs = { |
429 | 209 | program = { | 219 | program = { |
430 | 210 | 220 | ||
431 | === modified file 'data/tribes/immovables/resi/frisians/init.lua' | |||
432 | --- data/tribes/immovables/resi/frisians/init.lua 2018-09-21 20:12:46 +0000 | |||
433 | +++ data/tribes/immovables/resi/frisians/init.lua 2019-05-03 18:29:53 +0000 | |||
434 | @@ -6,6 +6,7 @@ | |||
435 | 6 | -- TRANSLATORS: This is a resource name used in lists of resources | 6 | -- TRANSLATORS: This is a resource name used in lists of resources |
436 | 7 | descname = pgettext("immovable", "Resources: None"), | 7 | descname = pgettext("immovable", "Resources: None"), |
437 | 8 | helptext_script = dirname .. "../helptexts/none.lua", | 8 | helptext_script = dirname .. "../helptexts/none.lua", |
438 | 9 | icon = dirname .. "pics/none_0.png", | ||
439 | 9 | attributes = { "resi" }, | 10 | attributes = { "resi" }, |
440 | 10 | programs = { | 11 | programs = { |
441 | 11 | program = { | 12 | program = { |
442 | @@ -28,6 +29,7 @@ | |||
443 | 28 | -- TRANSLATORS: This is a resource name used in lists of resources | 29 | -- TRANSLATORS: This is a resource name used in lists of resources |
444 | 29 | descname = pgettext("immovable", "Resources: Water Vein"), | 30 | descname = pgettext("immovable", "Resources: Water Vein"), |
445 | 30 | helptext_script = dirname .. "../helptexts/water.lua", | 31 | helptext_script = dirname .. "../helptexts/water.lua", |
446 | 32 | icon = dirname .. "pics/water_0.png", | ||
447 | 31 | attributes = { "resi" }, | 33 | attributes = { "resi" }, |
448 | 32 | programs = { | 34 | programs = { |
449 | 33 | program = { | 35 | program = { |
450 | @@ -51,6 +53,7 @@ | |||
451 | 51 | -- TRANSLATORS: This is a resource name used in lists of resources | 53 | -- TRANSLATORS: This is a resource name used in lists of resources |
452 | 52 | descname = pgettext("immovable", "Resources: Coal Vein"), | 54 | descname = pgettext("immovable", "Resources: Coal Vein"), |
453 | 53 | helptext_script = dirname .. "../helptexts/coal_1.lua", | 55 | helptext_script = dirname .. "../helptexts/coal_1.lua", |
454 | 56 | icon = dirname .. "pics/coal_1_0.png", | ||
455 | 54 | attributes = { "resi" }, | 57 | attributes = { "resi" }, |
456 | 55 | programs = { | 58 | programs = { |
457 | 56 | program = { | 59 | program = { |
458 | @@ -74,6 +77,7 @@ | |||
459 | 74 | -- TRANSLATORS: This is a resource name used in lists of resources | 77 | -- TRANSLATORS: This is a resource name used in lists of resources |
460 | 75 | descname = pgettext("immovable", "Resources: Gold Vein"), | 78 | descname = pgettext("immovable", "Resources: Gold Vein"), |
461 | 76 | helptext_script = dirname .. "../helptexts/gold_1.lua", | 79 | helptext_script = dirname .. "../helptexts/gold_1.lua", |
462 | 80 | icon = dirname .. "pics/gold_1_0.png", | ||
463 | 77 | attributes = { "resi" }, | 81 | attributes = { "resi" }, |
464 | 78 | programs = { | 82 | programs = { |
465 | 79 | program = { | 83 | program = { |
466 | @@ -97,6 +101,7 @@ | |||
467 | 97 | -- TRANSLATORS: This is a resource name used in lists of resources | 101 | -- TRANSLATORS: This is a resource name used in lists of resources |
468 | 98 | descname = pgettext("immovable", "Resources: Iron Vein"), | 102 | descname = pgettext("immovable", "Resources: Iron Vein"), |
469 | 99 | helptext_script = dirname .. "../helptexts/iron_1.lua", | 103 | helptext_script = dirname .. "../helptexts/iron_1.lua", |
470 | 104 | icon = dirname .. "pics/iron_1_0.png", | ||
471 | 100 | attributes = { "resi" }, | 105 | attributes = { "resi" }, |
472 | 101 | programs = { | 106 | programs = { |
473 | 102 | program = { | 107 | program = { |
474 | @@ -120,6 +125,7 @@ | |||
475 | 120 | -- TRANSLATORS: This is a resource name used in lists of resources | 125 | -- TRANSLATORS: This is a resource name used in lists of resources |
476 | 121 | descname = pgettext("immovable", "Resources: Some Stones"), | 126 | descname = pgettext("immovable", "Resources: Some Stones"), |
477 | 122 | helptext_script = dirname .. "../helptexts/stones_1.lua", | 127 | helptext_script = dirname .. "../helptexts/stones_1.lua", |
478 | 128 | icon = dirname .. "pics/stones_1_0.png", | ||
479 | 123 | attributes = { "resi" }, | 129 | attributes = { "resi" }, |
480 | 124 | programs = { | 130 | programs = { |
481 | 125 | program = { | 131 | program = { |
482 | @@ -143,6 +149,7 @@ | |||
483 | 143 | -- TRANSLATORS: This is a resource name used in lists of resources | 149 | -- TRANSLATORS: This is a resource name used in lists of resources |
484 | 144 | descname = pgettext("immovable", "Resources: Main Coal Vein"), | 150 | descname = pgettext("immovable", "Resources: Main Coal Vein"), |
485 | 145 | helptext_script = dirname .. "../helptexts/coal_2.lua", | 151 | helptext_script = dirname .. "../helptexts/coal_2.lua", |
486 | 152 | icon = dirname .. "pics/coal_2_0.png", | ||
487 | 146 | attributes = { "resi" }, | 153 | attributes = { "resi" }, |
488 | 147 | programs = { | 154 | programs = { |
489 | 148 | program = { | 155 | program = { |
490 | @@ -166,6 +173,7 @@ | |||
491 | 166 | -- TRANSLATORS: This is a resource name used in lists of resources | 173 | -- TRANSLATORS: This is a resource name used in lists of resources |
492 | 167 | descname = pgettext("immovable", "Resources: Main Gold Vein"), | 174 | descname = pgettext("immovable", "Resources: Main Gold Vein"), |
493 | 168 | helptext_script = dirname .. "../helptexts/gold_2.lua", | 175 | helptext_script = dirname .. "../helptexts/gold_2.lua", |
494 | 176 | icon = dirname .. "pics/gold_2_0.png", | ||
495 | 169 | attributes = { "resi" }, | 177 | attributes = { "resi" }, |
496 | 170 | programs = { | 178 | programs = { |
497 | 171 | program = { | 179 | program = { |
498 | @@ -189,6 +197,7 @@ | |||
499 | 189 | -- TRANSLATORS: This is a resource name used in lists of resources | 197 | -- TRANSLATORS: This is a resource name used in lists of resources |
500 | 190 | descname = pgettext("immovable", "Resources: Main Iron Vein"), | 198 | descname = pgettext("immovable", "Resources: Main Iron Vein"), |
501 | 191 | helptext_script = dirname .. "../helptexts/iron_2.lua", | 199 | helptext_script = dirname .. "../helptexts/iron_2.lua", |
502 | 200 | icon = dirname .. "pics/iron_2_0.png", | ||
503 | 192 | attributes = { "resi" }, | 201 | attributes = { "resi" }, |
504 | 193 | programs = { | 202 | programs = { |
505 | 194 | program = { | 203 | program = { |
506 | @@ -212,6 +221,7 @@ | |||
507 | 212 | -- TRANSLATORS: This is a resource name used in lists of resources | 221 | -- TRANSLATORS: This is a resource name used in lists of resources |
508 | 213 | descname = pgettext("immovable", "Resources: A Lot of Stones"), | 222 | descname = pgettext("immovable", "Resources: A Lot of Stones"), |
509 | 214 | helptext_script = dirname .. "../helptexts/stones_2.lua", | 223 | helptext_script = dirname .. "../helptexts/stones_2.lua", |
510 | 224 | icon = dirname .. "pics/stones_2_0.png", | ||
511 | 215 | attributes = { "resi" }, | 225 | attributes = { "resi" }, |
512 | 216 | programs = { | 226 | programs = { |
513 | 217 | program = { | 227 | program = { |
514 | 218 | 228 | ||
515 | === modified file 'data/tribes/immovables/shipconstruction_atlanteans/init.lua' | |||
516 | --- data/tribes/immovables/shipconstruction_atlanteans/init.lua 2018-02-28 09:38:13 +0000 | |||
517 | +++ data/tribes/immovables/shipconstruction_atlanteans/init.lua 2019-05-03 18:29:53 +0000 | |||
518 | @@ -24,7 +24,8 @@ | |||
519 | 24 | idle = { | 24 | idle = { |
520 | 25 | pictures = path.list_files(dirname .. "build_??.png"), | 25 | pictures = path.list_files(dirname .. "build_??.png"), |
521 | 26 | hotspot = { 118, 94 }, | 26 | hotspot = { 118, 94 }, |
523 | 27 | fps = 1 | 27 | fps = 1, |
524 | 28 | representative_frame = 5 | ||
525 | 28 | }, | 29 | }, |
526 | 29 | } | 30 | } |
527 | 30 | } | 31 | } |
528 | 31 | 32 | ||
529 | === modified file 'data/tribes/immovables/shipconstruction_barbarians/init.lua' | |||
530 | --- data/tribes/immovables/shipconstruction_barbarians/init.lua 2018-02-28 09:38:13 +0000 | |||
531 | +++ data/tribes/immovables/shipconstruction_barbarians/init.lua 2019-05-03 18:29:53 +0000 | |||
532 | @@ -24,7 +24,8 @@ | |||
533 | 24 | idle = { | 24 | idle = { |
534 | 25 | pictures = path.list_files(dirname .. "build_??.png"), | 25 | pictures = path.list_files(dirname .. "build_??.png"), |
535 | 26 | hotspot = { 115, 82 }, | 26 | hotspot = { 115, 82 }, |
537 | 27 | fps = 1 | 27 | fps = 1, |
538 | 28 | representative_frame = 5 | ||
539 | 28 | }, | 29 | }, |
540 | 29 | } | 30 | } |
541 | 30 | } | 31 | } |
542 | 31 | 32 | ||
543 | === modified file 'data/tribes/immovables/shipconstruction_empire/init.lua' | |||
544 | --- data/tribes/immovables/shipconstruction_empire/init.lua 2018-02-28 09:38:13 +0000 | |||
545 | +++ data/tribes/immovables/shipconstruction_empire/init.lua 2019-05-03 18:29:53 +0000 | |||
546 | @@ -24,7 +24,8 @@ | |||
547 | 24 | idle = { | 24 | idle = { |
548 | 25 | pictures = path.list_files(dirname .. "build_??.png"), | 25 | pictures = path.list_files(dirname .. "build_??.png"), |
549 | 26 | hotspot = { 115, 78 }, | 26 | hotspot = { 115, 78 }, |
551 | 27 | fps = 1 | 27 | fps = 1, |
552 | 28 | representative_frame = 5 | ||
553 | 28 | }, | 29 | }, |
554 | 29 | } | 30 | } |
555 | 30 | } | 31 | } |
556 | 31 | 32 | ||
557 | === modified file 'data/tribes/immovables/shipconstruction_frisians/init.lua' | |||
558 | --- data/tribes/immovables/shipconstruction_frisians/init.lua 2018-09-09 04:18:24 +0000 | |||
559 | +++ data/tribes/immovables/shipconstruction_frisians/init.lua 2019-05-03 18:29:53 +0000 | |||
560 | @@ -24,7 +24,8 @@ | |||
561 | 24 | idle = { | 24 | idle = { |
562 | 25 | pictures = path.list_files (dirname .. "build_??.png"), | 25 | pictures = path.list_files (dirname .. "build_??.png"), |
563 | 26 | hotspot = { 75, 141 }, | 26 | hotspot = { 75, 141 }, |
565 | 27 | fps = 1 | 27 | fps = 1, |
566 | 28 | representative_frame = 3 | ||
567 | 28 | }, | 29 | }, |
568 | 29 | } | 30 | } |
569 | 30 | } | 31 | } |
570 | 31 | 32 | ||
571 | === modified file 'data/tribes/scripting/help/building_help.lua' | |||
572 | --- data/tribes/scripting/help/building_help.lua 2019-04-07 05:46:13 +0000 | |||
573 | +++ data/tribes/scripting/help/building_help.lua 2019-05-03 18:29:53 +0000 | |||
574 | @@ -57,7 +57,7 @@ | |||
575 | 57 | am = amount | 57 | am = amount |
576 | 58 | end | 58 | end |
577 | 59 | end | 59 | end |
579 | 60 | local items_with_resource = { wl.Game():get_immovable_description(resi).representative_image } | 60 | local items_with_resource = { wl.Game():get_immovable_description(resi).icon_name } |
580 | 61 | for count, item in pairs(items) do | 61 | for count, item in pairs(items) do |
581 | 62 | table.insert(items_with_resource, item.icon_name) | 62 | table.insert(items_with_resource, item.icon_name) |
582 | 63 | end | 63 | end |
583 | @@ -181,13 +181,13 @@ | |||
584 | 181 | local result = h2(_"Lore") | 181 | local result = h2(_"Lore") |
585 | 182 | local lore_text = building_helptext_lore() | 182 | local lore_text = building_helptext_lore() |
586 | 183 | if type(lore_text) == "table" then | 183 | if type(lore_text) == "table" then |
588 | 184 | result = result .. li_image(building_description.representative_image, lore_text[1]) | 184 | result = result .. li_object(building_description.name, lore_text[1]) |
589 | 185 | for k,v in ipairs({table.unpack(lore_text, 2)}) do | 185 | for k,v in ipairs({table.unpack(lore_text, 2)}) do |
590 | 186 | result = result .. p(v) | 186 | result = result .. p(v) |
591 | 187 | end | 187 | end |
592 | 188 | else | 188 | else |
593 | 189 | result = result .. | 189 | result = result .. |
595 | 190 | li_image(building_description.representative_image, lore_text) | 190 | li_object(building_description.name, lore_text) |
596 | 191 | end | 191 | end |
597 | 192 | 192 | ||
598 | 193 | local lore_author = building_helptext_lore_author() | 193 | local lore_author = building_helptext_lore_author() |
599 | 194 | 194 | ||
600 | === modified file 'data/tribes/scripting/help/immovable_help.lua' | |||
601 | --- data/tribes/scripting/help/immovable_help.lua 2018-03-24 14:31:37 +0000 | |||
602 | +++ data/tribes/scripting/help/immovable_help.lua 2019-05-03 18:29:53 +0000 | |||
603 | @@ -32,7 +32,7 @@ | |||
604 | 32 | 32 | ||
605 | 33 | -- TRANSLATORS: Put 2 sentences one after the other. Languages using Chinese script probably want to lose the blank space here. | 33 | -- TRANSLATORS: Put 2 sentences one after the other. Languages using Chinese script probably want to lose the blank space here. |
606 | 34 | local purpose_text = pgettext("sentence_separator", "%s %s"):bformat(immovable_helptext(), immovable_helptext(tribe.name)) | 34 | local purpose_text = pgettext("sentence_separator", "%s %s"):bformat(immovable_helptext(), immovable_helptext(tribe.name)) |
608 | 35 | local result = li_image(immovable_description.representative_image, purpose_text) | 35 | local result = li_object(immovable_description.name, purpose_text) |
609 | 36 | 36 | ||
610 | 37 | -- Build cost | 37 | -- Build cost |
611 | 38 | local buildcost = "" | 38 | local buildcost = "" |
612 | 39 | 39 | ||
613 | === modified file 'data/world/immovables/trees/alder/init.lua' | |||
614 | --- data/world/immovables/trees/alder/init.lua 2019-03-17 08:30:43 +0000 | |||
615 | +++ data/world/immovables/trees/alder/init.lua 2019-05-03 18:29:53 +0000 | |||
616 | @@ -88,6 +88,7 @@ | |||
617 | 88 | name = "alder_summer_old", | 88 | name = "alder_summer_old", |
618 | 89 | descname = _ "Alder (Old)", | 89 | descname = _ "Alder (Old)", |
619 | 90 | species = _ "Alder", | 90 | species = _ "Alder", |
620 | 91 | icon = dirname .. "old/idle_0.png", | ||
621 | 91 | editor_category = "trees_deciduous", | 92 | editor_category = "trees_deciduous", |
622 | 92 | size = "small", | 93 | size = "small", |
623 | 93 | attributes = { "tree" }, | 94 | attributes = { "tree" }, |
624 | 94 | 95 | ||
625 | === modified file 'data/world/immovables/trees/aspen/init.lua' | |||
626 | --- data/world/immovables/trees/aspen/init.lua 2019-03-17 08:30:43 +0000 | |||
627 | +++ data/world/immovables/trees/aspen/init.lua 2019-05-03 18:29:53 +0000 | |||
628 | @@ -83,6 +83,7 @@ | |||
629 | 83 | name = "aspen_summer_old", | 83 | name = "aspen_summer_old", |
630 | 84 | descname = _ "Aspen (Old)", | 84 | descname = _ "Aspen (Old)", |
631 | 85 | species = _ "Aspen", | 85 | species = _ "Aspen", |
632 | 86 | icon = dirname .. "old/idle_0.png", | ||
633 | 86 | editor_category = "trees_deciduous", | 87 | editor_category = "trees_deciduous", |
634 | 87 | size = "small", | 88 | size = "small", |
635 | 88 | attributes = { "tree" }, | 89 | attributes = { "tree" }, |
636 | 89 | 90 | ||
637 | === modified file 'data/world/immovables/trees/beech/init.lua' | |||
638 | --- data/world/immovables/trees/beech/init.lua 2019-03-17 08:30:43 +0000 | |||
639 | +++ data/world/immovables/trees/beech/init.lua 2019-05-03 18:29:53 +0000 | |||
640 | @@ -80,6 +80,7 @@ | |||
641 | 80 | name = "beech_summer_old", | 80 | name = "beech_summer_old", |
642 | 81 | descname = _ "Beech (Old)", | 81 | descname = _ "Beech (Old)", |
643 | 82 | species = _ "Beech", | 82 | species = _ "Beech", |
644 | 83 | icon = dirname .. "old/idle_0.png", | ||
645 | 83 | editor_category = "trees_deciduous", | 84 | editor_category = "trees_deciduous", |
646 | 84 | size = "small", | 85 | size = "small", |
647 | 85 | attributes = { "tree" }, | 86 | attributes = { "tree" }, |
648 | 86 | 87 | ||
649 | === modified file 'data/world/immovables/trees/birch/init.lua' | |||
650 | --- data/world/immovables/trees/birch/init.lua 2019-03-17 08:30:43 +0000 | |||
651 | +++ data/world/immovables/trees/birch/init.lua 2019-05-03 18:29:53 +0000 | |||
652 | @@ -83,6 +83,7 @@ | |||
653 | 83 | name = "birch_summer_old", | 83 | name = "birch_summer_old", |
654 | 84 | descname = _ "Birch (Old)", | 84 | descname = _ "Birch (Old)", |
655 | 85 | species = _ "Birch", | 85 | species = _ "Birch", |
656 | 86 | icon = dirname .. "old/idle_0.png", | ||
657 | 86 | editor_category = "trees_deciduous", | 87 | editor_category = "trees_deciduous", |
658 | 87 | size = "small", | 88 | size = "small", |
659 | 88 | attributes = { "tree" }, | 89 | attributes = { "tree" }, |
660 | 89 | 90 | ||
661 | === modified file 'data/world/immovables/trees/cirrus/init.lua' | |||
662 | --- data/world/immovables/trees/cirrus/init.lua 2018-11-03 11:27:18 +0000 | |||
663 | +++ data/world/immovables/trees/cirrus/init.lua 2019-05-03 18:29:53 +0000 | |||
664 | @@ -85,6 +85,7 @@ | |||
665 | 85 | descname = _ "Cirrus Tree (Old)", | 85 | descname = _ "Cirrus Tree (Old)", |
666 | 86 | -- TRANSLATORS: This is a fictitious tree. Be creative if you want. | 86 | -- TRANSLATORS: This is a fictitious tree. Be creative if you want. |
667 | 87 | species = _ "Cirrus Tree", | 87 | species = _ "Cirrus Tree", |
668 | 88 | icon = dirname .. "old/idle_0.png", | ||
669 | 88 | editor_category = "trees_wasteland", | 89 | editor_category = "trees_wasteland", |
670 | 89 | size = "small", | 90 | size = "small", |
671 | 90 | attributes = { "tree" }, | 91 | attributes = { "tree" }, |
672 | 91 | 92 | ||
673 | === modified file 'data/world/immovables/trees/larch/init.lua' | |||
674 | --- data/world/immovables/trees/larch/init.lua 2019-03-17 08:30:43 +0000 | |||
675 | +++ data/world/immovables/trees/larch/init.lua 2019-05-03 18:29:53 +0000 | |||
676 | @@ -80,6 +80,7 @@ | |||
677 | 80 | name = "larch_summer_old", | 80 | name = "larch_summer_old", |
678 | 81 | descname = _ "Larch (Old)", | 81 | descname = _ "Larch (Old)", |
679 | 82 | species = _ "Larch", | 82 | species = _ "Larch", |
680 | 83 | icon = dirname .. "old/idle_0.png", | ||
681 | 83 | editor_category = "trees_coniferous", | 84 | editor_category = "trees_coniferous", |
682 | 84 | size = "small", | 85 | size = "small", |
683 | 85 | attributes = { "tree" }, | 86 | attributes = { "tree" }, |
684 | 86 | 87 | ||
685 | === modified file 'data/world/immovables/trees/liana/init.lua' | |||
686 | --- data/world/immovables/trees/liana/init.lua 2018-11-03 11:27:18 +0000 | |||
687 | +++ data/world/immovables/trees/liana/init.lua 2019-05-03 18:29:53 +0000 | |||
688 | @@ -88,6 +88,7 @@ | |||
689 | 88 | descname = _ "Liana Tree (Old)", | 88 | descname = _ "Liana Tree (Old)", |
690 | 89 | -- TRANSLATORS: This is a fictitious tree. Be creative if you want. | 89 | -- TRANSLATORS: This is a fictitious tree. Be creative if you want. |
691 | 90 | species = _ "Liana Tree", | 90 | species = _ "Liana Tree", |
692 | 91 | icon = dirname .. "old/idle_0.png", | ||
693 | 91 | editor_category = "trees_wasteland", | 92 | editor_category = "trees_wasteland", |
694 | 92 | size = "small", | 93 | size = "small", |
695 | 93 | attributes = { "tree" }, | 94 | attributes = { "tree" }, |
696 | 94 | 95 | ||
697 | === modified file 'data/world/immovables/trees/maple/init.lua' | |||
698 | --- data/world/immovables/trees/maple/init.lua 2019-03-17 08:30:43 +0000 | |||
699 | +++ data/world/immovables/trees/maple/init.lua 2019-05-03 18:29:53 +0000 | |||
700 | @@ -80,6 +80,7 @@ | |||
701 | 80 | name = "maple_winter_old", | 80 | name = "maple_winter_old", |
702 | 81 | descname = _ "Maple (Old)", | 81 | descname = _ "Maple (Old)", |
703 | 82 | species = _ "Maple", | 82 | species = _ "Maple", |
704 | 83 | icon = dirname .. "old/idle_0.png", | ||
705 | 83 | editor_category = "trees_deciduous", | 84 | editor_category = "trees_deciduous", |
706 | 84 | size = "small", | 85 | size = "small", |
707 | 85 | attributes = { "tree" }, | 86 | attributes = { "tree" }, |
708 | 86 | 87 | ||
709 | === modified file 'data/world/immovables/trees/mushroom_dark/init.lua' | |||
710 | --- data/world/immovables/trees/mushroom_dark/init.lua 2018-11-03 11:27:18 +0000 | |||
711 | +++ data/world/immovables/trees/mushroom_dark/init.lua 2019-05-03 18:29:53 +0000 | |||
712 | @@ -85,6 +85,7 @@ | |||
713 | 85 | descname = _ "Dark Mushroom Tree (Old)", | 85 | descname = _ "Dark Mushroom Tree (Old)", |
714 | 86 | -- TRANSLATORS: This is a fictitious tree. Be creative if you want. | 86 | -- TRANSLATORS: This is a fictitious tree. Be creative if you want. |
715 | 87 | species = _ "Dark Mushroom Tree", | 87 | species = _ "Dark Mushroom Tree", |
716 | 88 | icon = dirname .. "old/idle_0.png", | ||
717 | 88 | editor_category = "trees_wasteland", | 89 | editor_category = "trees_wasteland", |
718 | 89 | size = "small", | 90 | size = "small", |
719 | 90 | attributes = { "tree" }, | 91 | attributes = { "tree" }, |
720 | 91 | 92 | ||
721 | === modified file 'data/world/immovables/trees/mushroom_green/init.lua' | |||
722 | --- data/world/immovables/trees/mushroom_green/init.lua 2018-11-03 11:27:18 +0000 | |||
723 | +++ data/world/immovables/trees/mushroom_green/init.lua 2019-05-03 18:29:53 +0000 | |||
724 | @@ -85,6 +85,7 @@ | |||
725 | 85 | descname = _ "Green Mushroom Tree (Old)", | 85 | descname = _ "Green Mushroom Tree (Old)", |
726 | 86 | -- TRANSLATORS: This is a fictitious tree. Be creative if you want. | 86 | -- TRANSLATORS: This is a fictitious tree. Be creative if you want. |
727 | 87 | species = _ "Green Mushroom Tree", | 87 | species = _ "Green Mushroom Tree", |
728 | 88 | icon = dirname .. "old/idle_0.png", | ||
729 | 88 | editor_category = "trees_wasteland", | 89 | editor_category = "trees_wasteland", |
730 | 89 | size = "small", | 90 | size = "small", |
731 | 90 | attributes = { "tree" }, | 91 | attributes = { "tree" }, |
732 | 91 | 92 | ||
733 | === modified file 'data/world/immovables/trees/mushroom_red/init.lua' | |||
734 | --- data/world/immovables/trees/mushroom_red/init.lua 2018-11-03 11:27:18 +0000 | |||
735 | +++ data/world/immovables/trees/mushroom_red/init.lua 2019-05-03 18:29:53 +0000 | |||
736 | @@ -88,6 +88,7 @@ | |||
737 | 88 | descname = _ "Red Mushroom Tree (Old)", | 88 | descname = _ "Red Mushroom Tree (Old)", |
738 | 89 | -- TRANSLATORS: This is a fictitious tree. Be creative if you want. | 89 | -- TRANSLATORS: This is a fictitious tree. Be creative if you want. |
739 | 90 | species = _ "Red Mushroom Tree", | 90 | species = _ "Red Mushroom Tree", |
740 | 91 | icon = dirname .. "old/idle_0.png", | ||
741 | 91 | editor_category = "trees_wasteland", | 92 | editor_category = "trees_wasteland", |
742 | 92 | size = "small", | 93 | size = "small", |
743 | 93 | attributes = { "tree" }, | 94 | attributes = { "tree" }, |
744 | 94 | 95 | ||
745 | === modified file 'data/world/immovables/trees/oak/init.lua' | |||
746 | --- data/world/immovables/trees/oak/init.lua 2019-03-17 08:30:43 +0000 | |||
747 | +++ data/world/immovables/trees/oak/init.lua 2019-05-03 18:29:53 +0000 | |||
748 | @@ -80,6 +80,7 @@ | |||
749 | 80 | name = "oak_summer_old", | 80 | name = "oak_summer_old", |
750 | 81 | descname = _ "Oak (Old)", | 81 | descname = _ "Oak (Old)", |
751 | 82 | species = _ "Oak", | 82 | species = _ "Oak", |
752 | 83 | icon = dirname .. "old/idle_0.png", | ||
753 | 83 | editor_category = "trees_deciduous", | 84 | editor_category = "trees_deciduous", |
754 | 84 | size = "small", | 85 | size = "small", |
755 | 85 | attributes = { "tree" }, | 86 | attributes = { "tree" }, |
756 | 86 | 87 | ||
757 | === modified file 'data/world/immovables/trees/palm_borassus/init.lua' | |||
758 | --- data/world/immovables/trees/palm_borassus/init.lua 2019-03-17 08:30:43 +0000 | |||
759 | +++ data/world/immovables/trees/palm_borassus/init.lua 2019-05-03 18:29:53 +0000 | |||
760 | @@ -80,6 +80,7 @@ | |||
761 | 80 | name = "palm_borassus_desert_old", | 80 | name = "palm_borassus_desert_old", |
762 | 81 | descname = _ "Borassus Palm (Old)", | 81 | descname = _ "Borassus Palm (Old)", |
763 | 82 | species = _ "Borassus Palm", | 82 | species = _ "Borassus Palm", |
764 | 83 | icon = dirname .. "old/idle_0.png", | ||
765 | 83 | editor_category = "trees_palm", | 84 | editor_category = "trees_palm", |
766 | 84 | size = "small", | 85 | size = "small", |
767 | 85 | attributes = { "tree" }, | 86 | attributes = { "tree" }, |
768 | 86 | 87 | ||
769 | === modified file 'data/world/immovables/trees/palm_coconut/init.lua' | |||
770 | --- data/world/immovables/trees/palm_coconut/init.lua 2019-03-17 08:30:43 +0000 | |||
771 | +++ data/world/immovables/trees/palm_coconut/init.lua 2019-05-03 18:29:53 +0000 | |||
772 | @@ -80,6 +80,7 @@ | |||
773 | 80 | name = "palm_coconut_desert_old", | 80 | name = "palm_coconut_desert_old", |
774 | 81 | descname = _ "Coconut Palm (Old)", | 81 | descname = _ "Coconut Palm (Old)", |
775 | 82 | species = _ "Coconut Palm", | 82 | species = _ "Coconut Palm", |
776 | 83 | icon = dirname .. "old/idle_0.png", | ||
777 | 83 | editor_category = "trees_palm", | 84 | editor_category = "trees_palm", |
778 | 84 | size = "small", | 85 | size = "small", |
779 | 85 | attributes = { "tree" }, | 86 | attributes = { "tree" }, |
780 | 86 | 87 | ||
781 | === modified file 'data/world/immovables/trees/palm_date/init.lua' | |||
782 | --- data/world/immovables/trees/palm_date/init.lua 2019-03-17 08:30:43 +0000 | |||
783 | +++ data/world/immovables/trees/palm_date/init.lua 2019-05-03 18:29:53 +0000 | |||
784 | @@ -83,6 +83,7 @@ | |||
785 | 83 | name = "palm_date_desert_old", | 83 | name = "palm_date_desert_old", |
786 | 84 | descname = _ "Date Palm (Old)", | 84 | descname = _ "Date Palm (Old)", |
787 | 85 | species = _ "Date Palm", | 85 | species = _ "Date Palm", |
788 | 86 | icon = dirname .. "old/idle_0.png", | ||
789 | 86 | editor_category = "trees_palm", | 87 | editor_category = "trees_palm", |
790 | 87 | size = "small", | 88 | size = "small", |
791 | 88 | attributes = { "tree" }, | 89 | attributes = { "tree" }, |
792 | 89 | 90 | ||
793 | === modified file 'data/world/immovables/trees/palm_oil/init.lua' | |||
794 | --- data/world/immovables/trees/palm_oil/init.lua 2019-03-17 08:30:43 +0000 | |||
795 | +++ data/world/immovables/trees/palm_oil/init.lua 2019-05-03 18:29:53 +0000 | |||
796 | @@ -84,6 +84,7 @@ | |||
797 | 84 | name = "palm_oil_desert_old", | 84 | name = "palm_oil_desert_old", |
798 | 85 | descname = _ "Oil Palm (Old)", | 85 | descname = _ "Oil Palm (Old)", |
799 | 86 | species = _ "Oil Palm", | 86 | species = _ "Oil Palm", |
800 | 87 | icon = dirname .. "old/idle_0.png", | ||
801 | 87 | editor_category = "trees_palm", | 88 | editor_category = "trees_palm", |
802 | 88 | size = "small", | 89 | size = "small", |
803 | 89 | attributes = { "tree" }, | 90 | attributes = { "tree" }, |
804 | 90 | 91 | ||
805 | === modified file 'data/world/immovables/trees/palm_roystonea/init.lua' | |||
806 | --- data/world/immovables/trees/palm_roystonea/init.lua 2019-03-17 08:30:43 +0000 | |||
807 | +++ data/world/immovables/trees/palm_roystonea/init.lua 2019-05-03 18:29:53 +0000 | |||
808 | @@ -80,6 +80,7 @@ | |||
809 | 80 | name = "palm_roystonea_desert_old", | 80 | name = "palm_roystonea_desert_old", |
810 | 81 | descname = _ "Roystonea regia Palm (Old)", | 81 | descname = _ "Roystonea regia Palm (Old)", |
811 | 82 | species = _ "Roystonea regia Palm", | 82 | species = _ "Roystonea regia Palm", |
812 | 83 | icon = dirname .. "old/idle_0.png", | ||
813 | 83 | editor_category = "trees_palm", | 84 | editor_category = "trees_palm", |
814 | 84 | size = "small", | 85 | size = "small", |
815 | 85 | attributes = { "tree" }, | 86 | attributes = { "tree" }, |
816 | 86 | 87 | ||
817 | === modified file 'data/world/immovables/trees/rowan/init.lua' | |||
818 | --- data/world/immovables/trees/rowan/init.lua 2019-03-17 08:30:43 +0000 | |||
819 | +++ data/world/immovables/trees/rowan/init.lua 2019-05-03 18:29:53 +0000 | |||
820 | @@ -83,6 +83,7 @@ | |||
821 | 83 | name = "rowan_summer_old", | 83 | name = "rowan_summer_old", |
822 | 84 | descname = _ "Rowan (Old)", | 84 | descname = _ "Rowan (Old)", |
823 | 85 | species = _ "Rowan", | 85 | species = _ "Rowan", |
824 | 86 | icon = dirname .. "old/idle_0.png", | ||
825 | 86 | editor_category = "trees_deciduous", | 87 | editor_category = "trees_deciduous", |
826 | 87 | size = "small", | 88 | size = "small", |
827 | 88 | attributes = { "tree" }, | 89 | attributes = { "tree" }, |
828 | 89 | 90 | ||
829 | === modified file 'data/world/immovables/trees/spruce/init.lua' | |||
830 | --- data/world/immovables/trees/spruce/init.lua 2019-03-17 08:30:43 +0000 | |||
831 | +++ data/world/immovables/trees/spruce/init.lua 2019-05-03 18:29:53 +0000 | |||
832 | @@ -80,6 +80,7 @@ | |||
833 | 80 | name = "spruce_summer_old", | 80 | name = "spruce_summer_old", |
834 | 81 | descname = _ "Spruce (Old)", | 81 | descname = _ "Spruce (Old)", |
835 | 82 | species = _ "Spruce", | 82 | species = _ "Spruce", |
836 | 83 | icon = dirname .. "old/idle_0.png", | ||
837 | 83 | editor_category = "trees_coniferous", | 84 | editor_category = "trees_coniferous", |
838 | 84 | size = "small", | 85 | size = "small", |
839 | 85 | attributes = { "tree" }, | 86 | attributes = { "tree" }, |
840 | 86 | 87 | ||
841 | === modified file 'data/world/immovables/trees/twine/init.lua' | |||
842 | --- data/world/immovables/trees/twine/init.lua 2018-11-03 11:27:18 +0000 | |||
843 | +++ data/world/immovables/trees/twine/init.lua 2019-05-03 18:29:53 +0000 | |||
844 | @@ -85,6 +85,7 @@ | |||
845 | 85 | descname = _ "Twine Tree (Old)", | 85 | descname = _ "Twine Tree (Old)", |
846 | 86 | -- TRANSLATORS: This is a fictitious tree. Be creative if you want. | 86 | -- TRANSLATORS: This is a fictitious tree. Be creative if you want. |
847 | 87 | species = _ "Twine Tree", | 87 | species = _ "Twine Tree", |
848 | 88 | icon = dirname .. "old/idle_0.png", | ||
849 | 88 | editor_category = "trees_wasteland", | 89 | editor_category = "trees_wasteland", |
850 | 89 | size = "small", | 90 | size = "small", |
851 | 90 | attributes = { "tree" }, | 91 | attributes = { "tree" }, |
852 | 91 | 92 | ||
853 | === modified file 'data/world/immovables/trees/umbrella_green/init.lua' | |||
854 | --- data/world/immovables/trees/umbrella_green/init.lua 2018-11-03 11:27:18 +0000 | |||
855 | +++ data/world/immovables/trees/umbrella_green/init.lua 2019-05-03 18:29:53 +0000 | |||
856 | @@ -85,6 +85,7 @@ | |||
857 | 85 | descname = _ "Green Umbrella Tree (Old)", | 85 | descname = _ "Green Umbrella Tree (Old)", |
858 | 86 | -- TRANSLATORS: This is a fictitious tree. Be creative if you want. | 86 | -- TRANSLATORS: This is a fictitious tree. Be creative if you want. |
859 | 87 | species = _ "Green Umbrella Tree", | 87 | species = _ "Green Umbrella Tree", |
860 | 88 | icon = dirname .. "old/idle_0.png", | ||
861 | 88 | editor_category = "trees_wasteland", | 89 | editor_category = "trees_wasteland", |
862 | 89 | size = "small", | 90 | size = "small", |
863 | 90 | attributes = { "tree" }, | 91 | attributes = { "tree" }, |
864 | 91 | 92 | ||
865 | === modified file 'data/world/immovables/trees/umbrella_red/init.lua' | |||
866 | --- data/world/immovables/trees/umbrella_red/init.lua 2018-11-03 11:27:18 +0000 | |||
867 | +++ data/world/immovables/trees/umbrella_red/init.lua 2019-05-03 18:29:53 +0000 | |||
868 | @@ -88,6 +88,7 @@ | |||
869 | 88 | descname = _ "Red Umbrella Tree (Old)", | 88 | descname = _ "Red Umbrella Tree (Old)", |
870 | 89 | -- TRANSLATORS: This is a fictitious tree. Be creative if you want. | 89 | -- TRANSLATORS: This is a fictitious tree. Be creative if you want. |
871 | 90 | species = _ "Red Umbrella Tree", | 90 | species = _ "Red Umbrella Tree", |
872 | 91 | icon = dirname .. "old/idle_0.png", | ||
873 | 91 | editor_category = "trees_wasteland", | 92 | editor_category = "trees_wasteland", |
874 | 92 | size = "small", | 93 | size = "small", |
875 | 93 | attributes = { "tree" }, | 94 | attributes = { "tree" }, |
876 | 94 | 95 | ||
877 | === modified file 'doc/sphinx/source/animations.rst' | |||
878 | --- doc/sphinx/source/animations.rst 2019-04-24 06:32:02 +0000 | |||
879 | +++ doc/sphinx/source/animations.rst 2019-05-03 18:29:53 +0000 | |||
880 | @@ -26,6 +26,7 @@ | |||
881 | 26 | path = "sound/foo/bar", | 26 | path = "sound/foo/bar", |
882 | 27 | priority = 128 | 27 | priority = 128 |
883 | 28 | }, | 28 | }, |
884 | 29 | representative_frame = 3, | ||
885 | 29 | }, | 30 | }, |
886 | 30 | working = ... | 31 | working = ... |
887 | 31 | } | 32 | } |
888 | @@ -103,6 +104,8 @@ | |||
889 | 103 | Each mimap entry must define the ``files`` and the ``scale``. | 104 | Each mimap entry must define the ``files`` and the ``scale``. |
890 | 104 | See also :ref:`animations_converting_formats`. | 105 | See also :ref:`animations_converting_formats`. |
891 | 105 | 106 | ||
892 | 107 | **representative_frame** | ||
893 | 108 | *Optional*. Choose the animation frame that will be displayed in messages and in the encyclopedia as a representative image. Default is 0. | ||
894 | 106 | 109 | ||
895 | 107 | Directional Animations | 110 | Directional Animations |
896 | 108 | ---------------------- | 111 | ---------------------- |
897 | 109 | 112 | ||
898 | === modified file 'src/graphic/animation.cc' | |||
899 | --- src/graphic/animation.cc 2019-04-24 20:48:37 +0000 | |||
900 | +++ src/graphic/animation.cc 2019-05-03 18:29:53 +0000 | |||
901 | @@ -85,7 +85,6 @@ | |||
902 | 85 | uint16_t nr_frames() const override; | 85 | uint16_t nr_frames() const override; |
903 | 86 | uint32_t frametime() const override; | 86 | uint32_t frametime() const override; |
904 | 87 | const Image* representative_image(const RGBColor* clr) const override; | 87 | const Image* representative_image(const RGBColor* clr) const override; |
905 | 88 | const std::string& representative_image_filename() const override; | ||
906 | 89 | virtual void blit(uint32_t time, | 88 | virtual void blit(uint32_t time, |
907 | 90 | const Widelands::Coords& coords, | 89 | const Widelands::Coords& coords, |
908 | 91 | const Rectf& source_rect, | 90 | const Rectf& source_rect, |
909 | @@ -162,7 +161,8 @@ | |||
910 | 162 | } | 161 | } |
911 | 163 | 162 | ||
912 | 164 | NonPackedAnimation::NonPackedAnimation(const LuaTable& table) | 163 | NonPackedAnimation::NonPackedAnimation(const LuaTable& table) |
914 | 165 | : frametime_(FRAME_LENGTH), | 164 | : Animation(table.has_key("representative_frame") ? table.get_int("representative_frame") : 0), |
915 | 165 | frametime_(FRAME_LENGTH), | ||
916 | 166 | hotspot_(table.get_vector<std::string, int>("hotspot")), | 166 | hotspot_(table.get_vector<std::string, int>("hotspot")), |
917 | 167 | sound_effect_(kNoSoundEffect), | 167 | sound_effect_(kNoSoundEffect), |
918 | 168 | sound_priority_(kFxPriorityLowest), | 168 | sound_priority_(kFxPriorityLowest), |
919 | @@ -224,6 +224,10 @@ | |||
920 | 224 | frametime_ = 1000 / get_positive_int(table, "fps"); | 224 | frametime_ = 1000 / get_positive_int(table, "fps"); |
921 | 225 | } | 225 | } |
922 | 226 | 226 | ||
923 | 227 | if (representative_frame_ < 0 || representative_frame_ > nr_frames_ - 1) { | ||
924 | 228 | throw wexception("Animation has %d as its representative frame, but the frame indices available are 0 - %d", representative_frame_, nr_frames_ - 1); | ||
925 | 229 | } | ||
926 | 230 | |||
927 | 227 | // Perform some checks to make sure that the data is complete and consistent | 231 | // Perform some checks to make sure that the data is complete and consistent |
928 | 228 | const bool should_have_playercolor = mipmaps_.begin()->second->has_playercolor_masks; | 232 | const bool should_have_playercolor = mipmaps_.begin()->second->has_playercolor_masks; |
929 | 229 | for (const auto& mipmap : mipmaps_) { | 233 | for (const auto& mipmap : mipmaps_) { |
930 | @@ -327,8 +331,8 @@ | |||
931 | 327 | const MipMapEntry& mipmap = *mipmaps_.at(1.0f); | 331 | const MipMapEntry& mipmap = *mipmaps_.at(1.0f); |
932 | 328 | std::vector<std::string> images = mipmap.image_files; | 332 | std::vector<std::string> images = mipmap.image_files; |
933 | 329 | assert(!images.empty()); | 333 | assert(!images.empty()); |
936 | 330 | const Image* image = (mipmap.has_playercolor_masks && clr) ? playercolor_image(*clr, images[0]) : | 334 | const Image* image = (mipmap.has_playercolor_masks && clr) ? playercolor_image(*clr, images[representative_frame_]) : |
937 | 331 | g_gr->images().get(images[0]); | 335 | g_gr->images().get(images[representative_frame_]); |
938 | 332 | 336 | ||
939 | 333 | const int w = image->width(); | 337 | const int w = image->width(); |
940 | 334 | const int h = image->height(); | 338 | const int h = image->height(); |
941 | @@ -338,11 +342,6 @@ | |||
942 | 338 | return rv; | 342 | return rv; |
943 | 339 | } | 343 | } |
944 | 340 | 344 | ||
945 | 341 | // TODO(GunChleoc): This is only here for the font renderers. | ||
946 | 342 | const std::string& NonPackedAnimation::representative_image_filename() const { | ||
947 | 343 | return mipmaps_.at(1.0f)->image_files[0]; | ||
948 | 344 | } | ||
949 | 345 | |||
950 | 346 | uint32_t NonPackedAnimation::current_frame(uint32_t time) const { | 345 | uint32_t NonPackedAnimation::current_frame(uint32_t time) const { |
951 | 347 | if (nr_frames() > 1) { | 346 | if (nr_frames() > 1) { |
952 | 348 | return (play_once_ && time / frametime_ > static_cast<uint32_t>(nr_frames() - 1)) ? | 347 | return (play_once_ && time / frametime_ > static_cast<uint32_t>(nr_frames() - 1)) ? |
953 | @@ -437,6 +436,12 @@ | |||
954 | 437 | animations_.push_back(std::unique_ptr<Animation>(new NonPackedAnimation(table))); | 436 | animations_.push_back(std::unique_ptr<Animation>(new NonPackedAnimation(table))); |
955 | 438 | return animations_.size(); | 437 | return animations_.size(); |
956 | 439 | } | 438 | } |
957 | 439 | uint32_t AnimationManager::load(const std::string& map_object_name, const LuaTable& table) { | ||
958 | 440 | animations_.push_back(std::unique_ptr<Animation>(new NonPackedAnimation(table))); | ||
959 | 441 | const size_t result = animations_.size(); | ||
960 | 442 | representative_animations_by_map_object_name_.insert(std::make_pair(map_object_name, result)); | ||
961 | 443 | return result; | ||
962 | 444 | } | ||
963 | 440 | 445 | ||
964 | 441 | const Animation& AnimationManager::get_animation(uint32_t id) const { | 446 | const Animation& AnimationManager::get_animation(uint32_t id) const { |
965 | 442 | if (!id || id > animations_.size()) | 447 | if (!id || id > animations_.size()) |
966 | @@ -454,3 +459,11 @@ | |||
967 | 454 | } | 459 | } |
968 | 455 | return representative_images_.at(hash).get(); | 460 | return representative_images_.at(hash).get(); |
969 | 456 | } | 461 | } |
970 | 462 | |||
971 | 463 | const Image* AnimationManager::get_representative_image(const std::string& map_object_name, const RGBColor* clr) { | ||
972 | 464 | if (representative_animations_by_map_object_name_.count(map_object_name) != 1) { | ||
973 | 465 | log("Warning: %s has no animation assigned for its representative image, or it's not a known map object\n", map_object_name.c_str()); | ||
974 | 466 | return new Texture(0, 0); | ||
975 | 467 | } | ||
976 | 468 | return get_representative_image(representative_animations_by_map_object_name_.at(map_object_name), clr); | ||
977 | 469 | } | ||
978 | 457 | 470 | ||
979 | === modified file 'src/graphic/animation.h' | |||
980 | --- src/graphic/animation.h 2019-04-24 20:48:37 +0000 | |||
981 | +++ src/graphic/animation.h 2019-05-03 18:29:53 +0000 | |||
982 | @@ -53,7 +53,7 @@ | |||
983 | 53 | */ | 53 | */ |
984 | 54 | class Animation { | 54 | class Animation { |
985 | 55 | public: | 55 | public: |
987 | 56 | Animation() { | 56 | Animation(int representative_frame) : representative_frame_(representative_frame) { |
988 | 57 | } | 57 | } |
989 | 58 | virtual ~Animation() { | 58 | virtual ~Animation() { |
990 | 59 | } | 59 | } |
991 | @@ -82,8 +82,6 @@ | |||
992 | 82 | /// The 'clr' is the player color used for blending - the parameter can be | 82 | /// The 'clr' is the player color used for blending - the parameter can be |
993 | 83 | /// 'nullptr', in which case the neutral image will be returned. | 83 | /// 'nullptr', in which case the neutral image will be returned. |
994 | 84 | virtual const Image* representative_image(const RGBColor* clr) const = 0; | 84 | virtual const Image* representative_image(const RGBColor* clr) const = 0; |
995 | 85 | /// The filename of the image used for the first frame, without player color. | ||
996 | 86 | virtual const std::string& representative_image_filename() const = 0; | ||
997 | 87 | 85 | ||
998 | 88 | /// Blit the animation frame that should be displayed at the given time index | 86 | /// Blit the animation frame that should be displayed at the given time index |
999 | 89 | /// into the given 'destination_rect'. | 87 | /// into the given 'destination_rect'. |
1000 | @@ -105,6 +103,9 @@ | |||
1001 | 105 | /// If 'coords' == Widelands::Coords::null(), skip playing any sound effects. | 103 | /// If 'coords' == Widelands::Coords::null(), skip playing any sound effects. |
1002 | 106 | virtual void trigger_sound(uint32_t time, const Widelands::Coords& coords) const = 0; | 104 | virtual void trigger_sound(uint32_t time, const Widelands::Coords& coords) const = 0; |
1003 | 107 | 105 | ||
1004 | 106 | protected: | ||
1005 | 107 | int representative_frame_; | ||
1006 | 108 | |||
1007 | 108 | private: | 109 | private: |
1008 | 109 | DISALLOW_COPY_AND_ASSIGN(Animation); | 110 | DISALLOW_COPY_AND_ASSIGN(Animation); |
1009 | 110 | }; | 111 | }; |
1010 | @@ -122,6 +123,8 @@ | |||
1011 | 122 | * Optional parameters in the Lua table are 'fps' and 'sound_effect'. | 123 | * Optional parameters in the Lua table are 'fps' and 'sound_effect'. |
1012 | 123 | */ | 124 | */ |
1013 | 124 | uint32_t load(const LuaTable& table); | 125 | uint32_t load(const LuaTable& table); |
1014 | 126 | /// Same as above, but this animation will be used for getting a representative image by map object name | ||
1015 | 127 | uint32_t load(const std::string& map_object_name, const LuaTable& table); | ||
1016 | 125 | 128 | ||
1017 | 126 | /// Returns the animation with the given ID or throws an exception if it is | 129 | /// Returns the animation with the given ID or throws an exception if it is |
1018 | 127 | /// unknown. | 130 | /// unknown. |
1019 | @@ -131,11 +134,13 @@ | |||
1020 | 131 | /// If this image has been generated before, it is pulled from the cache using | 134 | /// If this image has been generated before, it is pulled from the cache using |
1021 | 132 | /// the clr argument that was used previously. | 135 | /// the clr argument that was used previously. |
1022 | 133 | const Image* get_representative_image(uint32_t id, const RGBColor* clr = nullptr); | 136 | const Image* get_representative_image(uint32_t id, const RGBColor* clr = nullptr); |
1023 | 137 | const Image* get_representative_image(const std::string& map_object_name, const RGBColor* clr = nullptr); | ||
1024 | 134 | 138 | ||
1025 | 135 | private: | 139 | private: |
1026 | 136 | std::vector<std::unique_ptr<Animation>> animations_; | 140 | std::vector<std::unique_ptr<Animation>> animations_; |
1027 | 137 | std::map<std::pair<uint32_t, const RGBColor*>, std::unique_ptr<const Image>> | 141 | std::map<std::pair<uint32_t, const RGBColor*>, std::unique_ptr<const Image>> |
1028 | 138 | representative_images_; | 142 | representative_images_; |
1029 | 143 | std::map<std::string, uint32_t> representative_animations_by_map_object_name_; | ||
1030 | 139 | }; | 144 | }; |
1031 | 140 | 145 | ||
1032 | 141 | #endif // end of include guard: WL_GRAPHIC_ANIMATION_H | 146 | #endif // end of include guard: WL_GRAPHIC_ANIMATION_H |
1033 | 142 | 147 | ||
1034 | === modified file 'src/graphic/text/rt_parse.cc' | |||
1035 | --- src/graphic/text/rt_parse.cc 2019-02-23 11:00:49 +0000 | |||
1036 | +++ src/graphic/text/rt_parse.cc 2019-05-03 18:29:53 +0000 | |||
1037 | @@ -481,15 +481,18 @@ | |||
1038 | 481 | ^^^^^^^^^^ | 481 | ^^^^^^^^^^ |
1039 | 482 | 482 | ||
1040 | 483 | * **src**: The path to the image, relative to the ``data`` directory. | 483 | * **src**: The path to the image, relative to the ``data`` directory. |
1041 | 484 | * **object**: Show the representative image of a map object instead of using ``src``. | ||
1042 | 484 | * **ref**: To be implemented | 485 | * **ref**: To be implemented |
1043 | 485 | * **color**: Player color for the image as a hex value | 486 | * **color**: Player color for the image as a hex value |
1046 | 486 | * **width**: Width of the image as a pixel amount. The corresponding height will be matched | 487 | * **width**: Width of the image as a pixel amount. |
1047 | 487 | automatically. | 488 | The corresponding height will be matched automatically. |
1048 | 489 | Not supported in conjunction with the ``object`` parameter. | ||
1049 | 488 | 490 | ||
1050 | 489 | :ref:`Return to tag index<rt_tags>` | 491 | :ref:`Return to tag index<rt_tags>` |
1051 | 490 | */ | 492 | */ |
1052 | 491 | TagConstraint tc; | 493 | TagConstraint tc; |
1053 | 492 | tc.allowed_attrs.insert("src"); | 494 | tc.allowed_attrs.insert("src"); |
1054 | 495 | tc.allowed_attrs.insert("object"); | ||
1055 | 493 | tc.allowed_attrs.insert("ref"); | 496 | tc.allowed_attrs.insert("ref"); |
1056 | 494 | tc.allowed_attrs.insert("color"); | 497 | tc.allowed_attrs.insert("color"); |
1057 | 495 | tc.allowed_attrs.insert("width"); | 498 | tc.allowed_attrs.insert("width"); |
1058 | 496 | 499 | ||
1059 | === modified file 'src/graphic/text/rt_render.cc' | |||
1060 | --- src/graphic/text/rt_render.cc 2019-02-23 11:00:49 +0000 | |||
1061 | +++ src/graphic/text/rt_render.cc 2019-05-03 18:29:53 +0000 | |||
1062 | @@ -36,6 +36,7 @@ | |||
1063 | 36 | #include "base/vector.h" | 36 | #include "base/vector.h" |
1064 | 37 | #include "base/wexception.h" | 37 | #include "base/wexception.h" |
1065 | 38 | #include "graphic/align.h" | 38 | #include "graphic/align.h" |
1066 | 39 | #include "graphic/animation.h" | ||
1067 | 39 | #include "graphic/graphic.h" | 40 | #include "graphic/graphic.h" |
1068 | 40 | #include "graphic/image_cache.h" | 41 | #include "graphic/image_cache.h" |
1069 | 41 | #include "graphic/image_io.h" | 42 | #include "graphic/image_io.h" |
1070 | @@ -970,6 +971,17 @@ | |||
1071 | 970 | check_size(); | 971 | check_size(); |
1072 | 971 | } | 972 | } |
1073 | 972 | 973 | ||
1074 | 974 | ImgRenderNode(NodeStyle& ns, | ||
1075 | 975 | const Image* image) | ||
1076 | 976 | : RenderNode(ns), | ||
1077 | 977 | image_(image), | ||
1078 | 978 | filename_(""), | ||
1079 | 979 | scale_(1.0f), | ||
1080 | 980 | color_(RGBColor(0, 0, 0)), | ||
1081 | 981 | use_playercolor_(false) { | ||
1082 | 982 | check_size(); | ||
1083 | 983 | } | ||
1084 | 984 | |||
1085 | 973 | std::string debug_info() const override { | 985 | std::string debug_info() const override { |
1086 | 974 | return "img"; | 986 | return "img"; |
1087 | 975 | } | 987 | } |
1088 | @@ -989,14 +1001,14 @@ | |||
1089 | 989 | const Image* image_; | 1001 | const Image* image_; |
1090 | 990 | const std::string filename_; | 1002 | const std::string filename_; |
1091 | 991 | const double scale_; | 1003 | const double scale_; |
1093 | 992 | const RGBColor& color_; | 1004 | const RGBColor color_; |
1094 | 993 | bool use_playercolor_; | 1005 | bool use_playercolor_; |
1095 | 994 | }; | 1006 | }; |
1096 | 995 | 1007 | ||
1097 | 996 | std::shared_ptr<UI::RenderedText> ImgRenderNode::render(TextureCache* texture_cache) { | 1008 | std::shared_ptr<UI::RenderedText> ImgRenderNode::render(TextureCache* texture_cache) { |
1098 | 997 | std::shared_ptr<UI::RenderedText> rendered_text(new UI::RenderedText()); | 1009 | std::shared_ptr<UI::RenderedText> rendered_text(new UI::RenderedText()); |
1099 | 998 | 1010 | ||
1101 | 999 | if (scale_ == 1.0) { | 1011 | if (scale_ == 1.0 || filename_.empty()) { |
1102 | 1000 | // Image can be used as is, and has already been cached in g_gr->images() | 1012 | // Image can be used as is, and has already been cached in g_gr->images() |
1103 | 1001 | assert(image_ != nullptr); | 1013 | assert(image_ != nullptr); |
1104 | 1002 | rendered_text->rects.push_back( | 1014 | rendered_text->rects.push_back( |
1105 | @@ -1267,28 +1279,34 @@ | |||
1106 | 1267 | const AttrMap& a = tag_.attrs(); | 1279 | const AttrMap& a = tag_.attrs(); |
1107 | 1268 | RGBColor color; | 1280 | RGBColor color; |
1108 | 1269 | bool use_playercolor = false; | 1281 | bool use_playercolor = false; |
1109 | 1270 | const std::string image_filename = a["src"].get_string(); | ||
1110 | 1271 | double scale = 1.0; | 1282 | double scale = 1.0; |
1111 | 1272 | 1283 | ||
1112 | 1273 | if (a.has("color")) { | 1284 | if (a.has("color")) { |
1113 | 1274 | color = a["color"].get_color(); | 1285 | color = a["color"].get_color(); |
1114 | 1275 | use_playercolor = true; | 1286 | use_playercolor = true; |
1115 | 1276 | } | 1287 | } |
1128 | 1277 | if (a.has("width")) { | 1288 | if (a.has("object")) { |
1129 | 1278 | int width = a["width"].get_int(); | 1289 | const Image* representative_image = g_gr->animations().get_representative_image(a["object"].get_string(), use_playercolor ? &color : nullptr); |
1130 | 1279 | if (width > renderer_style_.overall_width) { | 1290 | render_node_.reset(new ImgRenderNode(nodestyle_, representative_image)); |
1131 | 1280 | log("WARNING: Font renderer: Specified image width of %d exceeds the overall available " | 1291 | } else { |
1132 | 1281 | "width of %d. Setting width to %d.\n", | 1292 | const std::string image_filename = a["src"].get_string(); |
1133 | 1282 | width, renderer_style_.overall_width, renderer_style_.overall_width); | 1293 | |
1134 | 1283 | width = renderer_style_.overall_width; | 1294 | if (a.has("width")) { |
1135 | 1284 | } | 1295 | int width = a["width"].get_int(); |
1136 | 1285 | const int image_width = image_cache_->get(image_filename)->width(); | 1296 | if (width > renderer_style_.overall_width) { |
1137 | 1286 | if (width < image_width) { | 1297 | log("WARNING: Font renderer: Specified image width of %d exceeds the overall available " |
1138 | 1287 | scale = static_cast<double>(width) / image_width; | 1298 | "width of %d. Setting width to %d.\n", |
1139 | 1288 | } | 1299 | width, renderer_style_.overall_width, renderer_style_.overall_width); |
1140 | 1300 | width = renderer_style_.overall_width; | ||
1141 | 1301 | } | ||
1142 | 1302 | const int image_width = image_cache_->get(image_filename)->width(); | ||
1143 | 1303 | if (width < image_width) { | ||
1144 | 1304 | scale = static_cast<double>(width) / image_width; | ||
1145 | 1305 | } | ||
1146 | 1306 | } | ||
1147 | 1307 | render_node_.reset( | ||
1148 | 1308 | new ImgRenderNode(nodestyle_, image_filename, scale, color, use_playercolor)); | ||
1149 | 1289 | } | 1309 | } |
1150 | 1290 | render_node_.reset( | ||
1151 | 1291 | new ImgRenderNode(nodestyle_, image_filename, scale, color, use_playercolor)); | ||
1152 | 1292 | } | 1310 | } |
1153 | 1293 | void emit_nodes(std::vector<std::shared_ptr<RenderNode>>& nodes) override { | 1311 | void emit_nodes(std::vector<std::shared_ptr<RenderNode>>& nodes) override { |
1154 | 1294 | nodes.push_back(render_node_); | 1312 | nodes.push_back(render_node_); |
1155 | 1295 | 1313 | ||
1156 | === modified file 'src/logic/map_objects/immovable.cc' | |||
1157 | --- src/logic/map_objects/immovable.cc 2019-04-24 06:01:37 +0000 | |||
1158 | +++ src/logic/map_objects/immovable.cc 2019-05-03 18:29:53 +0000 | |||
1159 | @@ -222,6 +222,16 @@ | |||
1160 | 222 | table.get_table("attributes")->array_entries<std::string>(); | 222 | table.get_table("attributes")->array_entries<std::string>(); |
1161 | 223 | add_attributes(attributes, {MapObject::Attribute::RESI}); | 223 | add_attributes(attributes, {MapObject::Attribute::RESI}); |
1162 | 224 | 224 | ||
1163 | 225 | // All resource indicators must have a menu icon | ||
1164 | 226 | for (const std::string& attribute : attributes) { | ||
1165 | 227 | if (attribute == "resi") { | ||
1166 | 228 | if (icon_filename().empty()) { | ||
1167 | 229 | throw GameDataError("Resource indicator %s has no menu icon", name().c_str()); | ||
1168 | 230 | } | ||
1169 | 231 | break; | ||
1170 | 232 | } | ||
1171 | 233 | } | ||
1172 | 234 | |||
1173 | 225 | // Old trees get an extra species name so we can use it in help lists. | 235 | // Old trees get an extra species name so we can use it in help lists. |
1174 | 226 | bool is_tree = false; | 236 | bool is_tree = false; |
1175 | 227 | for (const std::string& attribute : attributes) { | 237 | for (const std::string& attribute : attributes) { |
1176 | 228 | 238 | ||
1177 | === modified file 'src/logic/map_objects/map_object.cc' | |||
1178 | --- src/logic/map_objects/map_object.cc 2019-03-03 08:31:25 +0000 | |||
1179 | +++ src/logic/map_objects/map_object.cc 2019-05-03 18:29:53 +0000 | |||
1180 | @@ -240,14 +240,18 @@ | |||
1181 | 240 | if (table.has_key("animations")) { | 240 | if (table.has_key("animations")) { |
1182 | 241 | std::unique_ptr<LuaTable> anims(table.get_table("animations")); | 241 | std::unique_ptr<LuaTable> anims(table.get_table("animations")); |
1183 | 242 | for (const std::string& animation : anims->keys<std::string>()) { | 242 | for (const std::string& animation : anims->keys<std::string>()) { |
1185 | 243 | add_animation(animation, g_gr->animations().load(*anims->get_table(animation))); | 243 | if (animation == "idle") { |
1186 | 244 | add_animation(animation, g_gr->animations().load(init_name, *anims->get_table(animation))); | ||
1187 | 245 | } else { | ||
1188 | 246 | add_animation(animation, g_gr->animations().load(*anims->get_table(animation))); | ||
1189 | 247 | } | ||
1190 | 244 | } | 248 | } |
1191 | 245 | if (!is_animation_known("idle")) { | 249 | if (!is_animation_known("idle")) { |
1192 | 246 | throw GameDataError( | 250 | throw GameDataError( |
1193 | 247 | "Map object %s has animations but no idle animation", init_name.c_str()); | 251 | "Map object %s has animations but no idle animation", init_name.c_str()); |
1194 | 248 | } | 252 | } |
1197 | 249 | representative_image_filename_ = | 253 | |
1198 | 250 | g_gr->animations().get_animation(get_animation("idle")).representative_image_filename(); | 254 | assert(g_gr->animations().get_representative_image(name())->width() > 0); |
1199 | 251 | } | 255 | } |
1200 | 252 | if (table.has_key("icon")) { | 256 | if (table.has_key("icon")) { |
1201 | 253 | icon_filename_ = table.get_string("icon"); | 257 | icon_filename_ = table.get_string("icon"); |
1202 | @@ -322,9 +326,6 @@ | |||
1203 | 322 | } | 326 | } |
1204 | 323 | return nullptr; | 327 | return nullptr; |
1205 | 324 | } | 328 | } |
1206 | 325 | const std::string& MapObjectDescr::representative_image_filename() const { | ||
1207 | 326 | return representative_image_filename_; | ||
1208 | 327 | } | ||
1209 | 328 | 329 | ||
1210 | 329 | void MapObjectDescr::check_representative_image() { | 330 | void MapObjectDescr::check_representative_image() { |
1211 | 330 | if (representative_image() == nullptr) { | 331 | if (representative_image() == nullptr) { |
1212 | 331 | 332 | ||
1213 | === modified file 'src/logic/map_objects/map_object.h' | |||
1214 | --- src/logic/map_objects/map_object.h 2019-02-27 17:19:00 +0000 | |||
1215 | +++ src/logic/map_objects/map_object.h 2019-05-03 18:29:53 +0000 | |||
1216 | @@ -138,9 +138,6 @@ | |||
1217 | 138 | /// Returns the image for the first frame of the idle animation if the MapObject has animations, | 138 | /// Returns the image for the first frame of the idle animation if the MapObject has animations, |
1218 | 139 | /// nullptr otherwise | 139 | /// nullptr otherwise |
1219 | 140 | const Image* representative_image(const RGBColor* player_color = nullptr) const; | 140 | const Image* representative_image(const RGBColor* player_color = nullptr) const; |
1220 | 141 | /// Returns the image fileneme for first frame of the idle animation if the MapObject has | ||
1221 | 142 | /// animations, is empty otherwise | ||
1222 | 143 | const std::string& representative_image_filename() const; | ||
1223 | 144 | 141 | ||
1224 | 145 | /// Returns the menu image if the MapObject has one, nullptr otherwise | 142 | /// Returns the menu image if the MapObject has one, nullptr otherwise |
1225 | 146 | const Image* icon() const; | 143 | const Image* icon() const; |
1226 | @@ -175,7 +172,6 @@ | |||
1227 | 175 | Anims anims_; | 172 | Anims anims_; |
1228 | 176 | static uint32_t dyn_attribhigh_; ///< highest attribute ID used | 173 | static uint32_t dyn_attribhigh_; ///< highest attribute ID used |
1229 | 177 | static AttribMap dyn_attribs_; | 174 | static AttribMap dyn_attribs_; |
1230 | 178 | std::string representative_image_filename_; // Image for big represenations, e.g. on buttons | ||
1231 | 179 | std::string icon_filename_; // Filename for the menu icon | 175 | std::string icon_filename_; // Filename for the menu icon |
1232 | 180 | 176 | ||
1233 | 181 | DISALLOW_COPY_AND_ASSIGN(MapObjectDescr); | 177 | DISALLOW_COPY_AND_ASSIGN(MapObjectDescr); |
1234 | 182 | 178 | ||
1235 | === modified file 'src/logic/map_objects/tribes/building.cc' | |||
1236 | --- src/logic/map_objects/tribes/building.cc 2019-04-24 06:01:37 +0000 | |||
1237 | +++ src/logic/map_objects/tribes/building.cc 2019-05-03 18:29:53 +0000 | |||
1238 | @@ -774,12 +774,10 @@ | |||
1239 | 774 | bool link_to_building_lifetime, | 774 | bool link_to_building_lifetime, |
1240 | 775 | uint32_t throttle_time, | 775 | uint32_t throttle_time, |
1241 | 776 | uint32_t throttle_radius) { | 776 | uint32_t throttle_radius) { |
1242 | 777 | const std::string& img = descr().representative_image_filename(); | ||
1243 | 778 | const int width = descr().representative_image()->width(); | ||
1244 | 779 | const std::string rt_description = | 777 | const std::string rt_description = |
1246 | 780 | (boost::format("<div padding_r=10><p><img width=%d src=%s color=%s></p></div>" | 778 | (boost::format("<div padding_r=10><p><img object=%s color=%s></p></div>" |
1247 | 781 | "<div width=*><p><font size=%d>%s</font></p></div>") % | 779 | "<div width=*><p><font size=%d>%s</font></p></div>") % |
1249 | 782 | width % img % owner().get_playercolor().hex_value() % UI_FONT_SIZE_MESSAGE % description) | 780 | descr().name() % owner().get_playercolor().hex_value() % UI_FONT_SIZE_MESSAGE % description) |
1250 | 783 | .str(); | 781 | .str(); |
1251 | 784 | 782 | ||
1252 | 785 | std::unique_ptr<Message> msg(new Message(msgtype, game.get_gametime(), title, icon_filename, | 783 | std::unique_ptr<Message> msg(new Message(msgtype, game.get_gametime(), title, icon_filename, |
1253 | 786 | 784 | ||
1254 | === modified file 'src/logic/map_objects/tribes/tribe_descr.cc' | |||
1255 | --- src/logic/map_objects/tribes/tribe_descr.cc 2019-04-09 16:43:49 +0000 | |||
1256 | +++ src/logic/map_objects/tribes/tribe_descr.cc 2019-05-03 18:29:53 +0000 | |||
1257 | @@ -64,8 +64,8 @@ | |||
1258 | 64 | initializations_ = info.initializations; | 64 | initializations_ = info.initializations; |
1259 | 65 | 65 | ||
1260 | 66 | std::unique_ptr<LuaTable> items_table = table.get_table("animations"); | 66 | std::unique_ptr<LuaTable> items_table = table.get_table("animations"); |
1263 | 67 | frontier_animation_id_ = g_gr->animations().load(*items_table->get_table("frontier")); | 67 | frontier_animation_id_ = g_gr->animations().load(name_ + std::string("_frontier"), *items_table->get_table("frontier")); |
1264 | 68 | flag_animation_id_ = g_gr->animations().load(*items_table->get_table("flag")); | 68 | flag_animation_id_ = g_gr->animations().load(name_ + std::string("_flag"), *items_table->get_table("flag")); |
1265 | 69 | 69 | ||
1266 | 70 | items_table = table.get_table("roads"); | 70 | items_table = table.get_table("roads"); |
1267 | 71 | const auto load_roads = [&items_table]( | 71 | const auto load_roads = [&items_table]( |
1268 | 72 | 72 | ||
1269 | === modified file 'src/logic/map_objects/tribes/worker.cc' | |||
1270 | --- src/logic/map_objects/tribes/worker.cc 2019-04-27 13:24:29 +0000 | |||
1271 | +++ src/logic/map_objects/tribes/worker.cc 2019-05-03 18:29:53 +0000 | |||
1272 | @@ -973,11 +973,10 @@ | |||
1273 | 973 | 973 | ||
1274 | 974 | // Geologist also sends a message notifying the player | 974 | // Geologist also sends a message notifying the player |
1275 | 975 | if (rdescr && rdescr->detectable() && position.field->get_resources_amount()) { | 975 | if (rdescr && rdescr->detectable() && position.field->get_resources_amount()) { |
1276 | 976 | const int width = g_gr->images().get(rdescr->representative_image())->width(); | ||
1277 | 977 | const std::string message = | 976 | const std::string message = |
1279 | 978 | (boost::format("<div padding_r=10><p><img width=%d src=%s></p></div>" | 977 | (boost::format("<div padding_r=10><p><img object=%s></p></div>" |
1280 | 979 | "<div width=*><p><font size=%d>%s</font></p></div>") % | 978 | "<div width=*><p><font size=%d>%s</font></p></div>") % |
1282 | 980 | width % ri.descr().representative_image_filename() % UI_FONT_SIZE_MESSAGE % | 979 | ri.descr().name() % UI_FONT_SIZE_MESSAGE % |
1283 | 981 | _("A geologist found resources.")) | 980 | _("A geologist found resources.")) |
1284 | 982 | .str(); | 981 | .str(); |
1285 | 983 | 982 | ||
1286 | 984 | 983 | ||
1287 | === modified file 'src/scripting/lua_map.cc' | |||
1288 | --- src/scripting/lua_map.cc 2019-04-09 16:43:49 +0000 | |||
1289 | +++ src/scripting/lua_map.cc 2019-05-03 18:29:53 +0000 | |||
1290 | @@ -1804,7 +1804,6 @@ | |||
1291 | 1804 | PROP_RO(LuaMapObjectDescription, icon_name), | 1804 | PROP_RO(LuaMapObjectDescription, icon_name), |
1292 | 1805 | PROP_RO(LuaMapObjectDescription, name), | 1805 | PROP_RO(LuaMapObjectDescription, name), |
1293 | 1806 | PROP_RO(LuaMapObjectDescription, type_name), | 1806 | PROP_RO(LuaMapObjectDescription, type_name), |
1294 | 1807 | PROP_RO(LuaMapObjectDescription, representative_image), | ||
1295 | 1808 | {nullptr, nullptr, nullptr}, | 1807 | {nullptr, nullptr, nullptr}, |
1296 | 1809 | }; | 1808 | }; |
1297 | 1810 | 1809 | ||
1298 | @@ -1866,17 +1865,6 @@ | |||
1299 | 1866 | } | 1865 | } |
1300 | 1867 | 1866 | ||
1301 | 1868 | /* RST | 1867 | /* RST |
1302 | 1869 | .. attribute:: representative_image | ||
1303 | 1870 | |||
1304 | 1871 | (RO) a :class:`string` with the file path to the representative image | ||
1305 | 1872 | of the map object's idle animation | ||
1306 | 1873 | */ | ||
1307 | 1874 | int LuaMapObjectDescription::get_representative_image(lua_State* L) { | ||
1308 | 1875 | lua_pushstring(L, get()->representative_image_filename()); | ||
1309 | 1876 | return 1; | ||
1310 | 1877 | } | ||
1311 | 1878 | |||
1312 | 1879 | /* RST | ||
1313 | 1880 | .. attribute:: type_name | 1868 | .. attribute:: type_name |
1314 | 1881 | 1869 | ||
1315 | 1882 | (RO) the map object's type as a string. Map object types are | 1870 | (RO) the map object's type as a string. Map object types are |
1316 | @@ -3701,7 +3689,6 @@ | |||
1317 | 3701 | 3689 | ||
1318 | 3702 | (RO) the :class:`string` file path to a representative image | 3690 | (RO) the :class:`string` file path to a representative image |
1319 | 3703 | */ | 3691 | */ |
1320 | 3704 | |||
1321 | 3705 | int LuaTerrainDescription::get_representative_image(lua_State* L) { | 3692 | int LuaTerrainDescription::get_representative_image(lua_State* L) { |
1322 | 3706 | lua_pushstring(L, get()->texture_paths().front()); | 3693 | lua_pushstring(L, get()->texture_paths().front()); |
1323 | 3707 | return 1; | 3694 | return 1; |
1324 | 3708 | 3695 | ||
1325 | === modified file 'src/scripting/lua_map.h' | |||
1326 | --- src/scripting/lua_map.h 2019-04-07 05:46:13 +0000 | |||
1327 | +++ src/scripting/lua_map.h 2019-05-03 18:29:53 +0000 | |||
1328 | @@ -198,7 +198,6 @@ | |||
1329 | 198 | int get_helptext_script(lua_State*); | 198 | int get_helptext_script(lua_State*); |
1330 | 199 | int get_name(lua_State*); | 199 | int get_name(lua_State*); |
1331 | 200 | int get_type_name(lua_State*); | 200 | int get_type_name(lua_State*); |
1332 | 201 | int get_representative_image(lua_State*); | ||
1333 | 202 | 201 | ||
1334 | 203 | /* | 202 | /* |
1335 | 204 | * Lua methods | 203 | * Lua methods |
1336 | 205 | 204 | ||
1337 | === modified file 'src/website/map_object_info.cc' | |||
1338 | --- src/website/map_object_info.cc 2019-03-08 17:26:28 +0000 | |||
1339 | +++ src/website/map_object_info.cc 2019-05-03 18:29:53 +0000 | |||
1340 | @@ -70,7 +70,7 @@ | |||
1341 | 70 | JSON::Object* json_building = json_buildings_array->add_object(); | 70 | JSON::Object* json_building = json_buildings_array->add_object(); |
1342 | 71 | json_building->add_string("name", building.name()); | 71 | json_building->add_string("name", building.name()); |
1343 | 72 | json_building->add_string("descname", building.descname()); | 72 | json_building->add_string("descname", building.descname()); |
1345 | 73 | json_building->add_string("icon", building.representative_image_filename()); | 73 | json_building->add_string("icon", building.icon_filename()); |
1346 | 74 | 74 | ||
1347 | 75 | // Buildcost | 75 | // Buildcost |
1348 | 76 | if (building.is_buildable()) { | 76 | if (building.is_buildable()) { |
Continuous integration builds have changed state:
Travis build 4543. State: failed. Details: https:/ /travis- ci.org/ widelands/ widelands/ builds/ 499778127. /ci.appveyor. com/project/ widelands- dev/widelands/ build/_ widelands_ dev_widelands_ representative_ image_in_ font_renderer- 4330.
Appveyor build 4330. State: success. Details: https:/