use override in all possible places

This commit is contained in:
jacob1 2019-03-09 20:42:54 -05:00
parent d3fe7e39a5
commit 55e6074942
82 changed files with 457 additions and 426 deletions

View File

@ -194,7 +194,7 @@ class {0}: public SimTool
public:
{0}();
virtual ~{0}();
virtual int Perform(Simulation * sim, Particle * cpart, int x, int y, int brushX, int brushY, float strength);
int Perform(Simulation * sim, Particle * cpart, int x, int y, int brushX, int brushY, float strength) override;
}};
""".format(className, str.join("\n", classMembers))

View File

@ -19,16 +19,16 @@ public:
{
Show();
}
virtual void Exit()
void Exit() override
{
Hide();
SelfDestruct();
}
virtual void Show()
void Show() override
{
MakeActiveWindow();
}
virtual void Hide()
void Hide() override
{
CloseActiveWindow();
}

View File

@ -10,6 +10,6 @@ class DebugLines : public DebugInfo
GameController * controller;
public:
DebugLines(unsigned int id, GameView * view, GameController * controller);
virtual void Draw();
void Draw() override;
virtual ~DebugLines();
};

View File

@ -8,6 +8,6 @@ class DebugParts : public DebugInfo
Simulation * sim;
public:
DebugParts(unsigned int id, Simulation * sim);
virtual void Draw();
void Draw() override;
virtual ~DebugParts();
};

View File

@ -9,6 +9,6 @@ class ElementPopulationDebug : public DebugInfo
float maxAverage;
public:
ElementPopulationDebug(unsigned int id, Simulation * sim);
virtual void Draw();
void Draw() override;
virtual ~ElementPopulationDebug();
};

View File

@ -12,7 +12,7 @@ class ParticleDebug : public DebugInfo
public:
ParticleDebug(unsigned int id, Simulation * sim, GameModel * model);
void Debug(int mode, int x, int y);
virtual bool KeyPress(int key, int scan, bool shift, bool ctrl, bool alt, ui::Point currentMouse);
bool KeyPress(int key, int scan, bool shift, bool ctrl, bool alt, ui::Point currentMouse) override;
virtual ~ParticleDebug();
};

View File

@ -25,7 +25,7 @@ ColourPickerActivity::ColourPickerActivity(ui::Colour initialColour, ColourPicke
public:
ColourChange(ColourPickerActivity * a) : a(a) {}
void TextChangedCallback(ui::Textbox * sender)
void TextChangedCallback(ui::Textbox * sender) override
{
int r, g, b, alpha;
r = a->rValue->GetText().ToNumber<int>(true);
@ -79,7 +79,7 @@ ColourPickerActivity::ColourPickerActivity(ui::Colour initialColour, ColourPicke
ColourPickerActivity * a;
public:
OkayAction(ColourPickerActivity * a) : a(a) { }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
int Red, Green, Blue;
Red = a->rValue->GetText().ToNumber<int>(true);

View File

@ -33,12 +33,12 @@ class ColourPickerActivity: public WindowActivity {
void UpdateTextboxes(int r, int g, int b, int a);
public:
virtual void OnMouseMove(int x, int y, int dx, int dy);
virtual void OnMouseDown(int x, int y, unsigned button);
virtual void OnMouseUp(int x, int y, unsigned button);
virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
virtual void OnTryExit(ExitMethod method);
void OnMouseMove(int x, int y, int dx, int dy) override;
void OnMouseDown(int x, int y, unsigned button) override;
void OnMouseUp(int x, int y, unsigned button) override;
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
void OnTryExit(ExitMethod method) override;
ColourPickerActivity(ui::Colour initialColour, ColourPickedCallback * callback = NULL);
virtual ~ColourPickerActivity();
virtual void OnDraw();
void OnDraw() override;
};

View File

@ -10,7 +10,7 @@ ConsoleView::ConsoleView():
ConsoleView * v;
public:
CommandHighlighter(ConsoleView * v_) { v = v_; }
virtual void TextChangedCallback(ui::Textbox * sender)
void TextChangedCallback(ui::Textbox * sender) override
{
sender->SetDisplayText(v->c->FormatCommand(sender->GetText()));
}

View File

@ -39,7 +39,7 @@ ConfirmPrompt::ConfirmPrompt(String title, String message, ConfirmDialogueCallba
ConfirmPrompt * prompt;
DialogueResult result;
CloseAction(ConfirmPrompt * prompt_, DialogueResult result_) { prompt = prompt_; result = result_; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
prompt->CloseActiveWindow();
if(prompt->callback)
@ -101,7 +101,7 @@ ConfirmPrompt::ConfirmPrompt(String title, String message, String buttonText, Co
ConfirmPrompt * prompt;
DialogueResult result;
CloseAction(ConfirmPrompt * prompt_, DialogueResult result_) { prompt = prompt_; result = result_; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
prompt->CloseActiveWindow();
if(prompt->callback)
@ -136,7 +136,7 @@ bool ConfirmPrompt::Blocking(String title, String message, String buttonText)
public:
bool & outputResult;
BlockingPromptCallback(bool & output): outputResult(output) {}
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
if (result == ConfirmPrompt::ResultOkay)
outputResult = true;
else

View File

@ -11,7 +11,7 @@ public:
ConfirmPrompt(String title, String message, ConfirmDialogueCallback * callback_ = NULL);
ConfirmPrompt(String title, String message, String buttonText, ConfirmDialogueCallback * callback_ = NULL);
static bool Blocking(String title, String message, String buttonText = String("Confirm"));
virtual void OnDraw();
void OnDraw() override;
virtual ~ConfirmPrompt();
ConfirmDialogueCallback * callback;
};

View File

@ -29,7 +29,7 @@ ErrorMessage::ErrorMessage(String title, String message, ErrorMessageCallback *
ErrorMessage * message;
public:
DismissAction(ErrorMessage * message_) { message = message_; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
message->CloseActiveWindow();
if(message->callback)
@ -55,7 +55,7 @@ void ErrorMessage::Blocking(String title, String message)
class BlockingDismissCallback: public ErrorMessageCallback {
public:
BlockingDismissCallback() {}
virtual void DismissCallback() {
void DismissCallback() override {
ui::Engine::Ref().Break();
}
virtual ~BlockingDismissCallback() { }

View File

@ -9,7 +9,7 @@ class ErrorMessage: public ui::Window {
public:
ErrorMessage(String title, String message, ErrorMessageCallback * callback_ = NULL);
static void Blocking(String title, String message);
virtual void OnDraw();
void OnDraw() override;
virtual ~ErrorMessage();
};

View File

@ -57,7 +57,7 @@ InformationMessage::InformationMessage(String title, String message, bool large)
InformationMessage * message;
public:
DismissAction(InformationMessage * message_) { message = message_; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
message->CloseActiveWindow();
message->SelfDestruct(); //TODO: Fix component disposal

View File

@ -6,7 +6,7 @@
class InformationMessage: public ui::Window {
public:
InformationMessage(String title, String message, bool large);
virtual void OnDraw();
void OnDraw() override;
virtual ~InformationMessage();
};

View File

@ -37,7 +37,7 @@ SaveIDMessage::SaveIDMessage(int id):
SaveIDMessage * message;
public:
DismissAction(SaveIDMessage * message_) { message = message_; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
message->CloseActiveWindow();
message->SelfDestruct();

View File

@ -6,8 +6,8 @@
class SaveIDMessage: public ui::Window {
public:
SaveIDMessage(int id);
virtual void OnDraw();
virtual void OnTryExit(ExitMethod method);
void OnDraw() override;
void OnTryExit(ExitMethod method) override;
virtual ~SaveIDMessage();
};

View File

@ -12,7 +12,7 @@ public:
TextPrompt * prompt;
TextPrompt::DialogueResult result;
CloseAction(TextPrompt * prompt_, TextPrompt::DialogueResult result_) { prompt = prompt_; result = result_; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
prompt->CloseActiveWindow();
if(prompt->callback)
@ -85,7 +85,7 @@ String TextPrompt::Blocking(String title, String message, String text, String pl
String & outputString;
public:
BlockingTextCallback(String & output) : outputString(output) {}
virtual void TextCallback(TextPrompt::DialogueResult result, String resultText) {
void TextCallback(TextPrompt::DialogueResult result, String resultText) override {
if(result == ResultOkay)
outputString = resultText;
else

View File

@ -13,7 +13,7 @@ public:
enum DialogueResult { ResultCancel, ResultOkay };
TextPrompt(String title, String message, String text, String placeholder, bool multiline, TextDialogueCallback * callback_);
static String Blocking(String title, String message, String text, String placeholder, bool multiline);
virtual void OnDraw();
void OnDraw() override;
virtual ~TextPrompt();
TextDialogueCallback * callback;
};

View File

@ -15,7 +15,7 @@ class ElementSearchActivity::ToolAction: public ui::ButtonAction
public:
Tool * tool;
ToolAction(ElementSearchActivity * a, Tool * tool) : a(a), tool(tool) { }
void ActionCallback(ui::Button * sender_)
void ActionCallback(ui::Button * sender_) override
{
ToolButton *sender = (ToolButton*)sender_;
if(sender->GetSelectionState() >= 0 && sender->GetSelectionState() <= 2)
@ -47,7 +47,7 @@ ElementSearchActivity::ElementSearchActivity(GameController * gameController, st
ElementSearchActivity * a;
public:
SearchAction(ElementSearchActivity * a) : a(a) {}
virtual void TextChangedCallback(ui::Textbox * sender) {
void TextChangedCallback(ui::Textbox * sender) override {
a->searchTools(sender->GetText());
}
};
@ -63,7 +63,7 @@ ElementSearchActivity::ElementSearchActivity(GameController * gameController, st
ElementSearchActivity * a;
public:
CloseAction(ElementSearchActivity * a) : a(a) { }
void ActionCallback(ui::Button * sender_)
void ActionCallback(ui::Button * sender_) override
{
a->exit = true;
}
@ -74,7 +74,7 @@ ElementSearchActivity::ElementSearchActivity(GameController * gameController, st
ElementSearchActivity * a;
public:
OKAction(ElementSearchActivity * a) : a(a) { }
void ActionCallback(ui::Button * sender_)
void ActionCallback(ui::Button * sender_) override
{
if(a->GetFirstResult())
a->SetActiveTool(0, a->GetFirstResult());

View File

@ -32,11 +32,11 @@ public:
ElementSearchActivity(GameController * gameController, std::vector<Tool*> tools);
void SetActiveTool(int selectionState, Tool * tool);
virtual ~ElementSearchActivity();
virtual void OnTick(float dt);
virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
virtual void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
virtual void OnDraw();
virtual void ToolTip(ui::Point senderPosition, String ToolTip);
void OnTick(float dt) override;
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
void OnDraw() override;
void ToolTip(ui::Point senderPosition, String ToolTip) override;
};
#endif /* ELEMENTSEARCHACTIVITY_H_ */

View File

@ -21,15 +21,15 @@ class SaveSelectedAction: public ui::SaveButtonAction
FileBrowserActivity * a;
public:
SaveSelectedAction(FileBrowserActivity * _a) { a = _a; }
virtual void ActionCallback(ui::SaveButton * sender)
void ActionCallback(ui::SaveButton * sender) override
{
a->SelectSave(sender->GetSaveFile());
}
virtual void AltActionCallback(ui::SaveButton * sender)
void AltActionCallback(ui::SaveButton * sender) override
{
a->RenameSave(sender->GetSaveFile());
}
virtual void AltActionCallback2(ui::SaveButton * sender)
void AltActionCallback2(ui::SaveButton * sender) override
{
a->DeleteSave(sender->GetSaveFile());
}
@ -42,17 +42,17 @@ class LoadFilesTask: public Task
ByteString search;
std::vector<SaveFile*> saveFiles;
virtual void before()
void before() override
{
}
virtual void after()
void after() override
{
}
virtual bool doWork()
bool doWork() override
{
std::vector<ByteString> files = Client::Ref().DirectorySearch(directory, search, ".cps");
std::sort(files.rbegin(), files.rend(), [](ByteString a, ByteString b) { return a.ToLower() < b.ToLower(); });
@ -99,7 +99,7 @@ class FileBrowserActivity::SearchAction: public ui::TextboxAction
public:
FileBrowserActivity * a;
SearchAction(FileBrowserActivity * a) : a(a) {}
virtual void TextChangedCallback(ui::Textbox * sender) {
void TextChangedCallback(ui::Textbox * sender) override {
a->DoSearch(sender->GetText().ToUtf8());
}
};

View File

@ -47,10 +47,10 @@ class FileBrowserActivity: public TaskListener, public WindowActivity
void populateList();
public:
FileBrowserActivity(ByteString directory, FileSelectedCallback * callback);
virtual void OnDraw();
virtual void OnTick(float dt);
virtual void OnTryExit(ExitMethod method);
virtual void OnMouseDown(int x, int y, unsigned button);
void OnDraw() override;
void OnTick(float dt) override;
void OnTryExit(ExitMethod method) override;
void OnMouseDown(int x, int y, unsigned button) override;
void loadDirectory(ByteString directory, ByteString search);
void SelectSave(SaveFile * file);
void DeleteSave(SaveFile * file);
@ -58,8 +58,8 @@ public:
void DoSearch(ByteString search);
virtual ~FileBrowserActivity();
virtual void NotifyDone(Task * task);
virtual void NotifyError(Task * task);
virtual void NotifyProgress(Task * task);
virtual void NotifyStatus(Task * task);
void NotifyDone(Task * task) override;
void NotifyError(Task * task) override;
void NotifyProgress(Task * task) override;
void NotifyStatus(Task * task) override;
};

View File

@ -583,28 +583,28 @@ void FontEditor::OnMouseDown(int x, int y, unsigned button)
}
}
void FontEditor::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt)
void FontEditor::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt)
{
if(IsFocused(NULL))
if (IsFocused(NULL))
{
switch(key)
switch(scan)
{
case SDLK_LEFT:
case SDL_SCANCODE_LEFT:
PrevChar(); break;
case SDLK_RIGHT:
case SDL_SCANCODE_RIGHT:
PrevChar(); break;
case SDLK_ESCAPE:
case 'q':
case SDL_SCANCODE_ESCAPE:
case SDL_SCANCODE_Q:
if(savedButton->GetToggleState())
ui::Engine::Ref().Exit();
else
ui::Engine::Ref().ConfirmExit();
break;
case 'c':
case SDL_SCANCODE_C:
clipboardWidth = fontWidths[currentChar];
clipboardPixels = fontPixels[currentChar];
break;
case 'v':
case SDL_SCANCODE_V:
fontWidths[currentChar] = clipboardWidth;
fontPixels[currentChar] = clipboardPixels;
break;

View File

@ -67,9 +67,9 @@ private:
public:
FontEditor(ByteString header);
void OnDraw();
void OnMouseDown(int x, int y, unsigned button);
void OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt);
void OnDraw() override;
void OnMouseDown(int x, int y, unsigned button) override;
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
};
#endif

View File

@ -47,7 +47,7 @@ public:
SetRadius(radius);
};
virtual void GenerateBitmap()
void GenerateBitmap() override
{
if(origBitmap)
{

View File

@ -68,16 +68,16 @@ public:
{
}
virtual ~DecorationTool() {}
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position){
void Draw(Simulation * sim, Brush * brush, ui::Point position) override{
sim->ApplyDecorationPoint(position.X, position.Y, Red, Green, Blue, Alpha, toolID, brush);
}
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging) {
void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging) override {
sim->ApplyDecorationLine(position1.X, position1.Y, position2.X, position2.Y, Red, Green, Blue, Alpha, toolID, brush);
}
virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) {
void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override {
sim->ApplyDecorationBox(position1.X, position1.Y, position2.X, position2.Y, Red, Green, Blue, Alpha, toolID);
}
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) {
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override {
pixel loc = ren->vid[position.X+position.Y*WINDOWW];
if (toolID == DECO_CLEAR)
sim->ApplyDecorationFill(ren, position.X, position.Y, 0, 0, 0, 0, PIXR(loc), PIXG(loc), PIXB(loc));

View File

@ -12,7 +12,7 @@ public:
{
SetRadius(size_);
}
virtual void GenerateBitmap()
void GenerateBitmap() override
{
delete[] bitmap;
bitmap = new unsigned char[size.X*size.Y];

View File

@ -46,7 +46,7 @@ class GameController::SearchCallback: public ControllerCallback
GameController * cc;
public:
SearchCallback(GameController * cc_) { cc = cc_; }
virtual void ControllerExit()
void ControllerExit() override
{
if(cc->search->GetLoadedSave())
{
@ -69,7 +69,7 @@ class GameController::SaveOpenCallback: public ControllerCallback
GameController * cc;
public:
SaveOpenCallback(GameController * cc_) { cc = cc_; }
virtual void ControllerExit()
void ControllerExit() override
{
if(cc->activePreview->GetDoOpen() && cc->activePreview->GetSaveInfo())
{
@ -91,7 +91,7 @@ class GameController::OptionsCallback: public ControllerCallback
GameController * cc;
public:
OptionsCallback(GameController * cc_) { cc = cc_; }
virtual void ControllerExit()
void ControllerExit() override
{
cc->gameModel->UpdateQuickOptions();
Client::Ref().WritePrefs();
@ -103,7 +103,7 @@ class GameController::TagsCallback: public ControllerCallback
GameController * cc;
public:
TagsCallback(GameController * cc_) { cc = cc_; }
virtual void ControllerExit()
void ControllerExit() override
{
cc->gameView->NotifySaveChanged(cc->gameModel);
}
@ -114,7 +114,7 @@ class GameController::StampsCallback: public ControllerCallback
GameController * cc;
public:
StampsCallback(GameController * cc_) { cc = cc_; }
virtual void ControllerExit()
void ControllerExit() override
{
SaveFile *file = cc->localBrowser->GetSave();
if (file)
@ -351,7 +351,7 @@ void GameController::Install()
public:
GameController * c;
InstallConfirmation(GameController * c_) { c = c_; }
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
if (result == ConfirmPrompt::ResultOkay)
{
if(Client::Ref().DoInstallation())
@ -1246,7 +1246,7 @@ void GameController::OpenLocalSaveWindow(bool asCurrent)
public:
LocalSaveCallback(GameController * _c): c(_c) {}
virtual ~LocalSaveCallback() {}
virtual void FileSaved(SaveFile* file)
void FileSaved(SaveFile* file) override
{
c->gameModel->SetSaveFile(file);
}
@ -1311,7 +1311,7 @@ void GameController::OpenLocalBrowse()
public:
LocalSaveOpenCallback(GameController * _c): c(_c) {}
virtual ~LocalSaveOpenCallback() {};
virtual void FileSelected(SaveFile* file)
void FileSelected(SaveFile* file) override
{
c->HistorySnapshot();
c->LoadSaveFile(file);
@ -1364,8 +1364,8 @@ void GameController::OpenColourPicker()
GameController * c;
public:
ColourPickerCallback(GameController * _c): c(_c) {}
virtual ~ColourPickerCallback() {};
virtual void ColourPicked(ui::Colour colour)
virtual ~ColourPickerCallback() {}
void ColourPicked(ui::Colour colour) override
{
c->SetColour(colour);
}
@ -1429,7 +1429,7 @@ void GameController::OpenSaveWindow()
public:
SaveUploadedCallback(GameController * _c): c(_c) {}
virtual ~SaveUploadedCallback() {}
virtual void SaveUploaded(SaveInfo save)
void SaveUploaded(SaveInfo save) override
{
save.SetVote(1);
save.SetVotesUp(1);
@ -1477,7 +1477,7 @@ void GameController::SaveAsCurrent()
public:
SaveUploadedCallback(GameController * _c): c(_c) {}
virtual ~SaveUploadedCallback() {}
virtual void SaveUploaded(SaveInfo save)
void SaveUploaded(SaveInfo save) override
{
c->LoadSave(&save);
}
@ -1616,7 +1616,7 @@ void GameController::NotifyNewNotification(Client * sender, std::pair<String, By
LinkNotification(ByteString link_, String message) : Notification(message), link(link_) {}
virtual ~LinkNotification() {}
virtual void Action()
void Action() override
{
Platform::OpenURI(link);
}
@ -1630,7 +1630,7 @@ void GameController::NotifyUpdateAvailable(Client * sender)
public:
GameController * c;
UpdateConfirmation(GameController * c_) { c = c_; }
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
if (result == ConfirmPrompt::ResultOkay)
{
c->RunUpdater();
@ -1646,7 +1646,7 @@ void GameController::NotifyUpdateAvailable(Client * sender)
UpdateNotification(GameController * c, String message) : Notification(message), c(c) {}
virtual ~UpdateNotification() {}
virtual void Action()
void Action() override
{
UpdateInfo info = Client::Ref().GetUpdateInfo();
StringBuilder updateMessage;

View File

@ -165,9 +165,9 @@ public:
void RemoveNotification(Notification * notification);
virtual void NotifyUpdateAvailable(Client * sender);
virtual void NotifyAuthUserChanged(Client * sender);
virtual void NotifyNewNotification(Client * sender, std::pair<String, ByteString> notification);
void NotifyUpdateAvailable(Client * sender) override;
void NotifyAuthUserChanged(Client * sender) override;
void NotifyNewNotification(Client * sender, std::pair<String, ByteString> notification) override;
void RunUpdater();
};

View File

@ -8,11 +8,11 @@ struct GameModelException: public exception {
String message;
public:
GameModelException(String message_): message(message_) {}
const char * what() const throw()
const char * what() const throw() override
{
return message.ToUtf8().c_str();
}
~GameModelException() throw() {};
~GameModelException() throw() {}
};
#endif /* GAMEMODELEXCEPTION_H_ */

View File

@ -72,7 +72,7 @@ public:
}
}
}
virtual void OnMouseUnclick(int x, int y, unsigned int button)
void OnMouseUnclick(int x, int y, unsigned int button) override
{
if(isButtonDown)
{
@ -84,22 +84,18 @@ public:
ui::Button::OnMouseUnclick(x, y, button);
}
virtual void OnMouseHover(int x, int y, int dx, int dy)
void OnMouseHover(int x, int y) override
{
SetToolTip(x, y);
}
virtual void OnMouseHover(int x, int y)
{
SetToolTip(x, y);
}
virtual void OnMouseEnter(int x, int y)
void OnMouseEnter(int x, int y) override
{
isMouseInside = true;
if(!Enabled)
return;
SetToolTip(x, y);
}
virtual void TextPosition(String ButtonText)
void TextPosition(String ButtonText) override
{
ui::Button::TextPosition(ButtonText);
textPosition.X += 3;
@ -109,7 +105,7 @@ public:
toolTip = newToolTip1;
toolTip2 = newToolTip2;
}
virtual void OnMouseClick(int x, int y, unsigned int button)
void OnMouseClick(int x, int y, unsigned int button) override
{
ui::Button::OnMouseClick(x, y, button);
rightDown = false;
@ -133,7 +129,7 @@ public:
if(splitActionCallback)
splitActionCallback->ActionCallbackLeft(this);
}
void Draw(const ui::Point& screenPos)
void Draw(const ui::Point& screenPos) override
{
ui::Button::Draw(screenPos);
Graphics * g = GetGraphics();
@ -213,7 +209,7 @@ GameView::GameView():
GameView * v;
public:
SearchAction(GameView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
if(v->CtrlBehaviour())
v->c->OpenLocalBrowse();
@ -241,11 +237,11 @@ GameView::GameView():
GameView * v;
public:
ReloadAction(GameView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->ReloadSim();
}
void AltActionCallback(ui::Button * sender)
void AltActionCallback(ui::Button * sender) override
{
v->c->OpenSavePreview();
}
@ -262,14 +258,14 @@ GameView::GameView():
GameView * v;
public:
SaveSimulationAction(GameView * _v) { v = _v; }
void ActionCallbackRight(ui::Button * sender)
void ActionCallbackRight(ui::Button * sender) override
{
if(v->CtrlBehaviour() || !Client::Ref().GetAuthUser().UserID)
v->c->OpenLocalSaveWindow(false);
else
v->c->OpenSaveWindow();
}
void ActionCallbackLeft(ui::Button * sender)
void ActionCallbackLeft(ui::Button * sender) override
{
if(v->CtrlBehaviour() || !Client::Ref().GetAuthUser().UserID)
v->c->OpenLocalSaveWindow(true);
@ -290,7 +286,7 @@ GameView::GameView():
GameView * v;
public:
UpVoteAction(GameView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->Vote(1);
}
@ -308,7 +304,7 @@ GameView::GameView():
GameView * v;
public:
DownVoteAction(GameView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->Vote(-1);
}
@ -326,7 +322,7 @@ GameView::GameView():
GameView * v;
public:
TagSimulationAction(GameView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->OpenTags();
}
@ -343,7 +339,7 @@ GameView::GameView():
GameView * v;
public:
ClearSimAction(GameView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->ClearSim();
}
@ -359,11 +355,11 @@ GameView::GameView():
GameView * v;
public:
LoginAction(GameView * _v) { v = _v; }
void ActionCallbackLeft(ui::Button * sender)
void ActionCallbackLeft(ui::Button * sender) override
{
v->c->OpenLogin();
}
void ActionCallbackRight(ui::Button * sender)
void ActionCallbackRight(ui::Button * sender) override
{
v->c->OpenProfile();
}
@ -379,7 +375,7 @@ GameView::GameView():
GameView * v;
public:
SimulationOptionAction(GameView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->OpenOptions();
}
@ -395,7 +391,7 @@ GameView::GameView():
GameView * v;
public:
DisplayModeAction(GameView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->OpenRenderOptions();
}
@ -411,7 +407,7 @@ GameView::GameView():
GameView * v;
public:
PauseAction(GameView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->SetPaused(sender->GetToggleState());
}
@ -427,7 +423,7 @@ GameView::GameView():
GameView * v;
public:
ElementSearchAction(GameView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->OpenElementSearch();
}
@ -442,7 +438,7 @@ GameView::GameView():
GameView * v;
public:
ColourPickerAction(GameView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->OpenColourPicker();
}
@ -484,7 +480,7 @@ public:
else
needsClick = false;
}
void MouseEnterCallback(ui::Button * sender)
void MouseEnterCallback(ui::Button * sender) override
{
// don't immediately change the active menu, the actual set is done inside GameView::OnMouseMove
// if we change it here it causes components to be removed, which causes the window to stop sending events
@ -492,7 +488,7 @@ public:
if(!needsClick && !v->GetMouseDown())
v->SetActiveMenuDelayed(menuID);
}
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
if (needsClick)
v->c->SetActiveMenu(menuID);
@ -506,7 +502,7 @@ class GameView::OptionAction: public ui::ButtonAction
QuickOption * option;
public:
OptionAction(QuickOption * _option) { option = _option; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
option->Perform();
}
@ -517,7 +513,7 @@ class GameView::OptionListener: public QuickOptionListener
ui::Button * button;
public:
OptionListener(ui::Button * _button) { button = _button; }
virtual void OnValueChanged(QuickOption * option)
void OnValueChanged(QuickOption * option) override
{
switch(option->GetType())
{
@ -537,7 +533,7 @@ class GameView::ToolAction: public ui::ButtonAction
public:
Tool * tool;
ToolAction(GameView * _v, Tool * tool_) { v = _v; tool = tool_; }
void ActionCallback(ui::Button * sender_)
void ActionCallback(ui::Button * sender_) override
{
ToolButton *sender = (ToolButton*)sender_;
if (v->ShiftBehaviour() && v->CtrlBehaviour() && !v->AltBehaviour())
@ -832,7 +828,7 @@ void GameView::NotifyColourPresetsChanged(GameModel * sender)
public:
int preset;
ColourPresetAction(GameView * _v, int preset) : preset(preset) { v = _v; }
void ActionCallback(ui::Button * sender_)
void ActionCallback(ui::Button * sender_) override
{
v->c->SetActiveColourPreset(preset);
v->c->SetColour(sender_->Appearance.BackgroundInactive);
@ -1871,7 +1867,7 @@ void GameView::NotifyNotificationsChanged(GameModel * sender)
Notification * notification;
public:
NotificationButtonAction(Notification * notification) : notification(notification) { }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
notification->Action();
//v->c->RemoveNotification(notification);
@ -1883,11 +1879,11 @@ void GameView::NotifyNotificationsChanged(GameModel * sender)
Notification * notification;
public:
CloseNotificationButtonAction(GameView * v, Notification * notification) : v(v), notification(notification) { }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->RemoveNotification(notification);
}
void AltActionCallback(ui::Button * sender)
void AltActionCallback(ui::Button * sender) override
{
v->c->RemoveNotification(notification);
}

View File

@ -185,28 +185,28 @@ public:
void NotifyLastToolChanged(GameModel * sender);
virtual void ToolTip(ui::Point senderPosition, String toolTip);
void ToolTip(ui::Point senderPosition, String toolTip) override;
virtual void OnMouseMove(int x, int y, int dx, int dy);
virtual void OnMouseDown(int x, int y, unsigned button);
virtual void OnMouseUp(int x, int y, unsigned button);
virtual void OnMouseWheel(int x, int y, int d);
virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
virtual void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
virtual void OnTick(float dt);
virtual void OnDraw();
virtual void OnBlur();
void OnMouseMove(int x, int y, int dx, int dy) override;
void OnMouseDown(int x, int y, unsigned button) override;
void OnMouseUp(int x, int y, unsigned button) override;
void OnMouseWheel(int x, int y, int d) override;
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
void OnTick(float dt) override;
void OnDraw() override;
void OnBlur() override;
//Top-level handlers, for Lua interface
virtual void DoExit();
virtual void DoDraw();
virtual void DoMouseMove(int x, int y, int dx, int dy);
virtual void DoMouseDown(int x, int y, unsigned button);
virtual void DoMouseUp(int x, int y, unsigned button);
virtual void DoMouseWheel(int x, int y, int d);
virtual void DoTextInput(String text);
virtual void DoKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
virtual void DoKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
void DoExit() override;
void DoDraw() override;
void DoMouseMove(int x, int y, int dx, int dy) override;
void DoMouseDown(int x, int y, unsigned button) override;
void DoMouseUp(int x, int y, unsigned button) override;
void DoMouseWheel(int x, int y, int d) override;
void DoTextInput(String text) override;
void DoKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
void DoKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
class MenuAction;
class ToolAction;

View File

@ -22,16 +22,16 @@ public:
std::vector<StructProperty> properties;
PropertyWindow(PropertyTool *tool_, Simulation *sim);
void SetProperty();
virtual void OnDraw();
virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
virtual void OnTryExit(ExitMethod method);
void OnDraw() override;
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
void OnTryExit(ExitMethod method) override;
virtual ~PropertyWindow() {}
class OkayAction: public ui::ButtonAction
{
public:
PropertyWindow * prompt;
OkayAction(PropertyWindow * prompt_) { prompt = prompt_; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
prompt->CloseActiveWindow();
if(prompt->textField->GetText().length())
@ -68,7 +68,7 @@ sim(sim_)
PropertyWindow * w;
public:
PropertyChanged(PropertyWindow * w): w(w) { }
virtual void OptionChanged(ui::DropDown * sender, std::pair<String, int> option)
void OptionChanged(ui::DropDown * sender, std::pair<String, int> option) override
{
w->FocusComponent(w->textField);
}

View File

@ -9,11 +9,11 @@ public:
{
}
virtual bool GetToggle()
bool GetToggle() override
{
return m->GetSimulation()->pretty_powder;
}
virtual void perform()
void perform() override
{
m->GetSimulation()->pretty_powder = !m->GetSimulation()->pretty_powder;
}
@ -27,11 +27,11 @@ public:
{
}
virtual bool GetToggle()
bool GetToggle() override
{
return m->GetGravityGrid();
}
virtual void perform()
void perform() override
{
m->ShowGravityGrid(!m->GetGravityGrid());
}
@ -45,11 +45,11 @@ public:
{
}
virtual bool GetToggle()
bool GetToggle() override
{
return m->GetDecoration();
}
virtual void perform()
void perform() override
{
m->SetDecoration(!m->GetDecoration());
}
@ -63,11 +63,11 @@ public:
{
}
virtual bool GetToggle()
bool GetToggle() override
{
return m->GetNewtonianGrvity();
}
virtual void perform()
void perform() override
{
m->SetNewtonianGravity(!m->GetNewtonianGrvity());
}
@ -81,11 +81,11 @@ public:
{
}
virtual bool GetToggle()
bool GetToggle() override
{
return m->GetAHeatEnable();
}
virtual void perform()
void perform() override
{
m->SetAHeatEnable(!m->GetAHeatEnable());
}
@ -100,11 +100,11 @@ public:
{
c = c_;
}
virtual bool GetToggle()
bool GetToggle() override
{
return 0;
}
virtual void perform()
void perform() override
{
c->ShowConsole();
}

View File

@ -21,22 +21,38 @@ public:
int signID;
ui::Point signPosition;
SignWindow(SignTool * tool_, Simulation * sim_, int signID_, ui::Point position_);
virtual void OnDraw();
virtual void DoDraw();
virtual void DoMouseMove(int x, int y, int dx, int dy);
virtual void DoMouseDown(int x, int y, unsigned button);
virtual void DoMouseUp(int x, int y, unsigned button) { if(!signMoving) ui::Window::DoMouseUp(x, y, button); }
virtual void DoMouseWheel(int x, int y, int d) { if(!signMoving) ui::Window::DoMouseWheel(x, y, d); }
virtual void DoKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) { if(!signMoving) ui::Window::DoKeyPress(key, scan, repeat, shift, ctrl, alt); }
virtual void DoKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) { if(!signMoving) ui::Window::DoKeyRelease(key, scan, repeat, shift, ctrl, alt); }
void OnDraw() override;
void DoDraw() override;
void DoMouseMove(int x, int y, int dx, int dy) override;
void DoMouseDown(int x, int y, unsigned button) override;
void DoMouseUp(int x, int y, unsigned button) override
{
if(!signMoving)
ui::Window::DoMouseUp(x, y, button);
}
void DoMouseWheel(int x, int y, int d) override
{
if(!signMoving)
ui::Window::DoMouseWheel(x, y, d);
}
void DoKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override
{
if(!signMoving)
ui::Window::DoKeyPress(key, scan, repeat, shift, ctrl, alt);
}
void DoKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override
{
if(!signMoving)
ui::Window::DoKeyRelease(key, scan, repeat, shift, ctrl, alt);
}
virtual ~SignWindow() {}
virtual void OnTryExit(ui::Window::ExitMethod method);
void OnTryExit(ui::Window::ExitMethod method) override;
class OkayAction: public ui::ButtonAction
{
public:
SignWindow * prompt;
OkayAction(SignWindow * prompt_) { prompt = prompt_; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
prompt->CloseActiveWindow();
if(prompt->signID==-1 && prompt->textField->GetText().length())
@ -55,7 +71,7 @@ public:
public:
SignWindow * prompt;
DeleteAction(SignWindow * prompt_) { prompt = prompt_; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
prompt->CloseActiveWindow();
if(prompt->signID!=-1)
@ -71,7 +87,7 @@ public:
public:
SignWindow * prompt;
SignTextAction(SignWindow * prompt_) { prompt = prompt_; }
virtual void TextChangedCallback(ui::Textbox * sender)
void TextChangedCallback(ui::Textbox * sender) override
{
if(prompt->signID!=-1)
{
@ -86,7 +102,7 @@ public:
public:
SignWindow * prompt;
MoveAction(SignWindow * prompt_) { prompt = prompt_; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
if(prompt->signID!=-1)
{

View File

@ -55,11 +55,11 @@ public:
}
static VideoBuffer * GetIcon(int toolID, int width, int height);
virtual ~SignTool() {}
virtual void Click(Simulation * sim, Brush * brush, ui::Point position);
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position) { }
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) { }
virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { }
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { }
void Click(Simulation * sim, Brush * brush, ui::Point position) override;
void Draw(Simulation * sim, Brush * brush, ui::Point position) override { }
void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override { }
void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override { }
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override { }
};
class SampleTool: public Tool
@ -73,11 +73,11 @@ public:
}
static VideoBuffer * GetIcon(int toolID, int width, int height);
virtual ~SampleTool() {}
virtual void Click(Simulation * sim, Brush * brush, ui::Point position) { }
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position);
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) { }
virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { }
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { }
void Click(Simulation * sim, Brush * brush, ui::Point position) override { }
void Draw(Simulation * sim, Brush * brush, ui::Point position) override;
void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override { }
void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override { }
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override { }
};
class PropertyTool: public Tool
@ -94,11 +94,11 @@ public:
void OpenWindow(Simulation *sim);
virtual ~PropertyTool() {}
virtual void SetProperty(Simulation *sim, ui::Point position);
virtual void Click(Simulation * sim, Brush * brush, ui::Point position) { }
virtual void Draw(Simulation *sim, Brush *brush, ui::Point position);
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false);
virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2);
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position);
void Click(Simulation * sim, Brush * brush, ui::Point position) override { }
void Draw(Simulation *sim, Brush *brush, ui::Point position) override;
void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override;
void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override;
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override;
};
@ -107,10 +107,10 @@ class ElementTool: public Tool
public:
ElementTool(int id, ByteString name, String description, int r, int g, int b, ByteString identifier, VideoBuffer * (*textureGen)(int, int, int) = NULL);
virtual ~ElementTool();
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position);
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false);
virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2);
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position);
void Draw(Simulation * sim, Brush * brush, ui::Point position) override;
void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override;
void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override;
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override;
};
class Element_LIGH_Tool: public ElementTool
@ -120,10 +120,10 @@ public:
ElementTool(id, name, description, r, g, b, identifier, textureGen)
{ }
virtual ~Element_LIGH_Tool() { }
virtual void Click(Simulation * sim, Brush * brush, ui::Point position) { }
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false);
virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { }
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { }
void Click(Simulation * sim, Brush * brush, ui::Point position) override { }
void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override;
void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override { }
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override { }
};
class Element_TESC_Tool: public ElementTool
@ -133,8 +133,8 @@ public:
ElementTool(id, name, description, r, g, b, identifier, textureGen)
{ }
virtual ~Element_TESC_Tool() {}
virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2);
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position);
void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override;
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override;
};
class PlopTool: public ElementTool
@ -144,11 +144,11 @@ public:
ElementTool(id, name, description, r, g, b, identifier, textureGen)
{ }
virtual ~PlopTool() { }
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position) { }
virtual void Click(Simulation * sim, Brush * brush, ui::Point position);
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) { }
virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { }
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { }
void Draw(Simulation * sim, Brush * brush, ui::Point position) override { }
void Click(Simulation * sim, Brush * brush, ui::Point position) override;
void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override { }
void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override { }
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override { }
};
class WallTool: public Tool
@ -156,10 +156,10 @@ class WallTool: public Tool
public:
WallTool(int id, ByteString name, String description, int r, int g, int b, ByteString identifier, VideoBuffer * (*textureGen)(int, int, int) = NULL);
virtual ~WallTool();
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position);
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false);
virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2);
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position);
void Draw(Simulation * sim, Brush * brush, ui::Point position) override;
void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override;
void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override;
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override;
};
class WindTool: public Tool
@ -167,10 +167,10 @@ class WindTool: public Tool
public:
WindTool(int id, ByteString name, String description, int r, int g, int b, ByteString identifier, VideoBuffer * (*textureGen)(int, int, int) = NULL);
virtual ~WindTool() { }
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position) { }
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false);
virtual void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) { }
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { }
void Draw(Simulation * sim, Brush * brush, ui::Point position) override { }
void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override;
void DrawRect(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2) override { }
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override { }
};
#endif /* TOOL_H_ */

View File

@ -9,10 +9,10 @@ class ToolButton: public ui::Button
ByteString toolIdentifier;
public:
ToolButton(ui::Point position, ui::Point size, ByteString text_, ByteString toolIdentifier, String toolTip = String());
virtual void OnMouseUnclick(int x, int y, unsigned int button);
virtual void OnMouseUp(int x, int y, unsigned int button);
virtual void OnMouseClick(int x, int y, unsigned int button);
virtual void Draw(const ui::Point& screenPos);
void OnMouseUnclick(int x, int y, unsigned int button) override;
void OnMouseUp(int x, int y, unsigned int button) override;
void OnMouseClick(int x, int y, unsigned int button) override;
void Draw(const ui::Point& screenPos) override;
void SetSelectionState(int state);
int GetSelectionState();
virtual ~ToolButton();

View File

@ -19,7 +19,7 @@ public:
{
SetRadius(size_);
};
virtual void GenerateBitmap()
void GenerateBitmap() override
{
delete[] bitmap;
bitmap = new unsigned char[size.X*size.Y];

View File

@ -10,7 +10,7 @@ class ContextMenu::ItemSelectedAction: public ButtonAction
int item;
public:
ItemSelectedAction(ContextMenu * window, int itemID): window(window), item(itemID) { }
virtual void ActionCallback(ui::Button *sender)
void ActionCallback(ui::Button *sender) override
{
window->ActionCallbackItem(sender, item);
}

View File

@ -21,7 +21,7 @@ public:
String option;
public:
ItemSelectedAction(DropDownWindow * window, String option): window(window), option(option) { }
virtual void ActionCallback(ui::Button *sender)
void ActionCallback(ui::Button *sender) override
{
window->CloseActiveWindow();
window->setOption(option);
@ -45,7 +45,7 @@ public:
currentY += 16;
}
}
virtual void OnDraw()
void OnDraw() override
{
Graphics * g = GetGraphics();
g->clearrect(Position.X, Position.Y, Size.X, Size.Y);
@ -64,7 +64,7 @@ public:
dropDown->callback->OptionChanged(dropDown, dropDown->options[optionIndex]);
}
}
virtual void OnTryExit(ExitMethod method)
void OnTryExit(ExitMethod method) override
{
CloseActiveWindow();
SelfDestruct();

View File

@ -81,7 +81,7 @@ void Engine::ConfirmExit()
class ExitConfirmation: public ConfirmDialogueCallback {
public:
ExitConfirmation() {}
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
if (result == ConfirmPrompt::ResultOkay)
{
ui::Engine::Ref().Exit();

View File

@ -58,22 +58,22 @@ class Component;
//Get child of this component by index.
Component* GetChild(unsigned idx);
void Tick(float dt);
void Draw(const Point& screenPos);
void Tick(float dt) override;
void Draw(const Point& screenPos) override;
void OnMouseHover(int localx, int localy);
void OnMouseMoved(int localx, int localy, int dx, int dy);
void OnMouseMovedInside(int localx, int localy, int dx, int dy);
void OnMouseEnter(int localx, int localy);
void OnMouseLeave(int localx, int localy);
void OnMouseDown(int x, int y, unsigned button);
void OnMouseUp(int x, int y, unsigned button);
void OnMouseClick(int localx, int localy, unsigned button);
void OnMouseUnclick(int localx, int localy, unsigned button);
void OnMouseWheel(int localx, int localy, int d);
void OnMouseWheelInside(int localx, int localy, int d);
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
void OnMouseHover(int localx, int localy) override;
void OnMouseMoved(int localx, int localy, int dx, int dy) override;
void OnMouseMovedInside(int localx, int localy, int dx, int dy) override;
void OnMouseEnter(int localx, int localy) override;
void OnMouseLeave(int localx, int localy) override;
void OnMouseDown(int x, int y, unsigned button) override;
void OnMouseUp(int x, int y, unsigned button) override;
void OnMouseClick(int localx, int localy, unsigned button) override;
void OnMouseUnclick(int localx, int localy, unsigned button) override;
void OnMouseWheel(int localx, int localy, int d) override;
void OnMouseWheelInside(int localx, int localy, int d) override;
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
protected:
// child components

View File

@ -54,11 +54,11 @@ public:
void OnContextMenuAction(int item) override;
void OnMouseClick(int x, int y, unsigned button) override;
void OnMouseUp(int x, int y, unsigned button) override;
void OnMouseMoved(int localx, int localy, int dx, int dy);
void OnMouseMoved(int localx, int localy, int dx, int dy) override;
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
void OnVKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
void OnTextInput(String text);
void OnTextInput(String text) override;
void Draw(const Point& screenPos) override;
protected:

View File

@ -37,7 +37,7 @@ void LocalBrowserController::RemoveSelected()
public:
LocalBrowserController * c;
RemoveSelectedConfirmation(LocalBrowserController * c_) { c = c_; }
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
if (result == ConfirmPrompt::ResultOkay)
c->removeSelectedC();
}
@ -60,7 +60,7 @@ void LocalBrowserController::removeSelectedC()
LocalBrowserController * c;
public:
RemoveSavesTask(LocalBrowserController * c, std::vector<ByteString> saves_) : c(c) { saves = saves_; }
virtual bool doWork()
bool doWork() override
{
for (size_t i = 0; i < saves.size(); i++)
{
@ -70,7 +70,7 @@ void LocalBrowserController::removeSelectedC()
}
return true;
}
virtual void after()
void after() override
{
Client::Ref().updateStamps();
c->RefreshSavesList();
@ -87,7 +87,7 @@ void LocalBrowserController::RescanStamps()
public:
LocalBrowserController * c;
RescanConfirmation(LocalBrowserController * c_) { c = c_; }
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
if (result == ConfirmPrompt::ResultOkay)
c->rescanStampsC();
}

View File

@ -33,7 +33,7 @@ LocalBrowserView::LocalBrowserView():
LocalBrowserView * v;
public:
PageNumAction(LocalBrowserView * _v) { v = _v; }
void TextChangedCallback(ui::Textbox * sender)
void TextChangedCallback(ui::Textbox * sender) override
{
v->textChanged();
}
@ -55,7 +55,7 @@ LocalBrowserView::LocalBrowserView():
int offset;
public:
RelativePageAction(LocalBrowserView * _v, int _offset): v(_v), offset(_offset) {}
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->SetPageRelative(offset);
}
@ -73,7 +73,7 @@ LocalBrowserView::LocalBrowserView():
LocalBrowserView * v;
public:
UndeleteAction(LocalBrowserView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->RescanStamps();
}
@ -85,7 +85,7 @@ LocalBrowserView::LocalBrowserView():
LocalBrowserView * v;
public:
RemoveSelectedAction(LocalBrowserView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->RemoveSelected();
}
@ -182,12 +182,12 @@ void LocalBrowserView::NotifySavesListChanged(LocalBrowserModel * sender)
LocalBrowserView * v;
public:
SaveOpenAction(LocalBrowserView * _v) { v = _v; }
virtual void ActionCallback(ui::SaveButton * sender)
void ActionCallback(ui::SaveButton * sender) override
{
if(sender->GetSaveFile())
v->c->OpenSave(sender->GetSaveFile());
}
virtual void SelectedCallback(ui::SaveButton * sender)
void SelectedCallback(ui::SaveButton * sender) override
{
if(sender->GetSaveFile())
v->c->Selected(sender->GetSaveFile()->GetName(), sender->GetSelected());

View File

@ -32,14 +32,14 @@ class LocalBrowserView: public ui::Window {
public:
LocalBrowserView();
//virtual void OnDraw();
virtual void OnTick(float dt);
void OnTick(float dt) override;
void AttachController(LocalBrowserController * c_) { c = c_; }
void NotifyPageChanged(LocalBrowserModel * sender);
void NotifySavesListChanged(LocalBrowserModel * sender);
void NotifySelectedChanged(LocalBrowserModel * sender);
virtual void OnMouseWheel(int x, int y, int d);
virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
virtual void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
void OnMouseWheel(int x, int y, int d) override;
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
virtual ~LocalBrowserView();
};

View File

@ -12,7 +12,7 @@ class LoginView::LoginAction : public ui::ButtonAction
LoginView * v;
public:
LoginAction(LoginView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->Login(v->usernameField->GetText().ToUtf8(), v->passwordField->GetText().ToUtf8());
}
@ -23,7 +23,7 @@ class LoginView::CancelAction : public ui::ButtonAction
LoginView * v;
public:
CancelAction(LoginView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->Exit();
}

View File

@ -27,12 +27,12 @@ public:
class LoginAction;
class CancelAction;
LoginView();
virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
virtual void OnTryExit(ExitMethod method);
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
void OnTryExit(ExitMethod method) override;
void AttachController(LoginController * c_) { c = c_; }
void NotifyStatusChanged(LoginModel * sender);
virtual void OnDraw();
virtual void OnTick(float dt);
void OnDraw() override;
void OnTick(float dt) override;
virtual ~LoginView();
};

View File

@ -29,7 +29,9 @@ OptionsView::OptionsView():
OptionsView * v;
public:
HeatSimulationAction(OptionsView * v_){ v = v_; }
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetHeatSimulation(sender->GetChecked()); }
void ActionCallback(ui::Checkbox * sender) override {
v->c->SetHeatSimulation(sender->GetChecked());
}
};
heatSimulation = new ui::Checkbox(ui::Point(8, 23), ui::Point(Size.X-6, 16), "Heat simulation \bgIntroduced in version 34", "");
@ -44,7 +46,9 @@ OptionsView::OptionsView():
OptionsView * v;
public:
AmbientHeatSimulationAction(OptionsView * v_){ v = v_; }
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetAmbientHeatSimulation(sender->GetChecked()); }
void ActionCallback(ui::Checkbox * sender) override {
v->c->SetAmbientHeatSimulation(sender->GetChecked());
}
};
ambientHeatSimulation = new ui::Checkbox(ui::Point(8, 53), ui::Point(Size.X-6, 16), "Ambient heat simulation \bgIntroduced in version 50", "");
@ -59,7 +63,9 @@ OptionsView::OptionsView():
OptionsView * v;
public:
NewtonianGravityAction(OptionsView * v_){ v = v_; }
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetNewtonianGravity(sender->GetChecked()); }
void ActionCallback(ui::Checkbox * sender) override {
v->c->SetNewtonianGravity(sender->GetChecked());
}
};
newtonianGravity = new ui::Checkbox(ui::Point(8, 83), ui::Point(Size.X-6, 16), "Newtonian gravity \bgIntroduced in version 48", "");
@ -74,7 +80,9 @@ OptionsView::OptionsView():
OptionsView * v;
public:
WaterEqualisationAction(OptionsView * v_){ v = v_; }
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetWaterEqualisation(sender->GetChecked()); }
void ActionCallback(ui::Checkbox * sender) override {
v->c->SetWaterEqualisation(sender->GetChecked());
}
};
waterEqualisation = new ui::Checkbox(ui::Point(8, 113), ui::Point(Size.X-6, 16), "Water equalisation \bgIntroduced in version 61", "");
@ -89,7 +97,9 @@ OptionsView::OptionsView():
OptionsView * v;
public:
AirModeChanged(OptionsView * v): v(v) { }
virtual void OptionChanged(ui::DropDown * sender, std::pair<String, int> option) { v->c->SetAirMode(option.second); }
void OptionChanged(ui::DropDown * sender, std::pair<String, int> option) override {
v->c->SetAirMode(option.second);
}
};
airMode = new ui::DropDown(ui::Point(Size.X-88, 146), ui::Point(80, 16));
AddComponent(airMode);
@ -109,7 +119,9 @@ OptionsView::OptionsView():
OptionsView * v;
public:
GravityModeChanged(OptionsView * v): v(v) { }
virtual void OptionChanged(ui::DropDown * sender, std::pair<String, int> option) { v->c->SetGravityMode(option.second); }
void OptionChanged(ui::DropDown * sender, std::pair<String, int> option) override {
v->c->SetGravityMode(option.second);
}
};
gravityMode = new ui::DropDown(ui::Point(Size.X-88, 166), ui::Point(80, 16));
@ -128,7 +140,9 @@ OptionsView::OptionsView():
OptionsView * v;
public:
EdgeModeChanged(OptionsView * v): v(v) { }
virtual void OptionChanged(ui::DropDown * sender, std::pair<String, int> option) { v->c->SetEdgeMode(option.second); }
void OptionChanged(ui::DropDown * sender, std::pair<String, int> option) override {
v->c->SetEdgeMode(option.second);
}
};
edgeMode = new ui::DropDown(ui::Point(Size.X-88, 186), ui::Point(80, 16));
@ -147,7 +161,9 @@ OptionsView::OptionsView():
OptionsView * v;
public:
ScaleAction(OptionsView * v): v(v) { }
virtual void OptionChanged(ui::DropDown * sender, std::pair<String, int> option) { v->c->SetScale(option.second); }
void OptionChanged(ui::DropDown * sender, std::pair<String, int> option) override {
v->c->SetScale(option.second);
}
};
scale = new ui::DropDown(ui::Point(8, 210), ui::Point(40, 16));
{
@ -178,7 +194,7 @@ OptionsView::OptionsView():
OptionsView * v;
public:
ResizableAction(OptionsView * v_){ v = v_; }
virtual void ActionCallback(ui::Checkbox * sender)
void ActionCallback(ui::Checkbox * sender) override
{
v->c->SetResizable(sender->GetChecked());
}
@ -196,7 +212,7 @@ OptionsView::OptionsView():
OptionsView * v;
public:
FullscreenAction(OptionsView * v_){ v = v_; }
virtual void ActionCallback(ui::Checkbox * sender)
void ActionCallback(ui::Checkbox * sender) override
{
v->c->SetFullscreen(sender->GetChecked());
}
@ -214,7 +230,7 @@ OptionsView::OptionsView():
OptionsView * v;
public:
AltFullscreenAction(OptionsView * v_){ v = v_; }
virtual void ActionCallback(ui::Checkbox * sender)
void ActionCallback(ui::Checkbox * sender) override
{
v->c->SetAltFullscreen(sender->GetChecked());
}
@ -232,7 +248,7 @@ OptionsView::OptionsView():
OptionsView * v;
public:
ForceIntegerScalingAction(OptionsView * v_) { v = v_; }
virtual void ActionCallback(ui::Checkbox * sender)
void ActionCallback(ui::Checkbox * sender) override
{
v->c->SetForceIntegerScaling(sender->GetChecked());
}
@ -251,7 +267,9 @@ OptionsView::OptionsView():
OptionsView * v;
public:
FastQuitAction(OptionsView * v_){ v = v_; }
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetFastQuit(sender->GetChecked()); }
void ActionCallback(ui::Checkbox * sender) override {
v->c->SetFastQuit(sender->GetChecked());
}
};
fastquit = new ui::Checkbox(ui::Point(8, forceIntegerScaling->Position.Y + 20), ui::Point(Size.X-6, 16), "Fast Quit", "");
@ -266,7 +284,9 @@ OptionsView::OptionsView():
OptionsView * v;
public:
ShowAvatarsAction(OptionsView * v_){ v = v_; }
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetShowAvatars(sender->GetChecked()); }
void ActionCallback(ui::Checkbox * sender) override {
v->c->SetShowAvatars(sender->GetChecked());
}
};
showAvatars = new ui::Checkbox(ui::Point(8, fastquit->Position.Y + 20), ui::Point(Size.X-6, 16), "Show Avatars", "");
@ -280,7 +300,7 @@ OptionsView::OptionsView():
{
public:
DataFolderAction() { }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
//one of these should always be defined
#ifdef WIN
@ -310,7 +330,7 @@ OptionsView::OptionsView():
public:
OptionsView * v;
CloseAction(OptionsView * v_) { v = v_; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->Exit();
}

View File

@ -30,8 +30,8 @@ public:
OptionsView();
void NotifySettingsChanged(OptionsModel * sender);
void AttachController(OptionsController * c_);
void OnDraw();
void OnTryExit(ExitMethod method);
void OnDraw() override;
void OnTryExit(ExitMethod method) override;
virtual ~OptionsView();
};

View File

@ -18,7 +18,7 @@ class PreviewController: public ClientListener {
LoginController * loginWindow;
ControllerCallback * callback;
public:
virtual void NotifyAuthUserChanged(Client * sender);
void NotifyAuthUserChanged(Client * sender) override;
inline int SaveID() { return saveId; }
bool HasExited;

View File

@ -9,11 +9,11 @@ struct PreviewModelException: public exception {
String message;
public:
PreviewModelException(String message_): message(message_) {}
const char * what() const throw()
const char * what() const throw() override
{
return message.ToUtf8().c_str();
}
~PreviewModelException() throw() {};
~PreviewModelException() throw() {}
};
#endif /* PREVIEWMODELEXCEPTION_H_ */

View File

@ -22,7 +22,7 @@ class PreviewView::LoginAction: public ui::ButtonAction
PreviewView * v;
public:
LoginAction(PreviewView * v_){ v = v_; }
virtual void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->ShowLogin();
}
@ -33,7 +33,7 @@ class PreviewView::SubmitCommentAction: public ui::ButtonAction
PreviewView * v;
public:
SubmitCommentAction(PreviewView * v_){ v = v_; }
virtual void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->submitComment();
}
@ -44,7 +44,7 @@ class PreviewView::AutoCommentSizeAction: public ui::TextboxAction
PreviewView * v;
public:
AutoCommentSizeAction(PreviewView * v): v(v) {}
virtual void TextChangedCallback(ui::Textbox * sender) {
void TextChangedCallback(ui::Textbox * sender) override {
v->CheckComment();
v->commentBoxAutoHeight();
}
@ -55,7 +55,7 @@ class PreviewView::AvatarAction: public ui::AvatarButtonAction
PreviewView * v;
public:
AvatarAction(PreviewView * v_){ v = v_; }
virtual void ActionCallback(ui::AvatarButton * sender)
void ActionCallback(ui::AvatarButton * sender) override
{
if(sender->GetUsername().size() > 0)
{
@ -84,7 +84,7 @@ PreviewView::PreviewView():
PreviewView * v;
public:
FavAction(PreviewView * v_){ v = v_; }
virtual void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->FavouriteSave();
}
@ -103,7 +103,7 @@ PreviewView::PreviewView():
public:
PreviewView * v;
ReportPromptCallback(PreviewView * v_) { v = v_; }
virtual void TextCallback(TextPrompt::DialogueResult result, String resultText) {
void TextCallback(TextPrompt::DialogueResult result, String resultText) override {
if (result == TextPrompt::ResultOkay)
v->c->Report(resultText);
}
@ -115,7 +115,7 @@ PreviewView::PreviewView():
PreviewView * v;
public:
ReportAction(PreviewView * v_){ v = v_; }
virtual void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
new TextPrompt("Report Save", "Things to consider when reporting:\n\bw1)\bg When reporting stolen saves, please include the ID of the original save.\n\bw2)\bg Do not ask for saves to be removed from front page unless they break the rules.\n\bw3)\bg You may report saves for comments or tags too (including your own saves)", "", "[reason]", true, new ReportPromptCallback(v));
}
@ -132,7 +132,7 @@ PreviewView::PreviewView():
PreviewView * v;
public:
OpenAction(PreviewView * v_){ v = v_; }
virtual void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->DoOpen();
}
@ -148,7 +148,7 @@ PreviewView::PreviewView():
PreviewView * v;
public:
BrowserOpenAction(PreviewView * v_){ v = v_; }
virtual void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->OpenInBrowser();
}

View File

@ -79,13 +79,13 @@ public:
void NotifyCommentsPageChanged(PreviewModel * sender);
void NotifyCommentBoxEnabledChanged(PreviewModel * sender);
void SaveLoadingError(String errorMessage);
virtual void OnDraw();
virtual void DoDraw();
virtual void OnTick(float dt);
virtual void OnTryExit(ExitMethod method);
virtual void OnMouseWheel(int x, int y, int d);
virtual void OnMouseUp(int x, int y, unsigned int button);
virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
void OnDraw() override;
void DoDraw() override;
void OnTick(float dt) override;
void OnTryExit(ExitMethod method) override;
void OnMouseWheel(int x, int y, int d) override;
void OnMouseUp(int x, int y, unsigned int button) override;
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
virtual ~PreviewView();
};

View File

@ -28,7 +28,7 @@ ProfileActivity::ProfileActivity(ByteString username) :
ProfileActivity * a;
public:
CloseAction(ProfileActivity * a) : a(a) { }
void ActionCallback(ui::Button * sender_)
void ActionCallback(ui::Button * sender_) override
{
a->Exit();
}
@ -39,7 +39,7 @@ ProfileActivity::ProfileActivity(ByteString username) :
ProfileActivity * a;
public:
SaveAction(ProfileActivity * a) : a(a) { }
void ActionCallback(ui::Button * sender_)
void ActionCallback(ui::Button * sender_) override
{
if (!a->loading && !a->saving && a->editable)
{
@ -79,7 +79,7 @@ void ProfileActivity::setUserInfo(UserInfo newInfo)
class EditAvatarAction: public ui::ButtonAction
{
public:
void ActionCallback(ui::Button * sender_)
void ActionCallback(ui::Button * sender_) override
{
Platform::OpenURI("http://" SERVER "/Profile/Avatar.html");
}
@ -206,7 +206,7 @@ void ProfileActivity::setUserInfo(UserInfo newInfo)
public:
ProfileActivity * profileActivity;
BioChangedAction(ProfileActivity * profileActivity_) { profileActivity = profileActivity_; }
virtual void TextChangedCallback(ui::Textbox * sender)
void TextChangedCallback(ui::Textbox * sender) override
{
profileActivity->ResizeArea();
}

View File

@ -30,9 +30,9 @@ class ProfileActivity: public WindowActivity, public SaveUserInfoRequestMonitor,
public:
ProfileActivity(ByteString username);
virtual ~ProfileActivity();
virtual void OnTick(float dt);
virtual void OnDraw();
virtual void OnTryExit(ExitMethod method);
void OnTick(float dt) override;
void OnDraw() override;
void OnTryExit(ExitMethod method) override;
void OnResponse(bool saveUserInfoStatus) override;
void OnResponse(std::unique_ptr<UserInfo> getUserInfoResult) override;

View File

@ -13,7 +13,7 @@ public:
v = v_;
renderMode = renderMode_;
}
virtual void ActionCallback(ui::Checkbox * sender)
void ActionCallback(ui::Checkbox * sender) override
{
if(sender->GetChecked())
v->c->SetRenderMode(renderMode);
@ -32,7 +32,7 @@ public:
v = v_;
displayMode = displayMode_;
}
virtual void ActionCallback(ui::Checkbox * sender)
void ActionCallback(ui::Checkbox * sender) override
{
if(sender->GetChecked())
v->c->SetDisplayMode(displayMode);
@ -51,7 +51,7 @@ public:
v = v_;
colourMode = colourMode_;
}
virtual void ActionCallback(ui::Checkbox * sender)
void ActionCallback(ui::Checkbox * sender) override
{
if(sender->GetChecked())
v->c->SetColourMode(colourMode);
@ -70,7 +70,7 @@ public:
v = v_;
renderPreset = renderPreset_;
}
virtual void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->LoadRenderPreset(renderPreset);
}

View File

@ -33,12 +33,12 @@ public:
void NotifyDisplayChanged(RenderModel * sender);
void NotifyColourChanged(RenderModel * sender);
void AttachController(RenderController * c_) { c = c_; }
void OnMouseDown(int x, int y, unsigned button);
void OnTryExit(ExitMethod method);
virtual void OnDraw();
virtual void OnTick(float dt);
virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
virtual void ToolTip(ui::Point senderPosition, String toolTip);
void OnMouseDown(int x, int y, unsigned button) override;
void OnTryExit(ExitMethod method) override;
void OnDraw() override;
void OnTick(float dt) override;
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
void ToolTip(ui::Point senderPosition, String toolTip) override;
virtual ~RenderView();
};

View File

@ -19,7 +19,7 @@ class LocalSaveActivity::CancelAction: public ui::ButtonAction
LocalSaveActivity * a;
public:
CancelAction(LocalSaveActivity * a) : a(a) {}
virtual void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
a->Exit();
}
@ -30,7 +30,7 @@ class LocalSaveActivity::SaveAction: public ui::ButtonAction
LocalSaveActivity * a;
public:
SaveAction(LocalSaveActivity * a) : a(a) {}
virtual void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
a->Save();
}
@ -97,7 +97,7 @@ void LocalSaveActivity::Save()
LocalSaveActivity * a;
ByteString filename;
FileOverwriteConfirmation(LocalSaveActivity * a, ByteString finalFilename) : a(a), filename(finalFilename) {}
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
if (result == ConfirmPrompt::ResultOkay)
{
a->saveWrite(filename);

View File

@ -35,8 +35,8 @@ class LocalSaveActivity: public WindowActivity
public:
LocalSaveActivity(SaveFile save, FileSavedCallback * callback);
void saveWrite(ByteString finalFilename);
virtual void Save();
virtual void OnDraw();
virtual void OnTick(float dt);
void Save();
void OnDraw() override;
void OnTick(float dt) override;
virtual ~LocalSaveActivity();
};

View File

@ -20,7 +20,7 @@ class ServerSaveActivity::CancelAction: public ui::ButtonAction
ServerSaveActivity * a;
public:
CancelAction(ServerSaveActivity * a) : a(a) {}
virtual void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
a->Exit();
}
@ -31,7 +31,7 @@ class ServerSaveActivity::SaveAction: public ui::ButtonAction
ServerSaveActivity * a;
public:
SaveAction(ServerSaveActivity * a) : a(a) {}
virtual void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
a->Save();
}
@ -42,7 +42,7 @@ class ServerSaveActivity::PublishingAction: public ui::ButtonAction
ServerSaveActivity * a;
public:
PublishingAction(ServerSaveActivity * a) : a(a) {}
virtual void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
a->ShowPublishingInfo();
}
@ -53,7 +53,7 @@ class ServerSaveActivity::RulesAction: public ui::ButtonAction
ServerSaveActivity * a;
public:
RulesAction(ServerSaveActivity * a) : a(a) {}
virtual void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
a->ShowRules();
}
@ -64,7 +64,7 @@ class ServerSaveActivity::NameChangedAction: public ui::TextboxAction
public:
ServerSaveActivity * a;
NameChangedAction(ServerSaveActivity * a) : a(a) {}
virtual void TextChangedCallback(ui::Textbox * sender) {
void TextChangedCallback(ui::Textbox * sender) override {
a->CheckName(sender->GetText());
}
};
@ -73,17 +73,17 @@ class SaveUploadTask: public Task
{
SaveInfo save;
virtual void before()
void before() override
{
}
virtual void after()
void after() override
{
}
virtual bool doWork()
bool doWork() override
{
notifyProgress(-1);
return Client::Ref().UploadSave(save) == RequestOkay;
@ -233,7 +233,7 @@ void ServerSaveActivity::Save()
public:
ServerSaveActivity * a;
PublishConfirmation(ServerSaveActivity * a) : a(a) {}
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
if (result == ConfirmPrompt::ResultOkay)
{
a->Exit();

View File

@ -29,17 +29,17 @@ public:
ServerSaveActivity(SaveInfo save, SaveUploadedCallback * callback);
ServerSaveActivity(SaveInfo save, bool saveNow, SaveUploadedCallback * callback);
void saveUpload();
virtual void Save();
virtual void Exit();
virtual void ShowPublishingInfo();
virtual void ShowRules();
virtual void CheckName(String newname);
virtual void OnDraw();
virtual void OnTick(float dt);
void Save();
virtual void Exit() override;
void ShowPublishingInfo();
void ShowRules();
void CheckName(String newname);
virtual void OnDraw() override;
virtual void OnTick(float dt) override;
virtual ~ServerSaveActivity();
protected:
void AddAuthorInfo();
virtual void NotifyDone(Task * task);
void NotifyDone(Task * task) override;
ThumbnailRendererTask *thumbnailRenderer;
std::unique_ptr<VideoBuffer> thumbnail;
SaveInfo save;

View File

@ -17,7 +17,7 @@ class SearchController::OpenCallback: public ControllerCallback
SearchController * cc;
public:
OpenCallback(SearchController * cc_) { cc = cc_; }
virtual void ControllerExit()
void ControllerExit() override
{
if(cc->activePreview->GetDoOpen() && cc->activePreview->GetSaveInfo())
{
@ -224,7 +224,7 @@ void SearchController::RemoveSelected()
public:
SearchController * c;
RemoveSelectedConfirmation(SearchController * c_) { c = c_; }
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
if (result == ConfirmPrompt::ResultOkay)
c->removeSelectedC();
}
@ -247,7 +247,7 @@ void SearchController::removeSelectedC()
std::vector<int> saves;
public:
RemoveSavesTask(std::vector<int> saves_, SearchController *c_) { saves = saves_; c = c_; }
virtual bool doWork()
bool doWork() override
{
for (size_t i = 0; i < saves.size(); i++)
{
@ -278,7 +278,7 @@ void SearchController::UnpublishSelected(bool publish)
SearchController * c;
bool publish;
UnpublishSelectedConfirmation(SearchController * c_, bool publish_) { c = c_; publish = publish_; }
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
if (result == ConfirmPrompt::ResultOkay)
c->unpublishSelectedC(publish);
}
@ -319,7 +319,7 @@ void SearchController::unpublishSelectedC(bool publish)
return true;
}
virtual bool doWork()
bool doWork() override
{
bool ret;
for (size_t i = 0; i < saves.size(); i++)
@ -355,7 +355,7 @@ void SearchController::FavouriteSelected()
std::vector<int> saves;
public:
FavouriteSavesTask(std::vector<int> saves_) { saves = saves_; }
virtual bool doWork()
bool doWork() override
{
for (size_t i = 0; i < saves.size(); i++)
{
@ -376,7 +376,7 @@ void SearchController::FavouriteSelected()
std::vector<int> saves;
public:
UnfavouriteSavesTask(std::vector<int> saves_) { saves = saves_; }
virtual bool doWork()
bool doWork() override
{
for (size_t i = 0; i < saves.size(); i++)
{

View File

@ -38,7 +38,7 @@ SearchView::SearchView():
SearchView * v;
public:
PageNumAction(SearchView * _v) { v = _v; }
void TextChangedCallback(ui::Textbox * sender)
void TextChangedCallback(ui::Textbox * sender) override
{
v->textChanged();
}
@ -59,7 +59,7 @@ SearchView::SearchView():
SearchView * v;
public:
SearchAction(SearchView * _v) { v = _v; }
void TextChangedCallback(ui::Textbox * sender)
void TextChangedCallback(ui::Textbox * sender) override
{
v->doSearch();
}
@ -77,7 +77,7 @@ SearchView::SearchView():
SearchView * v;
public:
SortAction(SearchView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->ChangeSort();
}
@ -95,7 +95,7 @@ SearchView::SearchView():
SearchView * v;
public:
MyOwnAction(SearchView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->ShowOwn(sender->GetToggleState());
}
@ -113,7 +113,7 @@ SearchView::SearchView():
SearchView * v;
public:
FavAction(SearchView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->ShowFavourite(sender->GetToggleState());
}
@ -133,7 +133,7 @@ SearchView::SearchView():
SearchView * v;
public:
ClearSearchAction(SearchView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->clearSearch();
}
@ -154,7 +154,7 @@ SearchView::SearchView():
int offset;
public:
RelativePageAction(SearchView * _v, int _offset): v(_v), offset(_offset) {}
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->SetPageRelative(offset);
}
@ -184,7 +184,7 @@ SearchView::SearchView():
SearchView * v;
public:
RemoveSelectedAction(SearchView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->RemoveSelected();
}
@ -195,7 +195,7 @@ SearchView::SearchView():
SearchView * v;
public:
UnpublishSelectedAction(SearchView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->UnpublishSelected(v->publishButtonShown);
}
@ -206,7 +206,7 @@ SearchView::SearchView():
SearchView * v;
public:
FavouriteSelectedAction(SearchView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->FavouriteSelected();
}
@ -217,7 +217,7 @@ SearchView::SearchView():
SearchView * v;
public:
ClearSelectionAction(SearchView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->ClearSelection();
}
@ -519,7 +519,7 @@ void SearchView::NotifyTagListChanged(SearchModel * sender)
ByteString tag;
public:
TagAction(SearchView * v, ByteString tag) : v(v), tag(tag) {}
virtual void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->Search(tag.FromUtf8());
}
@ -668,19 +668,19 @@ void SearchView::NotifySaveListChanged(SearchModel * sender)
SearchView * v;
public:
SaveOpenAction(SearchView * _v) { v = _v; }
virtual void ActionCallback(ui::SaveButton * sender)
void ActionCallback(ui::SaveButton * sender) override
{
v->c->OpenSave(sender->GetSave()->GetID(), sender->GetSave()->GetVersion());
}
virtual void SelectedCallback(ui::SaveButton * sender)
void SelectedCallback(ui::SaveButton * sender) override
{
v->c->Selected(sender->GetSave()->GetID(), sender->GetSelected());
}
virtual void AltActionCallback(ui::SaveButton * sender)
void AltActionCallback(ui::SaveButton * sender) override
{
v->Search(String::Build("history:", sender->GetSave()->GetID()));
}
virtual void AltActionCallback2(ui::SaveButton * sender)
void AltActionCallback2(ui::SaveButton * sender) override
{
v->Search(String::Build("user:", sender->GetSave()->GetUserName().FromUtf8()));
}

View File

@ -59,18 +59,18 @@ public:
void NotifySortChanged(SearchModel * sender);
void NotifyShowOwnChanged(SearchModel * sender);
void NotifyShowFavouriteChanged(SearchModel * sender);
void NotifyAuthUserChanged(Client * sender);
void NotifyMessageOfTheDay(Client * sender);
void NotifyAuthUserChanged(Client * sender) override;
void NotifyMessageOfTheDay(Client * sender) override;
void CheckAccess();
virtual void OnTryOkay(OkayMethod method);
void OnTryOkay(OkayMethod method) override;
SearchView();
virtual ~SearchView();
void AttachController(SearchController * _c) { c = _c; }
virtual void Search(String);
virtual void OnTick(float dt);
virtual void OnMouseWheel(int x, int y, int d);
virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
virtual void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
void OnTick(float dt) override;
void OnMouseWheel(int x, int y, int d) override;
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
};

View File

@ -21,7 +21,7 @@ TagsView::TagsView():
TagsView * v;
public:
CloseAction(TagsView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->c->Exit();
}
@ -45,7 +45,7 @@ TagsView::TagsView():
TagsView * v;
public:
AddTagAction(TagsView * _v) { v = _v; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
v->addTag();
}
@ -90,7 +90,7 @@ void TagsView::NotifyTagsChanged(TagsModel * sender)
ByteString tag;
public:
DeleteTagAction(TagsView * _v, ByteString tag) { v = _v; this->tag = tag; }
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
try
{

View File

@ -23,9 +23,9 @@ class TagsView: public ui::Window {
void addTag();
public:
TagsView();
virtual void OnDraw();
void OnDraw() override;
void AttachController(TagsController * c_) { c = c_; }
virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
void NotifyTagsChanged(TagsModel * sender);
virtual ~TagsView();
};

View File

@ -16,14 +16,14 @@ public:
private:
UpdateActivity * a;
ByteString updateName;
virtual void notifyDoneMain(){
void notifyDoneMain() override {
a->NotifyDone(this);
}
virtual void notifyErrorMain()
void notifyErrorMain() override
{
a->NotifyError(this);
}
virtual bool doWork()
bool doWork() override
{
String error;
http::Request *request = new http::Request(updateName);
@ -145,7 +145,7 @@ void UpdateActivity::NotifyError(Task * sender)
UpdateActivity * a;
public:
ErrorMessageCallback(UpdateActivity * a_) { a = a_; }
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
if (result == ConfirmPrompt::ResultOkay)
{
#ifndef UPDATESERVER

View File

@ -1529,7 +1529,7 @@ public:
CharReaderBuilder();
virtual ~CharReaderBuilder();
virtual CharReader* newCharReader() const;
CharReader* newCharReader() const override;
/** \return true if 'settings' are legal and consistent;
* otherwise, indicate bad settings via 'invalid'.
@ -1725,7 +1725,7 @@ public:
/**
* \throw std::exception if something goes wrong (e.g. invalid settings)
*/
virtual StreamWriter* newStreamWriter() const;
StreamWriter* newStreamWriter() const override;
/** \return true if 'settings' are legal and consistent;
* otherwise, indicate bad settings via 'invalid'.
@ -1780,7 +1780,7 @@ public:
void omitEndingLineFeed();
public: // overridden from Writer
virtual std::string write(const Value& root);
std::string write(const Value& root) override;
private:
void writeValue(const Value& value);
@ -1825,7 +1825,7 @@ public: // overridden from Writer
* \param root Value to serialize.
* \return String containing the JSON document that represents the root value.
*/
virtual std::string write(const Value& root);
std::string write(const Value& root) override;
private:
void writeValue(const Value& value);

View File

@ -2060,9 +2060,9 @@ public:
: collectComments_(collectComments)
, reader_(features)
{}
virtual bool parse(
bool parse(
char const* beginDoc, char const* endDoc,
Value* root, std::string* errs) {
Value* root, std::string* errs) override {
bool ok = reader_.parse(beginDoc, endDoc, *root, collectComments_);
if (errs) {
*errs = reader_.getFormattedErrorMessages();
@ -2534,7 +2534,7 @@ class JSON_API Exception : public std::exception {
public:
Exception(std::string const& msg);
virtual ~Exception() throw();
virtual char const* what() const throw();
char const* what() const throw() override;
protected:
std::string const msg_;
};
@ -4750,7 +4750,7 @@ struct BuiltStyledStreamWriter : public StreamWriter
std::string const& colonSymbol,
std::string const& nullSymbol,
std::string const& endingLineFeedSymbol);
virtual int write(Value const& root, std::ostream* sout);
int write(Value const& root, std::ostream* sout) override;
private:
void writeValue(Value const& value);
void writeArrayValue(Value const& value);

View File

@ -36,7 +36,7 @@ LuaButton::LuaButton(lua_State * l) :
LuaButton * luaButton;
public:
ClickAction(LuaButton * luaButton) : luaButton(luaButton) {}
void ActionCallback(ui::Button * sender)
void ActionCallback(ui::Button * sender) override
{
luaButton->triggerAction();
}

View File

@ -35,7 +35,7 @@ LuaCheckbox::LuaCheckbox(lua_State * l) :
LuaCheckbox * luaCheckbox;
public:
ClickAction(LuaCheckbox * luaCheckbox) : luaCheckbox(luaCheckbox) {}
void ActionCallback(ui::Checkbox * sender)
void ActionCallback(ui::Checkbox * sender) override
{
luaCheckbox->triggerAction();
}

View File

@ -188,13 +188,13 @@ public:
lua_State *l;
LuaScriptInterface(GameController * c, GameModel * m);
virtual void OnTick();
virtual bool HandleEvent(LuaEvents::EventTypes eventType, Event * event);
void OnTick() override;
bool HandleEvent(LuaEvents::EventTypes eventType, Event * event) override;
virtual void Init();
virtual void SetWindow(ui::Window * window);
virtual int Command(String command);
virtual String FormatCommand(String command);
void Init();
void SetWindow(ui::Window * window);
int Command(String command) override;
String FormatCommand(String command) override;
virtual ~LuaScriptInterface();
};

View File

@ -35,7 +35,7 @@ LuaSlider::LuaSlider(lua_State * l) :
LuaSlider * luaSlider;
public:
ValueAction(LuaSlider * luaSlider) : luaSlider(luaSlider) {}
void ValueChangedCallback(ui::Slider * sender)
void ValueChangedCallback(ui::Slider * sender) override
{
luaSlider->triggerOnValueChanged();
}

View File

@ -37,7 +37,7 @@ LuaTextbox::LuaTextbox(lua_State * l) :
LuaTextbox * t;
public:
TextChangedAction(LuaTextbox * t) : t(t) {}
void TextChangedCallback(ui::Textbox * sender)
void TextChangedCallback(ui::Textbox * sender) override
{
t->triggerOnTextChanged();
}

View File

@ -80,26 +80,26 @@ LuaWindow::LuaWindow(lua_State * l) :
LuaWindow * luaWindow;
public:
DrawnWindow(ui::Point position, ui::Point size, LuaWindow * luaWindow) : ui::Window(position, size), luaWindow(luaWindow) {}
virtual void OnDraw()
void OnDraw() override
{
Graphics * g = ui::Engine::Ref().g;
g->clearrect(Position.X-2, Position.Y-2, Size.X+4, Size.Y+4);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255);
luaWindow->triggerOnDraw();
}
virtual void OnInitialized() { luaWindow->triggerOnInitialized(); }
virtual void OnExit() { luaWindow->triggerOnExit(); }
virtual void OnTick(float dt) { luaWindow->triggerOnTick( dt); }
virtual void OnFocus() { luaWindow->triggerOnFocus(); }
virtual void OnBlur() { luaWindow->triggerOnBlur(); }
virtual void OnTryExit(ExitMethod) { luaWindow->triggerOnTryExit(); }
virtual void OnTryOkay(OkayMethod) { luaWindow->triggerOnTryOkay(); }
virtual void OnMouseMove(int x, int y, int dx, int dy) { luaWindow->triggerOnMouseMove(x, y, dx, dy); }
virtual void OnMouseDown(int x, int y, unsigned button) { luaWindow->triggerOnMouseDown(x, y, button); }
virtual void OnMouseUp(int x, int y, unsigned button) { luaWindow->triggerOnMouseUp(x, y, button); }
virtual void OnMouseWheel(int x, int y, int d) { luaWindow->triggerOnMouseWheel(x, y, d); }
virtual void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) { luaWindow->triggerOnKeyPress(key, scan, repeat, shift, ctrl, alt); }
virtual void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) { luaWindow->triggerOnKeyRelease(key, scan, repeat, shift, ctrl, alt); }
void OnInitialized() override { luaWindow->triggerOnInitialized(); }
void OnExit() override { luaWindow->triggerOnExit(); }
void OnTick(float dt) override { luaWindow->triggerOnTick( dt); }
void OnFocus() override { luaWindow->triggerOnFocus(); }
void OnBlur() override { luaWindow->triggerOnBlur(); }
void OnTryExit(ExitMethod) override { luaWindow->triggerOnTryExit(); }
void OnTryOkay(OkayMethod) override { luaWindow->triggerOnTryOkay(); }
void OnMouseMove(int x, int y, int dx, int dy) override { luaWindow->triggerOnMouseMove(x, y, dx, dy); }
void OnMouseDown(int x, int y, unsigned button) override { luaWindow->triggerOnMouseDown(x, y, button); }
void OnMouseUp(int x, int y, unsigned button) override { luaWindow->triggerOnMouseUp(x, y, button); }
void OnMouseWheel(int x, int y, int d) override { luaWindow->triggerOnMouseWheel(x, y, d); }
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override { luaWindow->triggerOnKeyPress(key, scan, repeat, shift, ctrl, alt); }
void OnKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override { luaWindow->triggerOnKeyRelease(key, scan, repeat, shift, ctrl, alt); }
};
window = new DrawnWindow(ui::Point(posX, posY), ui::Point(sizeX, sizeY), this);

View File

@ -18,9 +18,8 @@ protected:
ValueType testType(String word);
public:
TPTScriptInterface(GameController * c, GameModel * m);
virtual void Tick() {}
virtual int Command(String command);
virtual String FormatCommand(String command);
int Command(String command) override;
String FormatCommand(String command) override;
virtual ~TPTScriptInterface();
};

View File

@ -24,7 +24,7 @@ class CoordStackOverflowException: public std::exception
{
public:
CoordStackOverflowException() { }
virtual const char* what() const throw()
const char* what() const throw() override
{
return "Maximum number of entries in the coordinate stack was exceeded";
}

View File

@ -6,10 +6,10 @@
class AbandonableTask : public Task
{
public:
void Start();
void Start() override;
void Finish();
void Abandon();
void Poll();
void Poll() override;
AbandonableTask();
virtual ~AbandonableTask();

View File

@ -10,13 +10,13 @@ class TaskListener;
class Task {
public:
void AddTaskListener(TaskListener * listener);
void Start();
virtual void Start();
int GetProgress();
bool GetDone();
bool GetSuccess();
String GetError();
String GetStatus();
void Poll();
virtual void Poll();
Task() : listener(NULL) { progress = 0; thProgress = 0; }
virtual ~Task();
protected:

View File

@ -17,13 +17,13 @@ class TaskWindow: public ui::Window, public TaskListener {
String progressStatus;
public:
TaskWindow(String title_, Task * task_, bool closeOnDone = true);
virtual void NotifyStatus(Task * task);
virtual void NotifyDone(Task * task);
virtual void NotifyProgress(Task * task);
virtual void NotifyError(Task * task);
virtual void OnTick(float dt);
virtual void OnDraw();
virtual void Exit();
void NotifyStatus(Task * task) override;
void NotifyDone(Task * task) override;
void NotifyProgress(Task * task) override;
void NotifyError(Task * task) override;
void OnTick(float dt) override;
void OnDraw() override;
void Exit();
virtual ~TaskWindow();
};