fix chat and grid layout

This commit is contained in:
Eduardo Bart 2012-01-13 04:32:47 -02:00
parent 4590c1b894
commit eb308997d4
4 changed files with 10 additions and 13 deletions

View File

@ -6,10 +6,9 @@ local function onTabClick(tabButton)
end end
local function tabBlink(tabButton) local function tabBlink(tabButton)
if tabButton.blinking then if not tabButton.blinking then return end
tabButton:setOn(not tabButton:isOn()) tabButton:setOn(not tabButton:isOn())
scheduleEvent(function() tabBlink(tabButton) end, 300) scheduleEvent(function() tabBlink(tabButton) end, 500)
end
end end
-- public functions -- public functions
@ -66,11 +65,9 @@ function UITabBar:selectTab(tabButton)
end end
function UITabBar:blinkTab(tabButton) function UITabBar:blinkTab(tabButton)
if not tabButton:isChecked() then if tabButton:isChecked() or tabButton.blinking then return end
tabButton:setOn(true) tabButton.blinking = true
tabButton.blinking = true tabBlink(tabButton)
tabBlink(tabButton)
end
end end
function UITabBar:getTabPanel(tabButton) function UITabBar:getTabPanel(tabButton)

View File

@ -74,8 +74,7 @@ local function onCreatureSpeak(name, level, speaktypedesc, message, channelId, c
end end
end end
local channelPanel = consoleTabBar:getTabPanel(defaultChannelTab) Console.addText(message, speaktype.color, defaultChannelTab)
Console.addText(message, speaktype.color, channelPanel)
end end
connect(Game, { onLogin = Console.create, connect(Game, { onLogin = Console.create,

View File

@ -75,8 +75,8 @@ void UIGridLayout::internalUpdate()
if(!widget->isExplicitlyVisible()) if(!widget->isExplicitlyVisible())
continue; continue;
int line = index / m_numLines; int line = index / m_numColumns;
int column = index % m_numLines; int column = index % m_numColumns;
Point virtualPos = Point(column * (m_cellSize.width() + m_cellSpacing), line * (m_cellSize.height() + m_cellSpacing)); Point virtualPos = Point(column * (m_cellSize.width() + m_cellSpacing), line * (m_cellSize.height() + m_cellSpacing));
Point pos = topLeft + virtualPos; Point pos = topLeft + virtualPos;

View File

@ -129,6 +129,7 @@ void OTClient::registerLuaFunctions()
g_lua.bindClassMemberFunction<Creature>("setSkullTexture", &Creature::setSkullTexture); g_lua.bindClassMemberFunction<Creature>("setSkullTexture", &Creature::setSkullTexture);
g_lua.bindClassMemberFunction<Creature>("setShieldTexture", &Creature::setShieldTexture); g_lua.bindClassMemberFunction<Creature>("setShieldTexture", &Creature::setShieldTexture);
g_lua.bindClassMemberFunction<Creature>("setEmblemTexture", &Creature::setEmblemTexture); g_lua.bindClassMemberFunction<Creature>("setEmblemTexture", &Creature::setEmblemTexture);
g_lua.bindClassMemberFunction<Creature>("asMonster", &Creature::asMonster);
g_lua.registerClass<Item, Thing>(); g_lua.registerClass<Item, Thing>();
g_lua.bindClassStaticFunction<Item>("create", &Item::create); g_lua.bindClassStaticFunction<Item>("create", &Item::create);