Implemented the mount interface, Fixed some interface stuff, Some cosmetics, and Updated the outfits window
* Added new arrow buttons. * Fixed the vertical separator. * Added new game_playermount module to handle player mounting. * Moved the battle icons to /images. * Outfit window accommodates for mounts, loads addons more efficiently and keeps addons set on update, added new Outfit.randomize function that allows you to randomize your outfit colors, and set up a new layout.
BIN
modules/client_skins/skins/default/images/arrow_down.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
modules/client_skins/skins/default/images/arrow_left.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
modules/client_skins/skins/default/images/arrow_right.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
modules/client_skins/skins/default/images/arrow_up.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
modules/client_skins/skins/default/images/vertical_separator.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
@@ -38,4 +38,4 @@ TabButton < UIButton
|
||||
|
||||
$on:
|
||||
image-clip: 0 40 20 20
|
||||
color: #80c7f8
|
||||
color: #80c7f8
|
||||
|
@@ -6,7 +6,7 @@ HorizontalSeparator < UIWidget
|
||||
focusable: false
|
||||
|
||||
VerticalSeparator < UIWidget
|
||||
image-source: /images/horizontal_separator.png
|
||||
image-source: /images/vertical_separator.png
|
||||
image-border-left: 2
|
||||
width: 2
|
||||
phantom: true
|
||||
|
@@ -35,7 +35,7 @@ end
|
||||
function g_mouse.bindAutoPress(widget, callback, delay, button)
|
||||
local button = button or MouseLeftButton
|
||||
connect(widget, { onMousePress = function(widget, mousePos, mouseButton)
|
||||
if(mouseButton ~= button) then
|
||||
if mouseButton ~= button then
|
||||
return false
|
||||
end
|
||||
local startTime = g_clock.millis()
|
||||
|
@@ -31,6 +31,7 @@ Module
|
||||
- game_bugreport
|
||||
- game_shaders
|
||||
- game_playerdeath
|
||||
- game_playermount
|
||||
|
||||
@onLoad: |
|
||||
dofile 'const'
|
||||
|
@@ -84,10 +84,10 @@ function Battle.terminate()
|
||||
mouseWidget:destroy()
|
||||
mouseWidget = nil
|
||||
|
||||
disconnect(Creature, { onSkullChange = Battle.checkCreatureSkull,
|
||||
disconnect(Creature, { onSkullChange = Battle.checkCreatureSkull,
|
||||
onEmblemChange = Battle.checkCreatureEmblem } )
|
||||
|
||||
disconnect(g_game, { onAttackingCreatureChange = Battle.onAttack } )
|
||||
disconnect(g_game, { onAttackingCreatureChange = Battle.onAttack } )
|
||||
|
||||
Battle = nil
|
||||
end
|
||||
@@ -191,7 +191,7 @@ function Battle.addCreature(creature)
|
||||
local creatureId = creature:getId()
|
||||
|
||||
if battleButtonsByCreaturesList[creatureId] == nil then
|
||||
local battleButton = g_ui.loadUI('battleButton.otui', battlePanel)
|
||||
local battleButton = g_ui.loadUI('battlebutton.otui', battlePanel)
|
||||
local creatureWidget = battleButton:getChildById('creature')
|
||||
local labelWidget = battleButton:getChildById('label')
|
||||
local lifeBarWidget = battleButton:getChildById('lifeBar')
|
||||
|
@@ -22,19 +22,19 @@ BattleIcon < UICheckBox
|
||||
image-color: #ffffff88
|
||||
|
||||
BattlePlayers < BattleIcon
|
||||
image-source: /game_battle/battle_players.png
|
||||
image-source: /game_battle/images/battle_players.png
|
||||
|
||||
BattleNPCs < BattleIcon
|
||||
image-source: /game_battle/battle_npcs.png
|
||||
image-source: /game_battle/images/battle_npcs.png
|
||||
|
||||
BattleMonsters < BattleIcon
|
||||
image-source: /game_battle/battle_monsters.png
|
||||
image-source: /game_battle/images/battle_monsters.png
|
||||
|
||||
BattleSkulls < BattleIcon
|
||||
image-source: /game_battle/battle_skulls.png
|
||||
image-source: /game_battle/images/battle_skulls.png
|
||||
|
||||
BattleParty < BattleIcon
|
||||
image-source: /game_battle/battle_party.png
|
||||
image-source: /game_battle/images/battle_party.png
|
||||
|
||||
MiniWindow
|
||||
id: battleWindow
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
@@ -117,15 +117,15 @@ function GameInterface.show()
|
||||
end
|
||||
|
||||
function GameInterface.hide()
|
||||
if(logoutWindow) then
|
||||
if logoutWindow then
|
||||
logoutWindow:destroy()
|
||||
logoutWindow = nil
|
||||
end
|
||||
if(exitWindow) then
|
||||
if exitWindow then
|
||||
exitWindow:destroy()
|
||||
exitWindow = nil
|
||||
end
|
||||
if(countWindow) then
|
||||
if countWindow then
|
||||
countWindow:destroy()
|
||||
countWindow = nil
|
||||
end
|
||||
@@ -144,7 +144,7 @@ function GameInterface.exit()
|
||||
end
|
||||
|
||||
function GameInterface.tryExit()
|
||||
if(exitWindow) then
|
||||
if exitWindow then
|
||||
return true
|
||||
end
|
||||
exitWindow = g_ui.createWidget('ExitWindow', rootWidget)
|
||||
@@ -183,7 +183,7 @@ function GameInterface.logout()
|
||||
end
|
||||
|
||||
function GameInterface.tryLogout()
|
||||
if(logoutWindow) then
|
||||
if logoutWindow then
|
||||
return
|
||||
end
|
||||
logoutWindow = g_ui.createWidget('LogoutWindow', rootWidget)
|
||||
|
@@ -1,5 +1,8 @@
|
||||
Minimap = {}
|
||||
|
||||
-- public variables
|
||||
minimapFirstLoad = true
|
||||
|
||||
-- private variables
|
||||
local minimapWidget
|
||||
local minimapButton
|
||||
@@ -8,7 +11,6 @@ local DEFAULT_ZOOM = 60
|
||||
local MAX_FLOOR_UP = 0
|
||||
local MAX_FLOOR_DOWN = 15
|
||||
local navigating = false
|
||||
minimapFirstLoad = true
|
||||
|
||||
-- private functions
|
||||
function onMinimapMouseRelease(self, mousePosition, mouseButton)
|
||||
@@ -54,9 +56,9 @@ function Minimap.init()
|
||||
|
||||
minimapWindow = g_ui.loadUI('minimap.otui', GameInterface.getRightPanel())
|
||||
|
||||
|
||||
minimapWidget = minimapWindow:recursiveGetChildById('minimap')
|
||||
g_mouse.bindAutoPress(minimapWidget, Minimap.compassClick, nil, MouseRightButton)
|
||||
g_mouse.bindAutoPress(minimapWidget, Minimap.compassClick, nil, MouseLeftButton)
|
||||
minimapWidget:setAutoViewMode(false)
|
||||
minimapWidget:setViewMode(1) -- mid view
|
||||
minimapWidget:setDrawMinimapColors(true)
|
||||
@@ -150,13 +152,13 @@ function Minimap.onButtonClick(id)
|
||||
elseif id == "floorUp" then
|
||||
local pos = minimapWidget:getCameraPosition()
|
||||
pos.z = pos.z - 1
|
||||
if(pos.z > MAX_FLOOR_UP) then
|
||||
if pos.z > MAX_FLOOR_UP then
|
||||
minimapWidget:setCameraPosition(pos)
|
||||
end
|
||||
elseif id == "floorDown" then
|
||||
local pos = minimapWidget:getCameraPosition()
|
||||
pos.z = pos.z + 1
|
||||
if(pos.z < MAX_FLOOR_DOWN) then
|
||||
if pos.z < MAX_FLOOR_DOWN then
|
||||
minimapWidget:setCameraPosition(pos)
|
||||
end
|
||||
end
|
||||
|
@@ -1,5 +1,6 @@
|
||||
MapControl < Button
|
||||
size: 20 20
|
||||
icon-clip: 0 32 16 16
|
||||
|
||||
$pressed:
|
||||
icon-clip: 0 0 16 16
|
||||
@@ -7,19 +8,16 @@ MapControl < Button
|
||||
$hover !pressed:
|
||||
icon-clip: 0 16 16 16
|
||||
|
||||
$!pressed !hover:
|
||||
icon-clip: 0 32 16 16
|
||||
|
||||
FloorUpControl < MapControl
|
||||
icon-source: /game_minimap/floor_up.png
|
||||
|
||||
FloorDownControl < MapControl
|
||||
icon-source: /game_minimap/floor_down.png
|
||||
|
||||
//ZoomOutControl < MapControl
|
||||
ZoomOutControl < MapControl
|
||||
//image-source: /game_minimap/zoom_out.png
|
||||
|
||||
//ZoomInControl < MapControl
|
||||
ZoomInControl < MapControl
|
||||
//image-source: /game_minimap/zoom_in.png
|
||||
|
||||
MiniWindow
|
||||
@@ -64,10 +62,9 @@ MiniWindow
|
||||
enabled: true
|
||||
@onClick: Minimap.onButtonClick(self:getId())
|
||||
|
||||
Button
|
||||
ZoomInControl
|
||||
id: zoomIn
|
||||
text: +
|
||||
size: 20 20
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
margin-right: 4
|
||||
@@ -75,11 +72,10 @@ MiniWindow
|
||||
enabled: true
|
||||
@onClick: Minimap.onButtonClick(self:getId())
|
||||
|
||||
Button
|
||||
ZoomOutControl
|
||||
id: zoomOut
|
||||
text: -
|
||||
font: terminus-14px-bold
|
||||
size: 20 20
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
margin-right: 4
|
||||
|
@@ -1,13 +1,30 @@
|
||||
Outfit = {}
|
||||
|
||||
-- private variables
|
||||
local addonSets = {
|
||||
[1] = { 1 },
|
||||
[2] = { 2 },
|
||||
[3] = { 1, 2 },
|
||||
[4] = { 3 },
|
||||
[5] = { 1, 3 },
|
||||
[6] = { 2, 3 },
|
||||
[7] = { 1, 2, 3 }
|
||||
}
|
||||
local outfitWindow
|
||||
local outfitCreature
|
||||
local outfit
|
||||
local outfits
|
||||
local outfitCreature
|
||||
local currentOutfit = 1
|
||||
|
||||
local addons
|
||||
local currentColorBox
|
||||
local currentClotheButtonBox
|
||||
local colorBoxes = {}
|
||||
|
||||
local mount
|
||||
local mounts
|
||||
local mountCreature
|
||||
local currentMount = 1
|
||||
|
||||
-- private functions
|
||||
local function onAddonCheckChange(addon, value)
|
||||
@@ -71,51 +88,50 @@ local function onClotheCheckChange(clotheButtonBox)
|
||||
end
|
||||
end
|
||||
|
||||
local function update()
|
||||
local function updateOutfit()
|
||||
if table.empty(outfits) then
|
||||
return
|
||||
end
|
||||
local nameWidget = outfitWindow:getChildById('outfitName')
|
||||
nameWidget:setText(outfits[currentOutfit][2])
|
||||
|
||||
local availableAddons = outfits[currentOutfit][3]
|
||||
local addon1 = outfitWindow:getChildById('addon1')
|
||||
local addon2 = outfitWindow:getChildById('addon2')
|
||||
local addon3 = outfitWindow:getChildById('addon3')
|
||||
addon1:setChecked(false)
|
||||
addon2:setChecked(false)
|
||||
addon3:setChecked(false)
|
||||
addon1.onCheckChange = function(self) onAddonCheckChange(self, 1) end
|
||||
addon2.onCheckChange = function(self) onAddonCheckChange(self, 2) end
|
||||
addon3.onCheckChange = function(self) onAddonCheckChange(self, 4) end
|
||||
addon1:setEnabled(false)
|
||||
addon2:setEnabled(false)
|
||||
addon3:setEnabled(false)
|
||||
|
||||
-- Maybe rework this someday
|
||||
if availableAddons == 1 then
|
||||
addon1:setEnabled(true)
|
||||
elseif availableAddons == 2 then
|
||||
addon2:setEnabled(true)
|
||||
elseif availableAddons == 3 then
|
||||
addon1:setEnabled(true)
|
||||
addon2:setEnabled(true)
|
||||
elseif availableAddons == 4 then
|
||||
addon3:setEnabled(true)
|
||||
elseif availableAddons == 5 then
|
||||
addon1:setEnabled(true)
|
||||
addon3:setEnabled(true)
|
||||
elseif availableAddons == 6 then
|
||||
addon2:setEnabled(true)
|
||||
addon3:setEnabled(true)
|
||||
elseif availableAddons == 7 then
|
||||
addon1:setEnabled(true)
|
||||
addon2:setEnabled(true)
|
||||
addon3:setEnabled(true)
|
||||
local prevAddons = {}
|
||||
for k, addon in pairs(addons) do
|
||||
prevAddons[k] = addon.widget:isChecked()
|
||||
addon.widget:setChecked(false)
|
||||
addon.widget:setEnabled(false)
|
||||
end
|
||||
|
||||
if availableAddons > 0 then
|
||||
for _, i in pairs(addonSets[availableAddons]) do
|
||||
addons[i].widget:setEnabled(true)
|
||||
end
|
||||
end
|
||||
|
||||
outfit.addons = 0
|
||||
for k, addon in pairs(prevAddons) do
|
||||
if addon and addons[k].widget:isEnabled() then
|
||||
addons[k].widget:setChecked(true)
|
||||
end
|
||||
end
|
||||
|
||||
outfit.type = outfits[currentOutfit][1]
|
||||
outfit.addons = 0
|
||||
outfitCreature:setOutfit(outfit)
|
||||
end
|
||||
|
||||
function updateMount()
|
||||
if table.empty(mounts) then
|
||||
return
|
||||
end
|
||||
local nameMountWidget = outfitWindow:getChildById('mountName')
|
||||
nameMountWidget:setText(mounts[currentMount][2])
|
||||
|
||||
mount.type = mounts[currentMount][1]
|
||||
mountCreature:setOutfit(mount)
|
||||
end
|
||||
|
||||
-- public functions
|
||||
function Outfit.init()
|
||||
connect(g_game, { onOpenOutfitWindow = Outfit.create,
|
||||
@@ -126,20 +142,36 @@ function Outfit.terminate()
|
||||
disconnect(g_game, { onOpenOutfitWindow = Outfit.create,
|
||||
onGameEnd = Outfit.destroy })
|
||||
Outfit.destroy()
|
||||
|
||||
Outfit = nil
|
||||
end
|
||||
|
||||
function Outfit.create(creature, outfitList)
|
||||
outfitCreature = creature
|
||||
function Outfit.create(creatureOutfit, outfitList, creatureMount, mountList)
|
||||
outfitCreature = creatureOutfit
|
||||
mountCreature = creatureMount
|
||||
outfits = outfitList
|
||||
Outfit.destroy()
|
||||
|
||||
outfitWindow = g_ui.displayUI('outfit.otui')
|
||||
--outfitWindow:lock()
|
||||
mounts = mountList
|
||||
Outfit.destroy()
|
||||
|
||||
outfitWindow = g_ui.displayUI('outfitwindow.otui')
|
||||
outfit = outfitCreature:getOutfit()
|
||||
|
||||
mount = mountCreature:getOutfit()
|
||||
|
||||
addons = {
|
||||
[1] = {widget = outfitWindow:getChildById('addon1'), value = 1},
|
||||
[2] = {widget = outfitWindow:getChildById('addon2'), value = 2},
|
||||
[3] = {widget = outfitWindow:getChildById('addon3'), value = 4}
|
||||
}
|
||||
|
||||
for k, addon in pairs(addons) do
|
||||
addon.widget.onCheckChange = function(self) onAddonCheckChange(self, addon.value) end
|
||||
end
|
||||
|
||||
if outfit.addons > 0 then
|
||||
for _, i in pairs(addonSets[outfit.addons]) do
|
||||
addons[i].widget:setChecked(true)
|
||||
end
|
||||
end
|
||||
|
||||
currentClotheButtonBox = outfitWindow:getChildById('head')
|
||||
outfitWindow:getChildById('head').onCheckChange = onClotheCheckChange
|
||||
outfitWindow:getChildById('primary').onCheckChange = onClotheCheckChange
|
||||
@@ -150,6 +182,9 @@ function Outfit.create(creature, outfitList)
|
||||
local colorBoxPanel = outfitWindow:getChildById('colorBoxPanel')
|
||||
outfitCreatureBox:setCreature(outfitCreature)
|
||||
|
||||
local mountCreatureBox = outfitWindow:getChildById('mountCreatureBox')
|
||||
mountCreatureBox:setCreature(mountCreature)
|
||||
|
||||
for j=0,6 do
|
||||
for i=0,18 do
|
||||
local colorBox = g_ui.createWidget('ColorBox', colorBoxPanel)
|
||||
@@ -163,6 +198,7 @@ function Outfit.create(creature, outfitList)
|
||||
colorBox:setChecked(true)
|
||||
end
|
||||
colorBox.onCheckChange = onColorCheckChange
|
||||
table.insert(colorBoxes, colorBox)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -173,8 +209,16 @@ function Outfit.create(creature, outfitList)
|
||||
break
|
||||
end
|
||||
end
|
||||
currentMount = 1
|
||||
for i=1,#mountList do
|
||||
if mountList[i][1] == mount.type then
|
||||
currentMount = i
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
update()
|
||||
updateOutfit()
|
||||
updateMount()
|
||||
end
|
||||
|
||||
function Outfit.destroy()
|
||||
@@ -182,29 +226,62 @@ function Outfit.destroy()
|
||||
outfitWindow:destroy()
|
||||
outfitWindow = nil
|
||||
outfitCreature = nil
|
||||
mountCreature = nil
|
||||
currentColorBox = nil
|
||||
currentClotheButtonBox = nil
|
||||
end
|
||||
end
|
||||
|
||||
function Outfit.randomize()
|
||||
local outfitTemplate = {
|
||||
outfitWindow:getChildById('head'),
|
||||
outfitWindow:getChildById('primary'),
|
||||
outfitWindow:getChildById('secondary'),
|
||||
outfitWindow:getChildById('detail')
|
||||
}
|
||||
|
||||
for k, section in pairs(outfitTemplate) do
|
||||
section:setChecked(true)
|
||||
colorBoxes[math.random(1, #colorBoxes)]:setChecked(true)
|
||||
section:setChecked(false)
|
||||
end
|
||||
outfitTemplate[1]:setChecked(true)
|
||||
end
|
||||
|
||||
function Outfit.accept()
|
||||
outfit.mount = mount.type
|
||||
g_game.changeOutfit(outfit)
|
||||
Outfit.destroy()
|
||||
end
|
||||
|
||||
function Outfit.nextType()
|
||||
function Outfit.nextOutfitType()
|
||||
currentOutfit = currentOutfit + 1
|
||||
if currentOutfit > #outfits then
|
||||
currentOutfit = 1
|
||||
end
|
||||
update()
|
||||
updateOutfit()
|
||||
end
|
||||
|
||||
function Outfit.previousType()
|
||||
function Outfit.previousOutfitType()
|
||||
currentOutfit = currentOutfit - 1
|
||||
if currentOutfit <= 0 then
|
||||
currentOutfit = #outfits
|
||||
end
|
||||
update()
|
||||
updateOutfit()
|
||||
end
|
||||
|
||||
function Outfit.nextMountType()
|
||||
currentMount = currentMount + 1
|
||||
if currentMount > #mounts then
|
||||
currentMount = 1
|
||||
end
|
||||
updateMount()
|
||||
end
|
||||
|
||||
function Outfit.previousMountType()
|
||||
currentMount = currentMount - 1
|
||||
if currentMount <= 0 then
|
||||
currentMount = #mounts
|
||||
end
|
||||
updateMount()
|
||||
end
|
||||
|
@@ -1,145 +0,0 @@
|
||||
Window
|
||||
!text: tr('Select Outfit')
|
||||
size: 550 280
|
||||
padding: 0 0 0 0
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
@onEnter: Outfit.accept()
|
||||
@onEscape: Outfit.destroy()
|
||||
|
||||
Label
|
||||
id: outfitName
|
||||
!text: tr('Outfit Name')
|
||||
width: 100
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
margin-top: 34
|
||||
margin-left: 20
|
||||
|
||||
Creature
|
||||
id: outfitCreatureBox
|
||||
anchors.top: outfitName.bottom
|
||||
anchors.left: outfitName.left
|
||||
margin-top: 5
|
||||
padding: 4 4 4 4
|
||||
fixed-creature-size: true
|
||||
|
||||
Panel
|
||||
id: colorBoxPanel
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
margin-top: 54
|
||||
margin-right: 20
|
||||
width: 323
|
||||
height: 119
|
||||
layout:
|
||||
type: grid
|
||||
cell-size: 16 16
|
||||
cell-spacing: 2
|
||||
num-columns: 19
|
||||
num-lines: 7
|
||||
|
||||
ButtonBox
|
||||
id: head
|
||||
!text: tr('Head')
|
||||
anchors.top: outfitCreatureBox.top
|
||||
anchors.left: outfitCreatureBox.right
|
||||
margin-left: 10
|
||||
checked: true
|
||||
width: 90
|
||||
|
||||
ButtonBox
|
||||
id: primary
|
||||
!text: tr('Primary')
|
||||
anchors.top: prev.bottom
|
||||
anchors.left: prev.left
|
||||
width: 90
|
||||
|
||||
ButtonBox
|
||||
id: secondary
|
||||
!text: tr('Secondary')
|
||||
anchors.top: prev.bottom
|
||||
anchors.left: prev.left
|
||||
width: 90
|
||||
|
||||
ButtonBox
|
||||
id: detail
|
||||
!text: tr('Detail')
|
||||
anchors.top: prev.bottom
|
||||
anchors.left: prev.left
|
||||
width: 90
|
||||
|
||||
Button
|
||||
id: outfitNextButton
|
||||
@onClick: Outfit.nextType()
|
||||
text: >>
|
||||
width: 32
|
||||
margin-top: 4
|
||||
anchors.top: outfitCreatureBox.bottom
|
||||
anchors.right: outfitCreatureBox.right
|
||||
|
||||
Button
|
||||
id: outfitPreviousButton
|
||||
@onClick: Outfit.previousType()
|
||||
text: <<
|
||||
width: 32
|
||||
margin-top: 4
|
||||
anchors.top: outfitCreatureBox.bottom
|
||||
anchors.left: outfitCreatureBox.left
|
||||
|
||||
CheckBox
|
||||
id: addon1
|
||||
!text: tr('Addon 1')
|
||||
enabled: false
|
||||
margin-top: 6
|
||||
width: 100
|
||||
anchors.top: prev.bottom
|
||||
anchors.left: prev.left
|
||||
|
||||
CheckBox
|
||||
id: addon2
|
||||
!text: tr('Addon 2')
|
||||
enabled: false
|
||||
margin-top: 2
|
||||
width: 100
|
||||
anchors.top: prev.bottom
|
||||
anchors.left: prev.left
|
||||
|
||||
CheckBox
|
||||
id: addon3
|
||||
!text: tr('Addon 3')
|
||||
enabled: false
|
||||
margin-top: 2
|
||||
width: 100
|
||||
anchors.top: prev.bottom
|
||||
anchors.left: prev.left
|
||||
|
||||
HorizontalSeparator
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: next.top
|
||||
margin-left: 16
|
||||
margin-right: 16
|
||||
margin-bottom: 10
|
||||
|
||||
Button
|
||||
id: outfitOkButton
|
||||
!text: tr('Ok')
|
||||
width: 64
|
||||
anchors.right: next.left
|
||||
anchors.bottom: parent.bottom
|
||||
margin-bottom: 16
|
||||
margin-right: 16
|
||||
@onClick: Outfit.accept()
|
||||
|
||||
Button
|
||||
id: outfitCancelButton
|
||||
!text: tr('Cancel')
|
||||
width: 64
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
margin-bottom: 16
|
||||
margin-right: 16
|
||||
@onClick: Outfit.destroy()
|
221
modules/game_outfit/outfitwindow.otui
Normal file
@@ -0,0 +1,221 @@
|
||||
BrowseButton < Button
|
||||
size: 20 29
|
||||
icon-clip: 0 0 12 21
|
||||
|
||||
$hover !disabled:
|
||||
icon-clip: 0 21 12 21
|
||||
|
||||
$pressed:
|
||||
icon-clip: 0 22 12 21
|
||||
|
||||
$disabled:
|
||||
color: #f0ad4d88
|
||||
|
||||
NextOutfitButton < BrowseButton
|
||||
icon-source: /images/arrow_right.png
|
||||
|
||||
PrevOutfitButton < BrowseButton
|
||||
icon-source: /images/arrow_left.png
|
||||
|
||||
NextMountButton < BrowseButton
|
||||
icon-source: /images/arrow_right.png
|
||||
|
||||
PrevMountButton < BrowseButton
|
||||
icon-source: /images/arrow_left.png
|
||||
|
||||
Window
|
||||
!text: tr('Select Outfit')
|
||||
size: 338 375
|
||||
padding: 0 0 0 0
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
@onEnter: Outfit.accept()
|
||||
@onEscape: Outfit.destroy()
|
||||
|
||||
// Creature Boxes
|
||||
|
||||
Creature
|
||||
id: outfitCreatureBox
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
margin-top: 48
|
||||
margin-left: 40
|
||||
padding: 4 4 4 4
|
||||
fixed-creature-size: true
|
||||
|
||||
Label
|
||||
id: outfitName
|
||||
!text: tr('No Outfit')
|
||||
width: 100
|
||||
anchors.bottom: prev.top
|
||||
anchors.left: prev.left
|
||||
margin-bottom: 2
|
||||
|
||||
NextOutfitButton
|
||||
id: outfitNextButton
|
||||
anchors.left: outfitCreatureBox.right
|
||||
anchors.verticalCenter: outfitCreatureBox.verticalCenter
|
||||
margin-left: 3
|
||||
enabled: true
|
||||
@onClick: Outfit.nextOutfitType()
|
||||
|
||||
PrevOutfitButton
|
||||
id: outfitPrevButton
|
||||
anchors.right: outfitCreatureBox.left
|
||||
anchors.verticalCenter: outfitCreatureBox.verticalCenter
|
||||
margin-right: 3
|
||||
enabled: true
|
||||
@onClick: Outfit.previousOutfitType()
|
||||
|
||||
Creature
|
||||
id: mountCreatureBox
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
margin-top: 48
|
||||
margin-right: 40
|
||||
padding: 4 4 4 4
|
||||
fixed-creature-size: true
|
||||
|
||||
Label
|
||||
id: mountName
|
||||
!text: tr('No Mount')
|
||||
width: 140
|
||||
anchors.bottom: prev.top
|
||||
anchors.left: prev.left
|
||||
margin-bottom: 2
|
||||
|
||||
NextMountButton
|
||||
id: mountNextButton
|
||||
anchors.left: mountCreatureBox.right
|
||||
anchors.verticalCenter: mountCreatureBox.verticalCenter
|
||||
margin-left: 3
|
||||
enabled: true
|
||||
@onClick: Outfit.nextMountType()
|
||||
|
||||
PrevMountButton
|
||||
id: mountPreviousButton
|
||||
anchors.right: mountCreatureBox.left
|
||||
anchors.verticalCenter: mountCreatureBox.verticalCenter
|
||||
margin-right: 3
|
||||
enabled: true
|
||||
@onClick: Outfit.previousMountType()
|
||||
|
||||
// Addon Check Boxes
|
||||
|
||||
CheckBox
|
||||
id: addon1
|
||||
!text: tr('Addon 1')
|
||||
width: 80
|
||||
anchors.top: outfitCreatureBox.bottom
|
||||
anchors.left: parent.left
|
||||
margin-top: 6
|
||||
margin-left: 18
|
||||
enabled: false
|
||||
|
||||
CheckBox
|
||||
id: addon2
|
||||
!text: tr('Addon 2')
|
||||
width: 80
|
||||
anchors.top: prev.top
|
||||
anchors.left: prev.right
|
||||
enabled: false
|
||||
|
||||
CheckBox
|
||||
id: addon3
|
||||
!text: tr('Addon 3')
|
||||
width: 80
|
||||
anchors.top: prev.top
|
||||
anchors.left: prev.right
|
||||
enabled: false
|
||||
|
||||
// Body Selection Buttons
|
||||
|
||||
ButtonBox
|
||||
id: head
|
||||
!text: tr('Head')
|
||||
anchors.top: addon1.bottom
|
||||
anchors.left: addon1.left
|
||||
margin-top: 5
|
||||
checked: true
|
||||
width: 76
|
||||
|
||||
ButtonBox
|
||||
id: primary
|
||||
!text: tr('Primary')
|
||||
anchors.top: prev.top
|
||||
anchors.left: prev.right
|
||||
width: 76
|
||||
|
||||
ButtonBox
|
||||
id: secondary
|
||||
!text: tr('Secondary')
|
||||
anchors.top: prev.top
|
||||
anchors.left: prev.right
|
||||
width: 76
|
||||
|
||||
ButtonBox
|
||||
id: detail
|
||||
!text: tr('Detail')
|
||||
anchors.top: prev.top
|
||||
anchors.left: prev.right
|
||||
width: 76
|
||||
|
||||
// Color Panel
|
||||
|
||||
Panel
|
||||
id: colorBoxPanel
|
||||
anchors.top: head.bottom
|
||||
anchors.left: head.left
|
||||
margin-top: 3
|
||||
margin-right: 20
|
||||
width: 323
|
||||
height: 119
|
||||
layout:
|
||||
type: grid
|
||||
cell-size: 14 14
|
||||
cell-spacing: 2
|
||||
num-columns: 19
|
||||
num-lines: 7
|
||||
|
||||
// Action Button Section
|
||||
|
||||
Button
|
||||
id: randomizeButton
|
||||
!text: tr('Randomize')
|
||||
!tooltip: tr('Randomize characters outfit')
|
||||
width: 75
|
||||
anchors.left: prev.left
|
||||
anchors.top: prev.bottom
|
||||
margin-right: 16
|
||||
@onClick: Outfit.randomize()
|
||||
|
||||
HorizontalSeparator
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: next.top
|
||||
margin-left: 16
|
||||
margin-right: 16
|
||||
margin-bottom: 10
|
||||
margin-top: 5
|
||||
|
||||
Button
|
||||
id: outfitOkButton
|
||||
!text: tr('Okay')
|
||||
width: 64
|
||||
anchors.right: next.left
|
||||
anchors.bottom: parent.bottom
|
||||
margin-bottom: 16
|
||||
margin-right: 16
|
||||
@onClick: Outfit.accept()
|
||||
|
||||
Button
|
||||
id: outfitCancelButton
|
||||
!text: tr('Cancel')
|
||||
width: 64
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
margin-bottom: 16
|
||||
margin-right: 16
|
||||
@onClick: Outfit.destroy()
|
@@ -23,7 +23,7 @@ end
|
||||
|
||||
function PlayerDeath.reset()
|
||||
GameInterface.getMapPanel():recursiveGetChildById('centerAdvance'):hide()
|
||||
if(deathWindow) then
|
||||
if deathWindow then
|
||||
deathWindow:destroy()
|
||||
deathWindow = nil
|
||||
end
|
||||
@@ -44,7 +44,7 @@ function PlayerDeath.displayDeadMessage()
|
||||
end
|
||||
|
||||
function PlayerDeath.openWindow()
|
||||
if(deathWindow) then
|
||||
if deathWindow then
|
||||
return
|
||||
end
|
||||
deathWindow = g_ui.createWidget('DeathWindow', rootWidget)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
Module
|
||||
name: game_playerdeath
|
||||
description: Manage player deaths
|
||||
author: edubart, BeniS
|
||||
author: BeniS, edubart
|
||||
website: www.otclient.info
|
||||
|
||||
dependencies:
|
||||
|
38
modules/game_playermount/playermount.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
PlayerMount = {}
|
||||
|
||||
-- private variables
|
||||
|
||||
-- private functions
|
||||
|
||||
-- public functions
|
||||
function PlayerMount.init()
|
||||
g_ui.importStyle('playermount.otui')
|
||||
|
||||
connect(g_game, { onDeath = PlayerMount.dismount,
|
||||
onGameEnd = PlayerMount.dismount })
|
||||
|
||||
g_keyboard.bindKeyDown('Ctrl+R', PlayerMount.toggleMount, gameRootPanel)
|
||||
end
|
||||
|
||||
function PlayerMount.terminate()
|
||||
disconnect(g_game, { onDeath = PlayerMount.dismount,
|
||||
onGameEnd = PlayerMount.dismount })
|
||||
|
||||
g_keyboard.unbindKeyDown('Ctrl+R', PlayerMount.toggleMount, gameRootPanel)
|
||||
PlayerMount.reset()
|
||||
|
||||
PlayerMount = nil
|
||||
end
|
||||
|
||||
-- hooked events
|
||||
function PlayerMount.toggleMount()
|
||||
if g_game.isMounted() then
|
||||
g_game.mount(false)
|
||||
else
|
||||
g_game.mount(true)
|
||||
end
|
||||
end
|
||||
|
||||
function PlayerMount.dismount()
|
||||
g_game.mount(false)
|
||||
end
|
15
modules/game_playermount/playermount.otmod
Normal file
@@ -0,0 +1,15 @@
|
||||
Module
|
||||
name: game_playermount
|
||||
description: Manage player mounts
|
||||
author: BeniS
|
||||
website: www.otclient.info
|
||||
|
||||
dependencies:
|
||||
- client_entergame
|
||||
|
||||
@onLoad: |
|
||||
dofile 'playermount'
|
||||
PlayerMount.init()
|
||||
|
||||
@onUnload: |
|
||||
PlayerMount.terminate()
|
0
modules/game_playermount/playermount.otui
Normal file
@@ -5,7 +5,7 @@ local textWindow
|
||||
|
||||
-- private functions
|
||||
local function onGameEditText(id, itemId, maxLength, text, writter, time)
|
||||
if(textWindow) then
|
||||
if textWindow then
|
||||
return
|
||||
end
|
||||
textWindow = g_ui.createWidget('TextWindow', rootWidget)
|
||||
@@ -61,7 +61,7 @@ local function onGameEditText(id, itemId, maxLength, text, writter, time)
|
||||
end
|
||||
|
||||
local function onGameEditList(id, doorId, text)
|
||||
if(textWindow) then
|
||||
if textWindow then
|
||||
return
|
||||
end
|
||||
textWindow = g_ui.createWidget('TextWindow', rootWidget)
|
||||
@@ -105,7 +105,7 @@ function TextWindow.terminate()
|
||||
end
|
||||
|
||||
function TextWindow.destroy()
|
||||
if(textWindow) then
|
||||
if textWindow then
|
||||
textWindow:destroy()
|
||||
textWindow = nil
|
||||
end
|
||||
|