From f2b5d38744860360b4b592920c4732aea839ab75 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 15 Aug 2016 20:53:32 +0300 Subject: Copy skill cast offset to shortcuts. Also show offsets in skill popup in shortcuts. --- src/gui/popups/skillpopup.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'src/gui/popups/skillpopup.cpp') diff --git a/src/gui/popups/skillpopup.cpp b/src/gui/popups/skillpopup.cpp index fa757b844..82debd83d 100644 --- a/src/gui/popups/skillpopup.cpp +++ b/src/gui/popups/skillpopup.cpp @@ -49,7 +49,9 @@ SkillPopup::SkillPopup() : mSkillCastType(new TextBox(this)), mCastType(CastType::Default), mLastId(0U), - mLastLevel(-1) + mLastLevel(-1), + mOffsetX(0), + mOffsetY(0) { mSkillName->setFont(boldFont); mSkillName->setPosition(0, 0); @@ -95,13 +97,17 @@ SkillPopup::~SkillPopup() void SkillPopup::show(const SkillInfo *const skill, const int level, - const CastTypeT castType) + const CastTypeT castType, + const int offsetX, + const int offsetY) { if (!skill || !skill->data || (skill->id == mLastId && level == mLastLevel && - castType == mCastType)) + castType == mCastType && + offsetX == mOffsetX && + offsetY == mOffsetY)) { return; } @@ -109,6 +115,8 @@ void SkillPopup::show(const SkillInfo *const skill, mLastId = skill->id; mLastLevel = level; mCastType = castType; + mOffsetX = offsetX; + mOffsetY = offsetY; mSkillName->setCaption(skill->data->dispName); mSkillName->adjustSize(); @@ -168,12 +176,12 @@ void SkillPopup::show(const SkillInfo *const skill, castStr = _("Self position"); break; } - if (skill->customOffsetX != 0 || - skill->customOffsetY != 0) + if (offsetX != 0 || + offsetY != 0) { castStr.append(strprintf(" (%+d,%+d)", - skill->customOffsetX, - skill->customOffsetY)); + offsetX, + offsetY)); } mSkillCastType->setTextWrapped(strprintf( // TRANSLATORS: skill cast type @@ -234,4 +242,7 @@ void SkillPopup::reset() { mLastId = 0; mLastLevel = 0; + mCastType = CastType::Default; + mOffsetX = 0; + mOffsetY = 0; } -- cgit v1.2.3-60-g2f50