KeplerBR

[FreeCol] Do not buy land from unknown peoples

May 10th, 2014
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.78 KB | None | 0 0
  1.  data/strings/FreeColMessages.properties       |  1 +
  2.  data/strings/FreeColMessages_pt_BR.properties |  1 +
  3.  src/net/sf/freecol/client/gui/Canvas.java     | 24 ++++++++++++++++--------
  4.  3 files changed, 18 insertions(+), 8 deletions(-)
  5.  
  6. diff --git a/data/strings/FreeColMessages.properties b/data/strings/FreeColMessages.properties
  7. index 555d12f..55d8efe 100644
  8. --- a/data/strings/FreeColMessages.properties
  9. +++ b/data/strings/FreeColMessages.properties
  10. @@ -1212,6 +1212,7 @@ colony.tension.cease_fire=The %nation% scowl at you, and are clearly preparing t
  11.  colony.tension.war=The %nation% fire upon you at any opportunity.
  12.  
  13.  indianLand.text=This land is owned by the %player%. Would you like to:
  14. +indianLandUnknown.text=Some unknown people live in these lands. Would you like to:
  15.  indianLand.pay=Offer %amount% gold for the land
  16.  indianLand.take=Take what is rightfully ours
  17.  indianLand.cancel=Leave the land
  18. diff --git a/data/strings/FreeColMessages_pt_BR.properties b/data/strings/FreeColMessages_pt_BR.properties
  19. index a2e15a0..2059681 100644
  20. --- a/data/strings/FreeColMessages_pt_BR.properties
  21. +++ b/data/strings/FreeColMessages_pt_BR.properties
  22. @@ -954,6 +954,7 @@ declareIndependence.announce=As colônias de %oldNation% declararam independênc
  23.  declareIndependence.interventionForce={{tag:country|%nation%}} compromete-se solenemente a enviar uma Força de Intervenção para apoiar a sua legítima luta pela independência, desde que gere %number% {{plural:%number%|one=Sino Libertador|other=Sinos Libertadores}} como prova da sua determinação.
  24.  declareIndependence.interventionForceArrives=Chega a prometida Força de Intervenção!
  25.  indianLand.text=Esta terra está ocupada por %player%. Você gostaria de:
  26. +indianLandUnknown.text=Algumas pessoas desconhecidas vivem nessas terras. Você gostria de:
  27.  indianLand.pay=Oferecer %amount% moedas de ouro pelas terras
  28.  indianLand.take=Tomar o que é nosso por direito
  29.  indianLand.cancel=Sair da terra
  30. diff --git a/src/net/sf/freecol/client/gui/Canvas.java b/src/net/sf/freecol/client/gui/Canvas.java
  31. index f02cb48..0632497 100644
  32. --- a/src/net/sf/freecol/client/gui/Canvas.java
  33. +++ b/src/net/sf/freecol/client/gui/Canvas.java
  34. @@ -1501,16 +1501,24 @@ public final class Canvas extends JDesktopPane {
  35.       */
  36.      public ClaimAction showClaimDialog(Tile tile, Player player, int price,
  37.                                         Player owner, boolean canAccept) {
  38. -        StringTemplate template = StringTemplate.template("indianLand.text")
  39. -            .addStringTemplate("%player%", owner.getNationName());
  40. -        JTextArea text = GUI.getDefaultTextArea(Messages.message(template));
  41. -
  42.          List<ChoiceItem<ClaimAction>> choices
  43.              = new ArrayList<ChoiceItem<ClaimAction>>();
  44. -        StringTemplate pay = StringTemplate.template("indianLand.pay")
  45. -            .addAmount("%amount%", price);
  46. -        choices.add(new ChoiceItem<ClaimAction>(Messages.message(pay),
  47. -                ClaimAction.ACCEPT, canAccept));
  48. +        
  49. +        StringTemplate template;
  50. +        
  51. +        if (owner.hasContacted(player)) {
  52. +            template = StringTemplate.template("indianLand.text")
  53. +                .addStringTemplate("%player%", owner.getNationName());
  54. +            
  55. +            StringTemplate pay = StringTemplate.template("indianLand.pay")
  56. +                .addAmount("%amount%", price);
  57. +            choices.add(new ChoiceItem<ClaimAction>(Messages.message(pay),
  58. +                    ClaimAction.ACCEPT, canAccept));
  59. +        } else {
  60. +            template = StringTemplate.template("indianLandUnknown.text");
  61. +        }
  62. +        
  63. +        JTextArea text = GUI.getDefaultTextArea(Messages.message(template));
  64.          choices.add(new ChoiceItem<ClaimAction>(Messages.message("indianLand.take"),
  65.                  ClaimAction.STEAL));
Add Comment
Please, Sign In to add comment