Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/warehouse_worker into lp:widelands
Yes, that's the one. -- https://code.launchpad.net/~widelands-dev/widelands/warehouse_worker/+merge/277221 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/warehouse_worker into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/index_types into lp:widelands
The proposal to merge lp:~widelands-dev/widelands/index_types into lp:widelands has been updated. Description changed to: All Descr objects kept in DescriptionMaintainer lists are now indexed by DescriptionIndex rather than WareIndex, BuildingIndex, TerrainIndex etc. Important files to review are: src/logic/description_maintainer.h src/logic/widelands.h src/logic/tribes/tribe_descr.h src/logic/tribes/tribes.h src/logic/world/world.h For more details, see: https://code.launchpad.net/~widelands-dev/widelands/index_types/+merge/277294 -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/index_types into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/index_types into lp:widelands
The purpose is not to have 4 different data types that all map to WareIndex anyway in the end. And why would the DescriptionMaintainer be using WareIndex rather than BuildingIndex or TerrainIndex? It just doesn't make sense. -- https://code.launchpad.net/~widelands-dev/widelands/index_types/+merge/277294 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/index_types into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/warehouse_worker into lp:widelands
Answered :) Diff comments: > === modified file 'src/logic/warehouse.cc' > --- src/logic/warehouse.cc2015-10-18 15:42:01 + > +++ src/logic/warehouse.cc2015-11-11 09:47:46 + > @@ -883,30 +883,30 @@ > worker->set_location(this); // > back in a economy > > incorporated_workers.erase(worker_iter); > > - m_supply->remove_workers(ware, > 1); > + > m_supply->remove_workers(worker_id, 1); > return *worker; > } > } > } > > - assert(unincorporated <= m_supply->stock_workers(ware)); > + assert(unincorporated <= > m_supply->stock_workers(worker_id)); > > if (unincorporated) { > // Create a new one > // NOTE: This code lies about the > TrainingAttributes of the new worker > - m_supply->remove_workers(ware, 1); > - const WorkerDescr & workerdescr = > *game.tribes().get_worker_descr(ware); > + m_supply->remove_workers(worker_id, 1); > + const WorkerDescr & workerdescr = > *game.tribes().get_worker_descr(worker_id); > return workerdescr.create(game, owner(), this, > m_position); > } > } > > - if (can_create_worker(game, ware)) { > + if (can_create_worker(game, worker_id)) { > // don't want to use an upgraded worker, so create new > one. > - create_worker(game, ware); > + create_worker(game, worker_id); > } else { > - ware = game.tribes().get_worker_descr(ware)->becomes(); > + worker_id = > game.tribes().get_worker_descr(worker_id)->becomes(); > } > - } while (owner().tribe().has_ware(ware)); > + } while (owner().tribe().has_worker(worker_id)); Correct :) I also renamed the variable to make it clear we are talking about workers here and not wares. > > throw wexception > ("Warehouse::launch_worker: worker does not actually exist"); -- https://code.launchpad.net/~widelands-dev/widelands/warehouse_worker/+merge/277221 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/warehouse_worker into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/multiplayer_help into lp:widelands
Ths affects 2 help windows: 1. Set up a new Multiplayer game, but don't start it. There is a ? button on the top right explaining how the game setup works. 2. Start a game, select a building, click on ? on the bottom right. -- https://code.launchpad.net/~widelands-dev/widelands/multiplayer_help/+merge/274271 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/multiplayer_help into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/index_types into lp:widelands
Thee are multiple instantiations of DescriptionManager, so it gets its data assgined from outside. E.g. look at the member objects in src/logic/tribes.h or src/logic/world/world.h. -- https://code.launchpad.net/~widelands-dev/widelands/index_types/+merge/277294 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/index_types into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/multiplayer_help into lp:widelands
Thanks :) -- https://code.launchpad.net/~widelands-dev/widelands/multiplayer_help/+merge/274271 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/multiplayer_help. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/map_compatibility into lp:widelands
Hi Nasenbaer, the history here is that I recently removed all savegame compatibility code. I assumed te same thing that you do, thet maps would not know about buildings, workers etc. Turns out they do, so we get cpmpatibility problems with maps. I think one of he problematic maps was Together We're Strong - load it in he Editor to trigger the problem. -- https://code.launchpad.net/~widelands-dev/widelands/map_compatibility/+merge/276088 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/map_compatibility into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/artifacts into lp:widelands
Review: Approve -- https://code.launchpad.net/~widelands-dev/widelands/artifacts/+merge/276527 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/artifacts. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/artifacts into lp:widelands
I have finished reviewing the Lua code and testing. Now somebody needs to review the C++ changes - they are all in 1 commit: https://bazaar.launchpad.net/~widelands-dev/widelands/artifacts/revision/7571 -- https://code.launchpad.net/~widelands-dev/widelands/artifacts/+merge/276527 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/artifacts. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/string-fixes into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/string-fixes into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1421942 in widelands: "Unified term for "Black" and "Wasteland"" https://bugs.launchpad.net/widelands/+bug/1421942 Bug #1487887 in widelands: "Translation missing in editor and in replay tooltip" https://bugs.launchpad.net/widelands/+bug/1487887 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/string-fixes/+merge/277693 Various string fixes for issues reported on Transifex. Mostly for consistency with the recent terminology updates / disambiguation of strings. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/string-fixes into lp:widelands. === modified file 'campaigns/atl01.wmf/scripting/texts.lua' --- campaigns/atl01.wmf/scripting/texts.lua 2015-10-31 12:11:44 + +++ campaigns/atl01.wmf/scripting/texts.lua 2015-11-17 14:38:10 + @@ -190,7 +190,7 @@ title = _"Loftomor Speaks", body = loftomor( -- TRANSLATORS: Loftomor - _([[May Satul warm you, Jundlina! The most important things for building a settlement are the building materials. There are some trees here, so we should build housings for some woodcutters and of course also for foresters, so we will not run out of trees. Oh, and we mustn’t forget the sawmill, for most buildings can’t be made out of logs alone. Stronger buildings also need stone, but there is plenty to the north-east of here; we just need to build a quarry, and my stonemasons will go to work promptly.]])) + _([[May Satul warm you, Jundlina! The most important things for building a settlement are the building materials. There are some trees here, so we should build housings for some woodcutters and of course also for foresters, so we will not run out of trees. Oh, and we mustn’t forget the sawmill, for most buildings can’t be made out of logs alone. Stronger buildings also need granite, but there is plenty to the north-east of here; we just need to build a quarry, and my stonemasons will go to work promptly.]])) .. new_objectives(obj_ensure_build_wares_production) }, { === modified file 'campaigns/bar01.wmf/scripting/texts.lua' --- campaigns/bar01.wmf/scripting/texts.lua 2015-10-31 12:11:44 + +++ campaigns/bar01.wmf/scripting/texts.lua 2015-11-17 14:38:10 + @@ -113,7 +113,7 @@ title = _"Build a lime kiln and coal economy", number = 3, body = objective_text(_"Build a lime kiln fed by a well, and by a charcoal kiln or by a coal mine", - _([[Better buildings may also require other improved materials besides blackwood. One of these is grout, which is produced out of raw stone, water and coal by a lime-burner.]]) + _([[Better buildings may also require other improved materials besides blackwood. One of these is grout, which is produced out of granite, water and coal by a lime-burner.]]) .. paragraphdivider() .. _([[You can obtain water by building a well upon a water source, which your geologists can discover when you send them to any flag that is not on a mountain.]]) ..paragraphdivider() .. === modified file 'campaigns/emp01.wmf/scripting/texts.lua' --- campaigns/emp01.wmf/scripting/texts.lua 2015-11-08 15:54:28 + +++ campaigns/emp01.wmf/scripting/texts.lua 2015-11-17 14:38:10 + @@ -64,7 +64,7 @@ title=_"Build a quarry", number = 5, body = objective_text(_"Quarry", - listitem_bullet(_[[Build a quarry in the south to cut some stones and marble out of the rocks.]]) .. + listitem_bullet(_[[Build a quarry in the south to cut some granite and marble out of the rocks.]]) .. listitem_arrow(_[[These might be used for future buildings.]]) ), } @@ -201,7 +201,7 @@ title=_"Thinking About the Future", body= saledus(_"Saledus notes…", -- TRANSLATORS: Saledus - _([[Sire, I just thought about the rocks standing on the south shore of this land. Perhaps we could cut out some useful hard stones and beautiful marble.]]) + _([[Sire, I just thought about the rocks standing on the south shore of this land. Perhaps we could cut out some useful granite and beautiful marble.]]) .. paragraphdivider() .. -- TRANSLATORS: Saledus _([[The repair of our ship will take a few weeks, anyway, and the resources we harvest now might be the base of strong and big buildings in another land.]])) @@ -213,7 +213,7 @@ title=_"A Step Forward", body= saledus(_"Saledus looks excited…", -- TRANSLATORS: Saledus - _([[Sire, today we got a lot closer to our first castle. The quarry to the south began its work today and will soon provide us with stones and beautiful marble.]]) +
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1516777 into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1516777 into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1516777 in widelands: "Atlantean corn farms unproductive" https://bugs.launchpad.net/widelands/+bug/1516777 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/bug-1516777/+merge/277701 Fixed a bug with animation length. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1516777 into lp:widelands. === modified file 'tribes/immovables/blackrootfield_ripe/init.lua' --- tribes/immovables/blackrootfield_ripe/init.lua 2015-10-31 12:11:44 + +++ tribes/immovables/blackrootfield_ripe/init.lua 2015-11-17 15:05:44 + @@ -9,7 +9,7 @@ attributes = { "ripe_blackroot", "field" }, programs = { program = { - "animate=idle 5", + "animate=idle 50", "remove=", }, harvest = { === modified file 'tribes/immovables/cornfield_ripe/init.lua' --- tribes/immovables/cornfield_ripe/init.lua 2015-10-31 12:11:44 + +++ tribes/immovables/cornfield_ripe/init.lua 2015-11-17 15:05:44 + @@ -9,7 +9,7 @@ attributes = { "ripe_corn", "field" }, programs = { program = { - "animate=idle 5", + "animate=idle 50", "remove=", }, harvest = { ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/map_compatibility into lp:widelands
Yes, I would like that - you obviously know a lot more about the map loading code than I do. Would you like to take this on? -- https://code.launchpad.net/~widelands-dev/widelands/map_compatibility/+merge/276088 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/map_compatibility into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/artifacts into lp:widelands
Will do and merge. Thanks for the review :) -- https://code.launchpad.net/~widelands-dev/widelands/artifacts/+merge/276527 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/artifacts. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/farm_animal_sound into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/farm_animal_sound into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) For more details, see: https://code.launchpad.net/~widelands-dev/widelands/farm_animal_sound/+merge/277791 Removed farm animal sound from cereal producing farms. cf. https://wl.widelands.org/forum/topic/1158/ -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/farm_animal_sound into lp:widelands. === modified file 'tribes/buildings/productionsites/atlanteans/farm/init.lua' --- tribes/buildings/productionsites/atlanteans/farm/init.lua 2015-10-31 12:11:44 + +++ tribes/buildings/productionsites/atlanteans/farm/init.lua 2015-11-18 08:55:07 + @@ -52,7 +52,6 @@ actions = { "call=plant_corn", "call=harvest_corn", -"playFX=sound/farm farm_animal 192", "return=skipped" } }, === modified file 'tribes/buildings/productionsites/barbarians/farm/init.lua' --- tribes/buildings/productionsites/barbarians/farm/init.lua 2015-10-31 12:11:44 + +++ tribes/buildings/productionsites/barbarians/farm/init.lua 2015-11-18 08:55:07 + @@ -63,7 +63,6 @@ actions = { "call=plant_wheat", "call=harvest_wheat", -"playFX=sound/farm farm_animal 192", "return=skipped" } }, === modified file 'tribes/buildings/productionsites/empire/farm/init.lua' --- tribes/buildings/productionsites/empire/farm/init.lua 2015-10-31 12:11:44 + +++ tribes/buildings/productionsites/empire/farm/init.lua 2015-11-18 08:55:07 + @@ -50,7 +50,6 @@ actions = { "call=plant_wheat", "call=harvest_wheat", -"playFX=sound/farm farm_animal 192", "return=skipped" } }, ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/farm_animal_sound into lp:widelands
Ouch *lol -- https://code.launchpad.net/~widelands-dev/widelands/farm_animal_sound/+merge/277791 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/farm_animal_sound. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_sched_speedup into lp:widelands
Code review is in http://bazaar.launchpad.net/~widelands-dev/widelands/ai_sched_speedup/revision/7616 -- https://code.launchpad.net/~widelands-dev/widelands/ai_sched_speedup/+merge/277296 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ai_sched_speedup into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1505723 into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1505723 into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1505723 in widelands: "Some performance values for the buildings help text" https://bugs.launchpad.net/widelands/+bug/1505723 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/bug-1505723/+merge/278174 Added new performance calculations to help files. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1505723 into lp:widelands. === modified file 'i18n/locales.lua' --- i18n/locales.lua 2015-11-10 08:56:00 + +++ i18n/locales.lua 2015-11-20 16:42:18 + @@ -2,369 +2,369 @@ -- The locale data is managed in Transifex. return { - -- Locales are identified by their ISO code. - en = { - -- Used to display the locale in the Options menu. - name = "English", - - -- Defines the language's position on the list in the Options menu. - sort_name = "English", - - -- The font set used, including the script's direction. See i18n/fonts.lua - font = "default" - }, - - ar = { - name = "العربية", - sort_name = "Al-ʿArabiyyah", - font = "arabic" - }, - - ast = { - name = "Asturianu", - sort_name = "Asturianu", - font = "default" - }, - - bg = { - name = "Български", - sort_name = "Balgarski", - font = "default" - }, - - ca = { - name = "Català", - sort_name = "Catala", - font = "default" - }, - - cs = { - name = "Čeština", - sort_name = "Cestina", - font = "default" - }, - - da = { - name = "Dansk", - sort_name = "Dansk", - font = "default" - }, - - de = { - name = "Deutsch", - sort_name = "Deutsch", - font = "default" - }, - - el = { - name = "Ελληνικά", - sort_name = "Ellinika", - font = "default" - }, - - en_AU = { - name = "Australian English", - sort_name = "English (Australia)", - font = "default" - }, - - en_CA = { - name = "Canadian English", - sort_name = "English (Canada)", - font = "default" - }, - - en_GB = { - name = "British English", - sort_name = "English (Great Britain)", - font = "default" - }, - - en_US = { - name = "US American English", - sort_name = "English (USA)", - font = "default" - }, - - eo = { - name = "Esperanto", - sort_name = "Esperanto", - font = "default" - }, - - es = { - name = "Español", - sort_name = "Espanol", - font = "default" - }, - - es_CO = { - name = "Español colombiano", - sort_name = "Espanol colombiano", - font = "default" - }, - - et = { - name = "Eesti keel", - sort_name = "Eesti keel", - font = "default" - }, - - eu = { - name = "Euskara", - sort_name = "Euskara", - font = "default" - }, - - fa = { - name = "فارسی", - sort_name = "Farsi", - font = "arabic" - }, - - fi = { - name = "Suomi", - sort_name = "Suomi", - font = "default" - }, - - fr = { - name = "Français", - sort_name = "Francais", - font = "default" - }, - - gd = { - name = "Gàidhlig", - sort_name = "Gaidhlig", - font = "default" - }, - - gl = { - name = "Galego", - sort_name = "Galego", - font = "default" - }, - - he = { - name = "עברית", - sort_name = "Ivrit", - font = "hebrew" - }, - - hi = { - name = "हिन्दी", - sort_name = "Hindi", - font = "devanagari" - }, - - hr = { - name = "Hrvatski", - sort_name = "Hrvatski", - font = "default" - }, - - hu = { - name = "Magyar", - sort_name = "Magyar", - font = "default" - }, - - ia = { - name = "Interlingua", - sort_name = "Interlingua", - font = "default" - }, - - id = { - name = "Bahasa Indonesia", - sort_name = "Indonesia", - font = "default" - }, - - it = { - name = "Italiano", - sort_name = "Italiano", - font = "default" - }, - - ja = { - name = "日本語", - sort_name = "Nihongo", - font = "cjk" - }, - - jv = { - name = "Basa jawa", - sort_name = "Jawa", - font = "default" - }, - - ka = { - name = "ქართული", - sort_name = "Kartuli", - font = "default" - }, - - ko = { - name = "한국어", - sor
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/pc_on_buttons into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/pc_on_buttons into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) For more details, see: https://code.launchpad.net/~widelands-dev/widelands/pc_on_buttons/+merge/278191 This adds player color to building buttons. You can see it in action when building a new building or in the building statistics window. The images with player color are cached in the AnimationManager. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/pc_on_buttons into lp:widelands. === modified file 'src/graphic/animation.cc' --- src/graphic/animation.cc 2015-11-06 12:19:22 + +++ src/graphic/animation.cc 2015-11-20 18:25:18 + @@ -39,6 +39,7 @@ #include "graphic/image.h" #include "graphic/image_cache.h" #include "graphic/surface.h" +#include "graphic/texture.h" #include "io/filesystem/layered_filesystem.h" #include "logic/bob.h" #include "logic/instances.h" @@ -123,7 +124,8 @@ uint16_t nr_frames() const override; uint32_t frametime() const override; const Point& hotspot() const override; - const std::string& representative_image_from_disk_filename() const override; + Image* representative_image(const RGBColor* clr) const override; + const std::string& representative_image_filename() const override; virtual void blit(uint32_t time, const Point&, const Rect& srcrc, const RGBColor* clr, Surface*) const override; void trigger_soundfx(uint32_t framenumber, uint32_t stereo_position) const override; @@ -297,7 +299,33 @@ return hotspot_; } -const std::string& NonPackedAnimation::representative_image_from_disk_filename() const { +Image* NonPackedAnimation::representative_image(const RGBColor* clr) const { + assert(!image_files_.empty()); + + const Image* image = g_gr->images().get(image_files_[0]); + int w = image->width(); + int h = image->height(); + + Texture* rv = new Texture(w, h); + if (!hasplrclrs_ || clr == nullptr) { + ::blit(Rect(Point(0, 0), w, h), + *image, + Rect(Point(0, 0), w, h), + 1., + BlendMode::UseAlpha, + rv); + } else { + blit_blended(Rect(Point(0, 0), w, h), + *image, + *g_gr->images().get(pc_mask_image_files_[0]), + Rect(Point(0, 0), w, h), + *clr, + rv); + } + return rv; +} + +const std::string& NonPackedAnimation::representative_image_filename() const { return image_files_[0]; } @@ -383,20 +411,24 @@ */ uint32_t AnimationManager::load(const LuaTable& table) { - m_animations.push_back(new NonPackedAnimation(table)); - return m_animations.size(); + animations_.push_back(std::unique_ptr(new NonPackedAnimation(table))); + return animations_.size(); } const Animation& AnimationManager::get_animation(uint32_t id) const { - if (!id || id > m_animations.size()) + if (!id || id > animations_.size()) throw wexception("Requested unknown animation with id: %i", id); - return *m_animations[id - 1]; + return *animations_[id - 1].get(); } -AnimationManager::~AnimationManager() -{ - for (vector::iterator it = m_animations.begin(); it != m_animations.end(); ++it) - delete *it; +const Image* AnimationManager::get_representative_image(uint32_t id, const RGBColor* clr) { + if (representative_images_.count(id) != 1) { + representative_images_.insert( + std::make_pair( + id, + std::unique_ptr(g_gr->animations().get_animation(id).representative_image(clr; + } + return representative_images_.at(id).get(); } === modified file 'src/graphic/animation.h' --- src/graphic/animation.h 2015-11-06 12:19:22 + +++ src/graphic/animation.h 2015-11-20 18:25:18 + @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -67,13 +68,17 @@ /// so the caller has to adjust for the hotspot himself. virtual const Point& hotspot() const = 0; - /// Returns the disk filename for the first image in the animation - virtual const std::string& representative_image_from_disk_filename() const = 0; + /// An image of the first frame, blended with the given player color. + /// The 'clr' is the player color used for blending - the parameter can be + /// 'nullptr', in which case the neutral image will be returned. + virtual Image* representative_image(const RGBColor* clr) const = 0; + /// The filename of the image used for the first frame, without player color. + virtual const std::string& representative_image_filename() const = 0; /// Blit the animation frame that should be displayed at the given time index /// so that the given point is at the top left of the frame. Srcrc defines /// the part of the animation that should be blitted. The 'clr' is the player - /// color used for blitting - the parameter can be nullptr in which case the + /// color used for blitting
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1505723 into lp:widelands
Review: Resubmit Removed some crud from the diff. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1505723/+merge/278174 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1505723. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/number_glob into lp:widelands
Review: Resubmit Removed some crud from the diff. -- https://code.launchpad.net/~widelands-dev/widelands/number_glob/+merge/278192 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/number_glob. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/lua_tabs into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/lua_tabs into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) For more details, see: https://code.launchpad.net/~widelands-dev/widelands/lua_tabs/+merge/278206 update_authors.py now runs fix_lua_tabs.py at the end to keep diff sizes small. This avoids crud in the diffs like I had just now. It also implies that fix_lua_tabs.py is run every time that translations are updated and merged from Transifex. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/lua_tabs into lp:widelands. === modified file 'utils/update_authors.py' --- utils/update_authors.py 2015-07-27 15:15:42 + +++ utils/update_authors.py 2015-11-20 19:38:11 + @@ -138,4 +138,8 @@ dest_filepath = source_path + "/" + dest_filename dest_file = codecs.open(dest_filepath, encoding='utf-8', mode='w') dest_file.write(lua_string) + +print("Fixing the formatting") +import fix_lua_tabs +fix_lua_tabs.main() print("Done.") ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/compiler_warnings into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/compiler_warnings into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) For more details, see: https://code.launchpad.net/~widelands-dev/widelands/compiler_warnings/+merge/278240 Fixed compiler warnings. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/compiler_warnings into lp:widelands. === modified file 'src/ai/ai_help_structs.h' --- src/ai/ai_help_structs.h 2015-11-11 09:53:54 + +++ src/ai/ai_help_structs.h 2015-11-21 10:54:08 + @@ -426,8 +426,8 @@ // used to track amount of wares produced by building uint32_t stocklevel_; - int32_t stocklevel_time; // time when stocklevel_ was last time recalculated - int32_t last_dismantle_time_; + uint32_t stocklevel_time; // time when stocklevel_ was last time recalculated + uint32_t last_dismantle_time_; int32_t construction_decision_time_; uint32_t unoccupied_count_; === modified file 'src/economy/cmd_call_economy_balance.cc' --- src/economy/cmd_call_economy_balance.cc 2015-10-24 15:42:37 + +++ src/economy/cmd_call_economy_balance.cc 2015-11-21 10:54:08 + @@ -31,7 +31,7 @@ namespace Widelands { CmdCallEconomyBalance::CmdCallEconomyBalance - (int32_t const starttime, Economy * const economy, uint32_t const timerid) + (uint32_t const starttime, Economy * const economy, uint32_t const timerid) : GameLogicCommand(starttime) { m_flag = economy->get_arbitrary_flag(); === modified file 'src/economy/cmd_call_economy_balance.h' --- src/economy/cmd_call_economy_balance.h 2014-09-19 12:54:54 + +++ src/economy/cmd_call_economy_balance.h 2015-11-21 10:54:08 + @@ -33,7 +33,7 @@ struct CmdCallEconomyBalance : public GameLogicCommand { CmdCallEconomyBalance () : GameLogicCommand(0), m_timerid(0) {} ///< for load and save - CmdCallEconomyBalance (int32_t starttime, Economy *, uint32_t timerid); + CmdCallEconomyBalance (uint32_t starttime, Economy *, uint32_t timerid); void execute (Game &) override; === modified file 'src/logic/bob.cc' --- src/logic/bob.cc 2015-10-25 08:06:00 + +++ src/logic/bob.cc 2015-11-21 10:54:08 + @@ -760,7 +760,7 @@ void Bob::move_update(Game & game, State &) { - if (m_walkend <= game.get_gametime()) { + if (static_cast(m_walkend) <= game.get_gametime()) { end_walk(); return pop_task(game); } else @@ -822,7 +822,7 @@ spos.y += end.field->get_height() * HEIGHT_FACTOR; spos.y -= start.field->get_height() * HEIGHT_FACTOR; - assert(m_walkstart <= game.get_gametime()); + assert(static_cast(m_walkstart) <= game.get_gametime()); assert(m_walkstart < m_walkend); float f = static_cast(game.get_gametime() - m_walkstart) === modified file 'src/logic/cmd_calculate_statistics.h' --- src/logic/cmd_calculate_statistics.h 2015-01-31 16:03:59 + +++ src/logic/cmd_calculate_statistics.h 2015-11-21 10:54:08 + @@ -28,7 +28,7 @@ struct CmdCalculateStatistics : public GameLogicCommand { CmdCalculateStatistics() : GameLogicCommand(0) {} // For savegame loading - CmdCalculateStatistics(int32_t const _duetime) : + CmdCalculateStatistics(uint32_t const _duetime) : GameLogicCommand(_duetime) {} // Write these commands to a file (for savegames) === modified file 'src/logic/cmd_delete_message.h' --- src/logic/cmd_delete_message.h 2014-09-29 12:37:07 + +++ src/logic/cmd_delete_message.h 2015-11-21 10:54:08 + @@ -37,7 +37,7 @@ /// the savegame. struct CmdDeleteMessage : public Command { CmdDeleteMessage - (int32_t const t, PlayerNumber const p, MessageId const m) + (uint32_t const t, PlayerNumber const p, MessageId const m) : Command(t), player(p), message(m) {} === modified file 'src/logic/cmd_incorporate.h' --- src/logic/cmd_incorporate.h 2014-10-03 17:26:18 + +++ src/logic/cmd_incorporate.h 2015-11-21 10:54:08 + @@ -27,7 +27,7 @@ struct CmdIncorporate : public GameLogicCommand { CmdIncorporate() : GameLogicCommand(0), worker(nullptr) {} // For savegame loading - CmdIncorporate (int32_t const t, Worker * const w) + CmdIncorporate (uint32_t const t, Worker * const w) : GameLogicCommand(t), worker(w) {} === modified file 'src/logic/cmd_luacoroutine.h' --- src/logic/cmd_luacoroutine.h 2015-01-31 16:03:59 + +++ src/logic/cmd_luacoroutine.h 2015-11-21 10:54:08 + @@ -29,7 +29,7 @@ struct CmdLuaCoroutine : public GameLogicCommand { CmdLuaCoroutine() : GameLogicCommand(0), m_cr(nullptr) {} // For savegame loading - CmdLuaCoroutine(int32_t const _duetime, LuaCoroutine * const cr) : + CmdLuaCoroutine(uint32_t const _duetime, LuaCoroutine * const cr) : GameLogicCommand(_duetime), m_cr(cr) {} ~CmdLuaCoroutine() { === modified file 'src/logic/cmd_luascript.h' --- src/logic/cmd_luascript.h 2014-09-19 12:54:54 + +++ src/logic/cmd_luascript.h
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1509791 into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1509791 into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1509791 in widelands: "Flickering while mouseover the first time" https://bugs.launchpad.net/widelands/+bug/1509791 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/bug-1509791/+merge/278243 Fixes flickering with mouse over wares in warehouse window. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1509791 into lp:widelands. === modified file 'src/ui_basic/textarea.cc' --- src/ui_basic/textarea.cc 2015-10-03 07:21:52 + +++ src/ui_basic/textarea.cc 2015-11-21 15:58:12 + @@ -192,19 +192,11 @@ { int32_t x = get_x(); int32_t y = get_y(); - const Image* image = UI::g_fh1->render( - as_uifont(m_text, - m_textstyle.font->size() - UI::g_fh1->fontset().size_offset(), - m_textstyle.fg)); - uint32_t w = image->width(); - uint16_t h = image->height(); - // We want empty textareas to have height - if (m_text.empty()) { - h = UI::g_fh1->render( - as_uifont(".", - m_textstyle.font->size() - UI::g_fh1->fontset().size_offset(), - m_textstyle.fg))->height(); - } + + // TODO(GunChleoc): Calling the font renderer here will make things flicker while mousing over + // Wares in the warehouse window. So, we use calc_bare_width, although it's not exact. + uint32_t w = m_textstyle.calc_bare_width(m_text); + uint16_t h = m_textstyle.font->height(); if (m_align & Align_HCenter) x -= w >> 1; === modified file 'src/ui_basic/textarea.h' --- src/ui_basic/textarea.h 2014-11-27 12:02:08 + +++ src/ui_basic/textarea.h 2015-11-21 15:58:12 + @@ -96,7 +96,6 @@ LayoutMode m_layoutmode; std::string m_text; - const Image* m_text_image; Align m_align; UI::TextStyle m_textstyle; }; ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1509791 into lp:widelands
I found some cropping in editor map options, so please hold on with the review for now. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1509791/+merge/278243 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1509791 into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1509791 into lp:widelands
The proposal to merge lp:~widelands-dev/widelands/bug-1509791 into lp:widelands has been updated. Status: Needs review => Work in progress For more details, see: https://code.launchpad.net/~widelands-dev/widelands/bug-1509791/+merge/278243 -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1509791 into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_sched_speedup into lp:widelands
Review: Approve Yes, go ahead and merge :) -- https://code.launchpad.net/~widelands-dev/widelands/ai_sched_speedup/+merge/277296 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/ai_sched_speedup. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1518223 into lp:widelands
Added some diff comments. Diff comments: > === modified file 'src/logic/productionsite.cc' > --- src/logic/productionsite.cc 2015-11-11 09:53:54 + > +++ src/logic/productionsite.cc 2015-11-21 19:58:38 + > @@ -284,33 +284,56 @@ > } > > /** > - * Detect if the workers are experienced enough for an upgrade > + * Detect if the workers are experienced enough for an target building > + * Buildable workers are skipped, but upgraded ones (required be target > site) are tested > * @param idx Index of the enhancement > */ > bool ProductionSite::has_workers(DescriptionIndex targetSite, Game & /* game > */) > { > // bld holds the description of the building we want to have > if (upcast(ProductionSiteDescr const, bld, > owner().tribe().get_building_descr(targetSite))) { > - // if he has workers > + > if (bld->nr_working_positions()) { > - DescriptionIndex need = > bld->working_positions()[0].first; > - for (unsigned int i = 0; i < > descr().nr_working_positions(); ++i) { > - if (!working_positions()[i].worker) { > - return false; // no one is in this house > - } else { > - DescriptionIndex have = > working_positions()[i].worker->descr().worker_index(); > - if > (owner().tribe().get_worker_descr(have)->can_act_as(need)) { > - return true; // he found a lead > worker > + > + // Iterating over workers positions in target building > + for (const auto& wp : bld->working_positions()) { > + > + // If worker for this position is buildable, > just skip him > + if > (owner().tribe().get_worker_descr(wp.first)->is_buildable()){ > + continue; > + } > + > + // This position needs promoted worker, so > trying to find out if there is such worker > + // currently available in this site > + const DescriptionIndex needed_worker = wp.first; > + bool worker_available = false; > + for (unsigned int i = 0; i < > descr().nr_working_positions(); ++i) { > + if (working_positions()[i].worker) { You are getting working_positions()[i] twice here. Why not just iterate over working_positions() with a range-based for loop? > + DescriptionIndex current_worker > + = > working_positions()[i].worker->descr().worker_index(); > + if > (owner().tribe().get_worker_descr(current_worker)->can_act_as(needed_worker)) > { > + worker_available = > true; // We found a worker for the position Add a "break" statement to leave the inner loop - no need to check further, we have already found one. > + } > } > } > + if (!worker_available) { > + // We dont have needed workers in the > site :( > + return false; > + } > + > } > - return false; > + > + //if we are here, all needs are satisfied > + return true; > + > + } else { > + throw wexception("Building, index: %d, needs no > workers!\n", targetSite); > } > - return true; > - } else return true; > + } else { //NOCOM Remove the NOCOM unless you have a question. > + throw wexception("No such building, index: %d\n", targetSite); > + } > } > > - > WaresQueue & ProductionSite::waresqueue(DescriptionIndex const wi) { > for (WaresQueue * ip_queue : m_input_queues) { > if (ip_queue->get_ware() == wi) { -- https://code.launchpad.net/~widelands-dev/widelands/bug-1518223/+merge/278249 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1518223 into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1509791 into lp:widelands
The flickering is back, but I reduced it to a minimum by prerendering the text labels in the warehouse window. The flickering is triggered by a mere call of the font renderer, so my guess is that the real bug lies with updating and redrawing the textures. I don't want to dig this deep right now though, so I am in favour of merging this and keeping the bug open. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1509791/+merge/278243 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1509791 into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1509791 into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1509791 into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1509791 in widelands: "Flickering while mouseover the first time" https://bugs.launchpad.net/widelands/+bug/1509791 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/bug-1509791/+merge/278243 Fixes flickering with mouse over wares in warehouse window. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1509791 into lp:widelands. === modified file 'src/ui_basic/textarea.cc' --- src/ui_basic/textarea.cc 2015-10-03 07:21:52 + +++ src/ui_basic/textarea.cc 2015-11-22 08:23:34 + @@ -96,6 +96,11 @@ if (m_layoutmode == AutoMove) collapse(); m_textstyle = style; + rendered_text_ = UI::g_fh1->render( + as_uifont(m_text, + m_textstyle.font->size() - UI::g_fh1->fontset().size_offset(), + m_textstyle.fg)); + if (m_layoutmode == AutoMove) expand(); else if (m_layoutmode == Layouted) @@ -123,6 +128,10 @@ collapse(); // collapse() implicitly updates m_text = text; + rendered_text_ = UI::g_fh1->render( + as_uifont(m_text, + m_textstyle.font->size() - UI::g_fh1->fontset().size_offset(), + m_textstyle.fg)); if (m_layoutmode == AutoMove) expand(); else if (m_layoutmode == Layouted) @@ -149,13 +158,7 @@ m_align & Align_VCenter ? get_h() / 2 : m_align & Align_Bottom ? get_h() : 0); - dst.blit(anchor, - UI::g_fh1->render( - as_uifont(m_text, - m_textstyle.font->size() - UI::g_fh1->fontset().size_offset(), - m_textstyle.fg)), - BlendMode::UseAlpha, - m_align); + dst.blit(anchor, rendered_text_, BlendMode::UseAlpha, m_align); } } @@ -192,19 +195,10 @@ { int32_t x = get_x(); int32_t y = get_y(); - const Image* image = UI::g_fh1->render( - as_uifont(m_text, - m_textstyle.font->size() - UI::g_fh1->fontset().size_offset(), - m_textstyle.fg)); - uint32_t w = image->width(); - uint16_t h = image->height(); - // We want empty textareas to have height - if (m_text.empty()) { - h = UI::g_fh1->render( - as_uifont(".", - m_textstyle.font->size() - UI::g_fh1->fontset().size_offset(), - m_textstyle.fg))->height(); - } + + update_desired_size(); + uint32_t w, h; + get_desired_size(w, h); if (m_align & Align_HCenter) x -= w >> 1; @@ -225,18 +219,19 @@ */ void Textarea::update_desired_size() { - const Image* image = UI::g_fh1->render( - as_uifont(m_text, - m_textstyle.font->size() - UI::g_fh1->fontset().size_offset(), - m_textstyle.fg)); - uint32_t w = image->width(); - uint16_t h = image->height(); - // We want empty textareas to have height - if (m_text.empty()) { - h = UI::g_fh1->render( - as_uifont(".", - m_textstyle.font->size() - UI::g_fh1->fontset().size_offset(), - m_textstyle.fg))->height(); + uint32_t w = 0; + uint16_t h = 0; + + if (rendered_text_) { + w = rendered_text_->width(); + h = rendered_text_->height(); + // We want empty textareas to have height + if (m_text.empty()) { + h = UI::g_fh1->render( + as_uifont(".", + m_textstyle.font->size() - UI::g_fh1->fontset().size_offset(), + m_textstyle.fg))->height(); + } } set_desired_size(w, h); } === modified file 'src/ui_basic/textarea.h' --- src/ui_basic/textarea.h 2014-11-27 12:02:08 + +++ src/ui_basic/textarea.h 2015-11-22 08:23:34 + @@ -96,7 +96,7 @@ LayoutMode m_layoutmode; std::string m_text; - const Image* m_text_image; + const Image* rendered_text_; Align m_align; UI::TextStyle m_textstyle; }; === modified file 'src/wui/waresdisplay.cc' --- src/wui/waresdisplay.cc 2015-11-11 09:52:55 + +++ src/wui/waresdisplay.cc 2015-11-22 08:23:34 + @@ -56,7 +56,7 @@ m_curware (this, 0, get_inner_h() - 25, get_inner_w(), 20, - _("Stock"), UI::Align_Center), + "", UI::Align_Center), m_selectable(selectable), m_horizontal(horizontal), @@ -67,8 +67,17 @@ m_selected.insert(std::make_pair(index, false)); m_hidden.insert(std::make_pair(index, false)); m_in_selection.insert(std::make_pair(index, false)); + + // Prerender all texts to avoid flickering with mouseover + m_curware.set_text(index != Widelands::INVALID_INDEX ? + (m_type == Widelands::wwWORKER ? + m_tribe.get_worker_descr(index)->descname() : + m_tribe.get_ware_descr(index)->descname()) : + ""); } + m_curware.set_text(_("Stock")); + // Find out geometry from icons_order unsigned int columns = icons_order().size(); unsigned
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/pc_on_buttons into lp:widelands
E.g. if you are Player 1, all white bits in the buildings are replaced by blue bits. If you are player 2, they are red. Have a look at the Atlantean Sawmill, it has quite a big player color area, so it should be more noticeabe there. -- https://code.launchpad.net/~widelands-dev/widelands/pc_on_buttons/+merge/278191 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/pc_on_buttons into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/compiler_warnings into lp:widelands
I will redesign this - the reason that I left them as signed int is that this is the way they are saved. It is better if I change the packets though. -- https://code.launchpad.net/~widelands-dev/widelands/compiler_warnings/+merge/278240 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/compiler_warnings into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/pc_on_buttons into lp:widelands
Thanks :) -- https://code.launchpad.net/~widelands-dev/widelands/pc_on_buttons/+merge/278191 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/pc_on_buttons. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1518223 into lp:widelands
Review: Approve I see your point - see my diff comment. Diff comments: > === modified file 'src/logic/productionsite.cc' > --- src/logic/productionsite.cc 2015-11-11 09:53:54 + > +++ src/logic/productionsite.cc 2015-11-22 19:17:25 + > @@ -284,33 +284,57 @@ > } > > /** > - * Detect if the workers are experienced enough for an upgrade > + * Detect if the workers are experienced enough for an target building > + * Buildable workers are skipped, but upgraded ones (required be target > site) are tested > * @param idx Index of the enhancement > */ > bool ProductionSite::has_workers(DescriptionIndex targetSite, Game & /* game > */) > { > // bld holds the description of the building we want to have > if (upcast(ProductionSiteDescr const, bld, > owner().tribe().get_building_descr(targetSite))) { > - // if he has workers > + > if (bld->nr_working_positions()) { > - DescriptionIndex need = > bld->working_positions()[0].first; > - for (unsigned int i = 0; i < > descr().nr_working_positions(); ++i) { > - if (!working_positions()[i].worker) { > - return false; // no one is in this house > - } else { > - DescriptionIndex have = > working_positions()[i].worker->descr().worker_index(); > - if > (owner().tribe().get_worker_descr(have)->can_act_as(need)) { > - return true; // he found a lead > worker > + > + // Iterating over workers positions in target building > + for (const auto& wp : bld->working_positions()) { > + > + // If worker for this position is buildable, > just skip him > + if > (owner().tribe().get_worker_descr(wp.first)->is_buildable()){ > + continue; > + } > + > + // This position needs promoted worker, so > trying to find out if there is such worker > + // currently available in this site > + const DescriptionIndex needed_worker = wp.first; > + bool worker_available = false; > + for (unsigned int i = 0; i < > descr().nr_working_positions(); ++i) { > + if (working_positions()[i].worker) { > + DescriptionIndex current_worker > + = > working_positions()[i].worker->descr().worker_index(); Duh, of course - that's an important difference. So, ignore my comment. I don't know if sticking working_positions()[i].worker into a variable makes things easier to read, because it's used twice. I'll leave that up to you. > + if > (owner().tribe().get_worker_descr(current_worker)->can_act_as(needed_worker)) > { > + worker_available = > true; // We found a worker for the position > + break; > + } > } > } > + if (!worker_available) { > + // We dont have needed workers in the > site :( > + return false; > + } > + > } > - return false; > + > + //if we are here, all needs are satisfied > + return true; > + > + } else { > + throw wexception("Building, index: %d, needs no > workers!\n", targetSite); > } > - return true; > - } else return true; > + } else { > + throw wexception("No such building, index: %d\n", targetSite); > + } > } > > - > WaresQueue & ProductionSite::waresqueue(DescriptionIndex const wi) { > for (WaresQueue * ip_queue : m_input_queues) { > if (ip_queue->get_ware() == wi) { -- https://code.launchpad.net/~widelands-dev/widelands/bug-1518223/+merge/278249 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1518223. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/assert_removed into lp:widelands
I have created a bug report, in case somebody want to work on a macro https://bugs.launchpad.net/widelands/+bug/1518929 -- https://code.launchpad.net/~widelands-dev/widelands/assert_removed/+merge/278269 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/assert_removed. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_differentiation into lp:widelands
How about naming them "weak", "normal" and "strong"? I think that is pretty standard. Some comments in the diff. Diff comments: > > === modified file 'src/ai/defaultai.cc' > --- src/ai/defaultai.cc 2015-11-22 19:26:11 + > +++ src/ai/defaultai.cc 2015-11-24 21:27:31 + > @@ -556,6 +557,22 @@ > bo.plants_trees_ = false; > } > > + // Is total count of this building limited by AI mode? > + if (type_ == DEFENSIVE && bh.get_weak_ai_limit() >= 0) { I would rename DEFENSIVE etc to "kWeak" etc. to match. Can they be an enum class too? Also, instead of initializing with -1, how about INVALID_INDEX? > + bo.cnt_limit_by_aimode_ = bh.get_weak_ai_limit(); > + log (" %d: AI defensive mode: applying limit %d building(s) for > %s\n", AI weak mode > + player_number(), > + bo.cnt_limit_by_aimode_, > + bo.name); > + } > + if (type_ == NORMAL && bh.get_normal_ai_limit() >= 0) { > + bo.cnt_limit_by_aimode_ = bh.get_normal_ai_limit(); > + log (" %d: AI normal mode: applying limit %d building(s) for > %s\n", > + player_number(), > + bo.cnt_limit_by_aimode_, > + bo.name); > + } > + > // Read all interesting data from ware producing buildings > if (bld.type() == MapObjectType::PRODUCTIONSITE) { > const ProductionSiteDescr& prod = dynamic_cast ProductionSiteDescr&>(bld); > @@ -3119,19 +3155,15 @@ > > // forcing first upgrade > if (en_bo.total_count() == 0) { > - enbld = enhancement; > - bestbld = &en_bo; > + doing_upgrade = true; > } > > // if the decision was not made yet, > consider normal upgrade > - if (enbld == INVALID_INDEX) { > + if (!doing_upgrade) { > // compare the performance % > if > (static_cast(en_bo.current_stats_) - > - > static_cast(site.bo->current_stats_) > > - 20) { > - > - enbld = enhancement; > - bestbld = &en_bo; > + > static_cast(site.bo->current_stats_) > 20) { Why do you need to cast this? If the compiler complains about this line, I think it's safer to cast the 20. > + doing_upgrade = > true; > } > > if > ((static_cast(en_bo.current_stats_) > 85 && > @@ -3760,6 +3799,13 @@ > > const PerfEvaluation purpose, > > const uint32_t gametime) { > > + // Very first we finds if AI is allowed to build such building due to > its mode > + if (purpose == PerfEvaluation::kForConstruction > + && > + bo.total_count() - bo.unconnected_count_ >= > bo.cnt_limit_by_aimode_) { We have this comparison a lot. Create a boolean function for it? > + return BuildingNecessity::kForbidden; > + } > + > // First we iterate over outputs of building, count warehoused stock > // and deciding if we have enough on stock (in warehouses) > bo.max_preciousness_ = 0; -- https://code.launchpad.net/~widelands-dev/widelands/ai_differentiation/+merge/278517 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ai_differentiation into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/compiler_warnings into lp:widelands
Review: Resubmit This should be ready for review again. I found a nice article on comparing signed and unsigned values: http://jwwalker.com/pages/safe-compare.html So, I made the remaining comparisions safe (where it was not easy or not possible to change the data type). -- https://code.launchpad.net/~widelands-dev/widelands/compiler_warnings/+merge/278240 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/compiler_warnings. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/compiler_warnings into lp:widelands
Variables like that are all over the code base, we actually have an open bug for this. It isn't always as easy as it looks though, I tried fixing them in the network code and it stopped working. So, better take this in small bits and pieces - resulting bugs might be hard to track down. -- https://code.launchpad.net/~widelands-dev/widelands/compiler_warnings/+merge/278240 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/compiler_warnings. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/worker_icons into lp:widelands
Review: Approve LGTM. This is a great improvement :) -- https://code.launchpad.net/~widelands-dev/widelands/worker_icons/+merge/278633 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/worker_icons. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_differentiation into lp:widelands
Review: Approve I have added some more small code style fixes. If you agree with them, please go ahead and merge :) -- https://code.launchpad.net/~widelands-dev/widelands/ai_differentiation/+merge/278517 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/ai_differentiation. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/command_queue_types into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/command_queue_types into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) For more details, see: https://code.launchpad.net/~widelands-dev/widelands/command_queue_types/+merge/278824 This is another code cleanup branch. I stumbled upon this huge list of #defines for command IDs and decided to turn it into an enum class. This now has the advantage that we get compiler warnings if there is one of them missing from the switch statement in the associated factory object - some of them were in fact not used there. I also removed a no longer used command ID. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/command_queue_types into lp:widelands. === modified file 'src/economy/cmd_call_economy_balance.h' --- src/economy/cmd_call_economy_balance.h 2015-11-21 10:16:52 + +++ src/economy/cmd_call_economy_balance.h 2015-11-27 14:25:51 + @@ -37,7 +37,7 @@ void execute (Game &) override; - uint8_t id() const override {return QUEUE_CMD_CALL_ECONOMY_BALANCE;} + QueueCommandTypes id() const override {return QueueCommandTypes::kCallEconomyBalance;} void write(FileWrite &, EditorGameBase &, MapObjectSaver &) override; void read (FileRead &, EditorGameBase &, MapObjectLoader &) override; === modified file 'src/game_io/game_cmd_queue_packet.cc' --- src/game_io/game_cmd_queue_packet.cc 2015-11-25 10:41:46 + +++ src/game_io/game_cmd_queue_packet.cc 2015-11-27 14:25:51 + @@ -60,7 +60,7 @@ item.serial = fr.unsigned_32(); GameLogicCommand & cmd = - QueueCmdFactory::create_correct_queue_command(packet_id); + QueueCmdFactory::create_correct_queue_command(static_cast(packet_id)); cmd.read(fr, game, *ol); item.cmd = &cmd; @@ -106,7 +106,7 @@ if (it.cmd->duetime() == time) { if (upcast(GameLogicCommand, cmd, it.cmd)) { // The id (aka command type) - fw.unsigned_16(cmd->id()); + fw.unsigned_16(static_cast(cmd->id())); // Serial number fw.signed_32(it.category); === modified file 'src/logic/cmd_calculate_statistics.h' --- src/logic/cmd_calculate_statistics.h 2015-11-21 10:16:52 + +++ src/logic/cmd_calculate_statistics.h 2015-11-27 14:25:51 + @@ -35,7 +35,7 @@ void write(FileWrite &, EditorGameBase &, MapObjectSaver &) override; void read (FileRead &, EditorGameBase &, MapObjectLoader &) override; - uint8_t id() const override {return QUEUE_CMD_CALCULATE_STATISTICS;} + QueueCommandTypes id() const override {return QueueCommandTypes::kCalculateStatistics;} void execute(Game &) override; }; === modified file 'src/logic/cmd_delete_message.h' --- src/logic/cmd_delete_message.h 2015-11-21 10:16:52 + +++ src/logic/cmd_delete_message.h 2015-11-27 14:25:51 + @@ -42,7 +42,7 @@ {} void execute (Game & game) override; - uint8_t id() const override {return QUEUE_CMD_DELETEMESSAGE;} + QueueCommandTypes id() const override {return QueueCommandTypes::kDeleteMessage;} private: PlayerNumber player; === modified file 'src/logic/cmd_incorporate.h' --- src/logic/cmd_incorporate.h 2015-11-21 10:16:52 + +++ src/logic/cmd_incorporate.h 2015-11-27 14:25:51 + @@ -36,7 +36,7 @@ void write(FileWrite &, EditorGameBase &, MapObjectSaver &) override; void read (FileRead &, EditorGameBase &, MapObjectLoader &) override; - uint8_t id() const override {return QUEUE_CMD_INCORPORATE;} + QueueCommandTypes id() const override {return QueueCommandTypes::kIncorporate;} private: Worker * worker; === modified file 'src/logic/cmd_luacoroutine.h' --- src/logic/cmd_luacoroutine.h 2015-11-21 10:16:52 + +++ src/logic/cmd_luacoroutine.h 2015-11-27 14:25:51 + @@ -40,7 +40,7 @@ void write(FileWrite &, EditorGameBase &, MapObjectSaver &) override; void read (FileRead &, EditorGameBase &, MapObjectLoader &) override; - uint8_t id() const override {return QUEUE_CMD_LUACOROUTINE;} + QueueCommandTypes id() const override {return QueueCommandTypes::kLuaCoroutine;} void execute(Game &) override; === modified file 'src/logic/cmd_luascript.h' --- src/logic/cmd_luascript.h 2015-11-21 10:16:52 + +++ src/logic/cmd_luascript.h 2015-11-27 14:25:51 + @@ -36,7 +36,7 @@ void write(FileWrite &, EditorGameBase &, MapObjectSaver &) override; void read (FileRead &, EditorGameBase &, MapObjectLoader &) override; - uint8_t id() const override {return QUEUE_CMD_LUASCRIPT;} + QueueCommandTypes id() const override {return QueueCommandTypes::kLuaScript;} void execute(Game &) override; === modified file 'src/logic/cmd_queue.cc' --- src/logic/cmd_queue.cc 2015-11-25 10:41:46 + +++ src/logic/cmd_queue.cc 2015-11-27 14:25:51
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/hide_seafaring_buildings into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/hide_seafaring_buildings into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) For more details, see: https://code.launchpad.net/~widelands-dev/widelands/hide_seafaring_buildings/+merge/278830 Shipyards and Barbarian Weaving Mill are hidden from the flag actions in non-seafaring maps. This prevents players from building completely useless seafaring buildings, especially when they are new to the game. The buildings are still listed in the Encyclopedia. I implemented it like this: Added a new "needs_seafaring" property to buildings' init.lua. When this is set and the map doesn't have a need for ships, these buildings are hidden from the building window. Might also come in useful for the AI? -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/hide_seafaring_buildings into lp:widelands. === modified file 'src/logic/building.cc' --- src/logic/building.cc 2015-11-11 09:53:54 + +++ src/logic/building.cc 2015-11-27 15:10:27 + @@ -159,6 +159,8 @@ directory_ = table.get_string("directory"); + m_needs_seafaring = table.has_key("needs_seafaring") ? table.get_bool("needs_seafaring") : false; + if (table.has_key("vision_range")) { m_vision_range = table.get_int("vision_range"); } === modified file 'src/logic/building.h' --- src/logic/building.h 2015-11-11 09:53:54 + +++ src/logic/building.h 2015-11-27 15:10:27 + @@ -95,6 +95,7 @@ int32_t get_size() const {return m_size;} bool get_ismine() const {return m_mine;} bool get_isport() const {return m_port;} + bool needs_seafaring() const {return m_needs_seafaring;} // Returns the enhancement this building can become or // INVALID_INDEX if it cannot be enhanced. @@ -144,6 +145,7 @@ int32_t m_size;// size of the building bool m_mine; bool m_port; + bool m_needs_seafaring; // THis building should only be built on seafaring maps. DescriptionIndex m_enhancement; DescriptionIndex m_enhanced_from; // The building this building was enhanced from, or INVALID_INDEX bool m_enhanced_building; // if it is one, it is bulldozable === modified file 'src/wui/fieldaction.cc' --- src/wui/fieldaction.cc 2015-11-20 18:16:22 + +++ src/wui/fieldaction.cc 2015-11-27 15:10:27 + @@ -507,6 +507,8 @@ if (dynamic_cast(&ibase().egbase())) { if (!building_descr->is_buildable() || !m_plr->is_building_type_allowed(building_index)) continue; + if (building_descr->needs_seafaring() && ibase().egbase().map().get_port_spaces().size() < 2) +continue; } else if (!building_descr->is_buildable() && !building_descr->is_enhanced()) continue; === modified file 'tribes/buildings/productionsites/atlanteans/shipyard/init.lua' --- tribes/buildings/productionsites/atlanteans/shipyard/init.lua 2015-10-31 12:11:44 + +++ tribes/buildings/productionsites/atlanteans/shipyard/init.lua 2015-11-27 15:10:27 + @@ -8,6 +8,7 @@ directory = dirname, icon = dirname .. "menu.png", size = "medium", + needs_seafaring = true, buildcost = { log = 3, === modified file 'tribes/buildings/productionsites/barbarians/shipyard/init.lua' --- tribes/buildings/productionsites/barbarians/shipyard/init.lua 2015-10-31 12:11:44 + +++ tribes/buildings/productionsites/barbarians/shipyard/init.lua 2015-11-27 15:10:27 + @@ -8,6 +8,7 @@ directory = dirname, icon = dirname .. "menu.png", size = "medium", + needs_seafaring = true, buildcost = { log = 3, @@ -74,7 +75,7 @@ -- TRANSLATORS: Completed/Skipped/Did not start constructing a ship because ... descname = _"constructing a ship", actions = { -"check_map=seafaring", -- TODO(GunChleoc): We should make this check on game creation as well and remove it from the allowed buildings +"check_map=seafaring", "construct=barbarians_shipconstruction buildship 6", "animate=working 35000", "return=completed" === modified file 'tribes/buildings/productionsites/barbarians/weaving_mill/init.lua' --- tribes/buildings/productionsites/barbarians/weaving_mill/init.lua 2015-10-31 12:11:44 + +++ tribes/buildings/productionsites/barbarians/weaving_mill/init.lua 2015-11-27 15:10:27 + @@ -8,6 +8,7 @@ directory = dirname, icon = dirname .. "menu.png", size = "big", + needs_seafaring = true, buildcost = { log = 5, @@ -58,6 +59,7 @@ descname = _"weaving", actions = { "sleep=2", +"check_m
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/string-fixes into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/string-fixes into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1421942 in widelands: "Unified term for "Black" and "Wasteland"" https://bugs.launchpad.net/widelands/+bug/1421942 Bug #1487887 in widelands: "Translation missing in editor and in replay tooltip" https://bugs.launchpad.net/widelands/+bug/1487887 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/string-fixes/+merge/278857 Various string fixes. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/string-fixes into lp:widelands. === modified file 'campaigns/emp02.wmf/scripting/texts.lua' --- campaigns/emp02.wmf/scripting/texts.lua 2015-11-17 13:49:59 + +++ campaigns/emp02.wmf/scripting/texts.lua 2015-11-27 17:43:13 + @@ -154,7 +154,7 @@ posy=1, body= lutius(_"Diary of Lutius", -- TRANSLATORS: Lutius - Diary - _[[Great! Today the building of the quarry was completed. Now we will get enough stones to construct larger buildings.]]), + _[[Great! Today the building of the quarry was completed. Now we will get enough granite and marble to construct larger buildings.]]), } saledus_1 = { === modified file 'campaigns/tutorial01_basic_control.wmf/scripting/texts.lua' --- campaigns/tutorial01_basic_control.wmf/scripting/texts.lua 2015-11-17 13:49:59 + +++ campaigns/tutorial01_basic_control.wmf/scripting/texts.lua 2015-11-27 17:43:13 + @@ -41,7 +41,7 @@ h1(_"Let’s dive right in!") .. p(_[[There are three different tribes in Widelands: the Barbarians, the Empire and the Atlanteans. All tribes have a different economy, strength and weaknesses, but the general gameplay is the same for all. We will play the Barbarians for now.]]) .. p(_[[You will usually start the game with one headquarters. This is the big building with the blue flag in front of it. The headquarters is a warehouse that stores wares, workers and soldiers. Some wares are needed for building houses, others for making other wares. Obviously, the wares in the headquarters will not last forever, so you must make sure to replace them. The most important wares in the early game are the basic construction wares: logs and granite. Let’s make sure that we do not run out of logs. For this, we need a lumberjack and a hut for him to stay in.]]) .. - p(_[[We need to find a nice place for the lumberjack’s hut. To make this easier, we can activate ‘Show Building Spaces’. There are two ways you can do this, either by clicking on the ‘Show Building Spaces’ button at the bottom of the screen, which is the fourth one from the left. Or you can use the SPACE key to toggle it.]]) .. + p(_[[We need to find a nice place for the lumberjack’s hut. To make this easier, we can activate ‘Show Building Spaces’. There are two ways you can do this, either by clicking on the ‘Show Building Spaces’ button at the bottom of the screen, which is the fourth one from the left. Or you can use the Space key to toggle it.]]) .. paragraphdivider() .. listitem_bullet(_[[Left-click the ‘OK’ button to close this box and then try it.]]) ), @@ -51,7 +51,7 @@ h1(_"Show Building Spaces") .. p(_[[It is easier to understand what type of buildings can be built on which field when the symbols for the building spaces are enabled.]]) .. paragraphdivider() .. - listitem_bullet(_[[Do so now, either by pressing SPACE or by clicking the fourth button from the left at the very bottom of the screen. Right-click on this window and then give it a try.]]) + listitem_bullet(_[[Do so now, either by pressing Space or by clicking the fourth button from the left at the very bottom of the screen. Right-click on this window and then give it a try.]]) ) } @@ -135,7 +135,7 @@ position = "topright", body = rt( p(_[[Well done! Let’s wait till the hut is finished.]]) .. - p(_[[If you want things to go faster, simply use the PAGE UP key on your keyboard to increase the game speed. You can use PAGE DOWN to make the game slower again.]]) + p(_[[If you want things to go faster, simply use the Page Up key on your keyboard to increase the game speed. You can use Page Down to make the game slower again.]]) ), h = 300, w = 350 @@ -148,7 +148,7 @@ p(_[[I wanted to teach you how to build new flags, but it seems you have already found out on your own. Well done!]]) .. p(_[[Now you have split the road in two parts with a carrier each. This means less work for him and higher efficiency for us. You should therefore always place as many flags as possible on your roads.]]) .. p(_[[Now we only have to wait till the hut is finished.]]) .. - p(_[[If you want things to go faster, simply use the PAGE UP
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/string-fixes into lp:widelands
Yes, that fixed it :) -- https://code.launchpad.net/~widelands-dev/widelands/string-fixes/+merge/278857 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/string-fixes. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/string-fixes into lp:widelands
Thanks :) -- https://code.launchpad.net/~widelands-dev/widelands/string-fixes/+merge/278857 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/string-fixes. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1502965 into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1502965 into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1502965 in widelands: "Building statistics window does not "courtain up" correctly" https://bugs.launchpad.net/widelands/+bug/1502965 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/bug-1502965/+merge/278885 Fixed minimizing/restoring of Building Statistics window. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1502965 into lp:widelands. === modified file 'src/wui/building_statistics_menu.cc' --- src/wui/building_statistics_menu.cc 2015-11-20 18:16:22 + +++ src/wui/building_statistics_menu.cc 2015-11-28 12:35:36 + @@ -559,20 +559,25 @@ */ void BuildingStatisticsMenu::think() { // Adjust height to current tab - int tab_height = - 35 + row_counters_[tab_panel_.active()] * (kBuildGridCellHeight + kLabelHeight + kLabelHeight); - tab_panel_.set_size(kWindowWidth, tab_height); - set_size(get_w(), tab_height + kMargin + 4 * kButtonRowHeight + get_tborder() + get_bborder()); - navigation_panel_.set_pos(Point(0, tab_height + kMargin)); + if (is_minimal()) { + tab_panel_.set_size(0, 0); + } else { + int tab_height = + 35 + row_counters_[tab_panel_.active()] * (kBuildGridCellHeight + kLabelHeight + kLabelHeight); + tab_panel_.set_size(kWindowWidth, tab_height); + set_size(get_w(), tab_height + kMargin + 4 * kButtonRowHeight + get_tborder() + get_bborder()); + navigation_panel_.set_pos(Point(0, tab_height + kMargin)); + } // Update statistics - const Game& game = iplayer().game(); - const int32_t gametime = game.get_gametime(); + const int32_t gametime = iplayer().game().get_gametime(); - if ((gametime - lastupdate_) > kUpdateTimeInGametimeMs) { + if (was_minimized_ || (gametime - lastupdate_) > kUpdateTimeInGametimeMs) { update(); lastupdate_ = gametime; } + // Make sure we don't have a delay with displaying labels when we restore the window. + was_minimized_ = is_minimal(); } /* === modified file 'src/wui/building_statistics_menu.h' --- src/wui/building_statistics_menu.h 2015-11-11 09:53:54 + +++ src/wui/building_statistics_menu.h 2015-11-28 12:35:36 + @@ -126,6 +126,8 @@ Widelands::DescriptionIndex last_building_type_; /// The last time the information in this Panel got updated uint32_t lastupdate_; + /// Whether the window was minimized the last time that think() was executed + uint32_t was_minimized_; /// At which percent to deem buildings as unproductive int low_production_; ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1519361 into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1519361 into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1519361 in widelands: "PlayerColor in Building menu causes render errors" https://bugs.launchpad.net/widelands/+bug/1519361 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/bug-1519361/+merge/278886 This should fix the render errors for buttons displaying animation images. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1519361 into lp:widelands. === modified file 'src/graphic/animation.cc' --- src/graphic/animation.cc 2015-11-20 18:16:22 + +++ src/graphic/animation.cc 2015-11-28 14:21:03 + @@ -307,6 +307,10 @@ int h = image->height(); Texture* rv = new Texture(w, h); + + // Initialize the rectangle + ::fill_rect(Rect(Point(0, 0), w, h), RGBAColor(255, 255, 255, 0), rv); + if (!hasplrclrs_ || clr == nullptr) { ::blit(Rect(Point(0, 0), w, h), *image, ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1520762 into lp:widelands
Review: Approve Thumbs up :) -- https://code.launchpad.net/~widelands-dev/widelands/bug-1520762/+merge/278893 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1520762. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1520820 into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1520820 into lp:widelands. Requested reviews: Tino (tino79) Related bugs: Bug #1520820 in widelands: "trunk 7650 fails to compile on gcc 5.2.0" https://bugs.launchpad.net/widelands/+bug/1520820 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/bug-1520820/+merge/278898 Initialized some variables to fix error in gcc 5.2.0. Tino, could you please check if this does fix it? -- Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1520820. === modified file 'src/logic/production_program.cc' --- src/logic/production_program.cc 2015-11-28 13:56:45 + +++ src/logic/production_program.cc 2015-11-28 21:50:45 + @@ -1049,7 +1049,7 @@ assert(m_items.size()); std::vector ware_descnames; - uint8_t count; + uint8_t count = 0; for (const auto& item_pair : m_items) { count = item_pair.second; std::string ware_descname = tribe.get_ware_descr(item_pair.first)->descname(); @@ -1145,7 +1145,7 @@ const TribeDescr & tribe = ps.owner().tribe(); assert(m_items.size()); std::vector worker_descnames; - uint8_t count; + uint8_t count = 0; for (const auto& item_pair : m_items) { count = item_pair.second; std::string worker_descname = tribe.get_worker_descr(item_pair.first)->descname(); ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1520820 into lp:widelands
You are right, we need to sum these up. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1520820/+merge/278898 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1520820. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1520820 into lp:widelands
Review: Resubmit This should do it - thanks for having my back :) -- https://code.launchpad.net/~widelands-dev/widelands/bug-1520820/+merge/278898 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1520820. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/spinbox into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/spinbox into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) For more details, see: https://code.launchpad.net/~widelands-dev/widelands/spinbox/+merge/279153 Cleaned up buggy text positioning and width for spinboxes. Also, spinboxes now own their labels, just like checkboxes. Labels will automatically take up more than 1 line if needed - we don't have a test case for this right now, but it safeguards us against text overflow with translations. For testing: Spinboxes are only used in the Options window so far. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/spinbox into lp:widelands. === modified file 'src/ui_basic/spinbox.cc' --- src/ui_basic/spinbox.cc 2015-10-23 10:17:13 + +++ src/ui_basic/spinbox.cc 2015-12-01 17:08:30 + @@ -29,6 +29,7 @@ #include "graphic/text/font_set.h" #include "graphic/text_constants.h" #include "ui_basic/button.h" +#include "ui_basic/multilinetextarea.h" #include "ui_basic/textarea.h" namespace UI { @@ -76,13 +77,14 @@ */ SpinBox::SpinBox (Panel * const parent, - const int32_t x, const int32_t y, const uint32_t w, + const int32_t x, const int32_t y, const uint32_t w, const uint32_t unit_w, int32_t const startval, int32_t const minval, int32_t const maxval, + const std::string& label_text, const std::string& unit, const Image* background, bool const big) : - Panel(parent, x, y, w, 0), + Panel(parent, x, y, std::max(w, unit_w), 0), big_(big), sbi_(new SpinBoxImpl) { @@ -93,17 +95,40 @@ sbi_->background = background; uint32_t padding = 2; - + uint32_t actual_w = std::max(w, unit_w); + uint32_t no_padding = (big_ ? 6 : 4); uint32_t texth = UI::g_fh1->render(as_uifont("."))->height(); - box_ = new UI::Box(this, 0, 0, UI::Box::Horizontal, w, texth, padding); + + // 40 is an ad hoc width estimate for the MultilineTextarea scrollbar + a bit of text. + if (!label_text.empty() && (w + padding) <= unit_w - 40) { + throw wexception( + "SpinBox: Overall width %d must be bigger than unit width %d + %d * %d + 40 for padding", + w, unit_w, no_padding, padding); + } #ifndef NDEBUG // only in debug builds - if (w < (big_ ? 7 * texth : 3 * texth)) { + if (unit_w < (big_ ? 7 * texth : 3 * texth)) { throw wexception("Not enough space to draw spinbox. Width %d is smaller than required width %d", - w, (big_ ? 7 * texth : 3 * texth)); + unit_w, (big_ ? 7 * texth : 3 * texth)); } #endif + box_ = new UI::Box(this, 0, 0, UI::Box::Horizontal, actual_w, texth, padding); + + // Find out how much height we need for the label. We give it 6 rows maximum. + const Image* rendered_text = UI::g_fh1->render(as_uifont(label_text)); + uint32_t available_width = w - unit_w - no_padding * padding; + uint32_t extra_rows = + available_width > 0 ? +std::min(static_cast(rendered_text->width() / available_width), 6) : 0; + + UI::MultilineTextarea* label = new UI::MultilineTextarea(box_, 0, 0, available_width, +texth * (extra_rows + 1), label_text); + + box_->add(label, UI::Box::AlignTop); + + sbi_->text = new UI::Textarea(box_, "", Align_Center); + sbi_->button_minus = new Button (box_, "-", @@ -142,24 +167,22 @@ buttons_.push_back(sbi_->button_ten_minus); buttons_.push_back(sbi_->button_ten_plus); - sbi_->text = -new UI::Textarea( - box_, 0, 0, - w - 2 * sbi_->button_ten_plus->get_w() - 2 * sbi_->button_minus->get_w() - 4 * padding, texth, - "", Align_Center); + sbi_->text->set_fixed_width(unit_w + - 2 * sbi_->button_ten_plus->get_w() + - 2 * sbi_->button_minus->get_w() + - 4 * padding); - box_->add(sbi_->button_ten_minus, UI::Box::AlignCenter); - box_->add(sbi_->button_minus, UI::Box::AlignCenter); - box_->add(sbi_->text, UI::Box::AlignCenter); - box_->add(sbi_->button_plus, UI::Box::AlignCenter); - box_->add(sbi_->button_ten_plus, UI::Box::AlignCenter); + box_->add(sbi_->button_ten_minus, UI::Box::AlignTop); + box_->add(sbi_->button_minus, UI::Box::AlignTop); + box_->add(sbi_->text, UI::Box::AlignTop); + box_->add(sbi_->button_plus, UI::Box::AlignTop); + box_->add(sbi_->button_ten_plus, UI::Box::AlignTop); } else { - sbi_->text = new UI::Textarea(box_, 0, 0, -w - 2 * sbi_->button_minus->get_w() - 2 * padding, texth, -"", Align_Center); - box_->add(sbi_->button_minus, UI::Box::AlignCenter); - box_->add(sbi_->text, UI::Box::AlignCenter); - box_->add(sbi_->button_plus, UI::Box::AlignCenter); + sbi_->text->set_fixed_width(unit_w - 2 * sbi_->
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1502965 into lp:widelands
Thanks :) -- https://code.launchpad.net/~widelands-dev/widelands/bug-1502965/+merge/278885 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1502965. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/command_queue_types into lp:widelands
Thanks :) -- https://code.launchpad.net/~widelands-dev/widelands/command_queue_types/+merge/278824 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/command_queue_types. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~miroslavr256/widelands/official-lua-xgettext into lp:widelands
> On an unrelated note, why is the text domain for the map 'The Green Plateau' > called 'map_plateau.wmf' when buildcat updates > 'po/map_the_green_plateau.wmf/map_the_green_plateau.wmf.pot'? I'd say that this is historical baggage. My Python is a bit rusty, but I'll have a look and do some more testing to make sure that we don't lose any strings. -- https://code.launchpad.net/~miroslavr256/widelands/official-lua-xgettext/+merge/279224 Your team Widelands Developers is requested to review the proposed merge of lp:~miroslavr256/widelands/official-lua-xgettext into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1492114 into lp:widelands
Thanks! Yes, complete window rip-ups tend to get rather big in the diff :( -- https://code.launchpad.net/~widelands-dev/widelands/bug-1492114/+merge/272292 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1492114. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/string-fixes into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/string-fixes into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1421942 in widelands: "Unified term for "Black" and "Wasteland"" https://bugs.launchpad.net/widelands/+bug/1421942 Bug #1487887 in widelands: "Translation missing in editor and in replay tooltip" https://bugs.launchpad.net/widelands/+bug/1487887 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/string-fixes/+merge/279646 2 small string fixes. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/string-fixes into lp:widelands. === modified file 'src/logic/soldier.cc' --- src/logic/soldier.cc 2015-12-03 08:45:37 + +++ src/logic/soldier.cc 2015-12-04 19:21:30 + @@ -1501,7 +1501,7 @@ *new Message (Message::Type::kGameLogic, game.get_gametime(), - _("Soldier"), + descr().descname(), "pics/menu_help.png", _("Logic error"), messagetext, @@ -1512,7 +1512,7 @@ *new Message (Message::Type::kGameLogic, game.get_gametime(), - _("Soldier"), + descr().descname(), "pics/menu_help.png", _("Logic error"), messagetext, === modified file 'tribes/scripting/starting_conditions/atlanteans/fortified_village.lua' --- tribes/scripting/starting_conditions/atlanteans/fortified_village.lua 2015-12-03 09:56:01 + +++ tribes/scripting/starting_conditions/atlanteans/fortified_village.lua 2015-12-04 19:21:30 + @@ -100,7 +100,7 @@ end) then plr:send_message( -- TRANSLATORS: Short for "Not enough space" - _"Space", + _"No Space", rt(p(_([[Some of your starting buildings didn’t have enough room and weren’t built. You are at a disadvantage with this; consider restarting this map with a fair starting condition.]]))), {popup=true, heading=_"Not enough space"} ) === modified file 'tribes/scripting/starting_conditions/barbarians/fortified_village.lua' --- tribes/scripting/starting_conditions/barbarians/fortified_village.lua 2015-12-03 09:56:01 + +++ tribes/scripting/starting_conditions/barbarians/fortified_village.lua 2015-12-04 19:21:30 + @@ -93,7 +93,7 @@ end) then plr:send_message( -- TRANSLATORS: Short for "Not enough space" - _"Space", + _"No Space", rt(p(_([[Some of your starting buildings didn’t have enough room and weren’t built. You are at a disadvantage with this; consider restarting this map with a fair starting condition.]]))), {popup=true, heading=_"Not enough space"} ) === modified file 'tribes/scripting/starting_conditions/empire/fortified_village.lua' --- tribes/scripting/starting_conditions/empire/fortified_village.lua 2015-12-03 09:56:01 + +++ tribes/scripting/starting_conditions/empire/fortified_village.lua 2015-12-04 19:21:30 + @@ -118,7 +118,7 @@ end) then plr:send_message( -- TRANSLATORS: Short for "Not enough space" - _"Space", + _"No Space", rt(p(_([[Some of your starting buildings didn’t have enough room and weren’t built. You are at a disadvantage with this; consider restarting this map with a fair starting condition.]]))), {popup=true, heading=_"Not enough space"} ) ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/is_value_terms into lp:widelands
Review: Approve LGTM :) Somebody should look at my part of the code - files to review are: src/editor/tools/editor_info_tool.cc src/editor/ui_menus/editor_tool_set_terrain_options_menu.cc src/logic/world/terrain_description.cc src/logic/world/terrain_description.h -- https://code.launchpad.net/~widelands-dev/widelands/is_value_terms/+merge/279205 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/is_value_terms. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/is_value_terms into lp:widelands
Thanks for testing again! I still would like a C++ coder to have a look though. -- https://code.launchpad.net/~widelands-dev/widelands/is_value_terms/+merge/279205 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/is_value_terms. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/table_align into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/table_align into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1307356 in widelands: "Implement RTL support" https://bugs.launchpad.net/widelands/+bug/1307356 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/table_align/+merge/279685 This is a bugfix for RTL languages. When text is too long to fit a table cell, it is now cropped and positioned correctly. This will work for all language settings. Also, if the table cell has a picture, it is shown on the right if the table cell is right-aligned. I have attached a bogus savegame to the bug with a long name in Arabic script (I don't speak Arabic, so I hope it doesn't say anything offensive :P). -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/table_align into lp:widelands. === modified file 'src/graphic/text/bidi.cc' --- src/graphic/text/bidi.cc 2015-10-11 15:00:53 + +++ src/graphic/text/bidi.cc 2015-12-06 09:39:12 + @@ -555,11 +555,12 @@ namespace i18n { -// True if a string does not contain Latin characters -bool has_rtl_character(const char* input) { +// True if a string does not contain Latin characters. +// Checks for the first 'limit' characters maximum. +bool has_rtl_character(const char* input, int32_t limit) { bool result = false; const icu::UnicodeString parseme(input); - for (int32_t i = 0; i < parseme.length(); ++i) { + for (int32_t i = 0; i < parseme.length() && i < limit; ++i) { if (is_rtl_character(parseme.char32At(i))) { result = true; break; === modified file 'src/graphic/text/bidi.h' --- src/graphic/text/bidi.h 2015-09-28 18:47:57 + +++ src/graphic/text/bidi.h 2015-12-06 09:39:12 + @@ -32,7 +32,7 @@ std::string make_ligatures(const char* input); std::string line2bidi(const char* input); std::vector split_cjk_word(const char* input); - bool has_rtl_character(const char* input); + bool has_rtl_character(const char* input, int32_t limit = std::numeric_limits::max()); bool has_rtl_character(std::vector input); bool has_cjk_character(const char* input); bool cannot_start_line(const UChar& c); === modified file 'src/ui_basic/table.cc' --- src/ui_basic/table.cc 2015-11-21 11:34:10 + +++ src/ui_basic/table.cc 2015-12-06 09:39:12 + @@ -25,6 +25,7 @@ #include "graphic/font_handler1.h" #include "graphic/graphic.h" #include "graphic/rendertarget.h" +#include "graphic/text/bidi.h" #include "graphic/text/font_set.h" #include "graphic/text_constants.h" #include "graphic/text_layout.h" @@ -310,6 +311,10 @@ } } + if (alignment & Align_Right) { + draw_x += curw - blit_width; + } + dst.blitrect_scale( // Center align if text is empty Rect(draw_x, @@ -328,12 +333,16 @@ } else { draw_x = point.x + (curw - picw) / 2; } + } else if (alignment & Align_Right) { + draw_x += curw - picw; } dst.blit(Point(draw_x, point.y + (lineheight - pich) / 2), entry_picture); } point.x += picw; } + ++picw; // A bit or margin between image and text + if (entry_string.empty()) { curx += curw; continue; @@ -341,7 +350,7 @@ const Image* entry_text_im = UI::g_fh1->render(as_uifont(entry_string, m_fontsize)); if (alignment & Align_Right) { -point.x += curw - picw; +point.x += curw - 2 * picw; } else if (alignment & Align_HCenter) { point.x += (curw - picw) / 2; } @@ -352,8 +361,25 @@ text_width = text_width + m_scrollbar->get_w(); } UI::correct_for_align(alignment, text_width, entry_text_im->height(), &point); - // Crop to column width - dst.blitrect(point, entry_text_im, Rect(0, 0, curw - picw, lineheight)); + + // Crop to column width while blitting + if (((static_cast(curw) + picw) < text_width)) { +// Fix positioning for BiDi languages. +if (UI::g_fh1->fontset().is_rtl()) { + point.x = alignment & Align_Right ? curx : curx + picw; +} +// We want this always on, e.g. for mixed language savegame filenames +if (i18n::has_rtl_character(entry_string.c_str(), 20)) { // Restrict check for efficiency + dst.blitrect(point, + entry_text_im, + Rect(text_width - curw + picw, 0, text_width, lineheight)); +} +else { + dst.blitrect(point, entry_text_im, Rect(0, 0, curw - picw, lineheight)); +} + } else { +dst.blitrect(point, entry_text_im, Rect(0, 0, curw - picw, lineheight)); + } curx += curw; } ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_level_names into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/ai_level_names into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1516785 in widelands: "Redefine difficulty levels" https://bugs.launchpad.net/widelands/+bug/1516785 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/ai_level_names/+merge/279697 Renamed AI levels to "Normal", "Weak", "Very Weak". AI names and icon filenames are now independent of their descnames. pics/ai_strong.png is now unused, but I am having trouble grabbing the media repro, so I left it in for now. It should be moved over there though, because we're currently not using it, but we don't want to lose the graphic for when we do have a strong AI in the future. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ai_level_names into lp:widelands. === modified file 'campaigns/bar02.wmf/player_names' --- campaigns/bar02.wmf/player_names 2010-03-11 17:46:46 + +++ campaigns/bar02.wmf/player_names 2015-12-06 19:52:56 + @@ -10,14 +10,14 @@ [player_2] name="Kalitath" tribe="barbarians" -ai="Defensive" +ai="very_weak" [player_3] name="First Brother" tribe="barbarians" -ai="Aggressive" +ai="normal" [player_4] name="Second Brother" tribe="barbarians" -ai="Aggressive" +ai="normal" === modified file 'maps/The Green Plateau.wmf/player_names' --- maps/The Green Plateau.wmf/player_names 2015-11-01 22:12:57 + +++ maps/The Green Plateau.wmf/player_names 2015-12-06 19:52:56 + @@ -12,17 +12,17 @@ [player_2] name="Erwyn" tribe="barbarians" -ai="Normal" +ai="weak" closeable="false" [player_3] name="Jomo" tribe="barbarians" -ai="Defensive" +ai="very_weak" closeable="false" [player_4] name="Lanissa" tribe="barbarians" -ai="None" +ai="empty" closeable="false" === modified file 'maps/Trident of Fire.wmf/player_names' --- maps/Trident of Fire.wmf/player_names 2013-08-15 16:00:17 + +++ maps/Trident of Fire.wmf/player_names 2015-12-06 19:52:56 + @@ -24,29 +24,29 @@ [player_4] name="Player A" tribe="barbarians" -ai="Aggressive" +ai="normal" closeable="false" [player_5] name="Player B" tribe="empire" -ai="Aggressive" +ai="normal" closeable="false" [player_6] name="Player C" tribe="atlanteans" -ai="Aggressive" +ai="normal" closeable="false" [player_7] name="Player D" tribe="empire" -ai="Aggressive" +ai="normal" closeable="false" [player_8] name="Player E" tribe="atlanteans" -ai="Aggressive" +ai="normal" closeable="false" === renamed file 'pics/ai_None.png' => 'pics/ai_empty.png' === renamed file 'pics/ai_Normal.png' => 'pics/ai_normal.png' === renamed file 'pics/ai_Random.png' => 'pics/ai_random.png' === renamed file 'pics/ai_Strong.png' => 'pics/ai_strong.png' === renamed file 'pics/ai_Weak.png' => 'pics/ai_very_weak.png' === added file 'pics/ai_weak.png' Binary files pics/ai_weak.png 1970-01-01 00:00:00 + and pics/ai_weak.png 2015-12-06 19:52:56 + differ === modified file 'src/ai/ai_hints.cc' --- src/ai/ai_hints.cc 2015-11-23 18:44:38 + +++ src/ai/ai_hints.cc 2015-12-06 19:52:56 + @@ -40,8 +40,8 @@ // 10 days default forced_after_(table->has_key("forced_after") ? table->get_int("forced_after") : 864000), mines_percent_(table->has_key("mines_percent") ? table->get_int("mines_percent") : 100), - weak_ai_limit_(table->has_key("weak_ai_limit") ? table->get_int("weak_ai_limit") : -1), - normal_ai_limit_(table->has_key("normal_ai_limit") ? table->get_int("normal_ai_limit") : -1), + very_weak_ai_limit_(table->has_key("very_weak_ai_limit") ? table->get_int("very_weak_ai_limit") : -1), + weak_ai_limit_(table->has_key("weak_ai_limit") ? table->get_int("weak_ai_limit") : -1), trainingsite_type_(TrainingSiteType::kNoTS) { if (table->has_key("trainingsite_type")) { === modified file 'src/ai/ai_hints.h' --- src/ai/ai_hints.h 2015-11-23 18:44:38 + +++ src/ai/ai_hints.h 2015-12-06 19:52:56 + @@ -102,14 +102,14 @@ return mines_percent_; } + i
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_level_names into lp:widelands
I have posted on the forum to give this branch testing priority - hopefully somebody will find the time :) -- https://code.launchpad.net/~widelands-dev/widelands/ai_level_names/+merge/279697 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ai_level_names into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_level_names into lp:widelands
Thanks! You can delete the file from this branch with "bzr rm " if you want to take care of that too. -- https://code.launchpad.net/~widelands-dev/widelands/ai_level_names/+merge/279697 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ai_level_names into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_level_names into lp:widelands
Thanks! Your fix is correct, so this branch is ready to go :) -- https://code.launchpad.net/~widelands-dev/widelands/ai_level_names/+merge/279697 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ai_level_names into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/spinbox into lp:widelands
When approving, please use the "Review" dropdown on the bottom. Setting it on top hid this from view for some nebulous reason. -- https://code.launchpad.net/~widelands-dev/widelands/spinbox/+merge/279153 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/spinbox into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ware_help into lp:widelands
I expect so - the old encyclopedia code was a bit hacky to make it work. Thanks for the review :) -- https://code.launchpad.net/~widelands-dev/widelands/ware_help/+merge/276516 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ware_help into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ware_help into lp:widelands
No that's it - the encyclopedia and the help accessed through the buildings. I will fix and then post here again. The German translation should be changed to "Kunde" or "Überlieferung" or something - the English string is correct. -- https://code.launchpad.net/~widelands-dev/widelands/ware_help/+merge/276516 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ware_help into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ware_help into lp:widelands
OK, images replaced. The image I had used is pics/genstats_nrworkers.png, which is still used in the general statistics, and in multiplayer setup to represent human players. Would you like fixing these up in a new branch? I think the building icon could also do with some more oomph now. -- https://code.launchpad.net/~widelands-dev/widelands/ware_help/+merge/276516 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ware_help into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ware_help into lp:widelands
The deep mines come first, because their IDs are lower - they need to be loaded into the game before theis non-enhanced counterparts for technical reasons. So, changing that will need some extra coding. -- https://code.launchpad.net/~widelands-dev/widelands/ware_help/+merge/276516 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/one_tribe. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ware_help into lp:widelands
Please use the "Approve" option below the comment window - when you set the whole merge request to "Approve" on top, it will vanish from the list. -- https://code.launchpad.net/~widelands-dev/widelands/ware_help/+merge/276516 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/one_tribe. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ware_help into lp:widelands
Nevermind, this was just me being blind (see forum thread) -- https://code.launchpad.net/~widelands-dev/widelands/ware_help/+merge/276516 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/one_tribe. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/militarysites into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/militarysites into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1512076 in widelands: "Post one_tribe cleanup" https://bugs.launchpad.net/widelands/+bug/1512076 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/militarysites/+merge/280069 Cleaning up some more historical baggage: Militarysites no longer inherit from productionsites. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/militarysites into lp:widelands. === modified file 'src/logic/militarysite.cc' --- src/logic/militarysite.cc 2015-11-21 11:34:10 + +++ src/logic/militarysite.cc 2015-12-09 20:23:44 + @@ -46,8 +46,8 @@ const LuaTable& table, const EditorGameBase& egbase) : - ProductionSiteDescr - (init_descname, "", MapObjectType::MILITARYSITE, table, egbase), + BuildingDescr + (init_descname, MapObjectType::MILITARYSITE, table, egbase), m_conquer_radius (0), m_num_soldiers (0), m_heal_per_second(0) @@ -89,7 +89,7 @@ */ MilitarySite::MilitarySite(const MilitarySiteDescr & ms_descr) : -ProductionSite(ms_descr), +Building(ms_descr), m_didconquer (false), m_capacity(ms_descr.get_max_number_of_soldiers()), m_nexthealtime(0), @@ -151,7 +151,7 @@ void MilitarySite::init(EditorGameBase & egbase) { - ProductionSite::init(egbase); + Building::init(egbase); upcast(Game, game, &egbase); @@ -180,7 +180,7 @@ */ void MilitarySite::set_economy(Economy * const e) { - ProductionSite::set_economy(e); + Building::set_economy(e); if (m_normal_soldier_request && e) m_normal_soldier_request->set_economy(e); @@ -204,10 +204,15 @@ (egbase.map().get_fcoords(get_position()), descr().get_conquers())), m_defeating_player); - ProductionSite::cleanup(egbase); - - // Note that removing workers during ProductionSite::cleanup can generate - // new requests; that's why we delete it at the end of this function. + Building::cleanup(egbase); + + // Evict soldiers to get rid of requests + while (m_capacity > 0) { + update_soldier_request(); + --m_capacity; + } + update_soldier_request(); + m_normal_soldier_request.reset(); m_upgrade_soldier_request.reset(); } @@ -558,12 +563,12 @@ void MilitarySite::act(Game & game, uint32_t const data) { // TODO(unknown): do all kinds of stuff, but if you do nothing, let - // ProductionSite::act() handle all this. Also note, that some ProductionSite - // commands rely, that ProductionSite::act() is not called for a certain + // Building::act() handle all this. Also note, that some Building + // commands rely, that Building::act() is not called for a certain // period (like cmdAnimation). This should be reworked. // Maybe a new queueing system like MilitaryAct could be introduced. - ProductionSite::act(game, data); + Building::act(game, data); const int32_t timeofgame = game.get_gametime(); if (m_normal_soldier_request && m_upgrade_soldier_request) @@ -624,7 +629,7 @@ */ void MilitarySite::remove_worker(Worker & w) { - ProductionSite::remove_worker(w); + Building::remove_worker(w); if (upcast(Soldier, soldier, &w)) pop_soldier_job(soldier, nullptr); === modified file 'src/logic/militarysite.h' --- src/logic/militarysite.h 2015-11-11 09:52:55 + +++ src/logic/militarysite.h 2015-12-09 20:23:44 + @@ -23,8 +23,9 @@ #include #include "base/macros.h" +#include "economy/request.h" #include "logic/attackable.h" -#include "logic/productionsite.h" +#include "logic/building.h" #include "logic/requirements.h" #include "logic/soldiercontrol.h" #include "scripting/lua_table.h" @@ -34,7 +35,7 @@ class Soldier; class World; -class MilitarySiteDescr : public ProductionSiteDescr { +class MilitarySiteDescr : public BuildingDescr { public: MilitarySiteDescr(const std::string& init_descname, const LuaTable& t, const EditorGameBase& egbase); ~MilitarySiteDescr() override {} @@ -65,7 +66,7 @@ }; class MilitarySite : - public ProductionSite, public SoldierControl, public Attackable + public Building, public SoldierControl, public Attackable { friend class MapBuildingdataPacket; MO_DESCR(MilitarySiteDescr) === modified file 'src/map_io/map_buildingdata_packet.cc' --- src/map_io/map_buildingdata_packet.cc 2015-11-11 09:53:54 + +++ src/map_io/map_buildingdata_packet.cc 2015-12-09 20:23:44 + @@ -59,7 +59,7 @@ constexpr uint16_t kCurrentPacketVersionConstructionsite = 3; constexpr uint16_t kCurrentPacketPFBuilding = 1; constexpr uint16_t kCurrentPacketVersionWarehouse = 6; -constexpr uint16_t kCurrentPacketVersionMilitarysite = 4; +constexpr uint16_t kCurrentPacketVersionMilitarysite = 5; con
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/militarysites into lp:widelands
Added a comment to your comment :) Diff comments: > === modified file 'src/logic/militarysite.cc' > --- src/logic/militarysite.cc 2015-11-21 11:34:10 + > +++ src/logic/militarysite.cc 2015-12-09 20:23:44 + > @@ -204,10 +204,15 @@ > > (egbase.map().get_fcoords(get_position()), descr().get_conquers())), >m_defeating_player); > > - ProductionSite::cleanup(egbase); > - > - // Note that removing workers during ProductionSite::cleanup can > generate > - // new requests; that's why we delete it at the end of this function. > + Building::cleanup(egbase); > + > + // Evict soldiers to get rid of requests > + while (m_capacity > 0) { Yes - this is to make sure that there are no dead requests left over after the building is gone. The destructor has an assert for this, and if I don't get rid of the soldiers, it will trigger a crash. The productionsite has similar code. > + update_soldier_request(); > + --m_capacity; > + } > + update_soldier_request(); > + > m_normal_soldier_request.reset(); > m_upgrade_soldier_request.reset(); > } -- https://code.launchpad.net/~widelands-dev/widelands/militarysites/+merge/280069 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/militarysites into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/table_align into lp:widelands
Yes, I know there there are still issues for RTL languages with other GUI elements - these still need to be dealt with in separate bugs. This fix is for tables only - they are used in: - the main load map/game/tutorial/campaign screens - the in-game message window, productionsite window, and game summary - the editor load/save map windows. -- https://code.launchpad.net/~widelands-dev/widelands/table_align/+merge/279685 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/table_align into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/is_value_terms into lp:widelands
The "buf" thing is old code that I didn't want to mess with in this branch - it would have made the diff pretty big. We should overhaul it one day though. -- https://code.launchpad.net/~widelands-dev/widelands/is_value_terms/+merge/279205 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/is_value_terms. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/is_value_terms into lp:widelands
OK, thanks! Will merge :) -- https://code.launchpad.net/~widelands-dev/widelands/is_value_terms/+merge/279205 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/is_value_terms. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/forested_mountain_terrain into lp:widelands
We could go with "likes trees" or "tree friendly". I will look at the code. If you are unsure about C++ merge conflicts in the future, you can submit the branch without a merge and let me have a look. Most often, I will have been the one fiddling with the code, so I'll have the reason for the changes in my head. -- https://code.launchpad.net/~widelands-dev/widelands/forested_mountain_terrain/+merge/280198 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/forested_mountain_terrain into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/forested_mountain_terrain into lp:widelands
Code LGTM - just 2 nits. I'll do some testing once the compiler has finished. Diff comments: > > === modified file 'world/terrains/init.lua' > --- world/terrains/init.lua 2015-12-05 10:59:02 + > +++ world/terrains/init.lua 2015-12-10 21:13:03 + > @@ -42,12 +42,18 @@ > -- The following properties are available: > -- "arable": Allows building of normal buildings and roads > -- "mineable": Allows building of mines and roads > - -- "walkable": Allows building of roads only > + -- "walkable": Allows building of roads only. Trees don't like this > terrain. It is just a coincidence that our terrains that are only walkable aren't tree friendly. I think it's best to remove that comment - we could configure a tree-friendly walkable terrain in the future. > -- "water": Nothing can be built here, but ships and aquatic animals can > pass > - -- "unreachable": Nothing can be built here (not even immovables), and > nothing can walk on it > + -- "unreachable": Nothing can be built here, and nothing can walk on it, > and nothing will grow. > -- "unwalkable": Nothing can be built here, and nothing can walk on it > is = "arable", > > + -- You can add custom additional tooltip entries here. > + tooltips = { > + -- TRANSLATORS: This is an entry in a terrain tooltip. Try to > use 1 word if possible. > + _"likes trees", > + }, > + > -- The list resources that can be found in this terrain. > valid_resources = {"water"}, > > @@ -237,6 +255,46 @@ > > > world:new_terrain_type{ > + name = "summer_forested_mountain1", > + descname = _ "Mountain", How about calling all tree-friendly mountain terrains "Forested Mountain"? I think this would be an additional help to map editors. > + editor_category = "green", > + is = "mineable", > + -- You can add custom additional tooltip entries here. > + tooltips = { > + -- TRANSLATORS: This is an entry in a terrain tooltip. Try to > use 1 word if possible. > + _"likes trees", > + }, > + valid_resources = {"coal", "iron", "gold", "stones"}, > + default_resource = "", > + default_resource_amount = 0, > + textures = { pics_dir .. "green/forested_mountain1_00.png" }, > + dither_layer = 71, > + temperature = 50, > + humidity = 0.75, > + fertility = 0.5, > +} > + > +world:new_terrain_type{ > + name = "summer_forested_mountain2", > + descname = _ "Mountain", > + editor_category = "green", > + is = "mineable", > + -- You can add custom additional tooltip entries here. > + tooltips = { > + -- TRANSLATORS: This is an entry in a terrain tooltip. Try to > use 1 word if possible. > + _"likes trees", > + }, > + valid_resources = {"coal", "iron", "gold", "stones"}, > + default_resource = "", > + default_resource_amount = 0, > + textures = { pics_dir .. "green/forested_mountain2_00.png" }, > + dither_layer = 71, > + temperature = 50, > + humidity = 0.75, > + fertility = 0.5, > +} > + > +world:new_terrain_type{ > name = "sumpf", > descname = _ "Swamp", > editor_category = "green", -- https://code.launchpad.net/~widelands-dev/widelands/forested_mountain_terrain/+merge/280198 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/forested_mountain_terrain into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_ship_tweaks into lp:widelands
- serial number of a ship is changed after save/load - this made the code a bit complicated This is definitely a bug - all MapObjects should save their serial number. Would you like to look into fixing the saveloading rather than making the AI complicated? I will now look at your other branch first. -- https://code.launchpad.net/~widelands-dev/widelands/ai_ship_tweaks/+merge/280192 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ai_ship_tweaks into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/request_supply_opt into lp:widelands
Forum thread: https://wl.widelands.org/forum/topic/1856/ We still need to think about the threshold, but the rest of the code LGTM :) This still needs testing, but I think we can wait with that until we have decided how to solve this. -- https://code.launchpad.net/~widelands-dev/widelands/request_supply_opt/+merge/280193 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/request_supply_opt into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/forested_mountain_terrain into lp:widelands
Review: Approve Tested and LGTM. Will merge :) -- https://code.launchpad.net/~widelands-dev/widelands/forested_mountain_terrain/+merge/280198 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/forested_mountain_terrain. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_ship_tweaks into lp:widelands
I think numbered ships would definitely be welcome. We have 2 open bugs for ship names: https://bugs.launchpad.net/widelands/+bug/963842 https://bugs.launchpad.net/widelands/+bug/1358880 I will have to look into the map object serial number thing - it's already good news that this happens for all map objects and not just for ships. This means that we can just fix it in the MapObject packet. BTW you can get rid of the merge conflict if you run utils/fix_lua_tabs.py -- https://code.launchpad.net/~widelands-dev/widelands/ai_ship_tweaks/+merge/280192 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ai_ship_tweaks into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_ship_tweaks into lp:widelands
Any ID for ships would just give ships an additional serial number IMO, so we duplicate the concept - on the other hand, saving serial numbers for all map objects (unless this is already done somehow; I need to look at the code) will also make the savegames bigger. -- https://code.launchpad.net/~widelands-dev/widelands/ai_ship_tweaks/+merge/280192 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ai_ship_tweaks into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_ship_tweaks into lp:widelands
For the user, Ship 1577, 8523, 5719 can be easily renamed to Ship 1, 2, 3 by a simple enumeration, since the numbers can be strictly sorted... -- https://code.launchpad.net/~widelands-dev/widelands/ai_ship_tweaks/+merge/280192 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ai_ship_tweaks into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_ship_tweaks into lp:widelands
OK, I nipped over to my development machine and had a look at the code - the serial numbers aren't saved in savegames. So, I think your approach will be best after all. -- https://code.launchpad.net/~widelands-dev/widelands/ai_ship_tweaks/+merge/280192 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ai_ship_tweaks into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/editor_new_map into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/editor_new_map into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) For more details, see: https://code.launchpad.net/~widelands-dev/widelands/editor_new_map/+merge/280351 This changes the internal coding of Editor New Map and New Random Map to using a box layout. Includes some expansions to Spinbox as well: Step intervals other than 1, and using a value list as steps. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/editor_new_map into lp:widelands. === modified file 'src/editor/ui_menus/editor_main_menu_new_map.cc' --- src/editor/ui_menus/editor_main_menu_new_map.cc 2015-11-03 18:52:00 + +++ src/editor/ui_menus/editor_main_menu_new_map.cc 2015-12-11 20:10:11 + @@ -19,8 +19,6 @@ #include "editor/ui_menus/editor_main_menu_new_map.h" -#include -#include #include #include @@ -32,104 +30,65 @@ #include "logic/editor_game_base.h" #include "logic/map.h" #include "logic/world/world.h" -#include "ui_basic/button.h" #include "ui_basic/progresswindow.h" -#include "ui_basic/textarea.h" -#include "ui_basic/window.h" -using Widelands::NUMBER_OF_MAP_DIMENSIONS; MainMenuNewMap::MainMenuNewMap(EditorInteractive & parent) : - UI::Window - (&parent, "new_map_menu", - (parent.get_w() - 180) / 2, (parent.get_h() - 150) / 2, 180, 150, - _("New Map")) + UI::Window(&parent, "new_map_menu", 0, 0, 360, 150, _("New Map")), + margin_(4), + box_width_(get_inner_w() - 2 * margin_), + box_(this, margin_, margin_, UI::Box::Vertical, 0, 0, margin_), + width_(&box_, 0, 0, box_width_, 105, + 0, 0, 0, + _("Width:"), "", g_gr->images().get("pics/but1.png"), UI::SpinBox::Type::kValueList), + height_(&box_, 0, 0, box_width_, 105, + 0, 0, 0, + _("Height:"), "", g_gr->images().get("pics/but1.png"), UI::SpinBox::Type::kValueList), + // Buttons + button_box_(&box_, 0, 0, UI::Box::Horizontal, 0, 0, margin_), + ok_button_(&button_box_, "create_map", 0, 0, box_width_ / 2 - margin_, 0, + g_gr->images().get("pics/but5.png"), + _("Create Map")), + cancel_button_(&button_box_, "generate_map", 0, 0, box_width_ / 2 - margin_, 0, + g_gr->images().get("pics/but1.png"), + _("Cancel")) { - int32_t const offsx = 5; - int32_t const offsy = 30; - int32_t const spacing = 5; - int32_t const width = get_inner_w() - offsx * 2; - int32_t const height = 20; - int32_t posx= offsx; - int32_t posy= offsy; - const Widelands::Map & map = parent.egbase().map(); + width_.set_value_list(Widelands::kMapDimensions); + height_.set_value_list(Widelands::kMapDimensions); + { - Widelands::Extent const map_extent = map.extent(); - for (m_w = 0; Widelands::MAP_DIMENSIONS[m_w] < map_extent.w; ++m_w) {} - for (m_h = 0; Widelands::MAP_DIMENSIONS[m_h] < map_extent.h; ++m_h) {} - } - - m_width = new UI::Textarea(this, posx + spacing + 20, posy, - (boost::format(_("Width: %u")) % Widelands::MAP_DIMENSIONS[m_w]).str()); - - UI::Button * widthupbtn = new UI::Button - (this, "width_up", - get_inner_w() - spacing - 20, posy, 20, 20, - g_gr->images().get("pics/but1.png"), - g_gr->images().get("pics/scrollbar_up.png")); - widthupbtn->sigclicked.connect(boost::bind(&MainMenuNewMap::button_clicked, this, 0)); - - UI::Button * widthdownbtn = new UI::Button - (this, "width_down", - posx, posy, 20, 20, - g_gr->images().get("pics/but1.png"), - g_gr->images().get("pics/scrollbar_down.png")); - widthdownbtn->sigclicked.connect(boost::bind(&MainMenuNewMap::button_clicked, this, 1)); - - posy += 20 + spacing + spacing; - - m_height = new UI::Textarea(this, posx + spacing + 20, posy, - (boost::format(_("Height: %u")) - % Widelands::MAP_DIMENSIONS[m_h]).str()); - - UI::Button * heightupbtn = new UI::Button - (this, "height_up", - get_inner_w() - spacing - 20, posy, 20, 20, - g_gr->images().get("pics/but1.png"), - g_gr->images().get("pics/scrollbar_up.png")); - heightupbtn->sigclicked.connect(boost::bind(&MainMenuNewMap::button_clicked, this, 2)); - - UI::Button * heightdownbtn = new UI::Button - (this, "height_down", - posx, posy, 20, 20, - g_gr->images().get("pics/but1.png"), - g_gr->images().get("pics/scrollbar_down.png")); - heightdownbtn->sigclicked.connect(boost::bind(&MainMenuNewMap::button_clicked, this, 3)); - - posy += 20 + spacing + spacing; - - posy += height + spacing + spacing + spacing; - - UI::Button *
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/editor_new_map into lp:widelands
The proposal to merge lp:~widelands-dev/widelands/editor_new_map into lp:widelands has been updated. Description changed to: This changes the internal coding of Editor New Map and New Random Map to using a box layout. Includes some expansions to Spinbox as well: Step intervals other than 1, and using a value list as steps. The diff is hard to read; probably best review this offline with Meld or WinMerge. For more details, see: https://code.launchpad.net/~widelands-dev/widelands/editor_new_map/+merge/280351 -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/editor_new_map into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-536409 into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-536409 into lp:widelands with lp:~widelands-dev/widelands/editor_new_map as a prerequisite. Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #536409 in widelands: "create new map with different terrain" https://bugs.launchpad.net/widelands/+bug/536409 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/bug-536409/+merge/280352 Allow user to pick default terrain for new maps in the editor. We are talking in the forum about giving this a tabbed design and remembering the user choice, but this is already functional. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-536409 into lp:widelands. === modified file 'src/editor/editorinteractive.cc' --- src/editor/editorinteractive.cc 2015-11-08 17:31:06 + +++ src/editor/editorinteractive.cc 2015-12-11 20:16:39 + @@ -593,6 +593,7 @@ editor.world(), 64, 64, + 0, /** TRANSLATORS: Default name for new map */ _("No Name"), g_options.pull_section("global").get_string("realname", pgettext("map_name", "Unknown"))); === modified file 'src/editor/ui_menus/editor_main_menu_new_map.cc' --- src/editor/ui_menus/editor_main_menu_new_map.cc 2015-11-03 18:52:00 + +++ src/editor/ui_menus/editor_main_menu_new_map.cc 2015-12-11 20:16:39 + @@ -19,122 +19,95 @@ #include "editor/ui_menus/editor_main_menu_new_map.h" -#include -#include +#include #include #include #include #include "base/i18n.h" +#include "base/macros.h" #include "editor/editorinteractive.h" +#include "graphic/image.h" #include "graphic/graphic.h" +#include "graphic/texture.h" #include "logic/editor_game_base.h" #include "logic/map.h" #include "logic/world/world.h" -#include "ui_basic/button.h" +#include "logic/world/terrain_description.h" #include "ui_basic/progresswindow.h" -#include "ui_basic/textarea.h" -#include "ui_basic/window.h" -using Widelands::NUMBER_OF_MAP_DIMENSIONS; +inline EditorInteractive& MainMenuNewMap::eia() { + return dynamic_cast(*get_parent()); +} MainMenuNewMap::MainMenuNewMap(EditorInteractive & parent) : - UI::Window - (&parent, "new_map_menu", - (parent.get_w() - 180) / 2, (parent.get_h() - 150) / 2, 180, 150, - _("New Map")) + UI::Window(&parent, "new_map_menu", 0, 0, 360, 150, _("New Map")), + margin_(4), + box_width_(get_inner_w() - 2 * margin_), + box_(this, margin_, margin_, UI::Box::Vertical, 0, 0, margin_), + width_(&box_, 0, 0, box_width_, box_width_ / 3, + 0, 0, 0, + _("Width:"), "", g_gr->images().get("pics/but1.png"), UI::SpinBox::Type::kValueList), + height_(&box_, 0, 0, box_width_, box_width_ / 3, + 0, 0, 0, + _("Height:"), "", g_gr->images().get("pics/but1.png"), UI::SpinBox::Type::kValueList), + list_(&box_, 0, 0, box_width_, 330), + // Buttons + button_box_(&box_, 0, 0, UI::Box::Horizontal, 0, 0, margin_), + ok_button_(&button_box_, "create_map", 0, 0, box_width_ / 2 - margin_, 0, + g_gr->images().get("pics/but5.png"), + _("Create Map")), + cancel_button_(&button_box_, "generate_map", 0, 0, box_width_ / 2 - margin_, 0, + g_gr->images().get("pics/but1.png"), + _("Cancel")) { - int32_t const offsx = 5; - int32_t const offsy = 30; - int32_t const spacing = 5; - int32_t const width = get_inner_w() - offsx * 2; - int32_t const height = 20; - int32_t posx= offsx; - int32_t posy= offsy; - const Widelands::Map & map = parent.egbase().map(); + width_.set_value_list(Widelands::kMapDimensions); + height_.set_value_list(Widelands::kMapDimensions); + { - Widelands::Extent const map_extent = map.extent(); - for (m_w = 0; Widelands::MAP_DIMENSIONS[m_w] < map_extent.w; ++m_w) {} - for (m_h = 0; Widelands::MAP_DIMENSIONS[m_h] < map_extent.h; ++m_h) {} - } - - m_width = new UI::Textarea(this, posx + spacing + 20, posy, - (boost::format(_("Width: %u")) % Widelands::MAP_DIMENSIONS[m_w]).str()); - - UI::Button * widthupbtn = new UI::Button - (this, "width_up", - get_inner_w() - spacing - 20, posy, 20, 20, - g_gr->images().get("pics/but1.png"), - g_gr->images().get("pics/scrollbar_up.png")); - widthupbtn->sigclicked.connect(boost::bind(&MainMenuNewMap::button_clicked, this, 0)); - - UI::Button * widthdownbtn = new UI::Button - (this, "width_down", - posx, posy, 20, 20, - g_gr->images().get("pics/but1.png"), -
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/options_window into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/options_window into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1523096 in widelands: "Options Window redesign" https://bugs.launchpad.net/widelands/+bug/1523096 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/options_window/+merge/280355 The Options window now has a tabbed layout. I added textual tabs to TabPanel and did a couple of fixes there as well - the tab brightening on mouseover was never executed, and tabs now also play click on mouseclick. We are discussing some changes to the options themselves in the forum, e.g. some rephrasing and tooltips, but those can always be added later. options.h/cc is probably best viewed with an offline diff tool. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/options_window into lp:widelands. === removed file 'pics/optionsmenu.jpg' Binary files pics/optionsmenu.jpg 2008-07-23 15:48:24 + and pics/optionsmenu.jpg 1970-01-01 00:00:00 + differ === modified file 'src/ui_basic/tabpanel.cc' --- src/ui_basic/tabpanel.cc 2014-12-04 09:00:20 + +++ src/ui_basic/tabpanel.cc 2015-12-11 20:23:29 + @@ -19,41 +19,51 @@ #include "ui_basic/tabpanel.h" +#include "graphic/font_handler1.h" #include "graphic/rendertarget.h" +#include "graphic/text_layout.h" #include "ui_basic/mouse_constants.h" namespace UI { -// Button size of tab buttons in pixels. -constexpr int kTabPanelButtonSize = 34; +// Button height of tab buttons in pixels. Is also used for width with pictorial buttons. +constexpr int kTabPanelButtonHeight = 34; // Margin around image. The image will be scaled down to fit into this rectangle with preserving size. constexpr int kTabPanelImageMargin = 2; +// Left and right margin around text. +constexpr int kTabPanelTextMargin = 4; + // height of the bar separating buttons and tab contents constexpr int kTabPanelSeparatorHeight = 4; +// Constant to flag up when we're not at a tab. +constexpr uint32_t kNotFound = std::numeric_limits::max(); + /* * = * class Tab * = */ Tab::Tab - (TabPanel * const parent, - uint32_tconst id, - const std::string & name, - const Image* gpic, - const std::string & gtooltip, - Panel * const gpanel) + (TabPanel* const tab_parent, + size_t const tab_id, + int32_t x, + int32_t w, + const std::string& name, + const std::string& _title, + const Image* _pic, + const std::string& tooltip_text, + Panel* const contents) : - NamedPanel - (parent, name, id * kTabPanelButtonSize, 0, kTabPanelButtonSize, - kTabPanelButtonSize, gtooltip), - m_parent(parent), - m_id(id), - pic(gpic), - tooltip(gtooltip), - panel(gpanel) + NamedPanel(tab_parent, name, x, 0, w, kTabPanelButtonHeight, tooltip_text), + parent(tab_parent), + id(tab_id), + pic(_pic), + title(_title), + tooltip(tooltip_text), + panel(contents) { } @@ -61,10 +71,15 @@ * Currently active tab */ bool Tab::active() { - return m_parent->m_active == m_id; + return parent->active_ == id; } void Tab::activate() { - return m_parent->activate(m_id); + return parent->activate(id); +} + +bool Tab::handle_mousepress(uint8_t, int32_t, int32_t) { + play_click(); + return false; } /* @@ -78,22 +93,26 @@ TabPanel::TabPanel (Panel * const parent, int32_t const x, int32_t const y, - const Image* background) + const Image* background, + TabPanel::Type border_type) : - Panel(parent, x, y, 0, 0), - m_active (0), - m_highlight (-1), - m_pic_background (background) + Panel (parent, x, y, 0, 0), + active_ (0), + highlight_ (kNotFound), + pic_background_ (background), + border_type_(border_type) {} TabPanel::TabPanel (Panel * const parent, int32_t const x, int32_t const y, int32_t const w, int32_t const h, - const Image* background) + const Image* background, + TabPanel::Type border_type) : - Panel(parent, x, y, w, h), - m_active (0), - m_highlight (-1), - m_pic_background (background) + Panel (parent, x, y, w, h), + active_ (0), + highlight_ (kNotFound), + pic_background_ (background), + border_type_(border_type) {} /** @@ -101,12 +120,16 @@ */ void TabPanel::layout() { - if (m_active < m_tabs.size()) { - Panel * const panel = m_tabs[m_active]->panel; + if (active_ < tabs_.size()) { + Panel * const panel = tabs_[active_]->panel; uint32_t h = get_h(); // avoid excessive craziness in case there is a wraparound - h = std::min(h, h - (kTabPanelButtonSize + kTabPanelSeparatorHeight)); + h = std::min(h, h - (kTabPanelButtonHeight + kTabPanelSeparatorHeight)); + // If we have a border, we will also wan
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/options_window into lp:widelands
The proposal to merge lp:~widelands-dev/widelands/options_window into lp:widelands has been updated. Description changed to: The Options window now has a tabbed layout. I added textual tabs to TabPanel and did a couple of fixes there as well - the tab brightening on mouseover was never executed, and tabs now also play click on mouseclick. We are discussing some changes to the options themselves in the forum, e.g. some rephrasing and tooltips, but those can always be added later. options.h/cc is probably best viewed with an offline diff tool. ETA: I just saw that I still have 2 NOCOMs in the code - will try to fix those tomorrow. For more details, see: https://code.launchpad.net/~widelands-dev/widelands/options_window/+merge/280355 -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/options_window into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_ship_tweaks into lp:widelands
All the python script does is standardize the indentation in all Lua script. So, running the script on this branch should be enough to remove the conflict. For ship names, I would just go with _("Ship %d"). I think it would be more intuitive to have next_ship_id(bool increment = false) rather than next_ship_id() and incr_next_ship_id(). -- https://code.launchpad.net/~widelands-dev/widelands/ai_ship_tweaks/+merge/280192 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ai_ship_tweaks into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_ship_tweaks into lp:widelands
I have just seen that the merge conflict isn't because of indentation at all, but because we renamed the AI levels in trunk. -- https://code.launchpad.net/~widelands-dev/widelands/ai_ship_tweaks/+merge/280192 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/ai_ship_tweaks into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/options_window into lp:widelands
The proposal to merge lp:~widelands-dev/widelands/options_window into lp:widelands has been updated. Description changed to: The Options window now has a tabbed layout. I added textual tabs to TabPanel and did a couple of fixes there as well - the tab brightening on mouseover was never executed, and tabs now also play click on mouseclick. Exposed rolling autosave option to the UI. We are discussing some changes to the options themselves in the forum, e.g. some rephrasing and tooltips, but those can always be added later. options.h/cc is probably best viewed with an offline diff tool. For more details, see: https://code.launchpad.net/~widelands-dev/widelands/options_window/+merge/280355 -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/options_window into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1523165 into lp:widelands
Review: Approve Code LGTM - just some small nits and suggestions. I haven't tested it. Diff comments: > === modified file 'src/ai/defaultai.cc' > --- src/ai/defaultai.cc 2015-12-06 19:57:49 + > +++ src/ai/defaultai.cc 2015-12-12 20:55:58 + > @@ -1520,6 +1522,11 @@ > } else { > needed_spots = 1300 + (productionsites.size() - 200) * 20; > } > + const bool has_enough_space = (spots_ > needed_spots); > + > + //This is a replacement for simple count of mines Blank space after // > + const int32_t virtual_mines = > +mines_.size() + mineable_fields.size() / 25; > > // *_military_scores are used as minimal score for a new military > building > // to be built. As AI does not traverse all building fields at once, > these thresholds > @@ -1533,7 +1540,18 @@ > // least_military_score_ is allowed to get bellow 100 only if there is > no military site in construction > // right now in order to (try to) avoid expansion lockup > > - // this is just helpers to improve readability of code > + // Bools below are helpers to improve readability of code > + > + // Military sites have generally higher scores so this is a helper to > boost economy > + bool needs_boost_economy = false; > + if (highest_nonmil_prio_ > 10 > + && has_enough_space > + && virtual_mines >= 5){ > + needs_boost_economy = true; > + } > + //resetting highest_nonmil_prio_ so it can be recalculated anew Blank space after // > + highest_nonmil_prio_ = 0; > + > const bool too_many_ms_constructionsites = > (pow(msites_in_constr(), 2) > militarysites.size()); > const bool too_many_vacant_mil = > @@ -1674,9 +1691,15 @@ > // checking we have enough critical material on stock > for (uint32_t m = 0; m < bo.critical_built_mat_.size(); ++m) { > DescriptionIndex > wt(static_cast(bo.critical_built_mat_.at(m))); > - // shortage = less then 3 items in warehouses > - if (get_warehoused_stock(wt) < 3) { > + uint32_t treshold = 3; > + //generally trainingsites are more important Blank space after // > + if (bo.type == BuildingObserver::TRAININGSITE) { > + treshold = 2; > + } > + > + if (get_warehoused_stock(wt) < treshold) { > bo.build_material_shortage_ = true; > + break; > } > } > } > @@ -2280,53 +2311,45 @@ > > } else if (bo.type == BuildingObserver::TRAININGSITE) { > > - assert(!bo.build_material_shortage_); > + prio = 30; > + > + if (bo.new_building_ == > BuildingNecessity::kForced) { > + prio += 30; > + } > + > + if (bo.trainingsite_type_ == > TrainingSiteType::kBasic){ Blank space after ) > + prio = > static_cast(militarysites.size()) > + - 40 * > static_cast(ts_basic_count_); Can ts_basic_count_ be an int32_t in the first place? > + } > + > + if (bo.trainingsite_type_ == > TrainingSiteType::kAdvanced) { > + prio = > static_cast(militarysites.size()) > + - 50 * > static_cast(ts_advanced_count_); Can ts_advanced_count_ be an int32_t in the first place? > + } > > // exclude spots on border > if (bf->near_border_) { > - continue; > - } > - > - // it is a bit difficult to get a new > trainer. > - if (ts_without_trainers_) { > - continue; > - } > - > - // target is only one for both types > - if ((ts_basic_const_count_ + > ts_advanced_const_count_) > 0) { > - continue; > - } > - > - // we build one basic training site for 50 > militarysites > - if (bo.trainingsite_type_ == > TrainingSiteType::kBasic && > - militarysites.size() / 50 < > static_cast(ts_basic_count_)) { > - continue; > - } > - // we build one advanced training site for 75 > militarysites >
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/rtl_wordwrap into lp:widelands
Review: Resubmit The text truncation problem should be fixed now, at the expense of efficiency. I am planning to use the word_wrap algorithm in editboxes only, so the efficiency won't be that much of a problem. I would like to keep it in the multiline-textarea for a bit though, so it will get more testing exposure. Note that the caret rendering in the ediboxes for RTL languages is broken, but it didn't work before either, so it's not a regression. The best test case is the map descriptions when loading a new map. This should be tested at various screen resolutions with our own language, English, Arabic and Jaoanese (= Nihongo, that's the language entry below Nederlands). You should also be able to navigate around text and type in the Editor Map Options like before. -- https://code.launchpad.net/~widelands-dev/widelands/rtl_wordwrap/+merge/273968 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/rtl_wordwrap. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/table_image_overlap into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/table_image_overlap into lp:widelands. Requested reviews: Widelands Developers (widelands-dev) For more details, see: https://code.launchpad.net/~widelands-dev/widelands/table_image_overlap/+merge/280402 Fixed image overlap on the bottom of tables. The reason for the bug was that blictrect_scale can't handle cropping as well. So, I am blitting the image into a new Texture, which can then be blitted normally with built-in cropping. The bug is most notable while scrolling in the Mesages window. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/table_image_overlap into lp:widelands. === modified file 'src/ui_basic/table.cc' --- src/ui_basic/table.cc 2015-11-21 11:34:10 + +++ src/ui_basic/table.cc 2015-12-13 13:59:03 + @@ -24,6 +24,7 @@ #include "graphic/font.h" #include "graphic/font_handler1.h" #include "graphic/graphic.h" +#include "graphic/texture.h" #include "graphic/rendertarget.h" #include "graphic/text/font_set.h" #include "graphic/text_constants.h" @@ -297,9 +298,12 @@ int draw_x = point.x; -if (pich > 0 && pich > lineheight) { +// We want a bit of margin +int max_pic_height = lineheight - 3; + +if (pich > 0 && pich > max_pic_height) { // Scale image to fit lineheight - double image_scale = static_cast(lineheight) / pich; + double image_scale = static_cast(max_pic_height) / pich; int blit_width = image_scale * picw; if (entry_string.empty()) { @@ -310,16 +314,24 @@ } } - dst.blitrect_scale( -// Center align if text is empty -Rect(draw_x, - point.y, - blit_width, - lineheight), -entry_picture, -Rect(0, 0, picw, pich), -1., -BlendMode::UseAlpha); + // Temporary texture for the scaled image + Texture* scaled_texture = new Texture(blit_width, max_pic_height); + + // Initialize the rectangle + ::fill_rect(Rect(0, 0, blit_width, max_pic_height), RGBAColor(255, 255, 255, 0), scaled_texture); + + // Create the scaled image + ::blit(Rect(0, 0, blit_width, max_pic_height), + *entry_picture, + Rect(0, 0, picw, pich), + 1., + BlendMode::UseAlpha, + scaled_texture); + + // This will now blit with any appropriate cropping + dst.blit(Point(draw_x, point.y + 1), scaled_texture); + + // For text alignment below picw = blit_width; } else { if (entry_string.empty()) { ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1523165 into lp:widelands
LGTM :) This can go in as soon as somebody has tested it. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1523165/+merge/280397 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1523165. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~miroslavr256/widelands/buildcat-fixes into lp:widelands
Code LGTM, and the script will run through without error message. I haven't tested it yet though, compiling will take a few hours on my virtual machine... -- https://code.launchpad.net/~miroslavr256/widelands/buildcat-fixes/+merge/280529 Your team Widelands Developers is requested to review the proposed merge of lp:~miroslavr256/widelands/buildcat-fixes into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/map_compatibility into lp:widelands
I agree - the code control flow is a bit complex though, so I have to find out how to pull this off. I think that this sill probably best done in a fresh branch. -- https://code.launchpad.net/~widelands-dev/widelands/map_compatibility/+merge/276088 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/map_compatibility into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1523165 into lp:widelands
I have compiled this branch and will do the testing. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1523165/+merge/280397 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1523165. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp