Skip to content

Commit

Permalink
Make it possible to order a unit to join a city.
Browse files Browse the repository at this point in the history
  • Loading branch information
kvilhaugsvik committed Mar 23, 2015
1 parent 8aca6ca commit 8448f0b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions freeciv-web/src/main/webapp/javascript/action_dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,13 @@ function popup_action_selection(actor_unit, action_probabilities,
action_probabilities)
+ "'>";
}
if (action_probabilities[ACTION_JOIN_CITY] != 0) {
dhtml += "<input id='act_sel_join_city" + actor_unit['id']
+ "' class='act_sel_button' type='button' value='"
+ format_action_label(ACTION_JOIN_CITY,
action_probabilities)
+ "'>";
}
if (action_probabilities[ACTION_SPY_BRIBE_UNIT] != 0) {
dhtml += "<input id='act_sel_bribe" + actor_unit['id']
+ "' class='act_sel_button' type='button' value='"
Expand Down Expand Up @@ -421,6 +428,20 @@ function popup_action_selection(actor_unit, action_probabilities,
});
}

if (action_probabilities[ACTION_JOIN_CITY] != 0) {
$("#act_sel_join_city" + actor_unit['id']).click(function() {
var packet = {"pid" : packet_unit_do_action,
"actor_id" : actor_unit['id'],
"target_id" : target_city['id'],
"value" : 0,
"name" : "",
"action_type" : ACTION_JOIN_CITY};
send_request(JSON.stringify(packet));

$(id).remove();
});
}

if (action_probabilities[ACTION_SPY_BRIBE_UNIT] != 0) {
$("#act_sel_bribe" + actor_unit['id']).click(function() {
var packet = {"pid" : packet_unit_action_query,
Expand Down

0 comments on commit 8448f0b

Please sign in to comment.