diff --git a/modules/client_options/options.lua b/modules/client_options/options.lua index badd2685..b8ea319f 100644 --- a/modules/client_options/options.lua +++ b/modules/client_options/options.lua @@ -124,6 +124,7 @@ end function Options.terminate() g_keyboard.unbindKeyDown('Ctrl+D') g_keyboard.unbindKeyDown('Ctrl+F') + g_keyboard.unbindKeyDown('Ctrl+Shift+D') optionsWindow:destroy() optionsWindow = nil optionsButton:destroy() diff --git a/modules/client_skins/skins/default/images/contentpanel.png b/modules/client_skins/skins/default/images/contentpanel.png new file mode 100644 index 00000000..0eab48aa Binary files /dev/null and b/modules/client_skins/skins/default/images/contentpanel.png differ diff --git a/modules/client_skins/skins/default/images/scrollbar.png b/modules/client_skins/skins/default/images/scrollbar.png index c8d4fd44..3d0b6af1 100644 Binary files a/modules/client_skins/skins/default/images/scrollbar.png and b/modules/client_skins/skins/default/images/scrollbar.png differ diff --git a/modules/client_skins/skins/default/styles/scrollbars.otui b/modules/client_skins/skins/default/styles/scrollbars.otui index 62c9111b..8f83159a 100644 --- a/modules/client_skins/skins/default/styles/scrollbars.otui +++ b/modules/client_skins/skins/default/styles/scrollbars.otui @@ -1,15 +1,16 @@ ScrollBarSlider < UIButton id: sliderButton anchors.centerIn: parent - size: 13 13 + size: 13 17 image-source: /images/scrollbar.png image-clip: 0 26 13 13 image-border: 2 - image-color: #ffffffff + image-color: #ffffffbb $hover: image-clip: 13 26 13 13 $pressed: image-clip: 26 26 13 13 + image-color: #ffffff99 $disabled: image-color: #ffffff66 diff --git a/modules/corelib/ui/uiscrollbar.lua b/modules/corelib/ui/uiscrollbar.lua index 519fbc87..42a29fe4 100644 --- a/modules/corelib/ui/uiscrollbar.lua +++ b/modules/corelib/ui/uiscrollbar.lua @@ -51,6 +51,15 @@ local function calcValues(self) return range, pxrange, px, offset, center end +local function updateValueDisplay(widget) + if widget == nil then return end + + if widget:getShowValue() then + local symbol = widget:getSymbol() + widget:setText(widget:getValue()..(symbol and symbol or '')) + end +end + local function updateSlider(self) local slider = self:getChildById('sliderButton') if slider == nil then return end @@ -63,6 +72,7 @@ local function updateSlider(self) slider:setWidth(px) slider:setMarginLeft(offset) end + updateValueDisplay(self) local status = (self.maximum ~= self.minimum) @@ -96,6 +106,8 @@ function UIScrollBar.create() scrollbar.step = 1 scrollbar.orientation = 'vertical' scrollbar.pixelsScroll = false + scrollbar.showValue = false + scrollbar.symbol = nil return scrollbar end @@ -105,6 +117,7 @@ function UIScrollBar:onSetup() g_mouse.bindAutoPress(self:getChildById('decrementButton'), function() self:decrement() end, 300) g_mouse.bindAutoPress(self:getChildById('incrementButton'), function() self:increment() end, 300) g_mouse.bindPressMove(self:getChildById('sliderButton'), function(mousePos, mouseMoved) parseSliderPos(self, mousePos, mouseMoved) end) + updateSlider(self) end @@ -122,6 +135,10 @@ function UIScrollBar:onStyleApply(styleName, styleNode) self:setValue(value) elseif name == 'pixels-scroll' then self.pixelsScroll = true + elseif name == 'show-value' then + self.showValue = true + elseif name == 'symbol' then + self.symbol = value end end end @@ -185,7 +202,7 @@ function UIScrollBar:onGeometryChange() end function UIScrollBar:onMouseWheel(mousePos, mouseWheel) - if mouseWheel == MouseWheelUp then + if mouseWheel == MouseWheelDown then if self.orientation == 'vertical' then self:decrement() else @@ -206,3 +223,5 @@ function UIScrollBar:getMinimum() return self.minimum end function UIScrollBar:getValue() return math.round(self.value) end function UIScrollBar:getStep() return self.step end function UIScrollBar:getOrientation() return self.orientation end +function UIScrollBar:getShowValue() return self.showValue end +function UIScrollBar:getSymbol() return self.symbol end \ No newline at end of file diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index 43163c13..350a7665 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -77,7 +77,7 @@ function init() consoleContentPanel = consolePanel:getChildById('consoleContentPanel') consoleTabBar = consolePanel:getChildById('consoleTabBar') consoleTabBar:setContentWidget(consoleContentPanel) - consoleTabBar:setTabSpacing(0) + consoleTabBar:setTabSpacing(-1) channels = {} defaultTab = addTab(tr('Default'), true) diff --git a/modules/gamelib/player.lua b/modules/gamelib/player.lua index f2b50c65..2abe6e06 100644 --- a/modules/gamelib/player.lua +++ b/modules/gamelib/player.lua @@ -1,5 +1,24 @@ -- @docclass Player +PlayerStates = { + None = 0, + Poison = 1, + Burn = 2, + Energy = 4, + Drunk = 8, + ManaShield = 16, + Paralyze = 32, + Haste = 64, + Swords = 128, + Drowning = 256, + Freezing = 512, + Dazzled = 1024, + Cursed = 2048, + PartyBuff = 4096, + PzBlock = 8192, + Pz = 16384 +} + InventorySlotOther = 0 InventorySlotHead = 1 InventorySlotNeck = 2 diff --git a/src/framework/core/eventdispatcher.cpp b/src/framework/core/eventdispatcher.cpp index 5da923e4..80dcb112 100644 --- a/src/framework/core/eventdispatcher.cpp +++ b/src/framework/core/eventdispatcher.cpp @@ -45,7 +45,7 @@ void EventDispatcher::poll() int loops = 0; for(int count = 0, max = m_scheduledEventList.size(); count < max && !m_scheduledEventList.empty(); ++count) { ScheduledEventPtr scheduledEvent = m_scheduledEventList.top(); - if(scheduledEvent->reamaningTicks() > 0) + if(scheduledEvent->remainingTicks() > 0) break; m_scheduledEventList.pop(); scheduledEvent->execute(); diff --git a/src/framework/core/scheduledevent.h b/src/framework/core/scheduledevent.h index a7fd524f..f07a9593 100644 --- a/src/framework/core/scheduledevent.h +++ b/src/framework/core/scheduledevent.h @@ -35,7 +35,7 @@ public: bool nextCycle(); int ticks() { return m_ticks; } - int reamaningTicks() { return m_ticks - g_clock.millis(); } + int remainingTicks() { return m_ticks - g_clock.millis(); } int delay() { return m_delay; } int cyclesExecuted() { return m_cyclesExecuted; } int maxCycles() { return m_maxCycles; } diff --git a/src/framework/luafunctions.cpp b/src/framework/luafunctions.cpp index d8246931..8d2d2592 100644 --- a/src/framework/luafunctions.cpp +++ b/src/framework/luafunctions.cpp @@ -191,7 +191,7 @@ void Application::registerLuaFunctions() g_lua.registerClass(); g_lua.bindClassMemberFunction("nextCycle", &ScheduledEvent::nextCycle); g_lua.bindClassMemberFunction("ticks", &ScheduledEvent::ticks); - g_lua.bindClassMemberFunction("reamaningTicks", &ScheduledEvent::reamaningTicks); + g_lua.bindClassMemberFunction("remainingTicks", &ScheduledEvent::remainingTicks); g_lua.bindClassMemberFunction("delay", &ScheduledEvent::delay); g_lua.bindClassMemberFunction("cyclesExecuted", &ScheduledEvent::cyclesExecuted); g_lua.bindClassMemberFunction("maxCycles", &ScheduledEvent::maxCycles);