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
local function tabBlink(tabButton)
if tabButton.blinking then
if not tabButton.blinking then return end
tabButton:setOn(not tabButton:isOn())
scheduleEvent(function() tabBlink(tabButton) end, 300)
end
scheduleEvent(function() tabBlink(tabButton) end, 500)
end
-- public functions
@ -66,11 +65,9 @@ function UITabBar:selectTab(tabButton)
end
function UITabBar:blinkTab(tabButton)
if not tabButton:isChecked() then
tabButton:setOn(true)
if tabButton:isChecked() or tabButton.blinking then return end
tabButton.blinking = true
tabBlink(tabButton)
end
end
function UITabBar:getTabPanel(tabButton)

View File

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

View File

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

View File

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