forked from 0ad/0ad
Added PickFriendlyEntitiesOnScreen function to the JS side for #1187.
This was SVN commit r11230.
This commit is contained in:
parent
06672f0001
commit
649cb7ee7b
@ -136,6 +136,11 @@ std::vector<entity_id_t> PickFriendlyEntitiesInRect(void* UNUSED(cbdata), int x0
|
||||
return EntitySelection::PickEntitiesInRect(*g_Game->GetSimulation2(), *g_Game->GetView()->GetCamera(), x0, y0, x1, y1, player, false);
|
||||
}
|
||||
|
||||
std::vector<entity_id_t> PickFriendlyEntitiesOnScreen(void* cbdata, int player)
|
||||
{
|
||||
return PickFriendlyEntitiesInRect(cbdata, 0, 0, g_xres, g_yres, player);
|
||||
}
|
||||
|
||||
std::vector<entity_id_t> PickSimilarFriendlyEntities(void* UNUSED(cbdata), std::string templateName, bool includeOffScreen, bool matchRank)
|
||||
{
|
||||
return EntitySelection::PickSimilarEntities(*g_Game->GetSimulation2(), *g_Game->GetView()->GetCamera(), templateName, g_Game->GetPlayerID(), includeOffScreen, matchRank, false);
|
||||
@ -564,6 +569,7 @@ void GuiScriptingInit(ScriptInterface& scriptInterface)
|
||||
// Entity picking
|
||||
scriptInterface.RegisterFunction<std::vector<entity_id_t>, int, int, &PickEntitiesAtPoint>("PickEntitiesAtPoint");
|
||||
scriptInterface.RegisterFunction<std::vector<entity_id_t>, int, int, int, int, int, &PickFriendlyEntitiesInRect>("PickFriendlyEntitiesInRect");
|
||||
scriptInterface.RegisterFunction<std::vector<entity_id_t>, int, &PickFriendlyEntitiesOnScreen>("PickFriendlyEntitiesOnScreen");
|
||||
scriptInterface.RegisterFunction<std::vector<entity_id_t>, std::string, bool, bool, &PickSimilarFriendlyEntities>("PickSimilarFriendlyEntities");
|
||||
scriptInterface.RegisterFunction<CFixedVector3D, int, int, &GetTerrainAtPoint>("GetTerrainAtPoint");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user