mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-19 22:23:28 +02:00
Version 1.9
This commit is contained in:
@@ -383,44 +383,15 @@ function clear()
|
||||
end
|
||||
end
|
||||
|
||||
function switchMode(floating)
|
||||
if floating then
|
||||
function switchMode(newView)
|
||||
if newView then
|
||||
consolePanel:setImageColor('#ffffff88')
|
||||
consolePanel:removeAnchor(AnchorRight)
|
||||
consolePanel:setWidth(600)
|
||||
consolePanel:setDraggable(true)
|
||||
consoleTabBar:setDraggable(true)
|
||||
|
||||
local bottomSplitter = modules.game_interface.bottomSplitter
|
||||
if bottomSplitter then
|
||||
bottomSplitter:removeAnchor(AnchorRight)
|
||||
bottomSplitter:setWidth(600)
|
||||
end
|
||||
|
||||
if not floatingMode then
|
||||
local savedMargin = g_settings.get("consoleLeftMargin")
|
||||
local newMargin = 150
|
||||
if savedMargin and #savedMargin > 0 then
|
||||
newMargin = tonumber(savedMargin)
|
||||
end
|
||||
newMargin = math.max(0, newMargin)
|
||||
newMargin = math.min(consolePanel:getParent():getWidth() - consolePanel:getWidth(), newMargin)
|
||||
consolePanel:setMarginLeft(newMargin)
|
||||
if bottomSplitter then
|
||||
bottomSplitter:setMarginLeft(newMargin)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
else
|
||||
consolePanel:setImageColor('white')
|
||||
consolePanel:addAnchor(AnchorLeft, 'parent', AnchorLeft)
|
||||
consolePanel:addAnchor(AnchorRight, 'parent', AnchorRight)
|
||||
consolePanel:setDraggable(false)
|
||||
consoleTabBar:setDraggable(false)
|
||||
consolePanel:setMarginLeft(0)
|
||||
end
|
||||
floatingMode = floating
|
||||
--consolePanel:setDraggable(floating)
|
||||
--consoleTabBar:setDraggable(floating)
|
||||
--floatingMode = floating
|
||||
end
|
||||
|
||||
function onDragEnter(widget, pos)
|
||||
@@ -431,15 +402,7 @@ function onDragMove(widget, pos, moved)
|
||||
if not floatingMode then
|
||||
return
|
||||
end
|
||||
local newMargin = consolePanel:getMarginLeft() + moved.x
|
||||
newMargin = math.max(0, newMargin)
|
||||
newMargin = math.min(consolePanel:getParent():getWidth() - consolePanel:getWidth(), newMargin)
|
||||
consolePanel:setMarginLeft(newMargin)
|
||||
local bottomSplitter = modules.game_interface.bottomSplitter
|
||||
if bottomSplitter then
|
||||
bottomSplitter:setMarginLeft(newMargin)
|
||||
end
|
||||
g_settings.set("consoleLeftMargin", newMargin)
|
||||
-- update margin
|
||||
return true
|
||||
end
|
||||
|
||||
|
@@ -57,10 +57,18 @@ ConsoleTabBarButton < MoveableTabBarButton
|
||||
|
||||
Panel
|
||||
id: consolePanel
|
||||
anchors.fill: parent
|
||||
image-source: /images/ui/panel_bottom
|
||||
image-border: 4
|
||||
phantom: false
|
||||
|
||||
$first:
|
||||
anchors.fill: parent
|
||||
|
||||
$!first:
|
||||
anchors.top: prev.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
CheckBox
|
||||
id: toggleChat
|
||||
|
Reference in New Issue
Block a user