Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
代码示例
init.lua文件
function OnPlayerSpawned(player_entity)
GamePrint("$amap_open")
dofile("mods/advanced_map/button.lua")
DisposeMap()
EntityAddComponent( player_entity, "VariableStorageComponent", { _tags = "LastTeleportFram",value_int=0} )
end
map.lua文件
--mouse comp
local ctrl_components = EntityGetComponentIncludingDisabled( player_id, "ControlsComponent" )
local right_click = false
local right_clickfram =0
local mouse_x,mouse_y,map_gui_x,map_gui_y
if (ctrl_components ~= nil) then
edit_component2(player_id,"ControlsComponent",function (comp,vars)
right_click = ComponentGetValue2( comp, "mButtonDownRightClick")
right_clickfram = ComponentGetValue2( comp, "mButtonFrameRightClick")
mouse_x,mouse_y = ComponentGetValue2( comp, "mMousePosition")
map_gui_x,map_gui_y = ComponentGetValue2( comp, "mMousePositionRaw")
end )
end
--teleport
if right_click and ModSettingGet("advanced_map.teleport") then
local compClick = EntityGetFirstComponentIncludingDisabled( player_id, "VariableStorageComponent" ,"LastTeleportFram")
local lastright_clickfram = ComponentGetValue2(compClick,"value_int") or 0
if (right_clickfram-lastright_clickfram)>2 then
EntitySetTransform(player_id, msx, msy)
timer = 0
GamePrint( GameTextGet("$log_teleported").." "..tostring(right_clickfram)..tostring(lastright_clickfram )..tostring(msx).." , "..tostring(msy) )
ComponentSetValue2( compClick, "value_int", right_clickfram )
end
end