aboutsummaryrefslogtreecommitdiff
path: root/advtrains_interlocking/database.lua
Commit message (Expand)AuthorAge
* Fix removing stale TCB nodesrelease-2.2.0orwell962021-01-12
* Forbid track modification when train, IP or TCB is on it, better handle remov...orwell962020-10-07
* Do not throw error when sync_tcb_neighbors failsorwell962019-08-29
* Fix moving Signal IPs (no duplicate IPs)orwell962019-02-21
* Fixes regarding signal assignments/tcbsorwell962019-02-09
* Point speed restriction railsorwell962019-01-24
* Fix may_modify_section on newly created sectionsorwell962019-01-22
* Prohibit removing/changing of TCBs and sections while routes or signals are setorwell962019-01-22
* Do not print "couldn't determine section" warning when all traverser ends wer...orwell962018-10-29
* Miscellaneous routesetting fixesorwell962018-10-29
* Properly implement invalidate_all_paths, recheck lzb on aspect changeorwell962018-10-10
* Add signal safety control override, restructure control systemorwell962018-10-10
* Make signal influence point (~halt point) specifiableorwell962018-10-09
* Improve route programming:orwell962018-10-07
* Move passive API to the advtrains coreorwell962018-08-16
* Automatic working (re-set certain route on train pass)orwell962018-08-12
* Implement routesettingorwell962018-07-21
* Basic route management from signalling formspecorwell962018-07-04
* Signal assignment and route programming procedureorwell962018-07-04
* Implement trains blocking sectionsorwell962018-06-29
* get_ts_at_pos(), file for train-related stufforwell962018-06-29
* Complete Track Section handling, incl. removing tcb's and marker entitiesorwell962018-06-26
* Add track section concept and rework TCB design, implement new linking behaviororwell962018-06-21
* Add Track Circuit Breaks (TCBs), Database and Track Circuit Setuporwell962018-06-20
* Interlocking: Create demo signals, signal API and model for TCB configurer nodeorwell962018-06-19
* Draft of interlocking systemorwell962018-06-14
">); setVisible(true); Environment->setFocus(this); m_menumgr->createdMenu(this); } virtual ~GUIModalMenu() { m_menumgr->deletingMenu(this); } void allowFocusRemoval(bool allow) { m_allow_focus_removal = allow; } bool canTakeFocus(gui::IGUIElement *e) { return (e && (e == this || isMyChild(e))) || m_allow_focus_removal; } void draw() { if(!IsVisible) return; video::IVideoDriver* driver = Environment->getVideoDriver(); v2u32 screensize = driver->getScreenSize(); if(screensize != m_screensize_old /*|| m_force_regenerate_gui*/) { m_screensize_old = screensize; regenerateGui(screensize); //m_force_regenerate_gui = false; } drawMenu(); } /* This should be called when the menu wants to quit. WARNING: THIS DEALLOCATES THE MENU FROM MEMORY. Return immediately if you call this from the menu itself. */ void quitMenu() { allowFocusRemoval(true); // This removes Environment's grab on us Environment->removeFocus(this); m_menumgr->deletingMenu(this); this->remove(); #ifdef HAVE_TOUCHSCREENGUI if (g_touchscreengui) g_touchscreengui->Show(); #endif } void removeChildren() { const core::list<gui::IGUIElement*> &children = getChildren(); core::list<gui::IGUIElement*> children_copy; for(core::list<gui::IGUIElement*>::ConstIterator i = children.begin(); i != children.end(); i++) { children_copy.push_back(*i); } for(core::list<gui::IGUIElement*>::Iterator i = children_copy.begin(); i != children_copy.end(); i++) { (*i)->remove(); } } virtual void regenerateGui(v2u32 screensize) = 0; virtual void drawMenu() = 0; virtual bool preprocessEvent(const SEvent& event) { return false; }; virtual bool OnEvent(const SEvent& event) { return false; }; virtual bool pausesGame(){ return false; } // Used for pause menu protected: //bool m_force_regenerate_gui; v2u32 m_screensize_old; private: IMenuManager *m_menumgr; // This might be necessary to expose to the implementation if it // wants to launch other menus bool m_allow_focus_removal; }; #endif