Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1322473 into lp:widelands

2014-07-15 Thread SirVer
Review: Approve

I looked over this again and fixed some formatting issues, merged trunk, tested 
real quick and merged.

Thanks for taking care of this.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1322473/+merge/221235
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1322473.

___
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-1322473 into lp:widelands

2014-06-07 Thread SirVer


Diff comments:

 === modified file 'maps/MP Scenarios/Island 
 Hopping.wmf/scripting/multiplayer_init.lua'
 --- maps/MP Scenarios/Island Hopping.wmf/scripting/multiplayer_init.lua   
 2014-03-25 06:18:48 +
 +++ maps/MP Scenarios/Island Hopping.wmf/scripting/multiplayer_init.lua   
 2014-05-28 13:43:10 +
 @@ -239,6 +239,9 @@
 disable_unused_buildings()
  
 send_to_all(welcome_msg)
 +   -- set the objective with the game type for all players
 +   -- TODO change this to a broadcast once individual game objectives have 
 been implementes
 +   game.players[1]:add_objective(win_conditions, _Rules, welcome_msg)
  
 for idx,plr in ipairs(game.players) do
run(function() run_island(plr, 1) end)
 
 === modified file 'maps/MP 
 Scenarios/Smugglers.wmf/scripting/multiplayer_init.lua'
 --- maps/MP Scenarios/Smugglers.wmf/scripting/multiplayer_init.lua
 2014-03-25 06:18:48 +
 +++ maps/MP Scenarios/Smugglers.wmf/scripting/multiplayer_init.lua
 2014-05-28 13:43:10 +
 @@ -140,7 +140,9 @@
 end
  
 send_to_all(welcome_msg:format((ngettext(%i point, %i points, 
 points_to_win)):format(points_to_win)))
 -
 +   -- set the objective with the game type for all players
 +   -- TODO change this to a broadcast once individual game objectives have 
 been implementes
 +   game.players[1]:add_objective(win_conditions, _Rules, 
 welcome_msg:format((ngettext(%i point, %i points, 
 points_to_win)):format(points_to_win)))
  
 for idx,descr in ipairs(route_descrs) do
