• 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!

HOW TO CREATE NEW BUTTON IN OTCV8

lordposei

New Member
Joined
Jan 18, 2011
Messages
16
Reaction score
2
I have a task module, but I can't add a new button in the coordinates of the image that I'll leave here, is there a way to run the module by some command? I'm trying to add a task system per module, which I'll leave the file here in the post

tasks.otui
Code:
MiniPanel < Panel
  text-offset: 0 3
  text-align: top
  image-source: /images/ui/minipanel
  image-border: 2
  image-border-top: 19
  padding-left: 7
  padding-bottom: 7
  padding-top: 24
  padding-right: 7

SelectionButton < Panel
  image-source: /images/ui/button
  image-color: #dfdfdf
  image-clip: 0 0 22 23
  image-border: 3
  border: 1 alpha
  focusable: true
  phantom: false

  $hover:
    border: 1 white

  $focus:
    border: 1 white
    image-color: #ffffff

  Panel
    id: progress
    image-source: /images/ui/panel_flat
    image-color: #00ff00
    margin-left: 1
    margin-top: 1
    anchors.top: parent.top
    anchors.left: parent.left
    size: 159 158

  UICreature
    id: creature
    anchors.centerIn: parent
    size: 90 90
    margin-bottom: 17
    phantom: true
    anchors.verticalCenter: prev.verticalCenter

  Label
    id: name
    anchors.bottom: creature.top
    anchors.left: parent.left
    anchors.right: parent.right
    margin-top: -7
    text-align: top
    text-wrap: true
    text-border: 5 black

  Label
    id: kills
    anchors.top: creature.bottom
    anchors.left: parent.left
    anchors.right: parent.right
    text-align: center
    margin-top: 5
    text-wrap: true

  Label
    id: reward
    anchors.top: prev.bottom
    anchors.left: parent.left
    anchors.right: parent.right
    text-align: center
    margin-top: 2
    text-wrap: true

  Label
    id: rewardTaskPoints
    anchors.top: prev.bottom
    anchors.left: parent.left
    anchors.right: parent.right
    text-align: center
    margin-top: 3
    text-wrap: true

MainWindow
  height: ????
  id: tasksWindow
  !text: tr('Tasks')
  &save: true
  &autoOpen: 10

  @onEnter: modules.game_tasks.toggleWindow()
  @onEscape: modules.game_tasks.toggleWindow()

  MiniPanel
    id: listSearch
    anchors.top: parent.top
    anchors.left: parent.left
    anchors.right: parent.right
    margin-left: 5
    height: 50
    text: Filter

    TextEdit
      id: search
      anchors.fill: parent
      placeholder: Search by name

  ScrollablePanel
    id: selectionList
    anchors.top: listSearch.bottom
    anchors.left: listSearch.left
    anchors.right: parent.right
    anchors.bottom: separator.top
    margin-top: 5
    margin-bottom: 5
    image-source: /images/ui/panel_flat
    image-border: 1
    padding: 4
    padding-right: 16
    vertical-scrollbar: selectionScroll
    layout:
      type: grid
      cell-size: 160 160
      cell-spacing: 2
      flow: true

  VerticalScrollBar
    id: selectionScroll
    anchors.top: prev.top
    anchors.right: prev.right
    anchors.bottom: prev.bottom
    step: 80
    pixel-scroll: true

  HorizontalSeparator
    id: separator
    anchors.bottom: parent.bottom
    anchors.left: parent.left
    anchors.right: parent.right
    margin-bottom: 30

  Label
    id: info
    anchors.top: separator.top
    anchors.left: parent.left
    width: 140
    height: 45
    text-align: center
    text-wrap: true

  Button
    id: toggleButton
    anchors.bottom: parent.bottom
    anchors.right: parent.right
    text: Close
    width: 65
    @onClick: modules.game_tasks.toggleWindow()

  Button
    id: finishButton
    anchors.bottom: parent.bottom
    anchors.right: toggleButton.left
    text: Finish
    width: 55
    margin-right: 5
    @onClick: modules.game_tasks.finish()

  Button
    id: startButton
    anchors.bottom: parent.bottom
    anchors.right: toggleButton.left
    text: Start
    width: 55
    margin-right: 5
    @onClick: modules.game_tasks.start()

  Button
    id: abortButton
    anchors.bottom: parent.bottom
    anchors.right: toggleButton.left
    text: Abort
    width: 55
    margin-right: 5
    @onClick: modules.game_tasks.abort()

  ResizeBorder
    anchors.right: parent.right
    anchors.top: parent.top
    anchors.bottom: parent.bottom
    enabled: true
    minimum: 190
window.png
 

Attachments

it is unnecessary to create anything.
register it in interface.otmod and then compile.
 
@Gubailovo do i need to set the tasksystem.lua file from the data/scripts folder somewhere?
Post automatically merged:

I managed to resolve the above error, now I have another one that is not counting on kill, I am using nekiro downgrade tfs 1.5

nao conta task.png

I forgot to add
player:registerEvent("TaskKill")
in login.lua
 
Last edited:
Back
Top