cmd_givemobile.lua

来自「这是整套横扫千军3D版游戏的源码」· LUA 代码 · 共 44 行

LUA
44
字号
--------------------------------------------------------------------------------------------------------------------------------------------------------------------  file:    cmd_givemobile.lua--  brief:   adds a command to give all mobile units--  author:  Dave Rodgers----  Copyright (C) 2007.--  Licensed under the terms of the GNU GPL, v2 or later.------------------------------------------------------------------------------------------------------------------------------------------------------------------function widget:GetInfo()  return {    name      = "GiveMobile",    desc      = "Adds '/luaui give mobile', a limited '.give all'",    author    = "trepan",    date      = "Jan 8, 2007",    license   = "GNU GPL, v2 or later",    layer     = 0,    enabled   = false  --  loaded by default?  }end----------------------------------------------------------------------------------------------------------------------------------------------------------------function widget:TextCommand(command)  if (command ~= 'give mobile') then    return false  end  Spring.SendCommands({"say .cheat 1"}) -- enable cheating  for udid,ud in pairs(UnitDefs) do    if (ud and ud.canMove and (ud.speed > 0)) then      Spring.SendCommands({"say .give " .. ud.name})    end  end  return trueend--------------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?