run(wait_for_established_route, descr)
 
 === modified file 'maps/Plateau.wmf/scripting/init.lua'
 --- maps/Plateau.wmf/scripting/init.lua   2014-03-25 06:18:48 +
 +++ maps/Plateau.wmf/scripting/init.lua   2014-05-28 13:43:10 +
 @@ -22,6 +22,7 @@
 sleep(300)
  
 send_msg(briefing_1_the_forbidden_island)
 +   local o = add_obj(obj_forbidden_island)
  
 local map = wl.Game().map
 while not p1:seen_field(map:get_field(5,8)) do sleep(2345) end
 @@ -47,7 +48,8 @@
 scroll_smoothly_to(castle)
  
 send_msg(briefing_2_found_ancient_castle)
 -   local o = add_obj(obj_capture_ancient_castle)
 +   o.done = true
 +   o = add_obj(obj_capture_ancient_castle)
  
 -- Wait till we conquered the castle
 while #p1:get_buildingscastle.atlanteans  1 do sleep(2345) end
 
 === modified file 'maps/Plateau.wmf/scripting/texts.lua'
 --- maps/Plateau.wmf/scripting/texts.lua  2014-04-09 17:50:02 +
 +++ maps/Plateau.wmf/scripting/texts.lua  2014-05-28 13:43:10 +
 @@ -23,6 +23,19 @@
 return p1:add_objective(o.name, o.title, _obj(reflow(o.body)), o)
  end
  
 +obj_forbidden_island = {
 +   name = forbidden_island,
 +   title =_The Forbidden Island,
 +   body = _(
 +[[Finally! We have just taken our first step towards victory! ]] ..
 +[[Last night, we landed on the forbidden island and defeated the few guards 
 that were watching the ]] ..
 +[[north-western part of the island. ]] ..
 +[[I am quite sure that none of the other warlords has detected us so far, ]] 
 ..
 +[[so we should keep quiet and build up our infrastructure. Soon we will be 
 strong enough to raid their positions.]]),
 +}
 +
 +
 +
  obj_capture_ancient_castle = {
 name = capture_ancient_castle,
 title =_ Capture the Ancient Castle,
 
 === modified file 'scripting/win_condition_functions.lua'
 --- scripting/win_condition_functions.lua 2013-08-07 16:58:48 +
 +++ scripting/win_condition_functions.lua 2014-05-28 13:43:10 +
 @@ -125,3 +125,19 @@
 wl.game.report_result(p, 0, make_extra_data(p, wc_name, wc_ver, 
 extra))
 end
  end
 +
 +
 +-- RST
 +-- .. function:: broadcast_objective(plrs, header, msg, body)
 +--
 +--:arg plrs:This should be wl.Game().players
 +--:arg name:A unique name for the objective

function broadcast_objective(plrs, table)
  plrs[1]:add_objective(table.name, table.title, table.body)
end

of course you need to document what the table should contain. Your call.

 +--:arg title:   The title to be displayed for the objective
 +--:arg body:The content text to be displayed for the objective
 +--
 +--broadcast an objective to all players
 +--technically, it is assigned to player1, because all players will see 
 all objectives
 +function broadcast_objective(plrs, name, title, body)
 + plrs[1]:add_objective(name, title, body)
 +end
 +
 
 === modified file 'scripting/win_conditions/00_endless_game.lua'
 --- scripting/win_conditions/00_endless_game.lua  2014-03-25 06:18:48 
 +
 +++ scripting/win_conditions/00_endless_game.lua  2014-05-28 13:43:10 
 +
 @@ -18,7 +18,8 @@
   func = function()
   local plrs = wl.Game().players
  
 - broadcast(plrs, wc_name, wc_desc)
 + -- set the objective with the game type for all players
 + broadcast_objective(plrs, win_condition, wc_name, wc_desc)
  
   -- Iterate all players, if one is defeated, remove him

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1322473 into lp:widelands

2014-06-07 Thread SirVer
Review: Approve



Diff comments:

 === modified file 'maps/MP Scenarios/Island 
 Hopping.wmf/scripting/multiplayer_init.lua'
 --- maps/MP Scenarios/Island Hopping.wmf/scripting/multiplayer_init.lua   
 2014-03-25 06:18:48 +
 +++ maps/MP Scenarios/Island Hopping.wmf/scripting/multiplayer_init.lua   
 2014-06-05 10:04:49 +
 @@ -239,6 +239,9 @@
 disable_unused_buildings()
  
 send_to_all(welcome_msg)
 +   -- set the objective with the game type for all players
 +   -- TODO change this to a broadcast once individual game objectives have 
 been implemented
 +   game.players[1]:add_objective(win_conditions, _Rules, welcome_msg)
  
 for idx,plr in ipairs(game.players) do
run(function() run_island(plr, 1) end)
 
 === modified file 'maps/MP 
 Scenarios/Smugglers.wmf/scripting/multiplayer_init.lua'
 --- maps/MP Scenarios/Smugglers.wmf/scripting/multiplayer_init.lua
 2014-03-25 06:18:48 +
 +++ maps/MP Scenarios/Smugglers.wmf/scripting/multiplayer_init.lua
 2014-06-05 10:04:49 +
 @@ -140,7 +140,9 @@
 end
  
 send_to_all(welcome_msg:format((ngettext(%i point, %i points, 
 points_to_win)):format(points_to_win)))
 -
 +   -- set the objective with the game type for all players
 +   -- TODO change this to a broadcast once individual game objectives have 
 been implementes
 +   game.players[1]:add_objective(win_conditions, _Rules, 
 welcome_msg:format((ngettext(%i point, %i points, 
 points_to_win)):format(points_to_win)))
  
 for idx,descr in ipairs(route_descrs) do
run(wait_for_established_route, descr)
 
 === modified file 'maps/Plateau.wmf/scripting/init.lua'
 --- maps/Plateau.wmf/scripting/init.lua   2014-03-25 06:18:48 +
 +++ maps/Plateau.wmf/scripting/init.lua   2014-06-05 10:04:49 +
 @@ -22,6 +22,7 @@
 sleep(300)
  
 send_msg(briefing_1_the_forbidden_island)
 +   local o = add_obj(obj_forbidden_island)
  
 local map = wl.Game().map
 while not p1:seen_field(map:get_field(5,8)) do sleep(2345) end
 @@ -47,7 +48,8 @@
 scroll_smoothly_to(castle)
  
 send_msg(briefing_2_found_ancient_castle)
 -   local o = add_obj(obj_capture_ancient_castle)
 +   o.done = true
 +   o = add_obj(obj_capture_ancient_castle)
  
 -- Wait till we conquered the castle
 while #p1:get_buildingscastle.atlanteans  1 do sleep(2345) end
 
 === modified file 'maps/Plateau.wmf/scripting/texts.lua'
 --- maps/Plateau.wmf/scripting/texts.lua  2014-04-09 17:50:02 +
 +++ maps/Plateau.wmf/scripting/texts.lua  2014-06-05 10:04:49 +
 @@ -23,22 +23,35 @@
 return p1:add_objective(o.name, o.title, _obj(reflow(o.body)), o)
  end
  
 +obj_forbidden_island = {
 +   name = forbidden_island,
 +   title = _The Forbidden Island,
 +   body = _(
 +[[Finally! We have just taken our first step towards victory! ]] ..
 +[[Last night, we landed on the forbidden island and defeated the few guards 
 that were watching the ]] ..
 +[[north-western part of the island. ]] ..
 +[[I am quite sure that none of the other warlords has detected us so far, ]] 
 ..
 +[[so we should keep quiet and build up our infrastructure. Soon we will be 
 strong enough to raid their positions.]]),
 +}
 +
 +
 +
  obj_capture_ancient_castle = {
 name = capture_ancient_castle,
 -   title =_ Capture the Ancient Castle,
 +   title = _Capture the Ancient Castle,
 body = [[• ]] .. _
  [[Defeat Lanissa and capture the ancient castle.]],
  }
  
  obj_defeat_erwyn = {
 name = defeat_erwyn,
 -   title =_ Defeat Erwyn,
 +   title = _Defeat Erwyn,
 body = [[• ]] .. _
  [[Defeat Erwyn. He commands the strongest opposing military force left on 
 this island.]],
  }
  obj_defeat_jomo = {
 name = defeat_jomo,
 -   title =_ Defeat Jomo,
 +   title = _Defeat Jomo,
 body = [[• ]] .. _
  [[Defeat Jomo. He is taking care of the soldiers’ food supply.]]
 ,
 @@ -69,11 +82,11 @@
  end
  
  briefing_1_the_forbidden_island = {
 -   title =_ First Briefing,
 +   title = _First Briefing,
 width = 400,
 height = 300,
 posy = 1,
 -   body = _msg( _The Forbidden Island, _(
 +   body = _msg(_The Forbidden Island, _(
  [[Finally! We have just taken our first step towards victory! ]] ..
  [[Last night, we landed on the forbidden island and defeated the few guards 
 that were watching the ]] ..
  [[north-western part of the island. ]] ..
 @@ -82,7 +95,7 @@
  }
  
  briefing_2_found_ancient_castle = {
 -   title =_ Second Briefing,
 +   title = _Second Briefing,
 width = 400,
 height = 300,
 posy = 1,
 @@ -97,7 +110,7 @@
  }
  
  briefing_3_captured_ancient_castle = {
 -   title = _ Second Briefing,
 +   title = _Second Briefing,
 width = 400,
 height = 300,
 posy = 1,
 @@ -114,7 +127,7 @@
  }
  
  briefing_erwyn_defeated = {
 -   title=_ Another Briefing,
 +   title = _Another Briefing,
 width = 400,
 height = 300,
 posy = 1,
 @@ -123,19 +136,19 @@
  }
  
  briefing_jomo_defeated = {
 -   title=_ Another Briefing,
 +   title 

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1322473 into lp:widelands

2014-06-05 Thread GunChleoc
Fixed everything except for some open questions.

Diff comments:

 === modified file 'maps/MP Scenarios/Island 
 Hopping.wmf/scripting/multiplayer_init.lua'
 --- maps/MP Scenarios/Island Hopping.wmf/scripting/multiplayer_init.lua   
 2014-03-25 06:18:48 +
 +++ maps/MP Scenarios/Island Hopping.wmf/scripting/multiplayer_init.lua   
 2014-05-28 13:43:10 +
 @@ -239,6 +239,9 @@
 disable_unused_buildings()
  
 send_to_all(welcome_msg)

I left this in, because we can't update individual player objectives yet.

 +   -- set the objective with the game type for all players
 +   -- TODO change this to a broadcast once individual game objectives have 
 been implementes

Fixed.

 +   game.players[1]:add_objective(win_conditions, _Rules, welcome_msg)
  
 for idx,plr in ipairs(game.players) do
run(function() run_island(plr, 1) end)
 
 === modified file 'maps/MP 
 Scenarios/Smugglers.wmf/scripting/multiplayer_init.lua'
 --- maps/MP Scenarios/Smugglers.wmf/scripting/multiplayer_init.lua
 2014-03-25 06:18:48 +
 +++ maps/MP Scenarios/Smugglers.wmf/scripting/multiplayer_init.lua
 2014-05-28 13:43:10 +
 @@ -140,7 +140,9 @@
 end
  
 send_to_all(welcome_msg:format((ngettext(%i point, %i points, 
 points_to_win)):format(points_to_win)))
 -
 +   -- set the objective with the game type for all players
 +   -- TODO change this to a broadcast once individual game objectives have 
 been implementes
 +   game.players[1]:add_objective(win_conditions, _Rules, 
 welcome_msg:format((ngettext(%i point, %i points, 
 points_to_win)):format(points_to_win)))
  
 for idx,descr in ipairs(route_descrs) do
run(wait_for_established_route, descr)
 
 === modified file 'maps/Plateau.wmf/scripting/init.lua'
 --- maps/Plateau.wmf/scripting/init.lua   2014-03-25 06:18:48 +
 +++ maps/Plateau.wmf/scripting/init.lua   2014-05-28 13:43:10 +
 @@ -22,6 +22,7 @@
 sleep(300)
  
 send_msg(briefing_1_the_forbidden_island)
 +   local o = add_obj(obj_forbidden_island)
  
 local map = wl.Game().map
 while not p1:seen_field(map:get_field(5,8)) do sleep(2345) end
 @@ -47,7 +48,8 @@
 scroll_smoothly_to(castle)
  
 send_msg(briefing_2_found_ancient_castle)
 -   local o = add_obj(obj_capture_ancient_castle)
 +   o.done = true
 +   o = add_obj(obj_capture_ancient_castle)
  
 -- Wait till we conquered the castle
 while #p1:get_buildingscastle.atlanteans  1 do sleep(2345) end
 
 === modified file 'maps/Plateau.wmf/scripting/texts.lua'
 --- maps/Plateau.wmf/scripting/texts.lua  2014-04-09 17:50:02 +
 +++ maps/Plateau.wmf/scripting/texts.lua  2014-05-28 13:43:10 +
 @@ -23,6 +23,19 @@
 return p1:add_objective(o.name, o.title, _obj(reflow(o.body)), o)
  end
  
 +obj_forbidden_island = {
 +   name = forbidden_island,
 +   title =_The Forbidden Island,

Fixed.

 +   body = _(
 +[[Finally! We have just taken our first step towards victory! ]] ..
 +[[Last night, we landed on the forbidden island and defeated the few guards 
 that were watching the ]] ..
 +[[north-western part of the island. ]] ..
 +[[I am quite sure that none of the other warlords has detected us so far, ]] 
 ..
 +[[so we should keep quiet and build up our infrastructure. Soon we will be 
 strong enough to raid their positions.]]),
 +}
 +
 +
 +
  obj_capture_ancient_castle = {
 name = capture_ancient_castle,
 title =_ Capture the Ancient Castle,
 
 === modified file 'scripting/win_condition_functions.lua'
 --- scripting/win_condition_functions.lua 2013-08-07 16:58:48 +
 +++ scripting/win_condition_functions.lua 2014-05-28 13:43:10 +
 @@ -125,3 +125,19 @@
 wl.game.report_result(p, 0, make_extra_data(p, wc_name, wc_ver, 
 extra))
 end
  end
 +
 +
 +-- RST
 +-- .. function:: broadcast_objective(plrs, header, msg, body)
 +--
 +--:arg plrs:This should be wl.Game().players

Fixed.

 +--:arg name:A unique name for the objective
 +--:arg title:   The title to be displayed for the objective
 +--:arg body:The content text to be displayed for the objective
 +--
 +--broadcast an objective to all players

Fixed.

 +--technically, it is assigned to player1, because all players will see 
 all objectives
 +function broadcast_objective(plrs, name, title, body)
 + plrs[1]:add_objective(name, title, body)
 +end
 +
 
 === modified file 'scripting/win_conditions/00_endless_game.lua'
 --- scripting/win_conditions/00_endless_game.lua  2014-03-25 06:18:48 
 +
 +++ scripting/win_conditions/00_endless_game.lua  2014-05-28 13:43:10 
 +
 @@ -18,7 +18,8 @@
   func = function()
   local plrs = wl.Game().players
  
 - broadcast(plrs, wc_name, wc_desc)
 + -- set the objective with the game type for all players
 + broadcast_objective(plrs, win_condition, wc_name, wc_desc)
  
   -- Iterate all players, if one is defeated, remove him
   -- from the 

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1322473 into lp:widelands

2014-06-01 Thread SirVer
Review: Needs Fixing

some comments

Diff comments:

 === modified file 'maps/MP Scenarios/Island 
 Hopping.wmf/scripting/multiplayer_init.lua'
 --- maps/MP Scenarios/Island Hopping.wmf/scripting/multiplayer_init.lua   
 2014-03-25 06:18:48 +
 +++ maps/MP Scenarios/Island Hopping.wmf/scripting/multiplayer_init.lua   
 2014-05-28 13:43:10 +
 @@ -239,6 +239,9 @@
 disable_unused_buildings()
  
 send_to_all(welcome_msg)

should this not be deleted then?

 +   -- set the objective with the game type for all players
 +   -- TODO change this to a broadcast once individual game objectives have 
 been implementes

implementes - implemented

 +   game.players[1]:add_objective(win_conditions, _Rules, welcome_msg)
  
 for idx,plr in ipairs(game.players) do
run(function() run_island(plr, 1) end)
 
 === modified file 'maps/MP 
 Scenarios/Smugglers.wmf/scripting/multiplayer_init.lua'
 --- maps/MP Scenarios/Smugglers.wmf/scripting/multiplayer_init.lua
 2014-03-25 06:18:48 +
 +++ maps/MP Scenarios/Smugglers.wmf/scripting/multiplayer_init.lua
 2014-05-28 13:43:10 +
 @@ -140,7 +140,9 @@
 end
  
 send_to_all(welcome_msg:format((ngettext(%i point, %i points, 
 points_to_win)):format(points_to_win)))
 -
 +   -- set the objective with the game type for all players
 +   -- TODO change this to a broadcast once individual game objectives have 
 been implementes
 +   game.players[1]:add_objective(win_conditions, _Rules, 
 welcome_msg:format((ngettext(%i point, %i points, 
 points_to_win)):format(points_to_win)))
  
 for idx,descr in ipairs(route_descrs) do
run(wait_for_established_route, descr)
 
 === modified file 'maps/Plateau.wmf/scripting/init.lua'
 --- maps/Plateau.wmf/scripting/init.lua   2014-03-25 06:18:48 +
 +++ maps/Plateau.wmf/scripting/init.lua   2014-05-28 13:43:10 +
 @@ -22,6 +22,7 @@
 sleep(300)
  
 send_msg(briefing_1_the_forbidden_island)
 +   local o = add_obj(obj_forbidden_island)
  
 local map = wl.Game().map
 while not p1:seen_field(map:get_field(5,8)) do sleep(2345) end
 @@ -47,7 +48,8 @@
 scroll_smoothly_to(castle)
  
 send_msg(briefing_2_found_ancient_castle)
 -   local o = add_obj(obj_capture_ancient_castle)
 +   o.done = true

o.done = true? is that correct here?

 +   o = add_obj(obj_capture_ancient_castle)
  
 -- Wait till we conquered the castle
 while #p1:get_buildingscastle.atlanteans  1 do sleep(2345) end
 
 === modified file 'maps/Plateau.wmf/scripting/texts.lua'
 --- maps/Plateau.wmf/scripting/texts.lua  2014-04-09 17:50:02 +
 +++ maps/Plateau.wmf/scripting/texts.lua  2014-05-28 13:43:10 +
 @@ -23,6 +23,19 @@
 return p1:add_objective(o.name, o.title, _obj(reflow(o.body)), o)
  end
  
 +obj_forbidden_island = {
 +   name = forbidden_island,
 +   title =_The Forbidden Island,

be consistent with spaces. We use '= _text' in most places I think, you 
sometimes use '=_' and sometimes use '= _ '

 +   body = _(
 +[[Finally! We have just taken our first step towards victory! ]] ..

Didn't you want to make one line per sentence and tag them individually for 
translation?

 +[[Last night, we landed on the forbidden island and defeated the few guards 
 that were watching the ]] ..
 +[[north-western part of the island. ]] ..
 +[[I am quite sure that none of the other warlords has detected us so far, ]] 
 ..
 +[[so we should keep quiet and build up our infrastructure. Soon we will be 
 strong enough to raid their positions.]]),
 +}
 +
 +
 +
  obj_capture_ancient_castle = {
 name = capture_ancient_castle,
 title =_ Capture the Ancient Castle,
 
 === modified file 'scripting/win_condition_functions.lua'
 --- scripting/win_condition_functions.lua 2013-08-07 16:58:48 +
 +++ scripting/win_condition_functions.lua 2014-05-28 13:43:10 +
 @@ -125,3 +125,19 @@
 wl.game.report_result(p, 0, make_extra_data(p, wc_name, wc_ver, 
 extra))
 end
  end
 +
 +
 +-- RST
 +-- .. function:: broadcast_objective(plrs, header, msg, body)
 +--
 +--:arg plrs:This should be wl.Game().players

no need to pass it in then - you can get that in the method just as well.

 +--:arg name:A unique name for the objective

I would probably just pass in the table - we keep the data of objectives around 
in tables of the form anyways. Your call.

 +--:arg title:   The title to be displayed for the objective
 +--:arg body:The content text to be displayed for the objective
 +--
 +--broadcast an objective to all players

The description usually comes before the arguments.

 +--technically, it is assigned to player1, because all players will see 
 all objectives
 +function broadcast_objective(plrs, name, title, body)
 + plrs[1]:add_objective(name, title, body)
 +end
 +
 
 === modified file 'scripting/win_conditions/00_endless_game.lua'
 --- scripting/win_conditions/00_endless_game.lua  2014-03-25 06:18:48 
 +
 +++ 

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1322473 into lp:widelands

2014-05-29 Thread GunChleoc
BTW merging this should also make Trunk compile again, because of this line:

=== modified file 'src/logic/cmd_queue.h'
--- src/logic/cmd_queue.h   2014-05-11 12:29:55 +
+++ src/logic/cmd_queue.h   2014-05-28 13:43:10 +
@@ -22,6 +22,7 @@
 
 #include memory
 #include queue
+#include stdint.h
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1322473/+merge/221235
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1322473 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