As some you already know, the GUI has been -a bit- rewritten so the compatibility is broken with plugins using windows (others should still work) but I'll try to sum up the changes.
Positioning
- The Y swapping isn't used anymore to keep a standard with manialinks (maybe I can reconsider this temporarily if it's really too annoying but I think it's better for people who are used to manialinks but doesn't know yet how to write a ManiaLive plugin)
GUI namespaces
- Displayables has been totally removed
- Handler has been removed, classes are now directly in Gui
- Windowing has been removed, sub namespaces and classes are now directly in Gui too
Controls
- The initializeComponents() method doesn't exist anymore, you need to use the normal constructor
- Method beforeDraw() has been renamed onDraw() and method afterDraw() has been removed
- Methods applyLayout() and removeLayout() are now a single method setLayout()
- Methods onResize() and onMove() now takes the old values as parameters
- It's now plenty assumed that a Control can be added to several windows at the same time, so you need to call the destroy() method yourself (especially if you have created actions with it). It can seems weird but in fact it can be really useful for updating values and redrawing every window including it easily.
Windows
- The initializeComponents() method doesn't exist anymore, you need to use onConstruct() instead
- You can add parameters to onConstruct() and pass them when calling Window::Create() but they all have to be declared as optional (this is a PHP limitation)
- Static method Redraw() has been renamed RedrawAll() and a new method redraw() has been created to redraw a window only if it's shown
- Static methods (except Create) now use every subclass instances, eg. if you call ManagedWindow::EraseAll() it will destroy every windows which inherit from ManagedWindow
- Methods setPlayerValue(), getPlayerValue(), setHeaderElement() and getHeaderElement() has been removed
- Methods deactivateLinks(), activateLinks() and getLinksDeactivated() has been renamed respectively to disableLinks(), enableLinks() and areLinksDisabled()
- Method showDialog() has been more or less replaced by a new method showAsDialog() which works as the show() method, except that when drawn it will add a background preventing to click on any other window.
- Panel is not a Control anymore but inherits from Window and ManagedWindow inherits from Panel. If one of your class inherits directly or indirectly from Panel, don't forget to call parent::onConstruct() in your onConstruct() method and parent::onResize() if you overload it
Shortkeys
- The key to totally hide GUI is now F8
- F5, F6 and F7 are free to use
- Only one callback per key can be set (don't forget to free the keys when you don't need them anymore)
CustomUI
- It now works almost the same manner than windows: each player has its own and unique CustomUI instance you get by calling Create()
- You can set the visibility for a specific player or for everybody by using a mask of constant, eg. to hide notices and chat for everybody, you call CustomUI::HideForAll(CustomUI::NOTICE | CustomUI::CHAT)
- Sending the new CustomUI is then automatic
Actions
- There is now a singleton to create actions, the ActionHandler class
- Methods callback() in Control and Window has been replaced by createAction(). You should be a bit careful with this method as created actions will be removed when calling destroy() so if the action is used somewhere else, it can break things. On the other hand, if you create an action by calling directly the ActionHandler, you have to think about deleting it.
Events
- There is no more Event classes in GUI
- More generally, Event classes now declare a constant for each specific event and those constants are a power of 2, eg. with application events
Code: Select all
const ON_INIT = 1;
const ON_RUN = 2;
const ON_PRE_LOOP = 4;
const ON_POST_LOOP = 8;
const ON_TERMINATE = 16;
Chat command interpreter
- A bug has been fixed, preventing a polymorphic command to be removed
- When entering a polymorphic command in the chat, the interpreter will now call the registered method with the complete string (except the command)
- You can now escape double quotes " in the chat with a backslash \, it will be send to your method correctly and without the backslash (eg. if you have a setservername command with 1 parameter, you can type /setservername "My \"super\" server")
ManiaHome and WebServices
- ManiaLive is now including the WebServices SDK but
- WebServices credentials should be provided in the config file as it was for ManiaHome
- If you want to use a service, you have to create a client with these credentials which are in \ManiaLive\Features\WebServices\Config
That's it for the main changes I think. Everything should run fine with standard plugins but I'm considering this release as a beta as it can have ugly bugs or memory leaks.
So you can download the files here:
ManiaLive
Standard plugins