Changed scrollbar style, and some other changes:
* Changed the scrollbar style to look a bit nicer. * Fixed a typo in the EventDispatcher class. * Added PlayerStates to player.lua. * Minor tweak to console tab spacing. * Add unbinding key 'Ctrl+Shift+D' in the options.
This commit is contained in:
parent
ca46b5033e
commit
3fa5993177
|
@ -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()
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
Binary file not shown.
Before Width: | Height: | Size: 638 B After Width: | Height: | Size: 661 B |
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -191,7 +191,7 @@ void Application::registerLuaFunctions()
|
|||
g_lua.registerClass<ScheduledEvent, Event>();
|
||||
g_lua.bindClassMemberFunction<ScheduledEvent>("nextCycle", &ScheduledEvent::nextCycle);
|
||||
g_lua.bindClassMemberFunction<ScheduledEvent>("ticks", &ScheduledEvent::ticks);
|
||||
g_lua.bindClassMemberFunction<ScheduledEvent>("reamaningTicks", &ScheduledEvent::reamaningTicks);
|
||||
g_lua.bindClassMemberFunction<ScheduledEvent>("remainingTicks", &ScheduledEvent::remainingTicks);
|
||||
g_lua.bindClassMemberFunction<ScheduledEvent>("delay", &ScheduledEvent::delay);
|
||||
g_lua.bindClassMemberFunction<ScheduledEvent>("cyclesExecuted", &ScheduledEvent::cyclesExecuted);
|
||||
g_lua.bindClassMemberFunction<ScheduledEvent>("maxCycles", &ScheduledEvent::maxCycles);
|
||||
|
|
Loading…
Reference in New Issue