From 24aab00431156a7b7356d468a9038b5d3724f15c Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Tue, 24 Jan 2012 16:39:16 -0200 Subject: [PATCH] fix use with, improve move, change icons, improve topbar --- BUGS | 5 +-- TODO | 4 -- modules/addon_terminal/commands.lua | 2 +- modules/addon_terminal/terminal.lua | 2 +- modules/addon_terminal/terminal.png | Bin 0 -> 459 bytes modules/client_about/about.lua | 2 +- modules/client_about/about.png | Bin 0 -> 763 bytes modules/client_options/options.lua | 2 +- modules/client_options/options.png | Bin 0 -> 660 bytes modules/client_topmenu/topmenu.lua | 4 +- modules/core_styles/images/tabbutton.png | Bin 0 -> 415 bytes modules/core_styles/styles/buttons.otui | 2 +- modules/core_styles/styles/items.otui | 1 + modules/core_styles/styles/tabbars.otui | 2 +- modules/core_widgets/uiitem.lua | 18 ++++++-- modules/game/game.lua | 34 ++++++++++++++- modules/game/game.otui | 3 ++ modules/game/map.lua | 8 ++-- modules/game/thing.lua | 38 ++++++---------- .../game_combatcontrols/combatcontrols.lua | 8 ++++ .../game_combatcontrols/combatcontrols.otmod | 7 +++ .../game_combatcontrols/combatcontrols.otui | 0 .../game_combatcontrols/combatcontrols.png | Bin 0 -> 381 bytes modules/game_healthbar/healthbar.lua | 26 +++++++---- modules/game_healthbar/healthbar.png | Bin 0 -> 238 bytes modules/game_inventory/inventory.lua | 25 ++++++++--- modules/game_inventory/inventory.png | Bin 0 -> 753 bytes modules/game_miniwindow/miniwindow.lua | 0 modules/game_miniwindow/miniwindow.otmod | 0 modules/game_miniwindow/miniwindow.otui | 0 modules/game_textmessage/textmessage.lua | 2 +- modules/game_viplist/viplist.lua | 2 +- modules/game_viplist/viplist.png | Bin 0 -> 928 bytes src/framework/graphics/framebuffer.cpp | 6 ++- src/framework/graphics/framebuffer.h | 5 ++- src/framework/graphics/graphics.cpp | 2 +- src/framework/luafunctions.cpp | 1 + src/framework/math/color.h | 5 +++ src/framework/ui/uimanager.cpp | 2 +- src/framework/ui/uiwidget.cpp | 22 ++++++---- src/framework/ui/uiwidget.h | 4 +- src/otclient/core/creature.cpp | 41 +++++++++--------- src/otclient/core/game.cpp | 1 - src/otclient/core/game.h | 4 -- src/otclient/core/map.cpp | 1 + src/otclient/luafunctions.cpp | 2 - 46 files changed, 185 insertions(+), 108 deletions(-) create mode 100644 modules/addon_terminal/terminal.png create mode 100644 modules/client_about/about.png create mode 100644 modules/client_options/options.png create mode 100644 modules/core_styles/images/tabbutton.png create mode 100644 modules/game_combatcontrols/combatcontrols.lua create mode 100644 modules/game_combatcontrols/combatcontrols.otmod create mode 100644 modules/game_combatcontrols/combatcontrols.otui create mode 100644 modules/game_combatcontrols/combatcontrols.png create mode 100644 modules/game_healthbar/healthbar.png create mode 100644 modules/game_inventory/inventory.png create mode 100644 modules/game_miniwindow/miniwindow.lua create mode 100644 modules/game_miniwindow/miniwindow.otmod create mode 100644 modules/game_miniwindow/miniwindow.otui create mode 100644 modules/game_viplist/viplist.png diff --git a/BUGS b/BUGS index bd464b09..ec80fb07 100644 --- a/BUGS +++ b/BUGS @@ -11,11 +11,10 @@ hotkeys works while windows are locked, it shouldnt some animated hits are displayed as 2 hits instead of one numpad on windows doesn't work correctly skulls is rendering outside map bounds -these are some issues when skill progressbar is 0% or 100% paste on x11 platform does not work correctly when doing ctrl+c in google chrome +party options does not work when relogging inside a party -walk animation doesnt reset when leaving invisible -non tiles are no black +chamaleon doesnt animate items drop items in container background can view ocean in underground floors diff --git a/TODO b/TODO index a8a80815..aee91c45 100644 --- a/TODO +++ b/TODO @@ -12,13 +12,9 @@ adjust interface design display exit box when exiting from game attack modes player status icons (poison, etc) -container windows -move items -use with move count itens -open/close vip/skills move windows, go back in containers open private chat reopen channels diff --git a/modules/addon_terminal/commands.lua b/modules/addon_terminal/commands.lua index 8bd241f0..3d588dc0 100644 --- a/modules/addon_terminal/commands.lua +++ b/modules/addon_terminal/commands.lua @@ -32,4 +32,4 @@ end function quit() exit() -end \ No newline at end of file +end diff --git a/modules/addon_terminal/terminal.lua b/modules/addon_terminal/terminal.lua index fb951aed..c5fd92dc 100644 --- a/modules/addon_terminal/terminal.lua +++ b/modules/addon_terminal/terminal.lua @@ -107,7 +107,7 @@ function Terminal.init() terminalWidget = displayUI('terminal.otui') terminalWidget:setVisible(false) - terminalButton = TopMenu.addButton('terminalButton', 'Terminal (Ctrl + T)', '/core_styles/icons/terminal.png', Terminal.toggle) + terminalButton = TopMenu.addButton('terminalButton', 'Terminal (Ctrl + T)', 'terminal.png', Terminal.toggle) Hotkeys.bindKeyDown('Ctrl+T', Terminal.toggle) commandHistory = Settings.getList('terminal-history') diff --git a/modules/addon_terminal/terminal.png b/modules/addon_terminal/terminal.png new file mode 100644 index 0000000000000000000000000000000000000000..768c2e9ece17c676f783f123cdc2c8a30d038e59 GIT binary patch literal 459 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPgf7$c2W-&PmwC#`O^GU9E zO%e`jUENYWvAX3)TG%qPxq{Kzjt0J6%*_GnCsh vf6JB{+|8SAb6!yJOzY0Ptx*!8e}$X%R~b$8(Ys-J2^5T;u6{1-oD!MPx#24YJ`L;wH)0002_L%V+f000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipq) z1{n?mbm)};0013nR9JLFZ*6U5Zgc_CX>@2HM@dakWG-a~0006~ zNklA#8?$^vt$%tAy36f+QhT)TQ&0<`7D5}B5fnkt zAJ95lC(=4HM2S#L2g8rWG|f2UcxUe1xgY1W80I?TB6{J#Ip_Vo&*A*uS8ybPAV~HL z%PR;W7#$u+?rhuc(3?k#U%q=!uCPZ}R~ILaA0wS|__DOhLAA=so^FC5=zy5*#kU{L zV5QPbOZp~d4=iO*Bubq0$jTJfEa_jwK{usWCP(h~=c2dN`AORRWwInV=rVOk5sgb2~@ASVk#@loBZ=N+}9^W!5)$8R*N9 z->Y!(#=S#;G)*oHpJU(ks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!YnM|RhE&cxNc(wsJ4EPnViT1pDLp^Yj%lnb(m^t5x=*a!NL|s zY5;qE9xaig(LNZtx3_xB&F*!m0ic~Y)&J}1VTVvD^T6>3iS;SeL!I{JQ40T57)q-I z$zyoNF=|z*{5W6K*LIJl(}y$Bt*zXA%LUJO0oYtAVg54C@i$)Q_vz2^f7<3r>oY2{ zi+pnsK~l>HRyAZ+w-Qu^kIx_T;GN6Xe)%PzlvjKTaA(A072v{jP zciY&XN|Dr0g4ab9Nun@71|A>I{>9&0HKM?0_U0-w3{bV!<*2}`OUoVP{%GgV+lK&% zLLY!crHBj!-!87Rys?W6JUVJ6h~$5>u!nf|%q7oz?geB7exZPWxQ~ViTLW#C5~4Rn zET(ba+*fz9um@iR;yvT*nX3S8d(EDEL|I1ioqqw(q*|)N`W9dS0000getSize()); - if(clear) + if(clear) { + glClearColor(m_clearColor.rF(), m_clearColor.gF(), m_clearColor.bF(), m_clearColor.aF()); glClear(GL_COLOR_BUFFER_BIT); + } } void FrameBuffer::release() diff --git a/src/framework/graphics/framebuffer.h b/src/framework/graphics/framebuffer.h index b43a7710..bd81d6a4 100644 --- a/src/framework/graphics/framebuffer.h +++ b/src/framework/graphics/framebuffer.h @@ -30,12 +30,14 @@ class FrameBuffer public: FrameBuffer(const Size& size); virtual ~FrameBuffer(); - + void resize(const Size& size); void bind(bool clear = true); void release(); void draw(const Rect& dest); + void setClearColor(const Color& color) { m_clearColor = color; } + TexturePtr getTexture() { return m_texture; } private: @@ -48,6 +50,7 @@ private: Size m_oldViewportSize; uint m_fbo; uint m_prevBoundFbo; + Color m_clearColor; static uint boundFbo; }; diff --git a/src/framework/graphics/graphics.cpp b/src/framework/graphics/graphics.cpp index d7dc549d..d4e26986 100644 --- a/src/framework/graphics/graphics.cpp +++ b/src/framework/graphics/graphics.cpp @@ -43,7 +43,6 @@ void Graphics::init() #endif glEnable(GL_BLEND); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); logInfo("GPU ", glGetString(GL_RENDERER)); logInfo("OpenGL ", glGetString(GL_VERSION)); @@ -93,6 +92,7 @@ void Graphics::resize(const Size& size) void Graphics::beginRender() { + glClearColor(0, 0, 0, 1); glClear(GL_COLOR_BUFFER_BIT); } diff --git a/src/framework/luafunctions.cpp b/src/framework/luafunctions.cpp index b3d240d7..44899235 100644 --- a/src/framework/luafunctions.cpp +++ b/src/framework/luafunctions.cpp @@ -435,6 +435,7 @@ void Application::registerLuaFunctions() g_lua.bindClassStaticFunction("g_ui", "getStyleClass", std::bind(&UIManager::getStyleClass, &g_ui, _1)); g_lua.bindClassStaticFunction("g_ui", "loadUI", std::bind(&UIManager::loadUI, &g_ui, _1, _2)); g_lua.bindClassStaticFunction("g_ui", "getRootWidget", std::bind(&UIManager::getRootWidget, &g_ui)); + g_lua.bindClassStaticFunction("g_ui", "getDraggingWidget", std::bind(&UIManager::getDraggingWidget, &g_ui)); g_lua.bindClassStaticFunction("g_ui", "setDebugBoxesDrawing", std::bind(&UIManager::setDebugBoxesDrawing, &g_ui, _1)); g_lua.bindClassStaticFunction("g_ui", "isDrawingDebugBoxes", std::bind(&UIManager::setDebugBoxesDrawing, &g_ui, _1)); diff --git a/src/framework/math/color.h b/src/framework/math/color.h index 529cdd4d..743a1455 100644 --- a/src/framework/math/color.h +++ b/src/framework/math/color.h @@ -40,6 +40,11 @@ public: uint8 g() const { return m_g; } uint8 r() const { return m_r; } + float aF() const { return m_a/255.0f; } + float bF() const { return m_b/255.0f; } + float gF() const { return m_g/255.0f; } + float rF() const { return m_r/255.0f; } + uint32 rgba() const { return m_rgba; } const uint8* rgbaPtr() const { return (const uint8*)&m_rgba; } diff --git a/src/framework/ui/uimanager.cpp b/src/framework/ui/uimanager.cpp index 927ba502..0f46cf4e 100644 --- a/src/framework/ui/uimanager.cpp +++ b/src/framework/ui/uimanager.cpp @@ -72,7 +72,7 @@ void UIManager::inputEvent(const InputEvent& event) m_keyboardReceiver->propagateOnKeyUp(event.keyCode, event.keyboardModifiers); break; case Fw::MousePressInputEvent: - m_keyboardReceiver->propagateOnMousePress(event.mousePos, event.mouseButton); + m_mouseReceiver->propagateOnMousePress(event.mousePos, event.mouseButton); break; case Fw::MouseReleaseInputEvent: m_mouseReceiver->propagateOnMouseRelease(event.mousePos, event.mouseButton); diff --git a/src/framework/ui/uiwidget.cpp b/src/framework/ui/uiwidget.cpp index 123f9e19..472d00b4 100644 --- a/src/framework/ui/uiwidget.cpp +++ b/src/framework/ui/uiwidget.cpp @@ -830,10 +830,11 @@ UIWidgetPtr UIWidget::recursiveGetChildById(const std::string& id) UIWidgetPtr UIWidget::recursiveGetChildByPos(const Point& childPos) { for(const UIWidgetPtr& child : m_children) { - if(child->containsPoint(childPos)) { + if(child->isExplicitlyVisible() && child->containsPoint(childPos)) { if(UIWidgetPtr subChild = child->recursiveGetChildByPos(childPos)) return subChild; - return child; + else if(!child->isPhantom()) + return child; } } return nullptr; @@ -1113,7 +1114,7 @@ bool UIWidget::onMousePress(const Point& mousePos, Fw::MouseButton button) return callLuaField("onMousePress", mousePos, button); } -void UIWidget::onMouseRelease(const Point& mousePos, Fw::MouseButton button) +bool UIWidget::onMouseRelease(const Point& mousePos, Fw::MouseButton button) { if(isPressed() && getRect().contains(mousePos)) callLuaField("onClick"); @@ -1125,7 +1126,7 @@ void UIWidget::onMouseRelease(const Point& mousePos, Fw::MouseButton button) draggedWidget->setDragging(false); } - callLuaField("onMouseRelease", mousePos, button); + return callLuaField("onMouseRelease", mousePos, button); } bool UIWidget::onMouseMove(const Point& mousePos, const Point& mouseMoved) @@ -1260,16 +1261,16 @@ bool UIWidget::propagateOnMousePress(const Point& mousePos, Fw::MouseButton butt // only non phatom widgets receives mouse press events if(!isPhantom()) { - onMousePress(mousePos, button); + bool ret = onMousePress(mousePos, button); if(button == Fw::MouseLeftButton && !isPressed()) setPressed(true); - return true; + return ret; } return false; } -void UIWidget::propagateOnMouseRelease(const Point& mousePos, Fw::MouseButton button) +bool UIWidget::propagateOnMouseRelease(const Point& mousePos, Fw::MouseButton button) { // do a backup of children list, because it may change while looping it UIWidgetList children; @@ -1283,13 +1284,16 @@ void UIWidget::propagateOnMouseRelease(const Point& mousePos, Fw::MouseButton bu } for(const UIWidgetPtr& child : children) { - child->propagateOnMouseRelease(mousePos, button); + if(child->propagateOnMouseRelease(mousePos, button)) + return true; } - onMouseRelease(mousePos, button); + bool ret = onMouseRelease(mousePos, button); if(isPressed() && button == Fw::MouseLeftButton) setPressed(false); + + return ret; } bool UIWidget::propagateOnMouseMove(const Point& mousePos, const Point& mouseMoved) diff --git a/src/framework/ui/uiwidget.h b/src/framework/ui/uiwidget.h index 230aaac0..c0157de6 100644 --- a/src/framework/ui/uiwidget.h +++ b/src/framework/ui/uiwidget.h @@ -173,7 +173,7 @@ protected: virtual bool onKeyPress(uchar keyCode, int keyboardModifiers, bool wouldFilter); virtual bool onKeyUp(uchar keyCode, int keyboardModifiers); virtual bool onMousePress(const Point& mousePos, Fw::MouseButton button); - virtual void onMouseRelease(const Point& mousePos, Fw::MouseButton button); + virtual bool onMouseRelease(const Point& mousePos, Fw::MouseButton button); virtual bool onMouseMove(const Point& mousePos, const Point& mouseMoved); virtual bool onMouseWheel(const Point& mousePos, Fw::MouseWheelDirection direction); @@ -182,7 +182,7 @@ protected: bool propagateOnKeyPress(uchar keyCode, int keyboardModifiers, bool wouldFilter); bool propagateOnKeyUp(uchar keyCode, int keyboardModifiers); bool propagateOnMousePress(const Point& mousePos, Fw::MouseButton button); - void propagateOnMouseRelease(const Point& mousePos, Fw::MouseButton button); + bool propagateOnMouseRelease(const Point& mousePos, Fw::MouseButton button); bool propagateOnMouseMove(const Point& mousePos, const Point& mouseMoved); bool propagateOnMouseWheel(const Point& mousePos, Fw::MouseWheelDirection direction); diff --git a/src/otclient/core/creature.cpp b/src/otclient/core/creature.cpp index cf45df24..17e4ae22 100644 --- a/src/otclient/core/creature.cpp +++ b/src/otclient/core/creature.cpp @@ -245,12 +245,13 @@ void Creature::stopWalk() void Creature::updateWalkAnimation(int totalPixelsWalked) { // update outfit animation - if(m_outfit.getCategory() == ThingsType::Creature) { - if(totalPixelsWalked == 32 || totalPixelsWalked == 0 || m_type->dimensions[ThingType::AnimationPhases] <= 1) - m_animation = 0; - else if(m_type->dimensions[ThingType::AnimationPhases] > 1) - m_animation = 1 + ((totalPixelsWalked * 4) / Map::NUM_TILE_PIXELS) % (m_type->dimensions[ThingType::AnimationPhases] - 1); - } + if(m_outfit.getCategory() != ThingsType::Creature) + return; + + if(totalPixelsWalked == 32 || totalPixelsWalked == 0 || m_type->dimensions[ThingType::AnimationPhases] <= 1) + m_animation = 0; + else if(m_type->dimensions[ThingType::AnimationPhases] > 1) + m_animation = 1 + ((totalPixelsWalked * 4) / Map::NUM_TILE_PIXELS) % (m_type->dimensions[ThingType::AnimationPhases] - 1); } void Creature::updateWalkOffset(int totalPixelsWalked) @@ -373,11 +374,12 @@ void Creature::setDirection(Otc::Direction direction) void Creature::setOutfit(const Outfit& outfit) { - if(m_outfit.getCategory() != ThingsType::Effect && outfit.getCategory() == ThingsType::Effect) { - auto self = asCreature(); - g_dispatcher.scheduleEvent([self]() { - self->updateInvisibleAnimation(); - }, INVISIBLE_TICKS); + m_outfit = outfit; + m_type = getType(); + m_animation = 0; + + if(m_outfit.getCategory() == ThingsType::Effect) { + updateInvisibleAnimation(); m_xPattern = 0; m_yPattern = 0; @@ -387,11 +389,7 @@ void Creature::setOutfit(const Outfit& outfit) m_yPattern = 0; } - m_outfit = outfit; - m_type = getType(); - if(m_outfit.getCategory() == ThingsType::Creature && m_type->dimensions[ThingType::Layers] == 1) { - m_animation = 0; m_outfit.resetClothes(); } } @@ -453,6 +451,9 @@ void Creature::addVolatileSquare(uint8 color) void Creature::updateInvisibleAnimation() { + if(!g_game.isOnline() || m_outfit.getCategory() != ThingsType::Effect) + return; + if(m_animation == 1) m_animation = 2; else if(m_animation == 2) @@ -462,12 +463,10 @@ void Creature::updateInvisibleAnimation() else m_animation = 1; - if(g_game.isOnline() && m_outfit.getCategory() == ThingsType::Effect) { - auto self = asCreature(); - g_dispatcher.scheduleEvent([self]() { - self->updateInvisibleAnimation(); - }, INVISIBLE_TICKS); - } + auto self = asCreature(); + g_dispatcher.scheduleEvent([self]() { + self->updateInvisibleAnimation(); + }, INVISIBLE_TICKS); } void Creature::updateShield() diff --git a/src/otclient/core/game.cpp b/src/otclient/core/game.cpp index a6ae1a29..9d1d3c7e 100644 --- a/src/otclient/core/game.cpp +++ b/src/otclient/core/game.cpp @@ -36,7 +36,6 @@ Game g_game; void Game::loginWorld(const std::string& account, const std::string& password, const std::string& worldHost, int worldPort, const std::string& characterName) { m_dead = false; - m_selectedThing = nullptr; m_protocolGame = ProtocolGamePtr(new ProtocolGame); m_protocolGame->login(account, password, worldHost, (uint16)worldPort, characterName); } diff --git a/src/otclient/core/game.h b/src/otclient/core/game.h index 110cee1d..58451d5b 100644 --- a/src/otclient/core/game.h +++ b/src/otclient/core/game.h @@ -107,9 +107,6 @@ public: bool isOnline() { return !!m_localPlayer; } bool isDead() { return m_dead; } - void setSelectedThing(const ThingPtr& thing) { m_selectedThing = thing; } - ThingPtr getSelectedThing() { return m_selectedThing; } - void setServerBeat(int serverBeat) { m_serverBeat = serverBeat; } int getServerBeat() { return m_serverBeat; } @@ -122,7 +119,6 @@ private: ProtocolGamePtr m_protocolGame; bool m_dead; int m_serverBeat; - ThingPtr m_selectedThing; }; extern Game g_game; diff --git a/src/otclient/core/map.cpp b/src/otclient/core/map.cpp index 74d3b9b6..b269faea 100644 --- a/src/otclient/core/map.cpp +++ b/src/otclient/core/map.cpp @@ -46,6 +46,7 @@ void Map::draw(const Rect& rect) if(!m_framebuffer) { Size fboSize(m_visibleSize.width() * NUM_TILE_PIXELS, m_visibleSize.height() * NUM_TILE_PIXELS); m_framebuffer = FrameBufferPtr(new FrameBuffer(fboSize)); + m_framebuffer->setClearColor(Fw::black); m_shaderProgram = PainterShaderProgramPtr(new PainterShaderProgram); diff --git a/src/otclient/luafunctions.cpp b/src/otclient/luafunctions.cpp index 7f6c9d81..3571b58f 100644 --- a/src/otclient/luafunctions.cpp +++ b/src/otclient/luafunctions.cpp @@ -224,8 +224,6 @@ void OTClient::registerLuaFunctions() g_lua.bindClassStaticFunction("getLocalPlayer", std::bind(&Game::getLocalPlayer, &g_game)); g_lua.bindClassStaticFunction("getProtocolVersion", std::bind(&Game::getProtocolVersion, &g_game)); g_lua.bindClassStaticFunction("getProtocolGame", std::bind(&Game::getProtocolGame, &g_game)); - g_lua.bindClassStaticFunction("setSelectedThing", std::bind(&Game::setSelectedThing, &g_game, _1)); - g_lua.bindClassStaticFunction("getSelectedThing", std::bind(&Game::getSelectedThing, &g_game)); g_lua.registerClass(); g_lua.bindClassStaticFunction("create", []{ return UIItemPtr(new UIItem); } );