expose selecting a single unit to lua
This commit is contained in:
parent
c8b935b322
commit
d819adf949
1 changed files with 14 additions and 0 deletions
|
@ -1202,6 +1202,18 @@ static int CclSlotUsage(lua_State *l)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int CclSelectSingleUnit(lua_State *l)
|
||||
{
|
||||
const int nargs = lua_gettop(l);
|
||||
Assert(nargs == 1);
|
||||
lua_pushvalue(l, 1);
|
||||
CUnit *unit = CclGetUnit(l);
|
||||
lua_pop(l, 1);
|
||||
SelectSingleUnit(*unit);
|
||||
SelectionChanged();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
** Register CCL features for unit.
|
||||
*/
|
||||
|
@ -1234,6 +1246,8 @@ void UnitCclRegister()
|
|||
lua_register(Lua, "SetUnitVariable", CclSetUnitVariable);
|
||||
|
||||
lua_register(Lua, "SlotUsage", CclSlotUsage);
|
||||
|
||||
lua_register(Lua, "SelectSingleUnit", CclSelectSingleUnit);
|
||||
}
|
||||
|
||||
//@}
|
||||
|
|
Loading…
Reference in a new issue