655 lua_pushnil(L); |
655 lua_pushnil(L); |
656 end; |
656 end; |
657 lc_gethogname:= 1 |
657 lc_gethogname:= 1 |
658 end; |
658 end; |
659 |
659 |
|
660 function lc_sethogname(L : Plua_State) : LongInt; Cdecl; |
|
661 var gear : PGear; |
|
662 hogName: ShortString; |
|
663 begin |
|
664 if lua_gettop(L) <> 2 then |
|
665 begin |
|
666 LuaError('Lua: Wrong number of parameters passed to SetHogName!'); |
|
667 lua_pushnil(L) |
|
668 end |
|
669 else |
|
670 begin |
|
671 gear:= GearByUID(lua_tointeger(L, 1)); |
|
672 if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then |
|
673 |
|
674 hogName:= lua_tostring(L, 2); |
|
675 gear^.Hedgehog^.Name:= hogName; |
|
676 |
|
677 FreeTexture(gear^.Hedgehog^.NameTagTex); |
|
678 gear^.Hedgehog^.NameTagTex:= RenderStringTex(gear^.Hedgehog^.Name, gear^.Hedgehog^.Team^.Clan^.Color, fnt16); |
|
679 |
|
680 end; |
|
681 lc_sethogname:= 0; |
|
682 end; |
|
683 |
660 function lc_gettimer(L : Plua_State) : LongInt; Cdecl; |
684 function lc_gettimer(L : Plua_State) : LongInt; Cdecl; |
661 var gear : PGear; |
685 var gear : PGear; |
662 begin |
686 begin |
663 if lua_gettop(L) <> 1 then |
687 if lua_gettop(L) <> 1 then |
664 begin |
688 begin |
1710 lua_register(luaState, 'GetHogClan', @lc_gethogclan); |
1740 lua_register(luaState, 'GetHogClan', @lc_gethogclan); |
1711 lua_register(luaState, 'GetClanColor', @lc_getclancolor); |
1741 lua_register(luaState, 'GetClanColor', @lc_getclancolor); |
1712 lua_register(luaState, 'SetClanColor', @lc_setclancolor); |
1742 lua_register(luaState, 'SetClanColor', @lc_setclancolor); |
1713 lua_register(luaState, 'GetHogTeamName', @lc_gethogteamname); |
1743 lua_register(luaState, 'GetHogTeamName', @lc_gethogteamname); |
1714 lua_register(luaState, 'GetHogName', @lc_gethogname); |
1744 lua_register(luaState, 'GetHogName', @lc_gethogname); |
|
1745 lua_register(luaState, 'SetHogName', @lc_sethogname); |
1715 lua_register(luaState, 'GetHogLevel', @lc_gethoglevel); |
1746 lua_register(luaState, 'GetHogLevel', @lc_gethoglevel); |
1716 lua_register(luaState, 'SetHogLevel', @lc_sethoglevel); |
1747 lua_register(luaState, 'SetHogLevel', @lc_sethoglevel); |
1717 lua_register(luaState, 'GetX', @lc_getx); |
1748 lua_register(luaState, 'GetX', @lc_getx); |
1718 lua_register(luaState, 'GetY', @lc_gety); |
1749 lua_register(luaState, 'GetY', @lc_gety); |
1719 lua_register(luaState, 'CopyPV', @lc_copypv); |
1750 lua_register(luaState, 'CopyPV', @lc_copypv); |