Finalizing auto walk enhancements, closes #63, also other fixes:

* Can now auto walk up to 1000 steps!
* Re-added sexy topmenu buttons :)
* Tooltip for logout/edit will now change
* Changed xxStackpos to xxStackPos
This commit is contained in:
BeniS
2013-01-21 05:09:14 +13:00
parent c28596292f
commit 8c6d5a0f5c
16 changed files with 110 additions and 54 deletions

View File

@@ -28,6 +28,8 @@
#include <framework/const.h>
#include <framework/util/point.h>
#include <vector>
class Position
{
public:
@@ -122,6 +124,22 @@ public:
return angle;
}
std::vector<Position> translatedToDirections(const std::vector<Otc::Direction>& dirs) const {
Position lastPos = *this;
std::vector<Position> positions;
positions.push_back(lastPos);
for(auto dir : dirs) {
if(lastPos.isValid()) {
positions.push_back(lastPos);
}
lastPos = lastPos.translatedToDirection(dir);
}
return positions;
}
Otc::Direction getDirectionFromPosition(const Position& position) const {
int dx = position.x - x;
int dy = position.y - y;