Updates
Atom, Retro Rails
During these days without any access to the interwebs, I've remade the entire GUI engine of the old Retro Rails, so I've ported it to Mac and made the basic controls classes (TextEntry, Button, etc.). And I've made a remote installer to Atom that will be available when you download the server. In the installer you can create the admin user, select through Habbo versions etc. And the installer will do all the work you need, such as creating MySQL tables, etc. The code will be released so developers can build their own multiplatform installers to their applications.
Developer Information
Even if the Mac version of the GUI is made in Objective-C, you don't need to know it to build your application, as the GUI has three layers:
1. Frontend (C++)
The project that contains the application windows, etc. This projects depends on gui_controls and gui_core
2. Controls (C++) - gui_controls
The static library (.lib/.a) that contains the controls such as Button, Frame, TextEntry, etc. code. It will be linked to the Frontend
3. Core (C++/Objective-C) - gui_core
The dynamic library (.dll/.dylib) that contains the core code, this project will communicate directly with the Operating System.
The GUI API is very easy to use, and all the controls (including windows) derives from Panel class.
Code:
class Panel : public IBaseClient
{
GPANEL gpanel;
public:
GPANEL GetGPanel() { return gpanel; };
void SetStretchFlags(int flags);
void SetName(const char* name);
const char* GetName();
void LoadControlSettings(char* filename);
bool IsPopup();
void SetPopup(bool state);
SurfacePlat* Plat();
void SetPlat(SurfacePlat* plat);
virtual void Paint() { };
void PaintTraverse();
void Invalidate();
void SolveTraverse();
int GetChildCount();
GPANEL GetChild(int i);
GPANEL GetChild(const char* name);
void Solve();
GPANEL GetParent();
void SetParent(GPANEL panel);
bool IsVisible();
void SetVisible(bool state);
void GetSize(int &wide, int &tall);
void GetAbsPos(int &x, int &y);
void GetPos(int &x, int &y);
void SetSize(int wide, int tall);
void SetPos(int x, int y);
GPANEL GetPanelAt(int x, int y);
HCursor GetCursor();
void SetCursor(HCursor cursor);
virtual void SetProp(KeyValues* prop) { };
virtual void MousePressed(int key, int x, int y) { };
virtual void MouseMoved(int x, int y) { };
virtual void MouseReleased(int key, int x, int y) { };
virtual void OnChar(char c) { };
virtual void GotFocus() { };
virtual void LostFocus() { };
bool HasFocus();
void InternalMouseMoved(int x, int y);
void InternalMouseReleased(int key, int x, int y);
void InternalMousePressed(int key, int x, int y);
void PostActionSignal(KeyValues* message);
virtual MessageMapItem_t* GetMessageMap() { return 0; };
Panel(void);
~Panel(void);
};
The main procedure:
Code:
int main(int argc, char* argv[])
{
AlertCWD();
#if _WIN32
CSysModule* gui = ::Sys_LoadModule("C:\\hpm\\gui_core\\Debug\\gui_core.dll");
#else
CSysModule* gui = ::Sys_LoadModule("libgui_core.dylib");
#endif
CreateInterfaceFn factory = Sys_GetFactory(gui);
bool bb = GUI_InitInterfaceList(&factory, 1);
if(!bb)
return 0;
CAtomInstallWizard wiz;
wiz.SetPos(100, 100);
wiz.SetSize(465, 540);
surface()->CreatePopup(&wiz);
while(true)
{
surface()->RunFrame();
}
}
