prevent people from stealing the 404 save

This commit is contained in:
jacob1 2018-03-03 22:05:08 -05:00
parent 5dd01e9976
commit bd7f9fa247
2 changed files with 16 additions and 10 deletions

View File

@ -195,6 +195,7 @@ GameView::GameView():
ren(NULL),
activeBrush(NULL),
saveSimulationButtonEnabled(false),
saveReuploadAllowed(true),
drawMode(DrawPoints),
drawPoint1(0, 0),
drawPoint2(0, 0),
@ -939,6 +940,7 @@ void GameView::NotifyInfoTipChanged(GameModel * sender)
void GameView::NotifySaveChanged(GameModel * sender)
{
saveReuploadAllowed = true;
if (sender->GetSave())
{
if (introText > 50)
@ -998,6 +1000,9 @@ void GameView::NotifySaveChanged(GameModel * sender)
tagSimulationButton->SetText("[no tags set]");
}
currentSaveType = 1;
int saveID = sender->GetSave()->GetID();
if (saveID == 404 || saveID == 2157797)
saveReuploadAllowed = false;
}
else if (sender->GetSaveFile())
{
@ -1032,7 +1037,7 @@ void GameView::NotifySaveChanged(GameModel * sender)
tagSimulationButton->SetText("[no tags set]");
currentSaveType = 0;
}
saveSimulationButton->Enabled = (saveSimulationButtonEnabled || ctrlBehaviour);
saveSimulationButton->Enabled = (saveSimulationButtonEnabled && saveReuploadAllowed) || ctrlBehaviour;
SetSaveButtonTooltips();
}
@ -2045,7 +2050,7 @@ void GameView::disableCtrlBehaviour()
saveSimulationButton->Appearance.BackgroundInactive = ui::Colour(0, 0, 0);
saveSimulationButton->Appearance.BackgroundHover = ui::Colour(20, 20, 20);
saveSimulationButton->Appearance.TextInactive = saveSimulationButton->Appearance.TextHover = ui::Colour(255, 255, 255);
saveSimulationButton->Enabled = saveSimulationButtonEnabled;
saveSimulationButton->Enabled = saveSimulationButtonEnabled && saveReuploadAllowed;
SetSaveButtonTooltips();
searchButton->Appearance.BackgroundInactive = ui::Colour(0, 0, 0);
searchButton->Appearance.BackgroundHover = ui::Colour(20, 20, 20);

View File

@ -86,6 +86,7 @@ private:
ui::Button * reloadButton;
ui::Button * saveSimulationButton;
bool saveSimulationButtonEnabled;
bool saveReuploadAllowed;
ui::Button * downVoteButton;
ui::Button * upVoteButton;
ui::Button * tagSimulationButton;