sources are broken
This commit is contained in:
parent
96e0b1e909
commit
02ada0b82e
|
@ -3,6 +3,8 @@ window#enterGameWindow:
|
||||||
size: [236, 178]
|
size: [236, 178]
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
onLoad: mainMenu:lock(self)
|
||||||
|
onDestroy: mainMenu:unlock()
|
||||||
|
|
||||||
label#accountNameLabel:
|
label#accountNameLabel:
|
||||||
text: Account name
|
text: Account name
|
||||||
|
@ -49,9 +51,7 @@ window#enterGameWindow:
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
margin.bottom: 10
|
margin.bottom: 10
|
||||||
margin.right: 13
|
margin.right: 13
|
||||||
onClick: |
|
onClick: self:getParent():destroy()
|
||||||
self:getParent():destroy()
|
|
||||||
self:getParent():getParent():unlock()
|
|
||||||
|
|
||||||
textEdit#accountNameTextEdit:
|
textEdit#accountNameTextEdit:
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
|
@ -3,6 +3,8 @@ window#infoWindow:
|
||||||
size: [244, 221]
|
size: [244, 221]
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
onLoad: mainMenu:lock(self)
|
||||||
|
onDestroy: mainMenu:unlock()
|
||||||
|
|
||||||
panel#infoPanel:
|
panel#infoPanel:
|
||||||
skin: flatPanel
|
skin: flatPanel
|
||||||
|
@ -57,6 +59,4 @@ window#infoWindow:
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
margin.top: 191
|
margin.top: 191
|
||||||
margin.left: 188
|
margin.left: 188
|
||||||
onClick: |
|
|
||||||
self:getParent():destroy()
|
|
|
@ -1,25 +0,0 @@
|
||||||
-- main menu methods
|
|
||||||
function MainMenu_create()
|
|
||||||
mainMenu = loadUI("modules/mainmenu/mainmenu.yml")
|
|
||||||
end
|
|
||||||
|
|
||||||
function MainMenu_destroy()
|
|
||||||
mainMenu:destroy()
|
|
||||||
end
|
|
||||||
|
|
||||||
function MainMenu_enterGameClicked()
|
|
||||||
enterGameWindow = loadUI("modules/mainmenu/entergamewindow.yml")
|
|
||||||
button = enterGameWindow:getChildByID("okButton")
|
|
||||||
end
|
|
||||||
|
|
||||||
function MainMenu_optionsClicked()
|
|
||||||
optionsWindow = loadUI("modules/mainmenu/optionswindow.yml")
|
|
||||||
end
|
|
||||||
|
|
||||||
function MainMenu_infoClicked()
|
|
||||||
infoWindow = loadUI("modules/mainmenu/infowindow.yml")
|
|
||||||
end
|
|
||||||
|
|
||||||
function MainMenu_exitClicked()
|
|
||||||
onApplicationClose()
|
|
||||||
end
|
|
|
@ -21,7 +21,7 @@ panel#background:
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
margin.top: 16
|
margin.top: 16
|
||||||
onClick: MainMenu_enterGameClicked()
|
onClick: loadUI("modules/mainmenu/entergamewindow.yml")
|
||||||
|
|
||||||
button#accessAccountButton:
|
button#accessAccountButton:
|
||||||
text: Access Account
|
text: Access Account
|
||||||
|
@ -34,18 +34,18 @@ panel#background:
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
margin.top: 76
|
margin.top: 76
|
||||||
onClick: MainMenu_optionsClicked()
|
onClick: loadUI("modules/mainmenu/optionswindow.yml")
|
||||||
|
|
||||||
button#infoButton:
|
button#infoButton:
|
||||||
text: Info
|
text: Info
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
margin.top: 106
|
margin.top: 106
|
||||||
onClick: MainMenu_infoClicked()
|
onClick: loadUI("modules/mainmenu/infowindow.yml")
|
||||||
|
|
||||||
button#exitGameButton:
|
button#exitGameButton:
|
||||||
text: Exit
|
text: Exit
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
margin.top: 136
|
margin.top: 136
|
||||||
onClick: MainMenu_exitClicked()
|
onClick: exitGame()
|
|
@ -1,10 +1,10 @@
|
||||||
-- menu state
|
-- menu state
|
||||||
function onEnterMenuState()
|
function onEnterMenuState()
|
||||||
MainMenu_create()
|
mainMenu = loadUI("modules/mainmenu/mainmenu.yml")
|
||||||
end
|
end
|
||||||
|
|
||||||
function onLeaveMenuState()
|
function onLeaveMenuState()
|
||||||
MainMenu_destroy()
|
mainMenu:destroy()
|
||||||
end
|
end
|
||||||
|
|
||||||
function onApplicationClose()
|
function onApplicationClose()
|
||||||
|
|
|
@ -3,6 +3,8 @@ window#optionsWindow:
|
||||||
size: [286, 262]
|
size: [286, 262]
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
onLoad: mainMenu:lock(self)
|
||||||
|
onDestroy: mainMenu:unlock()
|
||||||
|
|
||||||
# general
|
# general
|
||||||
button#generalButton:
|
button#generalButton:
|
||||||
|
@ -109,5 +111,4 @@ window#optionsWindow:
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
margin.right: 10
|
margin.right: 10
|
||||||
margin.bottom: 13
|
margin.bottom: 13
|
||||||
onClick: |
|
onClick: self:getParent():destroy()
|
||||||
self:getParent():destroy()
|
|
|
@ -502,7 +502,7 @@ std::string Platform::getAppUserDir()
|
||||||
std::stringstream sdir;
|
std::stringstream sdir;
|
||||||
sdir << PHYSFS_getUserDir() << "/." << win32.appName << "/";
|
sdir << PHYSFS_getUserDir() << "/." << win32.appName << "/";
|
||||||
if((mkdir(sdir.str().c_str()) != 0) && (errno != EEXIST))
|
if((mkdir(sdir.str().c_str()) != 0) && (errno != EEXIST))
|
||||||
logError("ERROR: Couldn't create directory for saving configuration file. (%s)", sdir.str().c_str());
|
flogError("ERROR: Couldn't create directory for saving configuration file. (%s)", sdir.str().c_str());
|
||||||
return sdir.str();
|
return sdir.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,6 @@ public:
|
||||||
void registerFunctions();
|
void registerFunctions();
|
||||||
|
|
||||||
int lua_UIButton_setOnClick();
|
int lua_UIButton_setOnClick();
|
||||||
|
|
||||||
int lua_UIElement_getParent();
|
int lua_UIElement_getParent();
|
||||||
int lua_UIElement_destroy();
|
int lua_UIElement_destroy();
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ void UIElement::destroy()
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
setEnabled(false);
|
setEnabled(false);
|
||||||
|
|
||||||
|
g_dispatcher.addTask(boost::bind(&UIContainer::removeChild, getParent(), asUIElement()));
|
||||||
if(getParent()) {
|
if(getParent()) {
|
||||||
// schedule removal from parent
|
// schedule removal from parent
|
||||||
g_dispatcher.addTask(boost::bind(&UIContainer::removeChild, getParent(), asUIElement()));
|
g_dispatcher.addTask(boost::bind(&UIContainer::removeChild, getParent(), asUIElement()));
|
||||||
|
|
|
@ -86,6 +86,7 @@ public:
|
||||||
virtual UIContainerPtr asUIContainer() { return UIContainerPtr(); }
|
virtual UIContainerPtr asUIContainer() { return UIContainerPtr(); }
|
||||||
virtual const char *getScriptableName() const { return "UIElement"; }
|
virtual const char *getScriptableName() const { return "UIElement"; }
|
||||||
|
|
||||||
|
void setOnDestroy(
|
||||||
friend class UIContainer;
|
friend class UIContainer;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -100,7 +100,7 @@ int main(int argc, const char *argv[])
|
||||||
if(!g_configs.load("config.yml"))
|
if(!g_configs.load("config.yml"))
|
||||||
logInfo("Could not read configuration file, default configurations will be used.");
|
logInfo("Could not read configuration file, default configurations will be used.");
|
||||||
|
|
||||||
logInfo("OTClient 0.1.0");
|
logInfo("OTClient 0.2.0");
|
||||||
|
|
||||||
// create the window
|
// create the window
|
||||||
Platform::createWindow(g_configs.getInteger("window x"), g_configs.getInteger("window y"),
|
Platform::createWindow(g_configs.getInteger("window x"), g_configs.getInteger("window y"),
|
||||||
|
|
Loading…
Reference in New Issue