InviteNameWindow < NewMainWindow
  id: inviteCharacterName
  !text: tr('Invite player to selected chat channel')
  anchors.horizontalCenter: parent.horizontalCenter
  size: 360 121

  Panel
    id: contentPanel
    anchors.fill: parent
    margin: 12 12 12 13

    Label
      id: nameLabel
      anchors.top: parent.top
      anchors.left: parent.left
      !text: tr('Please Enter a character name:')

    TextEdit
      id: characterName
      size: 328 16
      focusable: true
      anchors.top: prev.bottom
      anchors.left: parent.left
      anchors.right: parent.right
      margin-top: 7

    HorizontalSeparator
      id: separator
      anchors.top: prev.bottom
      anchors.left: parent.left
      anchors.right: parent.right
      margin-top: 10

    Button
      id: cancel
      anchors.bottom: parent.bottom
      anchors.right: parent.right
      !text: tr('Cancel')
      size: 43 20

    Button
      id: ok
      anchors.bottom: parent.bottom
      anchors.right: prev.left
      !text: tr('Ok')
      size: 43 20
      margin-right: 10

ExcludeNameWindow < NewMainWindow
  id: excludeCharacterName
  !text: tr('Exclude player from selected chat channel')
  anchors.horizontalCenter: parent.horizontalCenter
  size: 360 121

  Panel
    id: contentPanel
    anchors.fill: parent
    margin: 12 12 12 13

    Label
      id: nameLabel
      anchors.top: parent.top
      anchors.left: parent.left
      !text: tr('Please Enter a character name:')

    TextEdit
      id: characterName
      size: 328 16
      focusable: true
      anchors.top: prev.bottom
      anchors.left: parent.left
      anchors.right: parent.right
      margin-top: 7

    HorizontalSeparator
      id: separator
      anchors.top: prev.bottom
      anchors.left: parent.left
      anchors.right: parent.right
      margin-top: 10

    Button
      id: cancel
      anchors.bottom: parent.bottom
      anchors.right: parent.right
      !text: tr('Cancel')
      size: 43 20

    Button
      id: ok
      anchors.bottom: parent.bottom
      anchors.right: prev.left
      !text: tr('Ok')
      size: 43 20
      margin-right: 10

ConsoleLabel < UITextEdit
  font: verdana-11px-antialised
  height: 14
  color: yellow
  margin-left: 2
  text-wrap: true
  text-auto-resize: true
  selection-color: #f4f4f4ff
  selection-background-color: #808080ff
  change-cursor-image: false
  cursor-visible: false
  editable: false
  draggable: true
  selectable: false
  focusable: false

ConsolePhantomLabel < UILabel
  font: verdana-11px-antialised
  height: 14
  color: yellow
  text-wrap: true
  text-auto-resize: true
  selection-color: #111416
  selection-background-color: #999999

ConsoleTabBar < MoveableTabBar
  height: 28
  phantom: true

ConsoleTabBarPanel < MoveableTabBarPanel
  id: consoleTab

  ScrollablePanel
    id: consoleBuffer
    anchors.fill: parent
    image-source: /images/ui/3pixel_frame_borderimage
    image-border: 4
    padding: 1
    padding-right: 12
    padding-left: 4
    padding-top: 4
    padding-bottom: 4
    vertical-scrollbar: consoleScrollBar
    layout:
      type: verticalBox
      align-bottom: true
    inverted-scroll: true

  VerticalQtScrollBar
    id: consoleScrollBar
    anchors.top: parent.top
    anchors.bottom: parent.bottom
    anchors.right: parent.right
    step: 14
    pixels-scroll: true
    margin-top: 4
    margin-right: 4
    margin-bottom: 4

ConsoleTabBarButton < UIButton
  size: 96 18
  image-source: /images/ui/console_button
  image-clip: 0 18 96 18
  color: #7f7f7fff
  text-offset: 0 -1
  font: verdana-11px-rounded
  anchors.top: parent.top
  anchors.left: parent.left
  padding: 5
  tab-spacing: 0
  padding-left: 20
  padding-right: 20
  &tabWidth: 95

  $checked:
    image-clip: 0 0 96 18
    color: #dfdfdfff

  $on !checked:
    image-clip: 0 18 96 18
    color: #7f7f7fff

