aboutsummaryrefslogtreecommitdiff
path: root/clientmods
Commit message (Expand)AuthorAge
* [CSM] Fix and improve minetest.get_language()sfan52019-11-11
* [CSM] Implement minetest.get_csm_restrictions()sfan52019-11-11
* Run on_item_use CSM callback even if item is not marked usablesfan52019-11-11
* [CSM] Expose more env functionssfan52019-11-11
* Be lenient with extra slashes for CSM pathssfan52019-11-09
* [CSM] Remove non-functional minetest.get_day_count()sfan52019-11-09
* Introduce get_modpath() for CSMsfan52019-11-09
* CSM/SSM: Add on_mods_loaded callback (#7411)Loïc Blot2018-06-06
* [CSM] Remove `on_connect` callback (#6941)red-0012018-01-21
* [CSM] Add basic HUD manipulation. (#6067)red-0012018-01-20
* [CSM] Add callback on open inventory (#5793)Vincent Glize2017-10-02
* preview: try to send mod channel messages 4 seconds after joining, not after ...Loic Blot2017-09-26
* Implement mod communication channels (#6351)Loïc Blot2017-09-26
* Create a filesystem abstraction layer for CSM and only allow accessing files ...red-0012017-06-30
* CSM: Fix documentation error for register_on_*_chat_messages (#5917)DS2017-06-09
* [CSM] Add function to get player privileges (#5933)red-0012017-06-07
* [CSM] Fix crash when the minimap is disabled. Caused by e25a38eSmallJoker2017-05-20
* [CSM] add `on_item_use` (#5544)red-0012017-05-06
* Add function to get server info.red-0012017-05-04
* [CSM] Add event on_place_node API lua (#5548)Vincent Glize2017-04-29
* [CSM] Add function to set minimap shape (#5569)bigfoot5472017-04-14
* [CSM] Move `.list_players` and `.disconnect` to builtin. (#5550)red-0012017-04-10
* [CSM] Add event on_connect player API lua (#5540)Vincent Glize2017-04-08
* [CSM] Add function to get the server protocol version. (#5529)red-0012017-04-06
* [CSM] Add function and chat command to disconnect from server. (#5487)red-0012017-04-01
* [CSM] Add function to get player names in range (#5435)bigfoot5472017-03-22
* Give CSM access to use `core.colorize()` (#5113)red-0012017-03-17
* [CSM] Fix minimap problems (#5405)Loïc Blot2017-03-17
* [CSM] Add core.get_timeofday & core.get_day_count env calls (#5401)Loïc Blot2017-03-17
* [CSM] Add minimap API modifiers (#5399)Loïc Blot2017-03-16
* Add ModStorageAPI to client side modding (#5396)Loïc Blot2017-03-16
* Add `get_wielded_item`red-0012017-03-13
* [CSM] Add `on_punchnode` callbackred-0012017-03-13
* [CSM] Add `get_node` and `get_node_or_nil`red-0012017-03-13
* [CSM] Add `on_dignode` callback (#5140)red-0012017-03-13
* [CSM] storage + fixesLoic Blot2017-03-13
* [CSM] implement client side mod loading (#5123)Loïc Blot2017-03-13
n> local sel = 1 for n,_ in pairs(atlatc.envs) do envs_asvalues[#envs_asvalues+1]=minetest.formspec_escape(n) if n==env then sel=#envs_asvalues end end local form = "size[10,10]dropdown[0,0;3;env;"..table.concat(envs_asvalues, ",")..";"..sel.."]" .."button[4,0;2,1;save;Save]button[7,0;2,1;cle;Clear local env] textarea[0.2,1;10,10;code;Code;"..minetest.formspec_escape(code).."]" .."label[0,9.8;"..err.."]" return form end function ac.after_dig_node(pos, node, player) advtrains.invalidate_all_paths(pos) advtrains.ndb.clear(pos) local ph=minetest.pos_to_string(pos) ac.nodes[ph]=nil end function ac.on_receive_fields(pos, formname, fields, player) if not minetest.check_player_privs(player:get_player_name(), {atlatc=true}) then minetest.chat_send_player(player:get_player_name(), "Missing privilege: atlatc - Operation cancelled!") return end local meta=minetest.get_meta(pos) local ph=minetest.pos_to_string(pos) local nodetbl = ac.nodes[ph] or {} --if fields.quit then return end if fields.env then nodetbl.env=fields.env end if fields.code then nodetbl.code=fields.code end if fields.save then -- reset certain things nodetbl.err=nil if advtrains.lines and advtrains.lines.sched then -- discard all schedules for this node advtrains.lines.sched.discard_all(advtrains.encode_pos(pos)) end end if fields.cle then nodetbl.data={} end ac.nodes[ph]=nodetbl meta:set_string("formspec", ac.getform(pos, meta)) if nodetbl.env then meta:set_string("infotext", "LuaAutomation component, assigned to environment '"..nodetbl.env.."'") else meta:set_string("infotext", "LuaAutomation component, invalid enviroment set!") end end function ac.run_in_env(pos, evtdata, customfct_p) local ph=minetest.pos_to_string(pos) local nodetbl = ac.nodes[ph] if not nodetbl then atwarn("LuaAutomation component at",ph,": Data not in memory! Please visit component and click 'Save'!") return end local meta if minetest.get_node_or_nil(pos) then meta=minetest.get_meta(pos) end if not nodetbl.env or not atlatc.envs[nodetbl.env] then atwarn("LuaAutomation component at",ph,": Not an existing environment: "..(nodetbl.env or "<nil>")) return false end if not nodetbl.code or nodetbl.code=="" then atwarn("LuaAutomation component at",ph,": No code to run! (insert -- to suppress warning)") return false end local customfct=customfct_p or {} -- add interrupt function customfct.interrupt=function(t, imesg) assertt(t, "number") assert(t >= 0) atlatc.interrupt.add(t, pos, {type="int", int=true, message=imesg, msg=imesg}) --Compatiblity "message" field. end -- add digiline_send function, if digiline is loaded if minetest.global_exists("digiline") then customfct.digiline_send=function(channel, msg) assertt(channel, "string") digiline:receptor_send(pos, digiline.rules.default, channel, msg) end end -- add lines scheduler if enabled if advtrains.lines and advtrains.lines.sched then customfct.schedule = function(rwtime, msg) return advtrains.lines.sched.enqueue(rwtime, "atlatc_env", {pos=pos, msg=msg}, advtrains.encode_pos(pos), 1) end customfct.schedule_in = function(rwtime, msg) return advtrains.lines.sched.enqueue_in(rwtime, "atlatc_env", {pos=pos, msg=msg}, advtrains.encode_pos(pos), 1) end end local datain=nodetbl.data or {} local succ, dataout = atlatc.envs[nodetbl.env]:execute_code(datain, nodetbl.code, evtdata, customfct) if succ then atlatc.active.nodes[ph].data=atlatc.remove_invalid_data(dataout) else atlatc.active.nodes[ph].err=dataout atwarn("LuaAutomation ATC interface rail at",ph,": LUA Error:",dataout) if meta then meta:set_string("infotext", "LuaAutomation ATC interface rail, ERROR:"..dataout) end end if meta then meta:set_string("formspec", ac.getform(pos, meta)) end end function ac.on_digiline_receive(pos, node, channel, msg) atlatc.interrupt.add(0, pos, {type="digiline", digiline=true, channel = channel, msg = msg}) end if advtrains.lines and advtrains.lines.sched then advtrains.lines.sched.register_callback("atlatc_env", function(data) -- This adds another interrupt to the atlatc queue... there might be a better way atlatc.interrupt.add(0, data.pos, {type="schedule",schedule=true, msg=data.msg}) end) end atlatc.active=ac