Added a "ui.getMode()" Function