Panel
  id: consolePanel
  anchors.fill: parent

  UIWidget
    image-source: /images/ui/2pixel_up_frame_borderimage
    image-border: 3
    anchors.fill: parent
    margin-top: 16
    focusable: false
  Panel
    id: consoleContentPanel
    anchors.top: parent.top
    anchors.left: parent.left
    anchors.right: parent.horizontalCenter
    anchors.bottom: consoleTextEdit.top
    margin-left: 3
    margin-right: 2
    margin-bottom: 4
    margin-top: 20
    padding: 1
    focusable: false

  Panel
    id: readOnlyPanel
    anchors.top: parent.top
    anchors.left: parent.horizontalCenter
    anchors.right: parent.right
    anchors.bottom: consoleTextEdit.top
    margin-left: 2
    margin-right: 6
    margin-bottom: 4
    margin-top: 20
    padding: 1
    focusable: false
    ScrollablePanel
      id: panel
      anchors.fill: parent
      vertical-scrollbar: consoleScrollBarReadOnlyPanel
      image-source: /images/ui/3pixel_frame_borderimage
      image-border: 4
      padding: 1
      padding-right: 12
      padding-left: 4
      padding-top: 4
      padding-bottom: 4
      inverted-scroll: true
      layout:
        type: verticalBox
        align-bottom: true
    VerticalQtScrollBar
      id: consoleScrollBarReadOnlyPanel
      anchors.top: parent.top
      anchors.bottom: parent.bottom
      anchors.right: parent.right
      step: 14
      pixels-scroll: true
      margin-top: 4
      margin-bottom: 4
      margin-right: 4

  ConsoleTabBar
    id: consoleTabBar
    anchors.left: parent.left
    anchors.bottom: consoleContentPanel.top
    anchors.right: closeChannelButton.left
    margin-right: 20
    margin-left: 18
    margin-bottom: -7
    tab-spacing: 2
    movable: true

  TabButton
    id: prevChannelButton
    image-source: /images/ui/console_flash_left
    image-clip: 36 0 18 18
    anchors.left: parent.left
    anchors.top: consoleTabBar.top
    size: 18 18
    enabled: false
    &dynamicNavigation: 96

    $disabled:
      image-clip: 36 0 18 18

    $!disabled:
      image-clip: 0 0 18 18

    $pressed !disabled:
      image-clip: 18 0 18 18

  TabButton
    id: nextChannelButton
    image-source: /images/ui/console_flash_right
    image-clip: 36 0 18 18
    anchors.left: consoleTabBar.right
    anchors.top: consoleTabBar.top
    margin-right: 1
    size: 0 18
    enabled: false
    &dynamicNavigation: 96

    $disabled:
      image-clip: 36 0 18 18
      width: 0

    $!disabled:
      image-clip: 0 0 18 18
      width: 18

    $pressed !disabled:
      image-clip: 18 0 18 18

  TabButton
    id: extendedViewDraggable
    !tooltip: tr('Enable/ Disable draggable chat')
    image-source: /images/ui/console_buttons
    image-clip: 0 64 16 16
    anchors.right: extendedViewHide.left
    anchors.bottom: consoleContentPanel.top
    margin-bottom: 5
    margin-right: 1
    size: 16 16
    visible: false
    checked: true

    @onClick: |
      self:setChecked(not self:isChecked())
      extendedViewDraggable(self:isChecked())

    $checked:
      image-clip: 16 64 16 16
    $!checked:
      image-clip: 0 64 16 16
    $pressed:
      image-clip: 16 64 16 16

  TabButton
    id: extendedViewHide
    !tooltip: tr('Hide Chat')
    image-source: /images/ui/console_buttons
    image-clip: 0 80 16 16
    anchors.right: closeChannelButton.left
    anchors.bottom: consoleContentPanel.top
    margin-bottom: 5
    margin-right: 1
    visible: false
    size: 16 16
    @onClick: |
      self:setChecked(not self:isChecked())
      extendedViewHide(self:isChecked())

    $checked:
      image-clip: 16 80 16 16
    $!checked:
      image-clip: 0 80 16 16
    $pressed:
      image-clip: 16 80 16 16

  TabButton
    id: closeChannelButton
    !tooltip: tr('Close this channel') .. ' (Ctrl+E)'
    image-source: /images/ui/console_buttons
    image-clip: 0 48 16 16
    anchors.right: channelsButton.left
    anchors.bottom: consoleContentPanel.top
    margin-bottom: 5
    margin-right: 1
    size: 16 16
    @onClick: removeCurrentTab()

    $hover !disabled:
      image-clip: 0 48 16 16

    $pressed:
      image-clip: 16 48 16 16

  TabButton
    id: channelsButton
    !tooltip: tr('Open new channel') .. ' (Ctrl+O)'
    image-source: /images/ui/console_buttons
    image-clip: 0 0 16 16
    anchors.right: ignoreButton.left
    anchors.bottom: consoleContentPanel.top
    margin-bottom: 5
    margin-right: 1
    size: 16 16
    @onClick: g_game.requestChannels()

    $hover !disabled:
      image-clip: 0 0 16 16

    $pressed:
      image-clip: 16 0 16 16

  TabButton
    id: ignoreButton
    !tooltip: tr('Ignore players')
    image-source: /images/ui/console_buttons
    image-clip: 0 32 16 16
    anchors.right: exivaOption.left
    anchors.bottom: consoleContentPanel.top
    margin-bottom: 5
    margin-right: 1
    size: 16 16
    @onClick: onClickIgnoreButton()

    $hover !disabled:
      image-clip: 0 32 16 16

    $pressed:
      image-clip: 16 32 16 16

  TabButton
    id: exivaOption
    image-clip: 16 64 16 16
    image-source: /images/ui/console_buttons
    anchors.right: readOnlyButton.left
    anchors.bottom: consoleContentPanel.top
    margin-bottom: 5
    margin-right: 5
    size: 16 16
    @onClick: |
      if self:isOn() then
        modules.game_console.onRequestExivaOptions()
      end
    !tooltip: tr('Exiva Options are only available on Optional Pvp game worlds')
    $on:
      image-clip: 0 95 16 16
    $!on:
      image-clip: 32 95 16 16
    $pressed:
      image-clip: 16 95 16 16
    $pressed !on:
      image-clip: 32 95 16 16
    $disabled:
      image-clip: 32 95 16 16
      
  UIButton
    id: readOnlyButton
    text: ""
    anchors.right: parent.right
    anchors.top: parent.top
    margin-right: 5
    size: 96 18
    image-clip: 0 0 96 18
    icon: /images/game/console/readOnly
    color: #dfdfdfff
    font: verdana-11px-rounded
    padding: 5
    tab-spacing: 0
    &tabWidth: 95
    padding-left: 20
    padding-right: 20
    $checked:
      image-clip: 0 0 96 18
      color: #dfdfdfff

    $on !checked:
      image-clip: 0 0 96 18
      color: #dfdfdfff

  UIButton
    id: sayModeButton
    anchors.left: parent.left
    anchors.bottom: parent.bottom
    margin-bottom: 4
    margin-left: 5
    size: 18 18
    image-source: /images/ui/console_say
    image-clip: 0 0 18 18
    !tooltip: tr('Set talk type')
    &sayMode: 2
    @onClick: sayModeChange()

    $pressed:
      image-clip: 18 0 18 18

    $hover !disabled:
      image-clip: 0 0 18 18

  TextEdit
    id: consoleTextEdit
    anchors.left: sayModeButton.right
    anchors.right: wasdBox.left
    anchors.bottom: parent.bottom
    margin-right: 5
    margin-left: 5
    margin-bottom: 3
    shift-navigation: true
    max-length: 255
    height: 18
    placeholder:  "Type here to chat"
    placeholder-color: #707070
    @onTextChange: onTextChange(self:getText())

  CheckBox
    id: wasdBox
    anchors.right: parent.right
    anchors.bottom: parent.bottom
    margin-right: 6
    margin-bottom: 5
    width: 60
    height: 16
    !text: tr('WASD')
    !tooltip: tr('Marcado: anda com WASD (Q E Z C nas diagonais).\nDesmarcado: anda nas setas.\nCom WASD ligado as letras movem - aperte Enter para conversar.')

  TopToggleButton
    id: toggleChat
    visible: false
    anchors.right: parent.right
    anchors.bottom: parent.bottom
    margin-bottom: 3
    margin-right: 3
    size: 64 18
    color: #c0c0c0ff
    font: cipsoftFont
    !text: tr('Chat Off')
    &isChecked: false
    @onClick: toggleChat()
