mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 03:24:55 +02:00
chat line wrapping
* rework UIWidget text wrapping * implement auto wrap * fixes in console
This commit is contained in:
@@ -105,7 +105,6 @@ function ModuleManager.updateModuleInfo(moduleName)
|
||||
|
||||
moduleManagerWindow:recursiveGetChildById('moduleName'):setText(name)
|
||||
moduleManagerWindow:recursiveGetChildById('moduleDescription'):setText(description)
|
||||
moduleManagerWindow:recursiveGetChildById('moduleDescription'):wrapText()
|
||||
moduleManagerWindow:recursiveGetChildById('moduleAuthor'):setText(author)
|
||||
moduleManagerWindow:recursiveGetChildById('moduleWebsite'):setText(website)
|
||||
moduleManagerWindow:recursiveGetChildById('moduleVersion'):setText(version)
|
||||
|
@@ -85,6 +85,7 @@ MainWindow
|
||||
ModuleValueLabel
|
||||
id: moduleDescription
|
||||
height: 100
|
||||
text-wrap: true
|
||||
|
||||
//ModuleInfoLabel
|
||||
// text: Autoload
|
||||
|
@@ -16,6 +16,10 @@ function Mouse.restoreCursor()
|
||||
g_window.restoreMouseCursor()
|
||||
end
|
||||
|
||||
function Mouse.isPressed()
|
||||
return g_ui.getPressedWidget() == nil
|
||||
end
|
||||
|
||||
function Mouse.bindAutoPress(widget, callback)
|
||||
connect(widget, { onMousePress = function(widget, mousePos, mouseButton)
|
||||
callback()
|
||||
|
@@ -21,7 +21,7 @@ end
|
||||
|
||||
local function onWidgetHoverChange(widget, hovered)
|
||||
if hovered then
|
||||
if widget.tooltip then
|
||||
if widget.tooltip and not Mouse.isPressed() then
|
||||
ToolTip.display(widget.tooltip)
|
||||
currentHoveredWidget = widget
|
||||
end
|
||||
|
@@ -229,8 +229,14 @@ function Console.clear()
|
||||
channels = {}
|
||||
channels[0] = 'Default'
|
||||
|
||||
consoleTabBar:getTab('Default').tabPanel:destroyChildren()
|
||||
consoleTabBar:getTab('Server Log').tabPanel:destroyChildren()
|
||||
consoleTabBar:getTab('Default').tabPanel:getChildById('consoleBuffer'):destroyChildren()
|
||||
consoleTabBar:getTab('Server Log').tabPanel:getChildById('consoleBuffer'):destroyChildren()
|
||||
|
||||
local npcTab = consoleTabBar:getTab('NPCs')
|
||||
if npcTab then
|
||||
consoleTabBar:removeTab(npcTab)
|
||||
end
|
||||
|
||||
consoleLineEdit:clearText()
|
||||
|
||||
if channelsWindow then
|
||||
|
@@ -2,6 +2,9 @@ ConsoleLabel < UILabel
|
||||
font: verdana-11px-antialised
|
||||
height: 14
|
||||
color: yellow
|
||||
margin-left: 2
|
||||
text-wrap: true
|
||||
text-auto-resize: true
|
||||
|
||||
ConsoleTabBar < TabBar
|
||||
ConsoleTabBarPanel < TabBarPanel
|
||||
|
@@ -37,7 +37,6 @@ local function displayMessage(msgtype, msg, time)
|
||||
|
||||
if msgtype.wrap then
|
||||
label:setWidth(label:getParent():getWidth())
|
||||
label:wrapText()
|
||||
label:setHeight(label:getTextSize().height)
|
||||
else
|
||||
label:resizeToText()
|
||||
|
Reference in New Issue
Block a user