Skip to content

Commit

Permalink
enable world map in keeper mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal committed Feb 7, 2014
1 parent 965793f commit 53bc76e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions collective.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ void Collective::processInput(View* view) {
} else
gatheringTeam = true;
break;
case CollectiveAction::DRAW_LEVEL_MAP: view->drawLevelMap(level, this); break;
case CollectiveAction::CANCEL_TEAM: gatheringTeam = false; team.clear(); break;
case CollectiveAction::MARKET: handleMarket(view); break;
case CollectiveAction::TECHNOLOGY:
Expand Down
2 changes: 1 addition & 1 deletion collective_action.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class CollectiveAction {
public:
enum Type { IDLE, GO_TO, BUTTON_RELEASE, ROOM_BUTTON, IMP_BUTTON, CREATURE_BUTTON,
CREATURE_DESCRIPTION, GATHER_TEAM, CANCEL_TEAM, MARKET, TECHNOLOGY };
CREATURE_DESCRIPTION, GATHER_TEAM, CANCEL_TEAM, MARKET, TECHNOLOGY, DRAW_LEVEL_MAP };

CollectiveAction(Type, Vec2 pos);
CollectiveAction(Type, int);
Expand Down
13 changes: 9 additions & 4 deletions window_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1615,6 +1615,7 @@ void WindowView::animation(Vec2 pos, AnimationId id) {
}*/

void WindowView::drawLevelMap(const Level* level, const CreatureView* creature) {
TempClockPause pause;
vector<Vec2> roads;
while (1) {
for (Vec2 v : maxLevelBounds) {
Expand Down Expand Up @@ -2022,7 +2023,7 @@ void WindowView::addMessage(const string& message) {
// }
}

void WindowView::unzoom(bool pixel, bool tpp) {
void WindowView::unzoom() {
if (mapLayout != currentTileLayout.normalLayout)
mapLayout = currentTileLayout.normalLayout;
else
Expand Down Expand Up @@ -2115,8 +2116,12 @@ CollectiveAction WindowView::getClick() {
case Event::KeyPressed:
switch (event.key.code) {
case Keyboard::Z:
unzoom(event.key.shift, event.key.control);
return CollectiveAction(CollectiveAction::IDLE);
if (event.key.shift)
return CollectiveAction(CollectiveAction::DRAW_LEVEL_MAP);
else {
unzoom();
return CollectiveAction(CollectiveAction::IDLE);
}
case Keyboard::F2: Options::handle(this); refreshScreen(); break;
case Keyboard::Space:
if (!myClock.isPaused())
Expand Down Expand Up @@ -2276,7 +2281,7 @@ Action WindowView::getAction() {
case Keyboard::Z: if (key->shift)
return Action(ActionId::DRAW_LEVEL_MAP);
else {
unzoom(key->shift, key->control);
unzoom();
return Action(ActionId::IDLE);
}
case Keyboard::F1: legendOption = (LegendOption)(1 - (int)legendOption); return Action(ActionId::IDLE);
Expand Down
2 changes: 1 addition & 1 deletion window_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class WindowView: public View {
Optional<ViewObject> drawObjectAbs(int x, int y, const ViewIndex&, int sizeX, int sizeY, Vec2 tilePos);
void darkenObjectAbs(int x, int y);
void clearMessageBox();
void unzoom(bool, bool);
void unzoom();
void switchTiles();
void resize(int, int);
Rectangle getMapViewBounds() const;
Expand Down

0 comments on commit 53bc76e

Please sign in to comment.