-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
97 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
testButton = nil | ||
testWindow = nil | ||
|
||
|
||
function init() | ||
-- Top left icon button | ||
testButton = modules.client_topmenu.addLeftToggleButton('testButton', tr('Test Button'), | ||
'/test/test/test', closing) | ||
testButton:setOn(false) | ||
|
||
testWindow = g_ui.displayUI('test') -- initiate the window ui | ||
testWindow:setVisible(false) -- dont shoe the window ui yet | ||
|
||
allTabs = testWindow:recursiveGetChildById('allTabs') | ||
allTabs:setContentWidget(testWindow:getChildById('optionsTabContent')) | ||
end | ||
|
||
function terminate() | ||
testButton:destroy() | ||
testWindow:destroy() | ||
end | ||
|
||
function closing() | ||
if testButton:isOn() then | ||
testWindow:setVisible(false) | ||
testButton:setOn(false) | ||
else | ||
testWindow:setVisible(true) | ||
testButton:setOn(true) | ||
end | ||
end | ||
|
||
|
||
function move() | ||
testButton:setPositionX(1) -- I'm lost here :) | ||
end | ||
|
||
function onMiniWindowClose() | ||
testButton:setOn(false) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Module | ||
name: test | ||
description: test | ||
author: mhnaufal | ||
website: - | ||
version: 1 | ||
|
||
autoload: true | ||
autoload-priority: 1000 | ||
sandboxed: true | ||
dependencies: [ game_interface ] | ||
scripts: [ test.lua ] | ||
@onLoad: init() | ||
@onUnload: terminate() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
MainWindow | ||
id: testMain | ||
!text: tr('test') | ||
size: 350 300 | ||
@onEscape: modules.test.closing() | ||
|
||
TabBar | ||
id: allTabs | ||
anchors.top: parent.top | ||
anchors.right: parent.right | ||
anchors.bottom: parent.bottom | ||
anchors.left: parent.left | ||
|
||
Panel | ||
id: optionsTabContent | ||
anchors.top: allTabs.top | ||
anchors.left: allTabs.left | ||
anchors.right: allTabs.right | ||
anchors.bottom: allTabs.bottom | ||
margin-top: 20 | ||
margin-bottom: 20 | ||
|
||
Button | ||
id: MovingButton | ||
!text: tr('MovingButton') | ||
width: 150 | ||
anchors.left: parent.left | ||
anchors.top: parent.top | ||
@onClick: modules.test.cake() | ||
|
||
Button | ||
id: closeButton | ||
!text: tr('Close') | ||
width: 200 | ||
anchors.left: parent.left | ||
anchors.bottom: parent.bottom | ||
@onClick: modules.test.closing() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters