mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 13:03:27 +02:00
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.
This commit is contained in:
38
modules/game_playermount/playermount.lua
Normal file
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
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
0
modules/game_playermount/playermount.otui
Normal file
Reference in New Issue
Block a user