prevent people from stealing the 404 save
This commit is contained in:
parent
5dd01e9976
commit
bd7f9fa247
@ -195,6 +195,7 @@ GameView::GameView():
|
|||||||
ren(NULL),
|
ren(NULL),
|
||||||
activeBrush(NULL),
|
activeBrush(NULL),
|
||||||
saveSimulationButtonEnabled(false),
|
saveSimulationButtonEnabled(false),
|
||||||
|
saveReuploadAllowed(true),
|
||||||
drawMode(DrawPoints),
|
drawMode(DrawPoints),
|
||||||
drawPoint1(0, 0),
|
drawPoint1(0, 0),
|
||||||
drawPoint2(0, 0),
|
drawPoint2(0, 0),
|
||||||
@ -939,13 +940,14 @@ void GameView::NotifyInfoTipChanged(GameModel * sender)
|
|||||||
|
|
||||||
void GameView::NotifySaveChanged(GameModel * sender)
|
void GameView::NotifySaveChanged(GameModel * sender)
|
||||||
{
|
{
|
||||||
if(sender->GetSave())
|
saveReuploadAllowed = true;
|
||||||
|
if (sender->GetSave())
|
||||||
{
|
{
|
||||||
if(introText > 50)
|
if (introText > 50)
|
||||||
introText = 50;
|
introText = 50;
|
||||||
|
|
||||||
saveSimulationButton->SetText(sender->GetSave()->GetName());
|
saveSimulationButton->SetText(sender->GetSave()->GetName());
|
||||||
if(sender->GetSave()->GetUserName() == sender->GetUser().Username)
|
if (sender->GetSave()->GetUserName() == sender->GetUser().Username)
|
||||||
((SplitButton*)saveSimulationButton)->SetShowSplit(true);
|
((SplitButton*)saveSimulationButton)->SetShowSplit(true);
|
||||||
else
|
else
|
||||||
((SplitButton*)saveSimulationButton)->SetShowSplit(false);
|
((SplitButton*)saveSimulationButton)->SetShowSplit(false);
|
||||||
@ -957,7 +959,7 @@ void GameView::NotifySaveChanged(GameModel * sender)
|
|||||||
upVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0));
|
upVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0));
|
||||||
|
|
||||||
downVoteButton->Enabled = upVoteButton->Enabled;
|
downVoteButton->Enabled = upVoteButton->Enabled;
|
||||||
if(sender->GetSave()->GetID() && sender->GetUser().UserID && sender->GetSave()->GetVote()==-1)
|
if (sender->GetSave()->GetID() && sender->GetUser().UserID && sender->GetSave()->GetVote()==-1)
|
||||||
downVoteButton->Appearance.BackgroundDisabled = (ui::Colour(108, 0, 10, 255));
|
downVoteButton->Appearance.BackgroundDisabled = (ui::Colour(108, 0, 10, 255));
|
||||||
else
|
else
|
||||||
downVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0));
|
downVoteButton->Appearance.BackgroundDisabled = (ui::Colour(0, 0, 0));
|
||||||
@ -974,15 +976,15 @@ void GameView::NotifySaveChanged(GameModel * sender)
|
|||||||
}
|
}
|
||||||
|
|
||||||
tagSimulationButton->Enabled = sender->GetSave()->GetID();
|
tagSimulationButton->Enabled = sender->GetSave()->GetID();
|
||||||
if(sender->GetSave()->GetID())
|
if (sender->GetSave()->GetID())
|
||||||
{
|
{
|
||||||
std::stringstream tagsStream;
|
std::stringstream tagsStream;
|
||||||
std::list<string> tags = sender->GetSave()->GetTags();
|
std::list<string> tags = sender->GetSave()->GetTags();
|
||||||
if(tags.size())
|
if (tags.size())
|
||||||
{
|
{
|
||||||
for(std::list<std::string>::const_iterator iter = tags.begin(), begin = tags.begin(), end = tags.end(); iter != end; iter++)
|
for (std::list<std::string>::const_iterator iter = tags.begin(), begin = tags.begin(), end = tags.end(); iter != end; iter++)
|
||||||
{
|
{
|
||||||
if(iter != begin)
|
if (iter != begin)
|
||||||
tagsStream << " ";
|
tagsStream << " ";
|
||||||
tagsStream << *iter;
|
tagsStream << *iter;
|
||||||
}
|
}
|
||||||
@ -998,6 +1000,9 @@ void GameView::NotifySaveChanged(GameModel * sender)
|
|||||||
tagSimulationButton->SetText("[no tags set]");
|
tagSimulationButton->SetText("[no tags set]");
|
||||||
}
|
}
|
||||||
currentSaveType = 1;
|
currentSaveType = 1;
|
||||||
|
int saveID = sender->GetSave()->GetID();
|
||||||
|
if (saveID == 404 || saveID == 2157797)
|
||||||
|
saveReuploadAllowed = false;
|
||||||
}
|
}
|
||||||
else if (sender->GetSaveFile())
|
else if (sender->GetSaveFile())
|
||||||
{
|
{
|
||||||
@ -1032,7 +1037,7 @@ void GameView::NotifySaveChanged(GameModel * sender)
|
|||||||
tagSimulationButton->SetText("[no tags set]");
|
tagSimulationButton->SetText("[no tags set]");
|
||||||
currentSaveType = 0;
|
currentSaveType = 0;
|
||||||
}
|
}
|
||||||
saveSimulationButton->Enabled = (saveSimulationButtonEnabled || ctrlBehaviour);
|
saveSimulationButton->Enabled = (saveSimulationButtonEnabled && saveReuploadAllowed) || ctrlBehaviour;
|
||||||
SetSaveButtonTooltips();
|
SetSaveButtonTooltips();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2045,7 +2050,7 @@ void GameView::disableCtrlBehaviour()
|
|||||||
saveSimulationButton->Appearance.BackgroundInactive = ui::Colour(0, 0, 0);
|
saveSimulationButton->Appearance.BackgroundInactive = ui::Colour(0, 0, 0);
|
||||||
saveSimulationButton->Appearance.BackgroundHover = ui::Colour(20, 20, 20);
|
saveSimulationButton->Appearance.BackgroundHover = ui::Colour(20, 20, 20);
|
||||||
saveSimulationButton->Appearance.TextInactive = saveSimulationButton->Appearance.TextHover = ui::Colour(255, 255, 255);
|
saveSimulationButton->Appearance.TextInactive = saveSimulationButton->Appearance.TextHover = ui::Colour(255, 255, 255);
|
||||||
saveSimulationButton->Enabled = saveSimulationButtonEnabled;
|
saveSimulationButton->Enabled = saveSimulationButtonEnabled && saveReuploadAllowed;
|
||||||
SetSaveButtonTooltips();
|
SetSaveButtonTooltips();
|
||||||
searchButton->Appearance.BackgroundInactive = ui::Colour(0, 0, 0);
|
searchButton->Appearance.BackgroundInactive = ui::Colour(0, 0, 0);
|
||||||
searchButton->Appearance.BackgroundHover = ui::Colour(20, 20, 20);
|
searchButton->Appearance.BackgroundHover = ui::Colour(20, 20, 20);
|
||||||
|
@ -86,6 +86,7 @@ private:
|
|||||||
ui::Button * reloadButton;
|
ui::Button * reloadButton;
|
||||||
ui::Button * saveSimulationButton;
|
ui::Button * saveSimulationButton;
|
||||||
bool saveSimulationButtonEnabled;
|
bool saveSimulationButtonEnabled;
|
||||||
|
bool saveReuploadAllowed;
|
||||||
ui::Button * downVoteButton;
|
ui::Button * downVoteButton;
|
||||||
ui::Button * upVoteButton;
|
ui::Button * upVoteButton;
|
||||||
ui::Button * tagSimulationButton;
|
ui::Button * tagSimulationButton;
|
||||||
|
Reference in New Issue
Block a user