From 76947cefbc4e14b933a62ce4d252701e886f9952 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Mon, 7 Jan 2013 13:24:38 -0500 Subject: [PATCH] paused checkbox when saving --- src/save/ServerSaveActivity.cpp | 8 +++++++- src/save/ServerSaveActivity.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/save/ServerSaveActivity.cpp b/src/save/ServerSaveActivity.cpp index de61dbe96..a666a7336 100644 --- a/src/save/ServerSaveActivity.cpp +++ b/src/save/ServerSaveActivity.cpp @@ -10,6 +10,7 @@ #include "client/Client.h" #include "tasks/Task.h" #include "Style.h" +#include "client/GameSave.h" class ServerSaveActivity::CancelAction: public ui::ButtonAction { @@ -97,7 +98,7 @@ ServerSaveActivity::ServerSaveActivity(SaveInfo save, ServerSaveActivity::SaveUp descriptionField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft; AddComponent(descriptionField); - publishedCheckbox = new ui::Checkbox(ui::Point(8, 45), ui::Point((Size.X/2)-16, 16), "Publish", ""); + publishedCheckbox = new ui::Checkbox(ui::Point(8, 45), ui::Point((Size.X/2)-80, 16), "Publish", ""); if(Client::Ref().GetAuthUser().Username != save.GetUserName()) { //Save is not owned by the user, disable by default @@ -110,6 +111,10 @@ ServerSaveActivity::ServerSaveActivity(SaveInfo save, ServerSaveActivity::SaveUp } AddComponent(publishedCheckbox); + pausedCheckbox = new ui::Checkbox(ui::Point(160, 45), ui::Point(55, 16), "Paused", ""); + pausedCheckbox->SetChecked(save.GetGameSave()->paused); + AddComponent(pausedCheckbox); + ui::Button * cancelButton = new ui::Button(ui::Point(0, Size.Y-16), ui::Point((Size.X/2)-75, 16), "Cancel"); cancelButton->Appearance.HorizontalAlign = ui::Appearance::AlignLeft; cancelButton->Appearance.VerticalAlign = ui::Appearance::AlignMiddle; @@ -206,6 +211,7 @@ void ServerSaveActivity::saveUpload() save.SetPublished(publishedCheckbox->GetChecked()); save.SetUserName(Client::Ref().GetAuthUser().Username); save.SetID(0); + save.GetGameSave()->paused = pausedCheckbox->GetChecked(); if(Client::Ref().UploadSave(save) != RequestOkay) { diff --git a/src/save/ServerSaveActivity.h b/src/save/ServerSaveActivity.h index 4bf581ca9..5f4cdfefc 100644 --- a/src/save/ServerSaveActivity.h +++ b/src/save/ServerSaveActivity.h @@ -41,6 +41,7 @@ protected: ui::Textbox * nameField; ui::Textbox * descriptionField; ui::Checkbox * publishedCheckbox; + ui::Checkbox * pausedCheckbox; class CancelAction; class SaveAction; friend class CancelAction;