Skip to content

Commit

Permalink
- Finished incomplete screen layouts.
Browse files Browse the repository at this point in the history
- Fixed incorrect usage of vector::erase().
  • Loading branch information
SupSuper committed Mar 3, 2011
1 parent ec86b55 commit 7fad20b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 22 deletions.
3 changes: 1 addition & 2 deletions src/Geoscape/DogfightState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,7 @@ void DogfightState::move()
_game->getResourcePack()->getSoundSet("GEO.CAT")->getSound(12)->play();
}
d = wDist->erase(d);
if (d == wDist->end())
break;
d--;
}
}

Expand Down
6 changes: 2 additions & 4 deletions src/Geoscape/GeoscapeState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,7 @@ void GeoscapeState::time5Seconds()
{
delete *i;
i = _game->getSavedGame()->getUfos()->erase(i);
if (i == _game->getSavedGame()->getUfos()->end())
break;
i--;
}
}

Expand All @@ -530,8 +529,7 @@ void GeoscapeState::time5Seconds()
{
delete *i;
i = _game->getSavedGame()->getWaypoints()->erase(i);
if (i == _game->getSavedGame()->getWaypoints()->end())
break;
i--;
}
}
}
Expand Down
29 changes: 13 additions & 16 deletions src/Geoscape/ItemsArrivingState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ ItemsArrivingState::ItemsArrivingState(Game *game, GeoscapeState *state) : State
_screen = false;

// Create objects
_window = new Window(this, 288, 180, 16, 10, POPUP_BOTH);
_btnOk = new TextButton(272, 16, 24, 166);
_btnOk5Secs = new TextButton(272, 16, 24, 166);
_txtTitle = new Text(278, 16, 21, 18);
_txtItem = new Text(114, 8, 26, 34);
_txtQuantity = new Text(44, 8, 141, 34);
_txtDestination = new Text(112, 8, 186, 34);
_lstTransfers = new TextList(256, 118, 24, 50);
_window = new Window(this, 320, 180, 0, 10, POPUP_BOTH);
_btnOk = new TextButton(148, 16, 8, 166);
_btnOk5Secs = new TextButton(148, 16, 160, 166);
_txtTitle = new Text(310, 16, 5, 18);
_txtItem = new Text(120, 8, 10, 34);
_txtQuantity = new Text(50, 8, 150, 34);
_txtDestination = new Text(110, 8, 205, 34);
_lstTransfers = new TextList(288, 112, 8, 50);

// Set palette
_game->setPalette(_game->getResourcePack()->getPalette("BACKPALS.DAT")->getColors(Palette::blockOffset(6)), Palette::backPos, 16);
Expand All @@ -73,9 +73,9 @@ ItemsArrivingState::ItemsArrivingState(Game *game, GeoscapeState *state) : State
_btnOk->setText(_game->getLanguage()->getString("STR_OK"));
_btnOk->onMouseClick((ActionHandler)&ItemsArrivingState::btnOkClick);

_btnOk->setColor(Palette::blockOffset(8)+8);
_btnOk->setText(_game->getLanguage()->getString("STR_OK_5_SECS"));
_btnOk->onMouseClick((ActionHandler)&ItemsArrivingState::btnOk5SecsClick);
_btnOk5Secs->setColor(Palette::blockOffset(8)+8);
_btnOk5Secs->setText(_game->getLanguage()->getString("STR_OK_5_SECS"));
_btnOk5Secs->onMouseClick((ActionHandler)&ItemsArrivingState::btnOk5SecsClick);

_txtTitle->setColor(Palette::blockOffset(8)+5);
_txtTitle->setBig();
Expand All @@ -93,7 +93,7 @@ ItemsArrivingState::ItemsArrivingState(Game *game, GeoscapeState *state) : State

_lstTransfers->setColor(Palette::blockOffset(8)+10);
_lstTransfers->setArrowColor(Palette::blockOffset(8)+8);
_lstTransfers->setColumns(3, 155, 55, 46);
_lstTransfers->setColumns(3, 165, 25, 98);
_lstTransfers->setSelectable(true);
_lstTransfers->setBackground(_window);
_lstTransfers->setMargin(2);
Expand All @@ -109,10 +109,7 @@ ItemsArrivingState::ItemsArrivingState(Game *game, GeoscapeState *state) : State
_lstTransfers->addRow(3, (*j)->getName(_game->getLanguage()).c_str(), ss.str().c_str(), (*i)->getName().c_str());
delete *j;
j = (*i)->getTransfers()->erase(j);
if (j == (*i)->getTransfers()->end())
{
break;
}
j--;
}
}
}
Expand Down

0 comments on commit 7fad20b

Please sign in to comment.