• 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 OTClientv8 inventory window margin problem

skic

Member
Joined
Aug 15, 2020
Messages
58
Reaction score
13
Hey guys, I'm playing around with Otclient-v8 and I have some weird margin below the inventory window as shown in the picture below.

How can I remove this margin, I don't know where it is coming from.
Here's the code for inventory: OTCv8/otclientv8 (https://github.com/OTCv8/otclientv8/blob/master/layouts/retro/styles/40-inventory.otui)
In the same folder, there are other codes for HeadlessMiniWindow and other parts that are used in inventory.otui.

Here's my custom module that is showing Skills, Battle, VIP:
Lua:
SpecialMiniWindow

  id: playerBarsWindow
  height: 30
  @onClose: modules.game_inventory.onMiniWindowClose()
  &save: true
  &notMinimize: true

  MiniWindowContents

  ButtonBox
    id: SkillsButton
    text: Skills
    size: 34 20
    anchors.left: parent.left
    anchors.top: parent.top
    margin: 0 9
    @onCheckChange: modules.game_skills.toggle()

  ButtonBox
    id: BattleButton
    anchors.left: SkillsButton.right
    anchors.top: SkillsButton.top
    margin-left: 4
    text: Battle
    size: 34 20
    @onCheckChange: modules.game_battle.toggle()

  ButtonBox
    id: VipButton
    anchors.left: BattleButton.right
    anchors.top: BattleButton.top
    margin-left: 4
    text: VIP
    size: 34 20
    @onCheckChange: modules.game_viplist.toggle()

and here is specialminiwindow.otui that is used in module:
Code:
SpecialMiniWindow < UIMiniWindow
  font: verdana-11px-antialised
  icon-rect: 4 3 13 12
  width: 192
  height: 200
  text-offset: 20 2
  text-align: topLeft
  image-source: /images/ui/special_miniwindow
  image-border: 4
  image-border-top: 20
  image-border-bottom: 4
  focusable: false
  &minimizedHeight: 20

  $on:
    image-border-bottom: 2

  UIWidget
    id: miniwindowTopBar
    anchors.top: parent.top
    anchors.right: parent.right
    anchors.left: parent.left
    margin-right: 3
    margin-left: 3
    margin-top: 3
    size: 258 18
    phantom: true

  UIButton
    id: closeButton

  UIButton
    id: minimizeButton

  VerticalScrollBar
    id: miniwindowScrollBar
    anchors.top: parent.top
    anchors.bottom: parent.bottom
    anchors.right: parent.right
    step: 14
    margin-top: 16
    margin-right: 4
    margin-bottom: 3
    pixels-scroll: true

    $!on:
      width: 0

  ResizeBorder
    id: bottomResizeBorder
    anchors.bottom: parent.bottom
    anchors.left: parent.left
    anchors.right: parent.right
    height: 3
    minimum: 48
    margin-left: 3
    margin-right: 3
    background: #ffffff44
    enabled: false

MiniWindowContents < ScrollablePanel
  id: contentsPanel
  anchors.fill: parent
  anchors.right: miniwindowScrollBar.left
  margin-left: 3
  margin-bottom: 3
  margin-top: 22
  margin-right: 1
  vertical-scrollbar: miniwindowScrollBar

BorderlessGameWindow < UIWindow
  focusable: false
  margin: 2

Does anyone see where is this margin coming from, I think it has to do something with Inventory.otui because If I move other parts like the health bar margin is still there?

Margin is only present on the bottom of inventory window not on top as you can see on the pictures.
 

Attachments

Last edited:
Hi im editing otc v8 and i can't remove or move things to the right it's seems that there is a margin i have edited game interface.otui
Lua:
GameSidePanel < UIMiniWindowContainer
  image-source: /images/ui/panel_side
  image-border: 1
  padding: 3
  padding-top: 9
  width: 185
  focusable: false
  on: true
  layout:
    type: verticalBox
  $mobile:
    padding: 0
    width: 200
 

GameMapPanel < UIGameMap
  padding: 4
  image-source: /images/ui/panel_map
  image-border: 4

  $on:
    padding: 0
  
GameAction < UIButton
  size: 32 32
  phantom: false
  
  UIButton
    id: image
    size: 24 24
    anchors.horizontalCenter: parent.horizontalCenter
    anchors.verticalCenter: parent.verticalCenter
    phantom: true
    $checked:
      opacity: 1.0
      background: #00FF0033
    $!checked:
      opacity: 0.6
      background: alpha


UIWidget
  id: gameRootPanel
  anchors.fill: parent
 
  GameMapPanel
    id: gameMapPanel
    anchors.left: gameLeftPanels.right
    anchors.right: gameRightPanels.left
    anchors.top: parent.top
    anchors.bottom: gameBottomPanel.top
    focusable: false 
  
  Panel
    id: gameLeftActions
    focusable: false
    anchors.bottom: parent.bottom
    anchors.left: parent.left
    width: 64
  
    $!mobile:
      visible: false
      width: 0
  
    layout:
      type: verticalBox
      fit-children: true
    
    GameAction
      id: use
      @onSetup: self.image:setImageSource("/images/game/mobile/use")
    GameAction
      id: attack
      @onSetup: self.image:setImageSource("/images/game/mobile/attack")
    GameAction
      id: follow
      @onSetup: self.image:setImageSource("/images/game/mobile/follow")
    GameAction
      id: look
      @onSetup: self.image:setImageSource("/images/game/mobile/look")
    GameAction
      id: chat
      @onSetup: self.image:setImageSource("/images/game/mobile/chat")
  
  Panel
    id: gameLeftPanels
and in containers.lua changed margin from 0 to 1
Code:
  containerItemWidget:setItem(container:getContainerItem())

  containerPanel:destroyChildren()
  for slot=0,container:getCapacity()-1 do
    local itemWidget = g_ui.createWidget('Item', containerPanel)
    itemWidget:setId('item' .. slot)
    itemWidget:setItem(container:getItem(slot))
    itemWidget:setMargin(1) --0
    itemWidget.position = container:getSlotPosition(slot)

    if not container:isUnlocked() then
      itemWidget:setBorderColor('red')
    end
  end
but there is a still an "invisible" frame in the right panel so can't mvoe icons or even squaring bp slots to the middle, who can help me?

can someone point me out where minimize icons options hotkeys logout,?
found this at inventory-40.otui
Code:
      InventoryButton
          !text: tr('Stop')
          @onClick: g_game.stop(); g_game.cancelAttackAndFollow()

        InventoryButton
          !text: tr('Options')
          @onClick: modules.client_options.toggle()

        InventoryButton
          !text: tr('Hotkeys')
          @onClick: modules.game_hotkeys.toggle()

        InventoryButton
          !text: tr('Logout')
          @onClick: modules.game_interface.tryLogout()
 
Last edited:
Back
Top