• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OTClient Bug on top menu dissapear when using 2560x1080 resolution

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,470
Solutions
27
Reaction score
844
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
Hi again! I'm using mehah's OTC GitHub - mehah/otclient: An alternative tibia client for otserv written in C++11 and Lua, made with a modular system that uses lua scripts for ingame interface and functionality, making otclient flexible and easy to customize (https://github.com/mehah/otclient) and I wonder if someone can help me with this. I have added more tiles to the game, using the following guide [Tutorial] Adding more tiles to game window - Updated 7/6/2018 (https://otland.net/threads/tutorial-adding-more-tiles-to-game-window-updated-7-6-2018.228243/), and configured my gameinferface.lua a little bit.

In this video I use 2 screens with different resolutions from the same PC


The problem is what I mention on the video, on 2560x1080 my top menu gets bugged, but, while running 1920x1080 it works well. There's 2 solutions I want to ask for.
a) How can I set-up a variable of setMaxiumSize? like is mentioned here OTClient window fixed? (https://otland.net/threads/otclient-window-fixed.260009/#post-2515098), but with the whole solution, to force a maxium size of 1920x1080 for the user (that should solve the bug).
b) Any chance to actually fix the top menu in 2560x1080 resolution instead of forcing the maxiumSize?

Here's my gameinterface.lua. I don't have errors in terminal.

And my OTC map.h
Code:
void Map::resetAwareRange()
{
    AwareRange range;
    range.left = 13; //Change this to = maxClientViewportX
    range.top = 8; //Change this to = maxClientViewportY
    range.bottom = range.top + 1;
    range.right = range.left + 1;
    setAwareRange(range);
}

gameinterface.lua setupViewmode
Lua:
function setupViewMode(mode)
  if mode == currentViewMode then return end

  if currentViewMode == 2 then
    gameMapPanel:addAnchor(AnchorLeft, 'gameLeftPanel', AnchorRight)
    gameMapPanel:addAnchor(AnchorRight, 'gameRightPanel', AnchorLeft)
    gameMapPanel:addAnchor(AnchorBottom, 'gameBottomPanel', AnchorTop)
    gameRootPanel:addAnchor(AnchorTop, 'topMenu', AnchorBottom)
    gameLeftPanel:setOn(modules.client_options.getOption('showLeftPanel'))
    gameLeftPanel:setImageColor('white')
    gameRightPanel:setImageColor('white')
    gameLeftPanel:setMarginTop(4)
    gameRightPanel:setMarginTop(4)
    gameBottomPanel:setImageColor('white')
    modules.client_topmenu.getTopMenu():setImageColor('white')
    g_game.changeMapAwareRange(18, 14)
  end

  if mode == 0 then
    gameMapPanel:setKeepAspectRatio(true)
    gameMapPanel:setLimitVisibleRange(false)
    gameMapPanel:setZoom(12)
    gameMapPanel:setVisibleDimension({ width = 15, height = 11 })
  elseif mode == 1 then
    gameMapPanel:setKeepAspectRatio(false)
    gameMapPanel:setLimitVisibleRange(true)
    gameMapPanel:setZoom(12)
    gameMapPanel:setVisibleDimension({ width = 15, height = 11 })
  elseif mode == 2 then
    local limit = limitedZoom and not g_game.isGM()
    gameMapPanel:setLimitVisibleRange(limit)
    gameMapPanel:setZoom(12)
    gameMapPanel:setVisibleDimension({ width = 23, height = 11 })
    gameMapPanel:fill('parent')
    gameRootPanel:fill('parent')
    gameLeftPanel:setImageColor('alpha')
    gameRightPanel:setImageColor('alpha')
    gameLeftPanel:setMarginTop(modules.client_topmenu.getTopMenu()
      :getHeight() - gameLeftPanel:getPaddingTop())
    gameRightPanel:setMarginTop(modules.client_topmenu.getTopMenu()
      :getHeight() - gameRightPanel:getPaddingTop())
    gameLeftPanel:setOn(true)
    gameLeftPanel:setVisible(true)
    gameRightPanel:setOn(true)
    gameMapPanel:setOn(true)
    gameBottomPanel:setImageColor('#ffffff88')
    modules.client_topmenu.getTopMenu():setImageColor('#ffffff66')
    if not limit then
      g_game.changeMapAwareRange(24, 20)
    end
  end

  currentViewMode = mode
end

function limitZoom()
  limitedZoom = true
end

Thanks in advance
Regards!
 
Last edited:
Solution
Change Panel anchor.top inside background.otui from anchors.top: topMenu.bottom to anchors.top: parent.top.
If there will still be 1px of that "bug" remove margin-top: 1.
Change Panel anchor.top inside background.otui from anchors.top: topMenu.bottom to anchors.top: parent.top.
If there will still be 1px of that "bug" remove margin-top: 1.
 
Solution
Back
Top