mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +03:00
Move widget object creation from the constructor to FrameInitialized()
This commit is contained in:
parent
8c4a593fb0
commit
3c836144e2
1 changed files with 13 additions and 12 deletions
|
@ -28,18 +28,8 @@ CLASS_DECLARATION(UIFloatingWindow, GameSpyDialog, NULL) {
|
|||
{NULL, NULL}
|
||||
};
|
||||
|
||||
GameSpyDialog::GameSpyDialog() {
|
||||
overlay = new UIButton();
|
||||
overlay->InitFrame(NULL,
|
||||
UIRect2D(0, 0, uid.vidWidth, uid.vidHeight),
|
||||
0);
|
||||
overlay->setBackgroundColor(UColor(0, 0, 0, 0.5f), true);
|
||||
overlay->AllowActivate(true);
|
||||
|
||||
overlay->Connect(this, W_Button_Pressed, W_Deactivated);
|
||||
|
||||
Connect(this, W_Deactivated, W_Deactivated);
|
||||
|
||||
GameSpyDialog::GameSpyDialog()
|
||||
: overlay(NULL) {
|
||||
AddFlag(WF_ALWAYS_TOP);
|
||||
}
|
||||
|
||||
|
@ -80,6 +70,17 @@ void GameSpyDialog::FrameInitialized(void) {
|
|||
closeButton->setTitle("Close");
|
||||
closeButton->AllowActivate(true);
|
||||
closeButton->Connect(this, W_Button_Pressed, W_Deactivated);
|
||||
|
||||
overlay = new UIButton();
|
||||
overlay->InitFrame(NULL,
|
||||
UIRect2D(0, 0, uid.vidWidth, uid.vidHeight),
|
||||
0);
|
||||
overlay->setBackgroundColor(UColor(0, 0, 0, 0.5f), true);
|
||||
overlay->AllowActivate(true);
|
||||
|
||||
overlay->Connect(this, W_Button_Pressed, W_Deactivated);
|
||||
|
||||
Connect(this, W_Deactivated, W_Deactivated);
|
||||
}
|
||||
|
||||
void GameSpyDialog::Create(UIWidget* parent, const UIRect2D& rect, const char* title, const UColor& bgColor, const UColor& fgColor)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue