aboutsummaryrefslogtreecommitdiff
path: root/advtrains/atc.lua
Commit message (Expand)AuthorAge
* [BREAKING] Use client-side translations instead of intllib; add zh_CN transla...ywang2020-07-19
* Fix sending empty ATC commandsorwell962019-02-05
* Fix last commit (and another warn2log)orwell962019-01-22
* Fix atc command evaluation BB commandorwell962019-01-22
* Do not clear tarvelocity when setting new, potential no-op commandorwell962019-01-15
* Handle the case that a train is not initialized (train_ensure_init returns ni...orwell962018-10-29
* Fix node database ATC rail bugorwell962018-10-17
* Add signal safety control override, restructure control systemorwell962018-10-10
* Fix ATC rail reversingorwell962018-08-12
* Add routesetting callbacks.orwell962018-08-12
* Mainly make collisions and coupling workorwell962018-06-14
* Implement a reverse path lookup for trains instead of an occupations window s...orwell962018-06-14
* Occupation System, new train steps, still incompleteorwell962018-06-14
* Fix detector lookup in ATC railsorwell962017-12-18
* Rewrite rail connection system...orwell962017-12-18
* Moved default train track to separate mod, for integration with advcarts.Gabriel PĂ©rez-Cerezo2017-10-25
* Remove zip release files, move mod to root, exclude assets from Makefile (#92)rubenwardy2017-09-20
* Restructure mod directoryorwell962017-01-04
* Add Automatic Train Control systemorwell962017-01-04
* Turning mod into a modpack and separating the trains from the core modorwell962016-12-20
o create caption = "tab caption", -- text to show for tab header cbf_button_handler = function(tabview, fields, tabname, tabdata), -- callback for button events --TODO cbf_events = function(tabview, event, tabname), -- callback for events cbf_formspec = function(tabview, name, tabdata), -- get formspec tabsize = { x, -- x width y -- y height }, -- special size for this tab (only relevant if no parent for tabview set) on_change = function(type,old_tab,new_tab) -- called on tab chang, type is "ENTER" or "LEAVE" } - set_autosave_tab(value) ^ tell tabview to automatically save current tabname as "tabview_name"_LAST ^ value: true/false - set_tab(name) ^ set's tab to tab named "name", returns true/false on success ^ name: name of tab to set - set_global_event_handler(handler) ^ set a handler to be called prior calling tab specific event handler ^ handler: function(tabview,event) --> returns true to finish event processing false to continue - set_global_button_handler(handler) ^ set a handler to be called prior calling tab specific button handler ^ handler: function(tabview,fields) --> returns true to finish button processing false to continue - set_parent(parent) ^ set parent to attach tabview to. TV's with parent are hidden if their parent is hidden and they don't set their specified size. ^ parent: component to attach to - show() ^ show tabview - hide() ^ hide tabview - delete() ^ delete tabview - set_fixed_size(state) ^ true/false set to fixed size, variable size File: fst/dialog.lua --------------------- Only one dialog can be shown at a time. If a dialog is closed it's parent is gonna be activated and shown again. dialog_create(name, cbf_formspec, cbf_button_handler, cbf_events) ^ create a dialog component ^ name: name of component (unique per ui) ^ cbf_formspec: function to be called to get formspec function(dialogdata) ^ cbf_button_handler: function to handle buttons function(dialog, fields) ^ cbf_events: function to handle events function(dialog, event) messagebox(name, message) ^ creates a message dialog Class reference dialog: methods: - set_parent(parent) ^ set parent to attach a dialog to ^ parent: component to attach to - show() ^ show dialog - hide() ^ hide dialog - delete() ^ delete dialog from ui members: - data ^ variable data attached to this dialog - parent ^ parent component to return to on exit File: fst/buttonbar.lua ----------------------- buttonbar_create(name, cbf_buttonhandler, pos, orientation, size) ^ create a buttonbar ^ name: name of component (unique per ui) ^ cbf_buttonhandler: function to be called on button pressed function(buttonbar,buttonname,buttondata) ^ pos: position relative to upper left of current shown formspec { x, y } ^ orientation: "vertical" or "horizontal" ^ size: size of bar { width, height } Class reference buttonbar: methods: - add_button(btn_id, caption, button_image) - set_parent(parent) ^ set parent to attach a buttonbar to ^ parent: component to attach to - show() ^ show buttonbar - hide() ^ hide buttonbar - delete() ^ delete buttonbar from ui Developer doc: ============== Skeleton for any component: { name = "some id", -- unique id type = "toplevel", -- type of component -- toplevel: component can be show without additional components -- addon: component is an addon to be shown along toplevel component hide = function(this) end, -- called to hide the component show = function(this) end, -- called to show the component delete = function(this) end, -- called to delete component from ui handle_buttons = function(this,fields) -- called upon button press handle_events = function(this,event) -- called upon event reception get_formspec = function(this) -- has to return formspec to be displayed }