Bug #17840, was updated on 2011-Jan-04 17:43
Here is a current snapshot of the bug.
Project: LinCityNG
Category: confirmed
Status: Open
Resolution: Fixed
Bug Group: None
Priority: 5
Submitted by: samaan
Assigned to : wolfgangb
Summary: Blank option in new game menu
Details: LinCityNG version: 2.0
When I click in "New Game" option the scenarios list show 6 options but it
exists just 5 scenarios in fact. If I select the last (blank) option and click
in "Start", the applications crash.
Follow-Ups:
Date: 2011-Jan-05 22:09
By: wolfgangb
Comment:
It works fine on my machine. Any local changes in the gui files? Otherwise I'm
out of ideas right now.
-------------------------------------------------------
Date: 2011-Jan-05 19:02
By: samaan
Comment:
It's in SVN version, revision 1607.
-------------------------------------------------------
Date: 2011-Jan-05 18:42
By: wolfgangb
Comment:
Is the new crash in svn version or from a patched 2.0?
-------------------------------------------------------
Date: 2011-Jan-05 14:13
By: samaan
Comment:
Now the application crashes when I click in "New Game", "Load", "Save" or
"Options". Stack below:
#0 0xb7bd94d9 in std::_List_node_base::hook(std::_List_node_base*) () from
/usr/lib/libstdc++.so.6
#1 0x0806e7d9 in MainMenu::fillNewGameMenu (this=0x828bae8) at
/usr/include/c++/4.3/bits/stl_list.h:1342
#2 0x0806f9c4 in MainMenu::loadNewGameMenu (this=0x828bae8) at
src/lincity-ng/MainMenu.cpp:250
#3 0x0806fa6c in MainMenu::newGameButtonClicked (this=0x828bae8) at
src/lincity-ng/MainMenu.cpp:692
#4 0x080b7e67 in Button::event (this=0x828c048, eve...@0xbfffeccc) at
src/gui/callback/Signal.hpp:88
#5 0x080a509e in Component::event (this=0x82bc0a0, eve...@0xbfffed2c) at
src/gui/Component.cpp:101
#6 0x080a509e in Component::event (this=0x82bb7d0, eve...@0xbfffedb8) at
src/gui/Component.cpp:101
#7 0x080a29ca in Desktop::event (this=0x82bb7d0, eve...@0xbfffedb8) at
src/gui/Desktop.cpp:78
#8 0x0806b54b in MainMenu::run (this=0x828bae8) at
src/lincity-ng/MainMenu.cpp:894
#9 0x0809692e in mainLoop () at src/lincity-ng/main.cpp:396
#10 0x08097761 in main (argc=-1212898840, argv=0xbffff004) at
src/lincity-ng/main.cpp:557
-------------------------------------------------------
Date: 2011-Jan-04 23:01
By: wolfgangb
Comment:
Fixed in revision 1606.
loadCityNG already did a check if the file exists but it also accepted
directories.
Not any longer.
-------------------------------------------------------
Date: 2011-Jan-04 21:12
By: wolfgangb
Comment:
At least that one is easy to reproduce.
-------------------------------------------------------
Date: 2011-Jan-04 17:46
By: samaan
Comment:
To solve this bug I remove the blank option from menu. I do not know if here is
the better place to put my resolution, so I am so sorry if it ins't. My patch:
Index: lincity-ng-2.0/data/gui/newgame.xml
===================================================================
--- lincity-ng-2.0.orig/data/gui/newgame.xml
+++ lincity-ng-2.0/data/gui/newgame.xml
@@ -25,7 +25,7 @@
</cell>
<cell row="2" col="1">
- <TableLayout rows="8" cols="3">
+ <TableLayout rows="7" cols="3">
<colsize col="1" relative="4"/>
<colsize col="2" relative="10"/>
<colsize col="3" relative="15"/>
@@ -76,15 +76,6 @@
<text-caption style="button">Savegame
1234567890</text-caption>
<image src="images/gui/buttons/savebutton.png"/>
<image-hover
src="images/gui/buttons/savebutton-hover.png"/>
- <image-clicked
src="images/gui/buttons/savebutton-clicked.png"/>
- <image-checked
src="images/gui/buttons/savebutton-checked.png"/>
- </CheckButton>
- </cell>
- <cell row="7" col="2">
- <CheckButton name="File5">
- <text-caption style="button">Savegame
1234567890</text-caption>
- <image src="images/gui/buttons/savebutton.png"/>
- <image-hover
src="images/gui/buttons/savebutton-hover.png"/>
<image-clicked
src="images/gui/buttons/savebutton-clicked.png"/>
<image-checked
src="images/gui/buttons/savebutton-checked.png"/>
</CheckButton>
Index: lincity-ng-2.0/src/lincity-ng/MainMenu.cpp
===================================================================
--- lincity-ng-2.0.orig/src/lincity-ng/MainMenu.cpp
+++ lincity-ng-2.0/src/lincity-ng/MainMenu.cpp
@@ -101,7 +101,7 @@ MainMenu::loadMainMenu()
void MainMenu::fillNewGameMenu()
{
- const std::string
buttonNames[]={"File0","File1","File2","File3","File4","File5"};
+ const std::string buttonNames[]={"File0","File1","File2","File3","File4"};
char **files= PHYSFS_enumerateFiles("opening");
@@ -109,7 +109,7 @@ void MainMenu::fillNewGameMenu()
fileMap.clear();
- for(int i=0;i<6;i++)
+ for(unsigned int i=0; i<sizeof(buttonNames) / sizeof(std::string); i++)
{
CheckButton *button=getCheckButton(*newGameMenu.get(),buttonNames[i]);
@@ -147,14 +147,14 @@ void MainMenu::fillNewGameMenu()
void MainMenu::fillLoadMenu( bool save /*= false*/ )
{
- const std::string
buttonNames[]={"File0","File1","File2","File3","File4","File5"};
+ const std::string buttonNames[]={"File0","File1","File2","File3","File4"};
char** rc = PHYSFS_enumerateFiles("/");
char* curfile;
CheckButton *button;
- for(int i=0;i<6;i++) {
+ for(unsigned int i=0; i<sizeof(buttonNames) / sizeof(std::string); i++){
char* recentfile = NULL;
PHYSFS_sint64 t = 0;
@@ -368,7 +368,7 @@ MainMenu::selectLoadSaveGameButtonClicke
after an existing one.
*/
- const std::string
bs[]={"File0","File1","File2","File3","File4","File5",""};
+ const std::string bs[]={"File0","File1","File2","File3","File4",""};
for(int i=0;std::string(bs[i]).length();i++) {
CheckButton *b=getCheckButton(*currentMenu,bs[i]);
if(b->getName()!=button->getName()){
Index: lincity-ng-2.0/data/gui/loadgame.xml
===================================================================
--- lincity-ng-2.0.orig/data/gui/loadgame.xml
+++ lincity-ng-2.0/data/gui/loadgame.xml
@@ -11,7 +11,7 @@
<Paragraph style="menutitle" translatable="yes">Load
Game</Paragraph>
</cell>
<cell row="2" col="1">
- <TableLayout rows="8" cols="3">
+ <TableLayout rows="7" cols="3">
<colsize col="1" relative="4"/>
<colsize col="2" relative="10"/>
<colsize col="3" relative="15"/>
@@ -61,15 +61,6 @@
<text-caption style="boxtext">Savegame
123456789012345678901234567890</text-caption>
<image src="images/gui/buttons/savebutton.png"/>
<image-hover
src="images/gui/buttons/savebutton-hover.png"/>
- <image-clicked
src="images/gui/buttons/savebutton-clicked.png"/>
- <image-checked
src="images/gui/buttons/savebutton-checked.png"/>
- </CheckButton>
- </cell>
- <cell row="7" col="2">
- <CheckButton name="File5">
- <text-caption style="boxtext">Savegame
123456789012345678901234567890</text-caption>
- <image src="images/gui/buttons/savebutton.png"/>
- <image-hover
src="images/gui/buttons/savebutton-hover.png"/>
<image-clicked
src="images/gui/buttons/savebutton-clicked.png"/>
<image-checked
src="images/gui/buttons/savebutton-checked.png"/>
</CheckButton>
Index: lincity-ng-2.0/data/gui/savegame.xml
===================================================================
--- lincity-ng-2.0.orig/data/gui/savegame.xml
+++ lincity-ng-2.0/data/gui/savegame.xml
@@ -11,7 +11,7 @@
<Paragraph style="menutitle" translatable="yes">Save
Game</Paragraph>
</cell>
<cell row="2" col="1">
- <TableLayout rows="8" cols="3">
+ <TableLayout rows="7" cols="3">
<!-- <rowsize row="1" fixed="50"/>
<rowsize row="4" fixed="50"/> -->
<colsize col="1" relative="4"/>
@@ -63,15 +63,6 @@
<text-caption style="boxtext">Savegame
123456789012345678901234567890</text-caption>
<image src="images/gui/buttons/savebutton.png"/>
<image-hover
src="images/gui/buttons/savebutton-hover.png"/>
- <image-clicked
src="images/gui/buttons/savebutton-clicked.png"/>
- <image-checked
src="images/gui/buttons/savebutton-checked.png"/>
- </CheckButton>
- </cell>
- <cell row="7" col="2">
- <CheckButton name="File5">
- <text-caption style="boxtext">Savegame
123456789012345678901234567890</text-caption>
- <image src="images/gui/buttons/savebutton.png"/>
- <image-hover
src="images/gui/buttons/savebutton-hover.png"/>
<image-clicked
src="images/gui/buttons/savebutton-clicked.png"/>
<image-checked
src="images/gui/buttons/savebutton-checked.png"/>
</CheckButton>
-------------------------------------------------------
For detailed info, follow this link:
http://developer.berlios.de/bugs/?func=detailbug&bug_id=17840&group_id=2929
_______________________________________________
Lincity-ng-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/lincity-ng-devel