2012-01-06 09:48:59 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2010-2012 OTClient <https://github.com/edubart/otclient>
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2011-12-03 22:41:37 +01:00
|
|
|
#include "otclient.h"
|
2011-08-15 16:11:24 +02:00
|
|
|
#include <framework/luascript/luainterface.h>
|
2011-12-03 22:41:37 +01:00
|
|
|
#include <otclient/luascript/luavaluecasts.h>
|
2011-08-26 20:00:22 +02:00
|
|
|
#include <otclient/core/game.h>
|
2011-08-29 16:14:21 +02:00
|
|
|
#include <otclient/core/tile.h>
|
|
|
|
#include <otclient/core/item.h>
|
2012-01-08 16:42:23 +01:00
|
|
|
#include <otclient/core/effect.h>
|
|
|
|
#include <otclient/core/missile.h>
|
|
|
|
#include <otclient/core/statictext.h>
|
|
|
|
#include <otclient/core/animatedtext.h>
|
2011-08-29 16:14:21 +02:00
|
|
|
#include <otclient/core/creature.h>
|
|
|
|
#include <otclient/core/player.h>
|
|
|
|
#include <otclient/core/localplayer.h>
|
|
|
|
#include <otclient/core/map.h>
|
2011-08-31 17:03:33 +02:00
|
|
|
#include <otclient/core/thingstype.h>
|
2011-08-15 21:15:49 +02:00
|
|
|
#include <otclient/core/spritemanager.h>
|
2011-08-15 16:11:24 +02:00
|
|
|
#include <otclient/net/protocollogin.h>
|
|
|
|
#include <otclient/net/protocolgame.h>
|
2011-11-10 06:29:25 +01:00
|
|
|
#include <otclient/ui/uiitem.h>
|
2011-11-14 23:32:55 +01:00
|
|
|
#include <otclient/ui/uicreature.h>
|
2011-08-29 05:04:23 +02:00
|
|
|
#include <otclient/ui/uimap.h>
|
2011-11-20 21:38:35 +01:00
|
|
|
#include <otclient/ui/uigame.h>
|
2011-11-16 08:20:14 +01:00
|
|
|
#include <otclient/core/outfit.h>
|
2011-08-15 16:11:24 +02:00
|
|
|
|
2012-01-13 00:47:31 +01:00
|
|
|
|
2011-08-15 16:11:24 +02:00
|
|
|
void OTClient::registerLuaFunctions()
|
|
|
|
{
|
2011-12-03 22:41:37 +01:00
|
|
|
Application::registerLuaFunctions();
|
|
|
|
|
2012-01-05 02:28:29 +01:00
|
|
|
g_lua.registerStaticClass("g_thingsType");
|
|
|
|
g_lua.bindClassStaticFunction("g_thingsType", "load", std::bind(&ThingsType::load, &g_thingsType, _1));
|
|
|
|
g_lua.bindClassStaticFunction("g_thingsType", "isLoaded", std::bind(&ThingsType::isLoaded, &g_thingsType));
|
2012-01-06 21:28:57 +01:00
|
|
|
g_lua.bindClassStaticFunction("g_thingsType", "getSignature", std::bind(&ThingsType::getSignature, &g_thingsType));
|
2012-01-05 02:28:29 +01:00
|
|
|
|
|
|
|
g_lua.registerStaticClass("g_sprites");
|
|
|
|
g_lua.bindClassStaticFunction("g_sprites", "load", std::bind(&SpriteManager::load, &g_sprites, _1));
|
|
|
|
g_lua.bindClassStaticFunction("g_sprites", "isLoaded", std::bind(&SpriteManager::isLoaded, &g_sprites));
|
2012-01-06 21:28:57 +01:00
|
|
|
g_lua.bindClassStaticFunction("g_sprites", "getSignature", std::bind(&SpriteManager::getSignature, &g_sprites));
|
2012-02-02 15:07:02 +01:00
|
|
|
g_lua.bindClassStaticFunction("g_sprites", "preloadSprites", std::bind(&SpriteManager::preloadSprites, &g_sprites));
|
2012-01-05 02:28:29 +01:00
|
|
|
|
2012-01-08 16:42:23 +01:00
|
|
|
g_lua.registerStaticClass("g_map");
|
|
|
|
g_lua.bindClassStaticFunction("g_map", "isLookPossible", std::bind(&Map::isLookPossible, &g_map, _1));
|
|
|
|
g_lua.bindClassStaticFunction("g_map", "isCovered", std::bind(&Map::isCovered, &g_map, _1, _2));
|
2012-01-30 01:00:12 +01:00
|
|
|
g_lua.bindClassStaticFunction("g_map", "isCompletelyCovered", std::bind(&Map::isCompletelyCovered, &g_map, _1, _2));
|
2012-01-08 16:42:23 +01:00
|
|
|
g_lua.bindClassStaticFunction("g_map", "addThing", std::bind(&Map::addThing, &g_map, _1, _2, _3));
|
|
|
|
g_lua.bindClassStaticFunction("g_map", "getThing", std::bind(&Map::getThing, &g_map, _1, _2));
|
|
|
|
g_lua.bindClassStaticFunction("g_map", "removeThingByPos", std::bind(&Map::removeThingByPos, &g_map, _1, _2));
|
|
|
|
g_lua.bindClassStaticFunction("g_map", "removeThing", std::bind(&Map::removeThing, &g_map, _1));
|
|
|
|
g_lua.bindClassStaticFunction("g_map", "cleanTile", std::bind(&Map::cleanTile, &g_map, _1));
|
|
|
|
g_lua.bindClassStaticFunction("g_map", "getTile", std::bind(&Map::getTile, &g_map, _1));
|
|
|
|
g_lua.bindClassStaticFunction("g_map", "setCentralPosition", std::bind(&Map::setCentralPosition, &g_map, _1));
|
|
|
|
g_lua.bindClassStaticFunction("g_map", "getCentralPosition", std::bind(&Map::getCentralPosition, &g_map));
|
|
|
|
g_lua.bindClassStaticFunction("g_map", "getCreatureById", std::bind(&Map::getCreatureById, &g_map, _1));
|
|
|
|
g_lua.bindClassStaticFunction("g_map", "removeCreatureById", std::bind(&Map::removeCreatureById, &g_map, _1));
|
2012-02-01 20:37:40 +01:00
|
|
|
g_lua.bindClassStaticFunction("g_map", "getSpectators", std::bind(&Map::getSpectators, &g_map, _1, _2));
|
2012-01-08 16:42:23 +01:00
|
|
|
|
2011-11-16 08:20:14 +01:00
|
|
|
g_lua.bindGlobalFunction("getOufitColor", Outfit::getColor);
|
2011-08-15 16:11:24 +02:00
|
|
|
|
|
|
|
g_lua.registerClass<ProtocolLogin, Protocol>();
|
|
|
|
g_lua.bindClassStaticFunction<ProtocolLogin>("create", &ProtocolLogin::create);
|
2012-01-06 04:29:26 +01:00
|
|
|
g_lua.bindClassMemberFunction<ProtocolLogin>("login", &ProtocolLogin::login);
|
|
|
|
g_lua.bindClassMemberFunction<ProtocolLogin>("cancelLogin", &ProtocolLogin::cancelLogin);
|
2011-08-15 16:11:24 +02:00
|
|
|
|
|
|
|
g_lua.registerClass<ProtocolGame, Protocol>();
|
2011-08-26 20:00:22 +02:00
|
|
|
|
2011-08-29 16:14:21 +02:00
|
|
|
g_lua.registerClass<Thing>();
|
2012-01-08 16:42:23 +01:00
|
|
|
g_lua.bindClassMemberFunction<Thing>("setId", &Thing::setId);
|
2012-01-30 01:00:12 +01:00
|
|
|
g_lua.bindClassMemberFunction<Thing>("setPosition", &Thing::setPosition);
|
2012-01-03 01:10:39 +01:00
|
|
|
g_lua.bindClassMemberFunction<Thing>("getId", &Thing::getId);
|
2012-01-30 01:00:12 +01:00
|
|
|
g_lua.bindClassMemberFunction<Thing>("getPosition", &Thing::getPosition);
|
2012-01-08 16:42:23 +01:00
|
|
|
g_lua.bindClassMemberFunction<Thing>("getStackPriority", &Thing::getStackPriority);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("getAnimationPhases", &Thing::getAnimationPhases);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("asThing", &Thing::asThing);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("asItem", &Thing::asItem);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("asCreature", &Thing::asCreature);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("asEffect", &Thing::asEffect);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("asMissile", &Thing::asMissile);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("asPlayer", &Thing::asPlayer);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("asLocalPlayer", &Thing::asLocalPlayer);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("asAnimatedText", &Thing::asAnimatedText);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("asStaticText", &Thing::asStaticText);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("isGround", &Thing::isGround);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("isGroundBorder", &Thing::isGroundBorder);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("isOnBottom", &Thing::isOnBottom);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("isOnTop", &Thing::isOnTop);
|
2012-01-03 00:08:04 +01:00
|
|
|
g_lua.bindClassMemberFunction<Thing>("isContainer", &Thing::isContainer);
|
2012-01-08 16:42:23 +01:00
|
|
|
g_lua.bindClassMemberFunction<Thing>("isForceUse", &Thing::isForceUse);
|
2012-01-03 23:27:31 +01:00
|
|
|
g_lua.bindClassMemberFunction<Thing>("isMultiUse", &Thing::isMultiUse);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("isRotateable", &Thing::isRotateable);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("isNotMoveable", &Thing::isNotMoveable);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("isPickupable", &Thing::isPickupable);
|
2012-01-30 01:00:12 +01:00
|
|
|
g_lua.bindClassMemberFunction<Thing>("isIgnoreLook", &Thing::isIgnoreLook);
|
2012-01-08 16:42:23 +01:00
|
|
|
g_lua.bindClassMemberFunction<Thing>("isStackable", &Thing::isStackable);
|
2012-02-02 17:55:42 +01:00
|
|
|
g_lua.bindClassMemberFunction<Thing>("isHookSouth", &Thing::isHookSouth);
|
2012-02-01 04:47:00 +01:00
|
|
|
g_lua.bindClassMemberFunction<Thing>("isTranslucent", &Thing::isTranslucent);
|
|
|
|
g_lua.bindClassMemberFunction<Thing>("isFullGround", &Thing::isFullGround);
|
2011-11-16 18:33:43 +01:00
|
|
|
|
2012-01-03 00:08:04 +01:00
|
|
|
g_lua.registerClass<Creature, Thing>();
|
2012-01-06 04:29:26 +01:00
|
|
|
g_lua.bindClassMemberFunction<Creature>("getName", &Creature::getName);
|
2012-01-11 00:38:32 +01:00
|
|
|
g_lua.bindClassMemberFunction<Creature>("getShield", &Creature::getShield);
|
2012-01-06 04:29:26 +01:00
|
|
|
g_lua.bindClassMemberFunction<Creature>("setOutfit", &Creature::setOutfit);
|
|
|
|
g_lua.bindClassMemberFunction<Creature>("getOutfit", &Creature::getOutfit);
|
2012-01-07 00:54:17 +01:00
|
|
|
g_lua.bindClassMemberFunction<Creature>("setSkullTexture", &Creature::setSkullTexture);
|
|
|
|
g_lua.bindClassMemberFunction<Creature>("setShieldTexture", &Creature::setShieldTexture);
|
|
|
|
g_lua.bindClassMemberFunction<Creature>("setEmblemTexture", &Creature::setEmblemTexture);
|
2012-01-13 07:32:47 +01:00
|
|
|
g_lua.bindClassMemberFunction<Creature>("asMonster", &Creature::asMonster);
|
2011-11-16 18:33:43 +01:00
|
|
|
|
2012-01-09 06:23:39 +01:00
|
|
|
g_lua.registerClass<Item, Thing>();
|
2012-01-09 22:16:50 +01:00
|
|
|
g_lua.bindClassStaticFunction<Item>("create", &Item::create);
|
2012-02-01 16:20:13 +01:00
|
|
|
g_lua.bindClassMemberFunction<Item>("getCount", &Item::getCount);
|
2012-01-09 22:16:50 +01:00
|
|
|
|
2012-01-08 16:42:23 +01:00
|
|
|
g_lua.registerClass<Effect, Thing>();
|
|
|
|
g_lua.registerClass<Missile, Thing>();
|
|
|
|
g_lua.registerClass<StaticText, Thing>();
|
|
|
|
g_lua.registerClass<AnimatedText, Thing>();
|
|
|
|
|
2012-01-09 06:23:39 +01:00
|
|
|
g_lua.registerClass<Player, Creature>();
|
2012-02-01 23:46:31 +01:00
|
|
|
g_lua.bindClassMemberFunction<Creature>("isWalking", &Creature::isWalking);
|
2012-01-09 06:23:39 +01:00
|
|
|
g_lua.registerClass<Npc, Creature>();
|
|
|
|
g_lua.registerClass<Monster, Creature>();
|
2011-08-29 16:14:21 +02:00
|
|
|
g_lua.registerClass<LocalPlayer, Player>();
|
2012-01-07 23:24:29 +01:00
|
|
|
g_lua.bindClassMemberFunction<LocalPlayer>("getAttackingCreature", &LocalPlayer::getAttackingCreature);
|
|
|
|
g_lua.bindClassMemberFunction<LocalPlayer>("getFollowingCreature", &LocalPlayer::getFollowingCreature);
|
2012-01-16 10:37:02 +01:00
|
|
|
g_lua.bindClassMemberFunction<LocalPlayer>("getHealth", &LocalPlayer::getHealth);
|
|
|
|
g_lua.bindClassMemberFunction<LocalPlayer>("getMaxHealth", &LocalPlayer::getMaxHealth);
|
|
|
|
g_lua.bindClassMemberFunction<LocalPlayer>("getFreeCapacity", &LocalPlayer::getFreeCapacity);
|
|
|
|
g_lua.bindClassMemberFunction<LocalPlayer>("getExperience", &LocalPlayer::getExperience);
|
2012-01-14 02:37:15 +01:00
|
|
|
g_lua.bindClassMemberFunction<LocalPlayer>("getLevel", &LocalPlayer::getLevel);
|
2012-01-16 10:37:02 +01:00
|
|
|
g_lua.bindClassMemberFunction<LocalPlayer>("getLevelPercent", &LocalPlayer::getLevelPercent);
|
|
|
|
g_lua.bindClassMemberFunction<LocalPlayer>("getMana", &LocalPlayer::getMana);
|
|
|
|
g_lua.bindClassMemberFunction<LocalPlayer>("getMaxMana", &LocalPlayer::getMaxMana);
|
|
|
|
g_lua.bindClassMemberFunction<LocalPlayer>("getMagicLevel", &LocalPlayer::getMagicLevel);
|
|
|
|
g_lua.bindClassMemberFunction<LocalPlayer>("getMagicLevelPercent", &LocalPlayer::getMagicLevelPercent);
|
|
|
|
g_lua.bindClassMemberFunction<LocalPlayer>("getSoul", &LocalPlayer::getSoul);
|
|
|
|
g_lua.bindClassMemberFunction<LocalPlayer>("getStamina", &LocalPlayer::getStamina);
|
2012-01-07 23:24:29 +01:00
|
|
|
|
2011-08-29 16:14:21 +02:00
|
|
|
g_lua.registerClass<Tile>();
|
2012-01-08 16:42:23 +01:00
|
|
|
g_lua.bindClassMemberFunction<Tile>("clean", &Tile::clean);
|
|
|
|
g_lua.bindClassMemberFunction<Tile>("addThing", &Tile::addThing);
|
|
|
|
g_lua.bindClassMemberFunction<Tile>("getThing", &Tile::getThing);
|
|
|
|
g_lua.bindClassMemberFunction<Tile>("getThingStackpos", &Tile::getThingStackpos);
|
|
|
|
g_lua.bindClassMemberFunction<Tile>("getTopThing", &Tile::getTopThing);
|
|
|
|
g_lua.bindClassMemberFunction<Tile>("removeThing", &Tile::removeThing);
|
|
|
|
g_lua.bindClassMemberFunction<Tile>("getTopLookThing", &Tile::getTopLookThing);
|
|
|
|
g_lua.bindClassMemberFunction<Tile>("getTopUseThing", &Tile::getTopUseThing);
|
|
|
|
g_lua.bindClassMemberFunction<Tile>("getTopCreature", &Tile::getTopCreature);
|
2012-01-20 02:12:26 +01:00
|
|
|
g_lua.bindClassMemberFunction<Tile>("getTopMoveThing", &Tile::getTopMoveThing);
|
2012-01-09 21:54:37 +01:00
|
|
|
g_lua.bindClassMemberFunction<Tile>("getTopMultiUseThing", &Tile::getTopMultiUseThing);
|
2012-01-30 01:00:12 +01:00
|
|
|
g_lua.bindClassMemberFunction<Tile>("getPosition", &Tile::getPosition);
|
2012-01-08 16:42:23 +01:00
|
|
|
g_lua.bindClassMemberFunction<Tile>("getDrawElevation", &Tile::getDrawElevation);
|
|
|
|
g_lua.bindClassMemberFunction<Tile>("getCreatures", &Tile::getCreatures);
|
|
|
|
g_lua.bindClassMemberFunction<Tile>("getGround", &Tile::getGround);
|
|
|
|
g_lua.bindClassMemberFunction<Tile>("isWalkable", &Tile::isWalkable);
|
|
|
|
g_lua.bindClassMemberFunction<Tile>("isFullGround", &Tile::isFullGround);
|
|
|
|
g_lua.bindClassMemberFunction<Tile>("isFullyOpaque", &Tile::isFullyOpaque);
|
|
|
|
g_lua.bindClassMemberFunction<Tile>("isLookPossible", &Tile::isLookPossible);
|
|
|
|
g_lua.bindClassMemberFunction<Tile>("hasCreature", &Tile::hasCreature);
|
|
|
|
g_lua.bindClassMemberFunction<Tile>("isEmpty", &Tile::isEmpty);
|
|
|
|
g_lua.bindClassMemberFunction<Tile>("isClickable", &Tile::isClickable);
|
|
|
|
|
2011-08-29 16:14:21 +02:00
|
|
|
g_lua.registerClass<Map>();
|
|
|
|
|
2011-08-26 20:00:22 +02:00
|
|
|
g_lua.registerClass<Game>();
|
|
|
|
g_lua.bindClassStaticFunction<Game>("loginWorld", std::bind(&Game::loginWorld, &g_game, _1, _2, _3, _4, _5));
|
2011-08-30 01:20:30 +02:00
|
|
|
g_lua.bindClassStaticFunction<Game>("logout", std::bind(&Game::logout, &g_game, _1));
|
2011-08-29 20:38:01 +02:00
|
|
|
g_lua.bindClassStaticFunction<Game>("cancelLogin", std::bind(&Game::cancelLogin, &g_game));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("isOnline", std::bind(&Game::isOnline, &g_game));
|
2012-01-14 02:37:15 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("requestOutfit", std::bind(&Game::requestOutfit, &g_game));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("requestChannels", std::bind(&Game::requestChannels, &g_game));
|
2012-01-14 06:54:20 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("joinChannel", std::bind(&Game::joinChannel, &g_game, _1));
|
2012-02-02 23:29:44 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("leaveChannel", std::bind(&Game::leaveChannel, &g_game, _1));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("closeNpcChannel", std::bind(&Game::closeNpcChannel, &g_game));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("openPrivateChannel", std::bind(&Game::openPrivateChannel, &g_game, _1));
|
2011-11-16 18:33:43 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("setOutfit", std::bind(&Game::setOutfit, &g_game, _1));
|
2012-01-03 21:41:00 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("look", std::bind(&Game::look, &g_game, _1));
|
2012-01-13 01:31:39 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("open", std::bind(&Game::open, &g_game, _1, _2));
|
2012-01-03 23:27:31 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("use", std::bind(&Game::use, &g_game, _1));
|
2012-02-07 04:33:36 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("useInventoryItem", std::bind(&Game::useInventoryItem, &g_game, _1));
|
2012-01-12 00:10:44 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("useWith", std::bind(&Game::useWith, &g_game, _1, _2));
|
2012-02-07 04:33:36 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("useInventoryItemWith", std::bind(&Game::useInventoryItemWith, &g_game, _1, _2));
|
2012-01-20 03:33:11 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("move", std::bind(&Game::move, &g_game, _1, _2, _3));
|
2012-02-02 03:38:46 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("turn", std::bind(&Game::turn, &g_game, _1));
|
2012-01-15 22:19:52 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("walk", std::bind(&Game::walk, &g_game, _1));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("forceWalk", std::bind(&Game::forceWalk, &g_game, _1));
|
2012-02-08 00:06:52 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("setChaseMode", std::bind(&Game::setChaseMode, &g_game, _1));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("setFightMode", std::bind(&Game::setFightMode, &g_game, _1));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("setSafeFight", std::bind(&Game::setSafeFight, &g_game, _1));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("getChaseMode", std::bind(&Game::getChaseMode, &g_game));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("getFightMode", std::bind(&Game::getFightMode, &g_game));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("isSafeFight", std::bind(&Game::isSafeFight, &g_game));
|
2012-01-04 14:02:35 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("attack", std::bind(&Game::attack, &g_game, _1));
|
2012-01-05 15:24:38 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("cancelAttack", std::bind(&Game::cancelAttack, &g_game));
|
2012-01-04 14:02:35 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("follow", std::bind(&Game::follow, &g_game, _1));
|
2012-01-05 15:24:38 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("cancelFollow", std::bind(&Game::cancelFollow, &g_game));
|
2012-01-04 14:02:35 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("rotate", std::bind(&Game::rotate, &g_game, _1));
|
2012-01-11 00:38:32 +01:00
|
|
|
|
|
|
|
g_lua.bindClassStaticFunction<Game>("partyInvite", std::bind(&Game::partyInvite, &g_game, _1));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("partyJoin", std::bind(&Game::partyJoin, &g_game, _1));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("partyRevokeInvitation", std::bind(&Game::partyRevokeInvitation, &g_game, _1));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("partyPassLeadership", std::bind(&Game::partyPassLeadership, &g_game, _1));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("partyLeave", std::bind(&Game::partyLeave, &g_game));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("partyShareExperience", std::bind(&Game::partyShareExperience, &g_game, _1));
|
|
|
|
|
2012-01-04 15:30:28 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("addVip", std::bind(&Game::addVip, &g_game, _1));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("removeVip", std::bind(&Game::removeVip, &g_game, _1));
|
2012-01-07 22:10:06 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("talk", std::bind(&Game::talk, &g_game, _1));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("talkChannel", std::bind(&Game::talkChannel, &g_game, _1, _2, _3));
|
|
|
|
g_lua.bindClassStaticFunction<Game>("talkPrivate", std::bind(&Game::talkPrivate, &g_game, _1, _2, _3));
|
2012-01-07 23:24:29 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("getLocalPlayer", std::bind(&Game::getLocalPlayer, &g_game));
|
2012-01-08 16:42:23 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("getProtocolVersion", std::bind(&Game::getProtocolVersion, &g_game));
|
2012-01-13 02:19:33 +01:00
|
|
|
g_lua.bindClassStaticFunction<Game>("getProtocolGame", std::bind(&Game::getProtocolGame, &g_game));
|
2011-08-29 05:04:23 +02:00
|
|
|
|
2011-11-10 06:29:25 +01:00
|
|
|
g_lua.registerClass<UIItem, UIWidget>();
|
2012-02-01 08:36:32 +01:00
|
|
|
g_lua.bindClassStaticFunction<UIItem>("create", []{ return UIItemPtr(new UIItem); });
|
|
|
|
g_lua.bindClassMemberFunction<UIItem>("setItemId", &UIItem::setItemId);
|
|
|
|
g_lua.bindClassMemberFunction<UIItem>("setItemCount", &UIItem::setItemCount);
|
2012-02-07 01:41:53 +01:00
|
|
|
g_lua.bindClassMemberFunction<UIItem>("setItemSubType", &UIItem::setItemSubType);
|
2011-11-10 06:29:25 +01:00
|
|
|
g_lua.bindClassMemberFunction<UIItem>("setItem", &UIItem::setItem);
|
2012-02-01 08:36:32 +01:00
|
|
|
g_lua.bindClassMemberFunction<UIItem>("setVirtual", &UIItem::setVirtual);
|
2012-02-07 01:41:53 +01:00
|
|
|
g_lua.bindClassMemberFunction<UIItem>("clearItem", &UIItem::clearItem);
|
2012-02-01 08:36:32 +01:00
|
|
|
g_lua.bindClassMemberFunction<UIItem>("getItemId", &UIItem::getItemId);
|
|
|
|
g_lua.bindClassMemberFunction<UIItem>("getItemCount", &UIItem::getItemCount);
|
2012-02-07 01:41:53 +01:00
|
|
|
g_lua.bindClassMemberFunction<UIItem>("getItemSubType", &UIItem::getItemSubType);
|
2012-02-01 08:36:32 +01:00
|
|
|
g_lua.bindClassMemberFunction<UIItem>("getItem", &UIItem::getItem);
|
|
|
|
g_lua.bindClassMemberFunction<UIItem>("isVirtual", &UIItem::isVirtual);
|
|
|
|
|
2011-11-14 23:32:55 +01:00
|
|
|
g_lua.registerClass<UICreature, UIWidget>();
|
2012-01-06 09:48:59 +01:00
|
|
|
g_lua.bindClassStaticFunction<UICreature>("create", []{ return UICreaturePtr(new UICreature); } );
|
2011-11-14 23:32:55 +01:00
|
|
|
g_lua.bindClassMemberFunction<UICreature>("getCreature", &UICreature::getCreature);
|
|
|
|
g_lua.bindClassMemberFunction<UICreature>("setCreature", &UICreature::setCreature);
|
|
|
|
|
2011-08-29 05:04:23 +02:00
|
|
|
g_lua.registerClass<UIMap, UIWidget>();
|
2012-01-06 09:48:59 +01:00
|
|
|
g_lua.bindClassStaticFunction<UIMap>("create", []{ return UIMapPtr(new UIMap); } );
|
2012-01-09 19:06:16 +01:00
|
|
|
g_lua.bindClassMemberFunction<UIMap>("getTile", &UIMap::getTile);
|
2012-01-30 01:00:12 +01:00
|
|
|
g_lua.bindClassMemberFunction<UIMap>("zoomIn", &UIMap::zoomIn);
|
|
|
|
g_lua.bindClassMemberFunction<UIMap>("zoomOut", &UIMap::zoomOut);
|
2011-11-03 21:54:53 +01:00
|
|
|
|
2011-11-20 21:38:35 +01:00
|
|
|
g_lua.registerClass<UIGame, UIWidget>();
|
2012-01-06 09:48:59 +01:00
|
|
|
g_lua.bindClassStaticFunction<UIGame>("create", []{ return UIGamePtr(new UIGame); } );
|
2011-11-20 21:38:35 +01:00
|
|
|
|
2011-08-15 16:11:24 +02:00
|
|
|
}
|