aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_client.h
Commit message (Expand)AuthorAge
* Implement minetest.sound_fade()sfan52020-04-11
* [CSM] Implement minetest.get_csm_restrictions()sfan52019-11-11
* Introduce get_modpath() for CSMsfan52019-11-09
* CSM: Remove screenshot APIred-0012018-01-23
* CSM: Add a way to get current locale from CSMlisacvuk2017-10-29
* C++ modernize: Pragma once (#6264)Loïc Blot2017-08-17
* [CSM] Add flavour limits controlled by server (#5930)Loïc Blot2017-07-18
* Revert "CSM: Revert "[CSM] Add send_chat_message and run_server_chatcommand""Loic Blot2017-07-15
* CSM: Revert "[CSM] Add send_chat_message and run_server_chatcommand"rubenwardy2017-07-15
* Create a filesystem abstraction layer for CSM and only allow accessing files ...red-0012017-06-30
* [CSM] Add function to get player privileges (#5933)red-0012017-06-07
* [CSM] Add send_chat_message and run_server_chatcommand API functions (#5747)Pierre-Adrien Langrognet2017-05-21
* Fix LINT broken by dfa0c15ce045705f05487d623dc7beca6c945b4bLoic Blot2017-05-21
* [CSM] Add function to get the definition of items (#5732)bigfoot5472017-05-21
* [CSM] Correct the log destination of print() (#5784)SmallJoker2017-05-20
* Add function to get server info.red-0012017-05-04
* [CSM] add screenshot api lua (#5674)Vincent Glize2017-04-29
* [CSM] Add function to get the server protocol version. (#5529)red-0012017-04-06
* [CSM] Add support for positional audio. (#5516)red-0012017-04-06
* [CSM] Add local node meta reference. (#5508)red-0012017-04-04
* [CSM] Add function and chat command to disconnect from server. (#5487)red-0012017-04-01
* Fix clang-format Columns WidthLoic Blot2017-03-31
* [CSM] Add function to get player names in range (#5435)bigfoot5472017-03-22
* Add `get_wielded_item`red-0012017-03-13
* [CSM] Add `get_node` and `get_node_or_nil`red-0012017-03-13
* [CSM] storage + fixesLoic Blot2017-03-13
* [CSM] Add local formspecs. (#5094)red-0012017-03-13
* [CSM] sound_play & sound_stop support + client_lua_api doc (#5096)Loïc Blot2017-03-13
* [CSM] Add client-sided chat commands (#5092)red-0012017-03-13
* [CSM] Add method that display chat to client-sided lua. (#5089) (#5091)red-0012017-03-13
* [CSM] Client side moddingLoic Blot2017-03-13
n>(sigd).." ("..tcbs.signal_name..") Route #"..routeid) -- this code is partially copy-pasted from routesetting.lua -- we start at the tc designated by signal local c_sigd = sigd local i = 1 local c_tcbs, c_ts_id, c_ts, c_rseg, c_lckp while c_sigd and i<=#route do c_tcbs = ildb.get_tcbs(c_sigd) if not c_tcbs then itab("-!- No TCBS at "..sigd_to_string(c_sigd)..". Please reconfigure route!") break end c_ts_id = c_tcbs.ts_id if not c_ts_id then itab("-!- No track section adjacent to "..sigd_to_string(c_sigd)..". Please reconfigure route!") break end c_ts = ildb.get_ts(c_ts_id) c_rseg = route[i] c_lckp = {} itab(""..i.." Entry "..sigd_to_string(c_sigd).." -> Sec. "..(c_ts and c_ts.name or "-").." -> Exit "..(c_rseg.next and sigd_to_string(c_rseg.next) or "END")) if c_rseg.locks then for pts, state in pairs(c_rseg.locks) do local pos = minetest.string_to_pos(pts) itab(" Lock: "..pts.." -> "..state) if not advtrains.is_passive(pos) then itab("-!- No passive component at "..pts..". Please reconfigure route!") break end end end -- advance c_sigd = c_rseg.next i = i + 1 end if c_sigd then local e_tcbs = ildb.get_tcbs(c_sigd) itab("Route end: "..sigd_to_string(c_sigd).." ("..(e_tcbs and e_tcbs.signal_name or "-")..")") else itab("Route ends on dead-end") end form = form.."textlist[0.5,2;7,4;rtelog;"..table.concat(tab, ",").."]" form = form.."button[0.5,6;2,1;back;<<< Back to signal]" form = form.."button[3.5,6;2,1;aspect;Signal Aspect]" form = form.."button[5.5,6;2,1;delete;Delete Route]" --atdebug(route.ars) form = form.."textarea[1,7.3;5.2,3;ars;ARS Rule List;"..atil.ars_to_text(route.ars).."]" form = form.."button[6,7.7;1,1;savears;Save]" minetest.show_formspec(pname, "at_il_routeedit_"..minetest.pos_to_string(sigd.p).."_"..sigd.s.."_"..routeid, form) end minetest.register_on_player_receive_fields(function(player, formname, fields) local pname = player:get_player_name() if not minetest.check_player_privs(pname, {train_operator=true, interlocking=true}) then return end local pts, connids, routeids = string.match(formname, "^at_il_routeedit_([^_]+)_(%d)_(%d+)$") local pos, connid, routeid if pts then pos = minetest.string_to_pos(pts) connid = tonumber(connids) routeid = tonumber(routeids) if not connid or connid<1 or connid>2 then return end if not routeid then return end end if pos and connid and routeid and not fields.quit then local sigd = {p=pos, s=connid} local tcbs = ildb.get_tcbs(sigd) if not tcbs then return end local route = tcbs.routes[routeid] if not route then return end if fields.setname and fields.name then route.name = fields.name end if fields.aspect then local suppasp = advtrains.interlocking.signal_get_supported_aspects(tcbs.signal) local callback = function(pname, asp) route.aspect = asp advtrains.interlocking.show_route_edit_form(pname, sigd, routeid) end advtrains.interlocking.show_signal_aspect_selector(pname, suppasp, route.name, callback, route.aspect) return end if fields.delete then -- if something set the route in the meantime, make sure this doesn't break. atil.route.update_route(sigd, tcbs, nil, true) table.remove(tcbs.routes, routeid) advtrains.interlocking.show_signalling_form(sigd, pname) end if fields.ars and fields.savears then route.ars = atil.text_to_ars(fields.ars) --atdebug(route.ars) end if fields.back then advtrains.interlocking.show_signalling_form(sigd, pname) end end end)