From c8d98334441285dc4fc4a5ef3ba1e691bd2b7e43 Mon Sep 17 00:00:00 2001 From: otfallen Date: Mon, 9 Jul 2012 08:56:18 +0200 Subject: [PATCH] woops, added new type to gitignore aswellas commit changes to init.lua --- .gitignore | 1 + init.lua | 5 ++ src/otclient/ui/uiprogressrect.cpp.autosave | 98 --------------------- 3 files changed, 6 insertions(+), 98 deletions(-) delete mode 100644 src/otclient/ui/uiprogressrect.cpp.autosave diff --git a/.gitignore b/.gitignore index 5149639a..4b2deb73 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ Makefile *.cbp *~ *.kate-swap +*.autosave CMakeLists.txt.user* *.xml *.otb diff --git a/init.lua b/init.lua index d6b35ad4..0bc3469e 100644 --- a/init.lua +++ b/init.lua @@ -44,3 +44,8 @@ g_modules.autoLoadModules(9999) if g_resources.fileExists("/otclientrc.lua") then dofile("/otclientrc.lua") end + +--g_things.loadOtb("/items.otb") +--g_map.loadOtbm("/forgotten.otbm") + + diff --git a/src/otclient/ui/uiprogressrect.cpp.autosave b/src/otclient/ui/uiprogressrect.cpp.autosave deleted file mode 100644 index c74ff034..00000000 --- a/src/otclient/ui/uiprogressrect.cpp.autosave +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2010-2012 OTClient - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "uiprogressrect.h" -#include -#include -#include - -UIProgressRect::UIProgressRect() -{ - m_percent = 0; -} - -void UIProgressRect::drawSelf(Fw::DrawPane drawPane) -{ - if((drawPane & Fw::ForegroundPane) == 0) - return; - - g_painter->setColor(m_backgroundColor); - - // todo: check +1 to right/bottom - // todo: add smooth - Rect drawRect = getPaddingRect(); - - // 0% - 12.5% (12.5) - // triangle from top center, to top right (var x) - if(m_percent < 12.5) { - Point var = Point(std::max(m_percent - 0.0, 0.0) * (drawRect.right() - drawRect.horizontalCenter()) / 12.5, 0); - g_painter->drawFilledTriangle(drawRect.center(), drawRect.topRight() + Point(1,0), drawRect.topCenter() + var); - } - - // 12.5% - 37.5% (25) - // triangle from top right to bottom right (var y) - if(m_percent < 37.5) { - Point var = Point(0, std::max(m_percent - 12.5, 0.0) * (drawRect.bottom() - drawRect.top()) / 25.0); - g_painter->drawFilledTriangle(drawRect.center(), drawRect.bottomRight() + Point(1,1), drawRect.topRight() + var + Point(1,0)); - } - - // 37.5% - 62.5% (25) - // triangle from bottom right to bottom left (var x) - if(m_percent < 62.5) { - Point var = Point(std::max(m_percent - 37.5, 0.0) * (drawRect.right() - drawRect.left()) / 25.0, 0); - g_painter->drawFilledTriangle(drawRect.center(), drawRect.bottomLeft() + Point(0,1), drawRect.bottomRight() - var + Point(1,1)); - } - - // 62.5% - 87.5% (25) - // triangle from bottom left to top left - if(m_percent < 87.5) { - Point var = Point(0, std::max(m_percent - 62.5, 0.0) * (drawRect.bottom() - drawRect.top()) / 25.0); - g_painter->drawFilledTriangle(drawRect.center(), drawRect.topLeft(), drawRect.bottomLeft() - var + Point(0,1)); - } - - // 87.5% - 100% (12.5) - // triangle from top left to top center - if(m_percent < 100) { - Point var = Point(std::max(m_percent - 87.5, 0.0) * (drawRect.horizontalCenter() - drawRect.left()) / 12.5, 0); - g_painter->drawFilledTriangle(drawRect.center(), drawRect.topCenter(), drawRect.topLeft() + var); - } - - drawImage(m_rect); - drawBorder(m_rect); - drawIcon(m_rect); - drawText(m_rect); -} - -void UIProgressRect::setPercent(float percent) -{ - m_percent = std::max(std::min((double)percent, 100.0), 0.0); -} - -void UIProgressRect::onStyleApply(const std::string& styleName, const OTMLNodePtr& styleNode) -{ - UIWidget::onStyleApply(styleName, styleNode); - - for(const OTMLNodePtr& node : styleNode->children()) { - if(node->tag() == "percent") - setPercent(node->value()); - } -}