Skip to content

Commit

Permalink
make strg+leftclick behave correctly on starting position tool in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed Jun 18, 2016
1 parent 4e60b25 commit 514821f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/editor/action/mouse/mouse_action.cpp
Expand Up @@ -398,10 +398,14 @@ editor_action* mouse_action_starting_position::up_left(editor_display& disp, int
if (!disp.map().on_board(hex)) {
return nullptr;
}

auto player_starting_at_hex = disp.map().is_starting_position(hex);

std::vector<map_location> starting_positions;
if (has_ctrl_modifier()) {
if (player_starting_at_hex) {
location_palette_.add_item(*player_starting_at_hex);
}
return nullptr;
}

std::string new_player_at_hex = location_palette_.selected_item();
editor_action* a = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion src/editor/palette/location_palette.hpp
Expand Up @@ -72,6 +72,7 @@ class location_palette : public common_palette {

virtual void select_item(const std::string& item_id);
virtual std::vector<std::string> action_pressed() const override;
void add_item(const std::string& id);
~location_palette();
private:

Expand All @@ -89,7 +90,6 @@ class location_palette : public common_palette {
int num_visible_items();

void hide(bool hidden) override;
void add_item(const std::string& id);
protected:

editor_display &gui_;
Expand Down

0 comments on commit 514821f

Please sign in to comment.