use override in all possible places
This commit is contained in:
parent
d3fe7e39a5
commit
55e6074942
@ -194,7 +194,7 @@ class {0}: public SimTool
|
|||||||
public:
|
public:
|
||||||
{0}();
|
{0}();
|
||||||
virtual ~{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))
|
""".format(className, str.join("\n", classMembers))
|
||||||
|
|
||||||
|
@ -19,16 +19,16 @@ public:
|
|||||||
{
|
{
|
||||||
Show();
|
Show();
|
||||||
}
|
}
|
||||||
virtual void Exit()
|
void Exit() override
|
||||||
{
|
{
|
||||||
Hide();
|
Hide();
|
||||||
SelfDestruct();
|
SelfDestruct();
|
||||||
}
|
}
|
||||||
virtual void Show()
|
void Show() override
|
||||||
{
|
{
|
||||||
MakeActiveWindow();
|
MakeActiveWindow();
|
||||||
}
|
}
|
||||||
virtual void Hide()
|
void Hide() override
|
||||||
{
|
{
|
||||||
CloseActiveWindow();
|
CloseActiveWindow();
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,6 @@ class DebugLines : public DebugInfo
|
|||||||
GameController * controller;
|
GameController * controller;
|
||||||
public:
|
public:
|
||||||
DebugLines(unsigned int id, GameView * view, GameController * controller);
|
DebugLines(unsigned int id, GameView * view, GameController * controller);
|
||||||
virtual void Draw();
|
void Draw() override;
|
||||||
virtual ~DebugLines();
|
virtual ~DebugLines();
|
||||||
};
|
};
|
||||||
|
@ -8,6 +8,6 @@ class DebugParts : public DebugInfo
|
|||||||
Simulation * sim;
|
Simulation * sim;
|
||||||
public:
|
public:
|
||||||
DebugParts(unsigned int id, Simulation * sim);
|
DebugParts(unsigned int id, Simulation * sim);
|
||||||
virtual void Draw();
|
void Draw() override;
|
||||||
virtual ~DebugParts();
|
virtual ~DebugParts();
|
||||||
};
|
};
|
||||||
|
@ -9,6 +9,6 @@ class ElementPopulationDebug : public DebugInfo
|
|||||||
float maxAverage;
|
float maxAverage;
|
||||||
public:
|
public:
|
||||||
ElementPopulationDebug(unsigned int id, Simulation * sim);
|
ElementPopulationDebug(unsigned int id, Simulation * sim);
|
||||||
virtual void Draw();
|
void Draw() override;
|
||||||
virtual ~ElementPopulationDebug();
|
virtual ~ElementPopulationDebug();
|
||||||
};
|
};
|
||||||
|
@ -12,7 +12,7 @@ class ParticleDebug : public DebugInfo
|
|||||||
public:
|
public:
|
||||||
ParticleDebug(unsigned int id, Simulation * sim, GameModel * model);
|
ParticleDebug(unsigned int id, Simulation * sim, GameModel * model);
|
||||||
void Debug(int mode, int x, int y);
|
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();
|
virtual ~ParticleDebug();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ ColourPickerActivity::ColourPickerActivity(ui::Colour initialColour, ColourPicke
|
|||||||
public:
|
public:
|
||||||
ColourChange(ColourPickerActivity * a) : a(a) {}
|
ColourChange(ColourPickerActivity * a) : a(a) {}
|
||||||
|
|
||||||
void TextChangedCallback(ui::Textbox * sender)
|
void TextChangedCallback(ui::Textbox * sender) override
|
||||||
{
|
{
|
||||||
int r, g, b, alpha;
|
int r, g, b, alpha;
|
||||||
r = a->rValue->GetText().ToNumber<int>(true);
|
r = a->rValue->GetText().ToNumber<int>(true);
|
||||||
@ -79,7 +79,7 @@ ColourPickerActivity::ColourPickerActivity(ui::Colour initialColour, ColourPicke
|
|||||||
ColourPickerActivity * a;
|
ColourPickerActivity * a;
|
||||||
public:
|
public:
|
||||||
OkayAction(ColourPickerActivity * a) : a(a) { }
|
OkayAction(ColourPickerActivity * a) : a(a) { }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
int Red, Green, Blue;
|
int Red, Green, Blue;
|
||||||
Red = a->rValue->GetText().ToNumber<int>(true);
|
Red = a->rValue->GetText().ToNumber<int>(true);
|
||||||
|
@ -33,12 +33,12 @@ class ColourPickerActivity: public WindowActivity {
|
|||||||
|
|
||||||
void UpdateTextboxes(int r, int g, int b, int a);
|
void UpdateTextboxes(int r, int g, int b, int a);
|
||||||
public:
|
public:
|
||||||
virtual void OnMouseMove(int x, int y, int dx, int dy);
|
void OnMouseMove(int x, int y, int dx, int dy) override;
|
||||||
virtual void OnMouseDown(int x, int y, unsigned button);
|
void OnMouseDown(int x, int y, unsigned button) override;
|
||||||
virtual void OnMouseUp(int x, int y, unsigned button);
|
void OnMouseUp(int x, int y, unsigned button) override;
|
||||||
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;
|
||||||
virtual void OnTryExit(ExitMethod method);
|
void OnTryExit(ExitMethod method) override;
|
||||||
ColourPickerActivity(ui::Colour initialColour, ColourPickedCallback * callback = NULL);
|
ColourPickerActivity(ui::Colour initialColour, ColourPickedCallback * callback = NULL);
|
||||||
virtual ~ColourPickerActivity();
|
virtual ~ColourPickerActivity();
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
};
|
};
|
||||||
|
@ -10,7 +10,7 @@ ConsoleView::ConsoleView():
|
|||||||
ConsoleView * v;
|
ConsoleView * v;
|
||||||
public:
|
public:
|
||||||
CommandHighlighter(ConsoleView * v_) { v = v_; }
|
CommandHighlighter(ConsoleView * v_) { v = v_; }
|
||||||
virtual void TextChangedCallback(ui::Textbox * sender)
|
void TextChangedCallback(ui::Textbox * sender) override
|
||||||
{
|
{
|
||||||
sender->SetDisplayText(v->c->FormatCommand(sender->GetText()));
|
sender->SetDisplayText(v->c->FormatCommand(sender->GetText()));
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ ConfirmPrompt::ConfirmPrompt(String title, String message, ConfirmDialogueCallba
|
|||||||
ConfirmPrompt * prompt;
|
ConfirmPrompt * prompt;
|
||||||
DialogueResult result;
|
DialogueResult result;
|
||||||
CloseAction(ConfirmPrompt * prompt_, DialogueResult result_) { prompt = prompt_; result = result_; }
|
CloseAction(ConfirmPrompt * prompt_, DialogueResult result_) { prompt = prompt_; result = result_; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
prompt->CloseActiveWindow();
|
prompt->CloseActiveWindow();
|
||||||
if(prompt->callback)
|
if(prompt->callback)
|
||||||
@ -101,7 +101,7 @@ ConfirmPrompt::ConfirmPrompt(String title, String message, String buttonText, Co
|
|||||||
ConfirmPrompt * prompt;
|
ConfirmPrompt * prompt;
|
||||||
DialogueResult result;
|
DialogueResult result;
|
||||||
CloseAction(ConfirmPrompt * prompt_, DialogueResult result_) { prompt = prompt_; result = result_; }
|
CloseAction(ConfirmPrompt * prompt_, DialogueResult result_) { prompt = prompt_; result = result_; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
prompt->CloseActiveWindow();
|
prompt->CloseActiveWindow();
|
||||||
if(prompt->callback)
|
if(prompt->callback)
|
||||||
@ -136,7 +136,7 @@ bool ConfirmPrompt::Blocking(String title, String message, String buttonText)
|
|||||||
public:
|
public:
|
||||||
bool & outputResult;
|
bool & outputResult;
|
||||||
BlockingPromptCallback(bool & output): outputResult(output) {}
|
BlockingPromptCallback(bool & output): outputResult(output) {}
|
||||||
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
|
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
|
||||||
if (result == ConfirmPrompt::ResultOkay)
|
if (result == ConfirmPrompt::ResultOkay)
|
||||||
outputResult = true;
|
outputResult = true;
|
||||||
else
|
else
|
||||||
|
@ -11,7 +11,7 @@ public:
|
|||||||
ConfirmPrompt(String title, String message, ConfirmDialogueCallback * callback_ = NULL);
|
ConfirmPrompt(String title, String message, ConfirmDialogueCallback * callback_ = NULL);
|
||||||
ConfirmPrompt(String title, String message, String buttonText, ConfirmDialogueCallback * callback_ = NULL);
|
ConfirmPrompt(String title, String message, String buttonText, ConfirmDialogueCallback * callback_ = NULL);
|
||||||
static bool Blocking(String title, String message, String buttonText = String("Confirm"));
|
static bool Blocking(String title, String message, String buttonText = String("Confirm"));
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
virtual ~ConfirmPrompt();
|
virtual ~ConfirmPrompt();
|
||||||
ConfirmDialogueCallback * callback;
|
ConfirmDialogueCallback * callback;
|
||||||
};
|
};
|
||||||
|
@ -29,7 +29,7 @@ ErrorMessage::ErrorMessage(String title, String message, ErrorMessageCallback *
|
|||||||
ErrorMessage * message;
|
ErrorMessage * message;
|
||||||
public:
|
public:
|
||||||
DismissAction(ErrorMessage * message_) { message = message_; }
|
DismissAction(ErrorMessage * message_) { message = message_; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
message->CloseActiveWindow();
|
message->CloseActiveWindow();
|
||||||
if(message->callback)
|
if(message->callback)
|
||||||
@ -55,7 +55,7 @@ void ErrorMessage::Blocking(String title, String message)
|
|||||||
class BlockingDismissCallback: public ErrorMessageCallback {
|
class BlockingDismissCallback: public ErrorMessageCallback {
|
||||||
public:
|
public:
|
||||||
BlockingDismissCallback() {}
|
BlockingDismissCallback() {}
|
||||||
virtual void DismissCallback() {
|
void DismissCallback() override {
|
||||||
ui::Engine::Ref().Break();
|
ui::Engine::Ref().Break();
|
||||||
}
|
}
|
||||||
virtual ~BlockingDismissCallback() { }
|
virtual ~BlockingDismissCallback() { }
|
||||||
|
@ -9,7 +9,7 @@ class ErrorMessage: public ui::Window {
|
|||||||
public:
|
public:
|
||||||
ErrorMessage(String title, String message, ErrorMessageCallback * callback_ = NULL);
|
ErrorMessage(String title, String message, ErrorMessageCallback * callback_ = NULL);
|
||||||
static void Blocking(String title, String message);
|
static void Blocking(String title, String message);
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
virtual ~ErrorMessage();
|
virtual ~ErrorMessage();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ InformationMessage::InformationMessage(String title, String message, bool large)
|
|||||||
InformationMessage * message;
|
InformationMessage * message;
|
||||||
public:
|
public:
|
||||||
DismissAction(InformationMessage * message_) { message = message_; }
|
DismissAction(InformationMessage * message_) { message = message_; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
message->CloseActiveWindow();
|
message->CloseActiveWindow();
|
||||||
message->SelfDestruct(); //TODO: Fix component disposal
|
message->SelfDestruct(); //TODO: Fix component disposal
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
class InformationMessage: public ui::Window {
|
class InformationMessage: public ui::Window {
|
||||||
public:
|
public:
|
||||||
InformationMessage(String title, String message, bool large);
|
InformationMessage(String title, String message, bool large);
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
virtual ~InformationMessage();
|
virtual ~InformationMessage();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ SaveIDMessage::SaveIDMessage(int id):
|
|||||||
SaveIDMessage * message;
|
SaveIDMessage * message;
|
||||||
public:
|
public:
|
||||||
DismissAction(SaveIDMessage * message_) { message = message_; }
|
DismissAction(SaveIDMessage * message_) { message = message_; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
message->CloseActiveWindow();
|
message->CloseActiveWindow();
|
||||||
message->SelfDestruct();
|
message->SelfDestruct();
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
class SaveIDMessage: public ui::Window {
|
class SaveIDMessage: public ui::Window {
|
||||||
public:
|
public:
|
||||||
SaveIDMessage(int id);
|
SaveIDMessage(int id);
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
virtual void OnTryExit(ExitMethod method);
|
void OnTryExit(ExitMethod method) override;
|
||||||
virtual ~SaveIDMessage();
|
virtual ~SaveIDMessage();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ public:
|
|||||||
TextPrompt * prompt;
|
TextPrompt * prompt;
|
||||||
TextPrompt::DialogueResult result;
|
TextPrompt::DialogueResult result;
|
||||||
CloseAction(TextPrompt * prompt_, TextPrompt::DialogueResult result_) { prompt = prompt_; result = result_; }
|
CloseAction(TextPrompt * prompt_, TextPrompt::DialogueResult result_) { prompt = prompt_; result = result_; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
prompt->CloseActiveWindow();
|
prompt->CloseActiveWindow();
|
||||||
if(prompt->callback)
|
if(prompt->callback)
|
||||||
@ -85,7 +85,7 @@ String TextPrompt::Blocking(String title, String message, String text, String pl
|
|||||||
String & outputString;
|
String & outputString;
|
||||||
public:
|
public:
|
||||||
BlockingTextCallback(String & output) : outputString(output) {}
|
BlockingTextCallback(String & output) : outputString(output) {}
|
||||||
virtual void TextCallback(TextPrompt::DialogueResult result, String resultText) {
|
void TextCallback(TextPrompt::DialogueResult result, String resultText) override {
|
||||||
if(result == ResultOkay)
|
if(result == ResultOkay)
|
||||||
outputString = resultText;
|
outputString = resultText;
|
||||||
else
|
else
|
||||||
|
@ -13,7 +13,7 @@ public:
|
|||||||
enum DialogueResult { ResultCancel, ResultOkay };
|
enum DialogueResult { ResultCancel, ResultOkay };
|
||||||
TextPrompt(String title, String message, String text, String placeholder, bool multiline, TextDialogueCallback * callback_);
|
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);
|
static String Blocking(String title, String message, String text, String placeholder, bool multiline);
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
virtual ~TextPrompt();
|
virtual ~TextPrompt();
|
||||||
TextDialogueCallback * callback;
|
TextDialogueCallback * callback;
|
||||||
};
|
};
|
||||||
|
@ -15,7 +15,7 @@ class ElementSearchActivity::ToolAction: public ui::ButtonAction
|
|||||||
public:
|
public:
|
||||||
Tool * tool;
|
Tool * tool;
|
||||||
ToolAction(ElementSearchActivity * a, Tool * tool) : a(a), 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_;
|
ToolButton *sender = (ToolButton*)sender_;
|
||||||
if(sender->GetSelectionState() >= 0 && sender->GetSelectionState() <= 2)
|
if(sender->GetSelectionState() >= 0 && sender->GetSelectionState() <= 2)
|
||||||
@ -47,7 +47,7 @@ ElementSearchActivity::ElementSearchActivity(GameController * gameController, st
|
|||||||
ElementSearchActivity * a;
|
ElementSearchActivity * a;
|
||||||
public:
|
public:
|
||||||
SearchAction(ElementSearchActivity * a) : a(a) {}
|
SearchAction(ElementSearchActivity * a) : a(a) {}
|
||||||
virtual void TextChangedCallback(ui::Textbox * sender) {
|
void TextChangedCallback(ui::Textbox * sender) override {
|
||||||
a->searchTools(sender->GetText());
|
a->searchTools(sender->GetText());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -63,7 +63,7 @@ ElementSearchActivity::ElementSearchActivity(GameController * gameController, st
|
|||||||
ElementSearchActivity * a;
|
ElementSearchActivity * a;
|
||||||
public:
|
public:
|
||||||
CloseAction(ElementSearchActivity * a) : a(a) { }
|
CloseAction(ElementSearchActivity * a) : a(a) { }
|
||||||
void ActionCallback(ui::Button * sender_)
|
void ActionCallback(ui::Button * sender_) override
|
||||||
{
|
{
|
||||||
a->exit = true;
|
a->exit = true;
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ ElementSearchActivity::ElementSearchActivity(GameController * gameController, st
|
|||||||
ElementSearchActivity * a;
|
ElementSearchActivity * a;
|
||||||
public:
|
public:
|
||||||
OKAction(ElementSearchActivity * a) : a(a) { }
|
OKAction(ElementSearchActivity * a) : a(a) { }
|
||||||
void ActionCallback(ui::Button * sender_)
|
void ActionCallback(ui::Button * sender_) override
|
||||||
{
|
{
|
||||||
if(a->GetFirstResult())
|
if(a->GetFirstResult())
|
||||||
a->SetActiveTool(0, a->GetFirstResult());
|
a->SetActiveTool(0, a->GetFirstResult());
|
||||||
|
@ -32,11 +32,11 @@ public:
|
|||||||
ElementSearchActivity(GameController * gameController, std::vector<Tool*> tools);
|
ElementSearchActivity(GameController * gameController, std::vector<Tool*> tools);
|
||||||
void SetActiveTool(int selectionState, Tool * tool);
|
void SetActiveTool(int selectionState, Tool * tool);
|
||||||
virtual ~ElementSearchActivity();
|
virtual ~ElementSearchActivity();
|
||||||
virtual void OnTick(float dt);
|
void OnTick(float dt) override;
|
||||||
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;
|
||||||
virtual void OnKeyRelease(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;
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
virtual void ToolTip(ui::Point senderPosition, String ToolTip);
|
void ToolTip(ui::Point senderPosition, String ToolTip) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* ELEMENTSEARCHACTIVITY_H_ */
|
#endif /* ELEMENTSEARCHACTIVITY_H_ */
|
||||||
|
@ -21,15 +21,15 @@ class SaveSelectedAction: public ui::SaveButtonAction
|
|||||||
FileBrowserActivity * a;
|
FileBrowserActivity * a;
|
||||||
public:
|
public:
|
||||||
SaveSelectedAction(FileBrowserActivity * _a) { a = _a; }
|
SaveSelectedAction(FileBrowserActivity * _a) { a = _a; }
|
||||||
virtual void ActionCallback(ui::SaveButton * sender)
|
void ActionCallback(ui::SaveButton * sender) override
|
||||||
{
|
{
|
||||||
a->SelectSave(sender->GetSaveFile());
|
a->SelectSave(sender->GetSaveFile());
|
||||||
}
|
}
|
||||||
virtual void AltActionCallback(ui::SaveButton * sender)
|
void AltActionCallback(ui::SaveButton * sender) override
|
||||||
{
|
{
|
||||||
a->RenameSave(sender->GetSaveFile());
|
a->RenameSave(sender->GetSaveFile());
|
||||||
}
|
}
|
||||||
virtual void AltActionCallback2(ui::SaveButton * sender)
|
void AltActionCallback2(ui::SaveButton * sender) override
|
||||||
{
|
{
|
||||||
a->DeleteSave(sender->GetSaveFile());
|
a->DeleteSave(sender->GetSaveFile());
|
||||||
}
|
}
|
||||||
@ -42,17 +42,17 @@ class LoadFilesTask: public Task
|
|||||||
ByteString search;
|
ByteString search;
|
||||||
std::vector<SaveFile*> saveFiles;
|
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::vector<ByteString> files = Client::Ref().DirectorySearch(directory, search, ".cps");
|
||||||
std::sort(files.rbegin(), files.rend(), [](ByteString a, ByteString b) { return a.ToLower() < b.ToLower(); });
|
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:
|
public:
|
||||||
FileBrowserActivity * a;
|
FileBrowserActivity * a;
|
||||||
SearchAction(FileBrowserActivity * a) : a(a) {}
|
SearchAction(FileBrowserActivity * a) : a(a) {}
|
||||||
virtual void TextChangedCallback(ui::Textbox * sender) {
|
void TextChangedCallback(ui::Textbox * sender) override {
|
||||||
a->DoSearch(sender->GetText().ToUtf8());
|
a->DoSearch(sender->GetText().ToUtf8());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -47,10 +47,10 @@ class FileBrowserActivity: public TaskListener, public WindowActivity
|
|||||||
void populateList();
|
void populateList();
|
||||||
public:
|
public:
|
||||||
FileBrowserActivity(ByteString directory, FileSelectedCallback * callback);
|
FileBrowserActivity(ByteString directory, FileSelectedCallback * callback);
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
virtual void OnTick(float dt);
|
void OnTick(float dt) override;
|
||||||
virtual void OnTryExit(ExitMethod method);
|
void OnTryExit(ExitMethod method) override;
|
||||||
virtual void OnMouseDown(int x, int y, unsigned button);
|
void OnMouseDown(int x, int y, unsigned button) override;
|
||||||
void loadDirectory(ByteString directory, ByteString search);
|
void loadDirectory(ByteString directory, ByteString search);
|
||||||
void SelectSave(SaveFile * file);
|
void SelectSave(SaveFile * file);
|
||||||
void DeleteSave(SaveFile * file);
|
void DeleteSave(SaveFile * file);
|
||||||
@ -58,8 +58,8 @@ public:
|
|||||||
void DoSearch(ByteString search);
|
void DoSearch(ByteString search);
|
||||||
virtual ~FileBrowserActivity();
|
virtual ~FileBrowserActivity();
|
||||||
|
|
||||||
virtual void NotifyDone(Task * task);
|
void NotifyDone(Task * task) override;
|
||||||
virtual void NotifyError(Task * task);
|
void NotifyError(Task * task) override;
|
||||||
virtual void NotifyProgress(Task * task);
|
void NotifyProgress(Task * task) override;
|
||||||
virtual void NotifyStatus(Task * task);
|
void NotifyStatus(Task * task) override;
|
||||||
};
|
};
|
||||||
|
@ -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;
|
PrevChar(); break;
|
||||||
case SDLK_RIGHT:
|
case SDL_SCANCODE_RIGHT:
|
||||||
PrevChar(); break;
|
PrevChar(); break;
|
||||||
case SDLK_ESCAPE:
|
case SDL_SCANCODE_ESCAPE:
|
||||||
case 'q':
|
case SDL_SCANCODE_Q:
|
||||||
if(savedButton->GetToggleState())
|
if(savedButton->GetToggleState())
|
||||||
ui::Engine::Ref().Exit();
|
ui::Engine::Ref().Exit();
|
||||||
else
|
else
|
||||||
ui::Engine::Ref().ConfirmExit();
|
ui::Engine::Ref().ConfirmExit();
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case SDL_SCANCODE_C:
|
||||||
clipboardWidth = fontWidths[currentChar];
|
clipboardWidth = fontWidths[currentChar];
|
||||||
clipboardPixels = fontPixels[currentChar];
|
clipboardPixels = fontPixels[currentChar];
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case SDL_SCANCODE_V:
|
||||||
fontWidths[currentChar] = clipboardWidth;
|
fontWidths[currentChar] = clipboardWidth;
|
||||||
fontPixels[currentChar] = clipboardPixels;
|
fontPixels[currentChar] = clipboardPixels;
|
||||||
break;
|
break;
|
||||||
|
@ -67,9 +67,9 @@ private:
|
|||||||
public:
|
public:
|
||||||
FontEditor(ByteString header);
|
FontEditor(ByteString header);
|
||||||
|
|
||||||
void OnDraw();
|
void OnDraw() override;
|
||||||
void OnMouseDown(int x, int y, unsigned button);
|
void OnMouseDown(int x, int y, unsigned button) override;
|
||||||
void OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt);
|
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -47,7 +47,7 @@ public:
|
|||||||
|
|
||||||
SetRadius(radius);
|
SetRadius(radius);
|
||||||
};
|
};
|
||||||
virtual void GenerateBitmap()
|
void GenerateBitmap() override
|
||||||
{
|
{
|
||||||
if(origBitmap)
|
if(origBitmap)
|
||||||
{
|
{
|
||||||
|
@ -68,16 +68,16 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
virtual ~DecorationTool() {}
|
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);
|
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);
|
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);
|
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];
|
pixel loc = ren->vid[position.X+position.Y*WINDOWW];
|
||||||
if (toolID == DECO_CLEAR)
|
if (toolID == DECO_CLEAR)
|
||||||
sim->ApplyDecorationFill(ren, position.X, position.Y, 0, 0, 0, 0, PIXR(loc), PIXG(loc), PIXB(loc));
|
sim->ApplyDecorationFill(ren, position.X, position.Y, 0, 0, 0, 0, PIXR(loc), PIXG(loc), PIXB(loc));
|
||||||
|
@ -12,7 +12,7 @@ public:
|
|||||||
{
|
{
|
||||||
SetRadius(size_);
|
SetRadius(size_);
|
||||||
}
|
}
|
||||||
virtual void GenerateBitmap()
|
void GenerateBitmap() override
|
||||||
{
|
{
|
||||||
delete[] bitmap;
|
delete[] bitmap;
|
||||||
bitmap = new unsigned char[size.X*size.Y];
|
bitmap = new unsigned char[size.X*size.Y];
|
||||||
|
@ -46,7 +46,7 @@ class GameController::SearchCallback: public ControllerCallback
|
|||||||
GameController * cc;
|
GameController * cc;
|
||||||
public:
|
public:
|
||||||
SearchCallback(GameController * cc_) { cc = cc_; }
|
SearchCallback(GameController * cc_) { cc = cc_; }
|
||||||
virtual void ControllerExit()
|
void ControllerExit() override
|
||||||
{
|
{
|
||||||
if(cc->search->GetLoadedSave())
|
if(cc->search->GetLoadedSave())
|
||||||
{
|
{
|
||||||
@ -69,7 +69,7 @@ class GameController::SaveOpenCallback: public ControllerCallback
|
|||||||
GameController * cc;
|
GameController * cc;
|
||||||
public:
|
public:
|
||||||
SaveOpenCallback(GameController * cc_) { cc = cc_; }
|
SaveOpenCallback(GameController * cc_) { cc = cc_; }
|
||||||
virtual void ControllerExit()
|
void ControllerExit() override
|
||||||
{
|
{
|
||||||
if(cc->activePreview->GetDoOpen() && cc->activePreview->GetSaveInfo())
|
if(cc->activePreview->GetDoOpen() && cc->activePreview->GetSaveInfo())
|
||||||
{
|
{
|
||||||
@ -91,7 +91,7 @@ class GameController::OptionsCallback: public ControllerCallback
|
|||||||
GameController * cc;
|
GameController * cc;
|
||||||
public:
|
public:
|
||||||
OptionsCallback(GameController * cc_) { cc = cc_; }
|
OptionsCallback(GameController * cc_) { cc = cc_; }
|
||||||
virtual void ControllerExit()
|
void ControllerExit() override
|
||||||
{
|
{
|
||||||
cc->gameModel->UpdateQuickOptions();
|
cc->gameModel->UpdateQuickOptions();
|
||||||
Client::Ref().WritePrefs();
|
Client::Ref().WritePrefs();
|
||||||
@ -103,7 +103,7 @@ class GameController::TagsCallback: public ControllerCallback
|
|||||||
GameController * cc;
|
GameController * cc;
|
||||||
public:
|
public:
|
||||||
TagsCallback(GameController * cc_) { cc = cc_; }
|
TagsCallback(GameController * cc_) { cc = cc_; }
|
||||||
virtual void ControllerExit()
|
void ControllerExit() override
|
||||||
{
|
{
|
||||||
cc->gameView->NotifySaveChanged(cc->gameModel);
|
cc->gameView->NotifySaveChanged(cc->gameModel);
|
||||||
}
|
}
|
||||||
@ -114,7 +114,7 @@ class GameController::StampsCallback: public ControllerCallback
|
|||||||
GameController * cc;
|
GameController * cc;
|
||||||
public:
|
public:
|
||||||
StampsCallback(GameController * cc_) { cc = cc_; }
|
StampsCallback(GameController * cc_) { cc = cc_; }
|
||||||
virtual void ControllerExit()
|
void ControllerExit() override
|
||||||
{
|
{
|
||||||
SaveFile *file = cc->localBrowser->GetSave();
|
SaveFile *file = cc->localBrowser->GetSave();
|
||||||
if (file)
|
if (file)
|
||||||
@ -351,7 +351,7 @@ void GameController::Install()
|
|||||||
public:
|
public:
|
||||||
GameController * c;
|
GameController * c;
|
||||||
InstallConfirmation(GameController * c_) { c = c_; }
|
InstallConfirmation(GameController * c_) { c = c_; }
|
||||||
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
|
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
|
||||||
if (result == ConfirmPrompt::ResultOkay)
|
if (result == ConfirmPrompt::ResultOkay)
|
||||||
{
|
{
|
||||||
if(Client::Ref().DoInstallation())
|
if(Client::Ref().DoInstallation())
|
||||||
@ -1246,7 +1246,7 @@ void GameController::OpenLocalSaveWindow(bool asCurrent)
|
|||||||
public:
|
public:
|
||||||
LocalSaveCallback(GameController * _c): c(_c) {}
|
LocalSaveCallback(GameController * _c): c(_c) {}
|
||||||
virtual ~LocalSaveCallback() {}
|
virtual ~LocalSaveCallback() {}
|
||||||
virtual void FileSaved(SaveFile* file)
|
void FileSaved(SaveFile* file) override
|
||||||
{
|
{
|
||||||
c->gameModel->SetSaveFile(file);
|
c->gameModel->SetSaveFile(file);
|
||||||
}
|
}
|
||||||
@ -1311,7 +1311,7 @@ void GameController::OpenLocalBrowse()
|
|||||||
public:
|
public:
|
||||||
LocalSaveOpenCallback(GameController * _c): c(_c) {}
|
LocalSaveOpenCallback(GameController * _c): c(_c) {}
|
||||||
virtual ~LocalSaveOpenCallback() {};
|
virtual ~LocalSaveOpenCallback() {};
|
||||||
virtual void FileSelected(SaveFile* file)
|
void FileSelected(SaveFile* file) override
|
||||||
{
|
{
|
||||||
c->HistorySnapshot();
|
c->HistorySnapshot();
|
||||||
c->LoadSaveFile(file);
|
c->LoadSaveFile(file);
|
||||||
@ -1364,8 +1364,8 @@ void GameController::OpenColourPicker()
|
|||||||
GameController * c;
|
GameController * c;
|
||||||
public:
|
public:
|
||||||
ColourPickerCallback(GameController * _c): c(_c) {}
|
ColourPickerCallback(GameController * _c): c(_c) {}
|
||||||
virtual ~ColourPickerCallback() {};
|
virtual ~ColourPickerCallback() {}
|
||||||
virtual void ColourPicked(ui::Colour colour)
|
void ColourPicked(ui::Colour colour) override
|
||||||
{
|
{
|
||||||
c->SetColour(colour);
|
c->SetColour(colour);
|
||||||
}
|
}
|
||||||
@ -1429,7 +1429,7 @@ void GameController::OpenSaveWindow()
|
|||||||
public:
|
public:
|
||||||
SaveUploadedCallback(GameController * _c): c(_c) {}
|
SaveUploadedCallback(GameController * _c): c(_c) {}
|
||||||
virtual ~SaveUploadedCallback() {}
|
virtual ~SaveUploadedCallback() {}
|
||||||
virtual void SaveUploaded(SaveInfo save)
|
void SaveUploaded(SaveInfo save) override
|
||||||
{
|
{
|
||||||
save.SetVote(1);
|
save.SetVote(1);
|
||||||
save.SetVotesUp(1);
|
save.SetVotesUp(1);
|
||||||
@ -1477,7 +1477,7 @@ void GameController::SaveAsCurrent()
|
|||||||
public:
|
public:
|
||||||
SaveUploadedCallback(GameController * _c): c(_c) {}
|
SaveUploadedCallback(GameController * _c): c(_c) {}
|
||||||
virtual ~SaveUploadedCallback() {}
|
virtual ~SaveUploadedCallback() {}
|
||||||
virtual void SaveUploaded(SaveInfo save)
|
void SaveUploaded(SaveInfo save) override
|
||||||
{
|
{
|
||||||
c->LoadSave(&save);
|
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_) {}
|
LinkNotification(ByteString link_, String message) : Notification(message), link(link_) {}
|
||||||
virtual ~LinkNotification() {}
|
virtual ~LinkNotification() {}
|
||||||
|
|
||||||
virtual void Action()
|
void Action() override
|
||||||
{
|
{
|
||||||
Platform::OpenURI(link);
|
Platform::OpenURI(link);
|
||||||
}
|
}
|
||||||
@ -1630,7 +1630,7 @@ void GameController::NotifyUpdateAvailable(Client * sender)
|
|||||||
public:
|
public:
|
||||||
GameController * c;
|
GameController * c;
|
||||||
UpdateConfirmation(GameController * c_) { c = c_; }
|
UpdateConfirmation(GameController * c_) { c = c_; }
|
||||||
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
|
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
|
||||||
if (result == ConfirmPrompt::ResultOkay)
|
if (result == ConfirmPrompt::ResultOkay)
|
||||||
{
|
{
|
||||||
c->RunUpdater();
|
c->RunUpdater();
|
||||||
@ -1646,7 +1646,7 @@ void GameController::NotifyUpdateAvailable(Client * sender)
|
|||||||
UpdateNotification(GameController * c, String message) : Notification(message), c(c) {}
|
UpdateNotification(GameController * c, String message) : Notification(message), c(c) {}
|
||||||
virtual ~UpdateNotification() {}
|
virtual ~UpdateNotification() {}
|
||||||
|
|
||||||
virtual void Action()
|
void Action() override
|
||||||
{
|
{
|
||||||
UpdateInfo info = Client::Ref().GetUpdateInfo();
|
UpdateInfo info = Client::Ref().GetUpdateInfo();
|
||||||
StringBuilder updateMessage;
|
StringBuilder updateMessage;
|
||||||
|
@ -165,9 +165,9 @@ public:
|
|||||||
|
|
||||||
void RemoveNotification(Notification * notification);
|
void RemoveNotification(Notification * notification);
|
||||||
|
|
||||||
virtual void NotifyUpdateAvailable(Client * sender);
|
void NotifyUpdateAvailable(Client * sender) override;
|
||||||
virtual void NotifyAuthUserChanged(Client * sender);
|
void NotifyAuthUserChanged(Client * sender) override;
|
||||||
virtual void NotifyNewNotification(Client * sender, std::pair<String, ByteString> notification);
|
void NotifyNewNotification(Client * sender, std::pair<String, ByteString> notification) override;
|
||||||
void RunUpdater();
|
void RunUpdater();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,11 +8,11 @@ struct GameModelException: public exception {
|
|||||||
String message;
|
String message;
|
||||||
public:
|
public:
|
||||||
GameModelException(String message_): message(message_) {}
|
GameModelException(String message_): message(message_) {}
|
||||||
const char * what() const throw()
|
const char * what() const throw() override
|
||||||
{
|
{
|
||||||
return message.ToUtf8().c_str();
|
return message.ToUtf8().c_str();
|
||||||
}
|
}
|
||||||
~GameModelException() throw() {};
|
~GameModelException() throw() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* GAMEMODELEXCEPTION_H_ */
|
#endif /* GAMEMODELEXCEPTION_H_ */
|
||||||
|
@ -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)
|
if(isButtonDown)
|
||||||
{
|
{
|
||||||
@ -84,22 +84,18 @@ public:
|
|||||||
ui::Button::OnMouseUnclick(x, y, button);
|
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);
|
SetToolTip(x, y);
|
||||||
}
|
}
|
||||||
virtual void OnMouseHover(int x, int y)
|
void OnMouseEnter(int x, int y) override
|
||||||
{
|
|
||||||
SetToolTip(x, y);
|
|
||||||
}
|
|
||||||
virtual void OnMouseEnter(int x, int y)
|
|
||||||
{
|
{
|
||||||
isMouseInside = true;
|
isMouseInside = true;
|
||||||
if(!Enabled)
|
if(!Enabled)
|
||||||
return;
|
return;
|
||||||
SetToolTip(x, y);
|
SetToolTip(x, y);
|
||||||
}
|
}
|
||||||
virtual void TextPosition(String ButtonText)
|
void TextPosition(String ButtonText) override
|
||||||
{
|
{
|
||||||
ui::Button::TextPosition(ButtonText);
|
ui::Button::TextPosition(ButtonText);
|
||||||
textPosition.X += 3;
|
textPosition.X += 3;
|
||||||
@ -109,7 +105,7 @@ public:
|
|||||||
toolTip = newToolTip1;
|
toolTip = newToolTip1;
|
||||||
toolTip2 = newToolTip2;
|
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);
|
ui::Button::OnMouseClick(x, y, button);
|
||||||
rightDown = false;
|
rightDown = false;
|
||||||
@ -133,7 +129,7 @@ public:
|
|||||||
if(splitActionCallback)
|
if(splitActionCallback)
|
||||||
splitActionCallback->ActionCallbackLeft(this);
|
splitActionCallback->ActionCallbackLeft(this);
|
||||||
}
|
}
|
||||||
void Draw(const ui::Point& screenPos)
|
void Draw(const ui::Point& screenPos) override
|
||||||
{
|
{
|
||||||
ui::Button::Draw(screenPos);
|
ui::Button::Draw(screenPos);
|
||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
@ -213,7 +209,7 @@ GameView::GameView():
|
|||||||
GameView * v;
|
GameView * v;
|
||||||
public:
|
public:
|
||||||
SearchAction(GameView * _v) { v = _v; }
|
SearchAction(GameView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
if(v->CtrlBehaviour())
|
if(v->CtrlBehaviour())
|
||||||
v->c->OpenLocalBrowse();
|
v->c->OpenLocalBrowse();
|
||||||
@ -241,11 +237,11 @@ GameView::GameView():
|
|||||||
GameView * v;
|
GameView * v;
|
||||||
public:
|
public:
|
||||||
ReloadAction(GameView * _v) { v = _v; }
|
ReloadAction(GameView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->ReloadSim();
|
v->c->ReloadSim();
|
||||||
}
|
}
|
||||||
void AltActionCallback(ui::Button * sender)
|
void AltActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->OpenSavePreview();
|
v->c->OpenSavePreview();
|
||||||
}
|
}
|
||||||
@ -262,14 +258,14 @@ GameView::GameView():
|
|||||||
GameView * v;
|
GameView * v;
|
||||||
public:
|
public:
|
||||||
SaveSimulationAction(GameView * _v) { v = _v; }
|
SaveSimulationAction(GameView * _v) { v = _v; }
|
||||||
void ActionCallbackRight(ui::Button * sender)
|
void ActionCallbackRight(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
if(v->CtrlBehaviour() || !Client::Ref().GetAuthUser().UserID)
|
if(v->CtrlBehaviour() || !Client::Ref().GetAuthUser().UserID)
|
||||||
v->c->OpenLocalSaveWindow(false);
|
v->c->OpenLocalSaveWindow(false);
|
||||||
else
|
else
|
||||||
v->c->OpenSaveWindow();
|
v->c->OpenSaveWindow();
|
||||||
}
|
}
|
||||||
void ActionCallbackLeft(ui::Button * sender)
|
void ActionCallbackLeft(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
if(v->CtrlBehaviour() || !Client::Ref().GetAuthUser().UserID)
|
if(v->CtrlBehaviour() || !Client::Ref().GetAuthUser().UserID)
|
||||||
v->c->OpenLocalSaveWindow(true);
|
v->c->OpenLocalSaveWindow(true);
|
||||||
@ -290,7 +286,7 @@ GameView::GameView():
|
|||||||
GameView * v;
|
GameView * v;
|
||||||
public:
|
public:
|
||||||
UpVoteAction(GameView * _v) { v = _v; }
|
UpVoteAction(GameView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->Vote(1);
|
v->c->Vote(1);
|
||||||
}
|
}
|
||||||
@ -308,7 +304,7 @@ GameView::GameView():
|
|||||||
GameView * v;
|
GameView * v;
|
||||||
public:
|
public:
|
||||||
DownVoteAction(GameView * _v) { v = _v; }
|
DownVoteAction(GameView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->Vote(-1);
|
v->c->Vote(-1);
|
||||||
}
|
}
|
||||||
@ -326,7 +322,7 @@ GameView::GameView():
|
|||||||
GameView * v;
|
GameView * v;
|
||||||
public:
|
public:
|
||||||
TagSimulationAction(GameView * _v) { v = _v; }
|
TagSimulationAction(GameView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->OpenTags();
|
v->c->OpenTags();
|
||||||
}
|
}
|
||||||
@ -343,7 +339,7 @@ GameView::GameView():
|
|||||||
GameView * v;
|
GameView * v;
|
||||||
public:
|
public:
|
||||||
ClearSimAction(GameView * _v) { v = _v; }
|
ClearSimAction(GameView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->ClearSim();
|
v->c->ClearSim();
|
||||||
}
|
}
|
||||||
@ -359,11 +355,11 @@ GameView::GameView():
|
|||||||
GameView * v;
|
GameView * v;
|
||||||
public:
|
public:
|
||||||
LoginAction(GameView * _v) { v = _v; }
|
LoginAction(GameView * _v) { v = _v; }
|
||||||
void ActionCallbackLeft(ui::Button * sender)
|
void ActionCallbackLeft(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->OpenLogin();
|
v->c->OpenLogin();
|
||||||
}
|
}
|
||||||
void ActionCallbackRight(ui::Button * sender)
|
void ActionCallbackRight(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->OpenProfile();
|
v->c->OpenProfile();
|
||||||
}
|
}
|
||||||
@ -379,7 +375,7 @@ GameView::GameView():
|
|||||||
GameView * v;
|
GameView * v;
|
||||||
public:
|
public:
|
||||||
SimulationOptionAction(GameView * _v) { v = _v; }
|
SimulationOptionAction(GameView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->OpenOptions();
|
v->c->OpenOptions();
|
||||||
}
|
}
|
||||||
@ -395,7 +391,7 @@ GameView::GameView():
|
|||||||
GameView * v;
|
GameView * v;
|
||||||
public:
|
public:
|
||||||
DisplayModeAction(GameView * _v) { v = _v; }
|
DisplayModeAction(GameView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->OpenRenderOptions();
|
v->c->OpenRenderOptions();
|
||||||
}
|
}
|
||||||
@ -411,7 +407,7 @@ GameView::GameView():
|
|||||||
GameView * v;
|
GameView * v;
|
||||||
public:
|
public:
|
||||||
PauseAction(GameView * _v) { v = _v; }
|
PauseAction(GameView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->SetPaused(sender->GetToggleState());
|
v->c->SetPaused(sender->GetToggleState());
|
||||||
}
|
}
|
||||||
@ -427,7 +423,7 @@ GameView::GameView():
|
|||||||
GameView * v;
|
GameView * v;
|
||||||
public:
|
public:
|
||||||
ElementSearchAction(GameView * _v) { v = _v; }
|
ElementSearchAction(GameView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->OpenElementSearch();
|
v->c->OpenElementSearch();
|
||||||
}
|
}
|
||||||
@ -442,7 +438,7 @@ GameView::GameView():
|
|||||||
GameView * v;
|
GameView * v;
|
||||||
public:
|
public:
|
||||||
ColourPickerAction(GameView * _v) { v = _v; }
|
ColourPickerAction(GameView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->OpenColourPicker();
|
v->c->OpenColourPicker();
|
||||||
}
|
}
|
||||||
@ -484,7 +480,7 @@ public:
|
|||||||
else
|
else
|
||||||
needsClick = false;
|
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
|
// 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
|
// 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())
|
if(!needsClick && !v->GetMouseDown())
|
||||||
v->SetActiveMenuDelayed(menuID);
|
v->SetActiveMenuDelayed(menuID);
|
||||||
}
|
}
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
if (needsClick)
|
if (needsClick)
|
||||||
v->c->SetActiveMenu(menuID);
|
v->c->SetActiveMenu(menuID);
|
||||||
@ -506,7 +502,7 @@ class GameView::OptionAction: public ui::ButtonAction
|
|||||||
QuickOption * option;
|
QuickOption * option;
|
||||||
public:
|
public:
|
||||||
OptionAction(QuickOption * _option) { option = _option; }
|
OptionAction(QuickOption * _option) { option = _option; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
option->Perform();
|
option->Perform();
|
||||||
}
|
}
|
||||||
@ -517,7 +513,7 @@ class GameView::OptionListener: public QuickOptionListener
|
|||||||
ui::Button * button;
|
ui::Button * button;
|
||||||
public:
|
public:
|
||||||
OptionListener(ui::Button * _button) { button = _button; }
|
OptionListener(ui::Button * _button) { button = _button; }
|
||||||
virtual void OnValueChanged(QuickOption * option)
|
void OnValueChanged(QuickOption * option) override
|
||||||
{
|
{
|
||||||
switch(option->GetType())
|
switch(option->GetType())
|
||||||
{
|
{
|
||||||
@ -537,7 +533,7 @@ class GameView::ToolAction: public ui::ButtonAction
|
|||||||
public:
|
public:
|
||||||
Tool * tool;
|
Tool * tool;
|
||||||
ToolAction(GameView * _v, Tool * tool_) { v = _v; 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_;
|
ToolButton *sender = (ToolButton*)sender_;
|
||||||
if (v->ShiftBehaviour() && v->CtrlBehaviour() && !v->AltBehaviour())
|
if (v->ShiftBehaviour() && v->CtrlBehaviour() && !v->AltBehaviour())
|
||||||
@ -832,7 +828,7 @@ void GameView::NotifyColourPresetsChanged(GameModel * sender)
|
|||||||
public:
|
public:
|
||||||
int preset;
|
int preset;
|
||||||
ColourPresetAction(GameView * _v, int preset) : preset(preset) { v = _v; }
|
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->SetActiveColourPreset(preset);
|
||||||
v->c->SetColour(sender_->Appearance.BackgroundInactive);
|
v->c->SetColour(sender_->Appearance.BackgroundInactive);
|
||||||
@ -1871,7 +1867,7 @@ void GameView::NotifyNotificationsChanged(GameModel * sender)
|
|||||||
Notification * notification;
|
Notification * notification;
|
||||||
public:
|
public:
|
||||||
NotificationButtonAction(Notification * notification) : notification(notification) { }
|
NotificationButtonAction(Notification * notification) : notification(notification) { }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
notification->Action();
|
notification->Action();
|
||||||
//v->c->RemoveNotification(notification);
|
//v->c->RemoveNotification(notification);
|
||||||
@ -1883,11 +1879,11 @@ void GameView::NotifyNotificationsChanged(GameModel * sender)
|
|||||||
Notification * notification;
|
Notification * notification;
|
||||||
public:
|
public:
|
||||||
CloseNotificationButtonAction(GameView * v, Notification * notification) : v(v), notification(notification) { }
|
CloseNotificationButtonAction(GameView * v, Notification * notification) : v(v), notification(notification) { }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->RemoveNotification(notification);
|
v->c->RemoveNotification(notification);
|
||||||
}
|
}
|
||||||
void AltActionCallback(ui::Button * sender)
|
void AltActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->RemoveNotification(notification);
|
v->c->RemoveNotification(notification);
|
||||||
}
|
}
|
||||||
|
@ -185,28 +185,28 @@ public:
|
|||||||
void NotifyLastToolChanged(GameModel * sender);
|
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);
|
void OnMouseMove(int x, int y, int dx, int dy) override;
|
||||||
virtual void OnMouseDown(int x, int y, unsigned button);
|
void OnMouseDown(int x, int y, unsigned button) override;
|
||||||
virtual void OnMouseUp(int x, int y, unsigned button);
|
void OnMouseUp(int x, int y, unsigned button) override;
|
||||||
virtual void OnMouseWheel(int x, int y, int d);
|
void OnMouseWheel(int x, int y, int d) override;
|
||||||
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;
|
||||||
virtual void OnKeyRelease(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;
|
||||||
virtual void OnTick(float dt);
|
void OnTick(float dt) override;
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
virtual void OnBlur();
|
void OnBlur() override;
|
||||||
|
|
||||||
//Top-level handlers, for Lua interface
|
//Top-level handlers, for Lua interface
|
||||||
virtual void DoExit();
|
void DoExit() override;
|
||||||
virtual void DoDraw();
|
void DoDraw() override;
|
||||||
virtual void DoMouseMove(int x, int y, int dx, int dy);
|
void DoMouseMove(int x, int y, int dx, int dy) override;
|
||||||
virtual void DoMouseDown(int x, int y, unsigned button);
|
void DoMouseDown(int x, int y, unsigned button) override;
|
||||||
virtual void DoMouseUp(int x, int y, unsigned button);
|
void DoMouseUp(int x, int y, unsigned button) override;
|
||||||
virtual void DoMouseWheel(int x, int y, int d);
|
void DoMouseWheel(int x, int y, int d) override;
|
||||||
virtual void DoTextInput(String text);
|
void DoTextInput(String text) override;
|
||||||
virtual void DoKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
|
void DoKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
|
||||||
virtual void DoKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt);
|
void DoKeyRelease(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override;
|
||||||
|
|
||||||
class MenuAction;
|
class MenuAction;
|
||||||
class ToolAction;
|
class ToolAction;
|
||||||
|
@ -22,16 +22,16 @@ public:
|
|||||||
std::vector<StructProperty> properties;
|
std::vector<StructProperty> properties;
|
||||||
PropertyWindow(PropertyTool *tool_, Simulation *sim);
|
PropertyWindow(PropertyTool *tool_, Simulation *sim);
|
||||||
void SetProperty();
|
void SetProperty();
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
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;
|
||||||
virtual void OnTryExit(ExitMethod method);
|
void OnTryExit(ExitMethod method) override;
|
||||||
virtual ~PropertyWindow() {}
|
virtual ~PropertyWindow() {}
|
||||||
class OkayAction: public ui::ButtonAction
|
class OkayAction: public ui::ButtonAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PropertyWindow * prompt;
|
PropertyWindow * prompt;
|
||||||
OkayAction(PropertyWindow * prompt_) { prompt = prompt_; }
|
OkayAction(PropertyWindow * prompt_) { prompt = prompt_; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
prompt->CloseActiveWindow();
|
prompt->CloseActiveWindow();
|
||||||
if(prompt->textField->GetText().length())
|
if(prompt->textField->GetText().length())
|
||||||
@ -68,7 +68,7 @@ sim(sim_)
|
|||||||
PropertyWindow * w;
|
PropertyWindow * w;
|
||||||
public:
|
public:
|
||||||
PropertyChanged(PropertyWindow * w): w(w) { }
|
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);
|
w->FocusComponent(w->textField);
|
||||||
}
|
}
|
||||||
|
@ -9,11 +9,11 @@ public:
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual bool GetToggle()
|
bool GetToggle() override
|
||||||
{
|
{
|
||||||
return m->GetSimulation()->pretty_powder;
|
return m->GetSimulation()->pretty_powder;
|
||||||
}
|
}
|
||||||
virtual void perform()
|
void perform() override
|
||||||
{
|
{
|
||||||
m->GetSimulation()->pretty_powder = !m->GetSimulation()->pretty_powder;
|
m->GetSimulation()->pretty_powder = !m->GetSimulation()->pretty_powder;
|
||||||
}
|
}
|
||||||
@ -27,11 +27,11 @@ public:
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual bool GetToggle()
|
bool GetToggle() override
|
||||||
{
|
{
|
||||||
return m->GetGravityGrid();
|
return m->GetGravityGrid();
|
||||||
}
|
}
|
||||||
virtual void perform()
|
void perform() override
|
||||||
{
|
{
|
||||||
m->ShowGravityGrid(!m->GetGravityGrid());
|
m->ShowGravityGrid(!m->GetGravityGrid());
|
||||||
}
|
}
|
||||||
@ -45,11 +45,11 @@ public:
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual bool GetToggle()
|
bool GetToggle() override
|
||||||
{
|
{
|
||||||
return m->GetDecoration();
|
return m->GetDecoration();
|
||||||
}
|
}
|
||||||
virtual void perform()
|
void perform() override
|
||||||
{
|
{
|
||||||
m->SetDecoration(!m->GetDecoration());
|
m->SetDecoration(!m->GetDecoration());
|
||||||
}
|
}
|
||||||
@ -63,11 +63,11 @@ public:
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual bool GetToggle()
|
bool GetToggle() override
|
||||||
{
|
{
|
||||||
return m->GetNewtonianGrvity();
|
return m->GetNewtonianGrvity();
|
||||||
}
|
}
|
||||||
virtual void perform()
|
void perform() override
|
||||||
{
|
{
|
||||||
m->SetNewtonianGravity(!m->GetNewtonianGrvity());
|
m->SetNewtonianGravity(!m->GetNewtonianGrvity());
|
||||||
}
|
}
|
||||||
@ -81,11 +81,11 @@ public:
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual bool GetToggle()
|
bool GetToggle() override
|
||||||
{
|
{
|
||||||
return m->GetAHeatEnable();
|
return m->GetAHeatEnable();
|
||||||
}
|
}
|
||||||
virtual void perform()
|
void perform() override
|
||||||
{
|
{
|
||||||
m->SetAHeatEnable(!m->GetAHeatEnable());
|
m->SetAHeatEnable(!m->GetAHeatEnable());
|
||||||
}
|
}
|
||||||
@ -100,11 +100,11 @@ public:
|
|||||||
{
|
{
|
||||||
c = c_;
|
c = c_;
|
||||||
}
|
}
|
||||||
virtual bool GetToggle()
|
bool GetToggle() override
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
virtual void perform()
|
void perform() override
|
||||||
{
|
{
|
||||||
c->ShowConsole();
|
c->ShowConsole();
|
||||||
}
|
}
|
||||||
|
@ -21,22 +21,38 @@ public:
|
|||||||
int signID;
|
int signID;
|
||||||
ui::Point signPosition;
|
ui::Point signPosition;
|
||||||
SignWindow(SignTool * tool_, Simulation * sim_, int signID_, ui::Point position_);
|
SignWindow(SignTool * tool_, Simulation * sim_, int signID_, ui::Point position_);
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
virtual void DoDraw();
|
void DoDraw() override;
|
||||||
virtual void DoMouseMove(int x, int y, int dx, int dy);
|
void DoMouseMove(int x, int y, int dx, int dy) override;
|
||||||
virtual void DoMouseDown(int x, int y, unsigned button);
|
void DoMouseDown(int x, int y, unsigned button) override;
|
||||||
virtual void DoMouseUp(int x, int y, unsigned button) { if(!signMoving) ui::Window::DoMouseUp(x, y, button); }
|
void DoMouseUp(int x, int y, unsigned button) override
|
||||||
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); }
|
if(!signMoving)
|
||||||
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); }
|
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 ~SignWindow() {}
|
||||||
virtual void OnTryExit(ui::Window::ExitMethod method);
|
void OnTryExit(ui::Window::ExitMethod method) override;
|
||||||
class OkayAction: public ui::ButtonAction
|
class OkayAction: public ui::ButtonAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SignWindow * prompt;
|
SignWindow * prompt;
|
||||||
OkayAction(SignWindow * prompt_) { prompt = prompt_; }
|
OkayAction(SignWindow * prompt_) { prompt = prompt_; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
prompt->CloseActiveWindow();
|
prompt->CloseActiveWindow();
|
||||||
if(prompt->signID==-1 && prompt->textField->GetText().length())
|
if(prompt->signID==-1 && prompt->textField->GetText().length())
|
||||||
@ -55,7 +71,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
SignWindow * prompt;
|
SignWindow * prompt;
|
||||||
DeleteAction(SignWindow * prompt_) { prompt = prompt_; }
|
DeleteAction(SignWindow * prompt_) { prompt = prompt_; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
prompt->CloseActiveWindow();
|
prompt->CloseActiveWindow();
|
||||||
if(prompt->signID!=-1)
|
if(prompt->signID!=-1)
|
||||||
@ -71,7 +87,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
SignWindow * prompt;
|
SignWindow * prompt;
|
||||||
SignTextAction(SignWindow * prompt_) { prompt = prompt_; }
|
SignTextAction(SignWindow * prompt_) { prompt = prompt_; }
|
||||||
virtual void TextChangedCallback(ui::Textbox * sender)
|
void TextChangedCallback(ui::Textbox * sender) override
|
||||||
{
|
{
|
||||||
if(prompt->signID!=-1)
|
if(prompt->signID!=-1)
|
||||||
{
|
{
|
||||||
@ -86,7 +102,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
SignWindow * prompt;
|
SignWindow * prompt;
|
||||||
MoveAction(SignWindow * prompt_) { prompt = prompt_; }
|
MoveAction(SignWindow * prompt_) { prompt = prompt_; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
if(prompt->signID!=-1)
|
if(prompt->signID!=-1)
|
||||||
{
|
{
|
||||||
|
@ -55,11 +55,11 @@ public:
|
|||||||
}
|
}
|
||||||
static VideoBuffer * GetIcon(int toolID, int width, int height);
|
static VideoBuffer * GetIcon(int toolID, int width, int height);
|
||||||
virtual ~SignTool() {}
|
virtual ~SignTool() {}
|
||||||
virtual void Click(Simulation * sim, Brush * brush, ui::Point position);
|
void Click(Simulation * sim, Brush * brush, ui::Point position) override;
|
||||||
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position) { }
|
void Draw(Simulation * sim, Brush * brush, ui::Point position) override { }
|
||||||
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) { }
|
void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override { }
|
||||||
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 { }
|
||||||
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { }
|
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override { }
|
||||||
};
|
};
|
||||||
|
|
||||||
class SampleTool: public Tool
|
class SampleTool: public Tool
|
||||||
@ -73,11 +73,11 @@ public:
|
|||||||
}
|
}
|
||||||
static VideoBuffer * GetIcon(int toolID, int width, int height);
|
static VideoBuffer * GetIcon(int toolID, int width, int height);
|
||||||
virtual ~SampleTool() {}
|
virtual ~SampleTool() {}
|
||||||
virtual void Click(Simulation * sim, Brush * brush, ui::Point position) { }
|
void Click(Simulation * sim, Brush * brush, ui::Point position) override { }
|
||||||
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position);
|
void Draw(Simulation * sim, Brush * brush, ui::Point position) override;
|
||||||
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) { }
|
void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override { }
|
||||||
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 { }
|
||||||
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { }
|
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override { }
|
||||||
};
|
};
|
||||||
|
|
||||||
class PropertyTool: public Tool
|
class PropertyTool: public Tool
|
||||||
@ -94,11 +94,11 @@ public:
|
|||||||
void OpenWindow(Simulation *sim);
|
void OpenWindow(Simulation *sim);
|
||||||
virtual ~PropertyTool() {}
|
virtual ~PropertyTool() {}
|
||||||
virtual void SetProperty(Simulation *sim, ui::Point position);
|
virtual void SetProperty(Simulation *sim, ui::Point position);
|
||||||
virtual void Click(Simulation * sim, Brush * brush, ui::Point position) { }
|
void Click(Simulation * sim, Brush * brush, ui::Point position) override { }
|
||||||
virtual void Draw(Simulation *sim, Brush *brush, ui::Point position);
|
void Draw(Simulation *sim, Brush *brush, ui::Point position) override;
|
||||||
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false);
|
void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override;
|
||||||
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;
|
||||||
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position);
|
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -107,10 +107,10 @@ class ElementTool: public Tool
|
|||||||
public:
|
public:
|
||||||
ElementTool(int id, ByteString name, String description, int r, int g, int b, ByteString identifier, VideoBuffer * (*textureGen)(int, int, int) = NULL);
|
ElementTool(int id, ByteString name, String description, int r, int g, int b, ByteString identifier, VideoBuffer * (*textureGen)(int, int, int) = NULL);
|
||||||
virtual ~ElementTool();
|
virtual ~ElementTool();
|
||||||
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position);
|
void Draw(Simulation * sim, Brush * brush, ui::Point position) override;
|
||||||
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false);
|
void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override;
|
||||||
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;
|
||||||
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position);
|
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Element_LIGH_Tool: public ElementTool
|
class Element_LIGH_Tool: public ElementTool
|
||||||
@ -120,10 +120,10 @@ public:
|
|||||||
ElementTool(id, name, description, r, g, b, identifier, textureGen)
|
ElementTool(id, name, description, r, g, b, identifier, textureGen)
|
||||||
{ }
|
{ }
|
||||||
virtual ~Element_LIGH_Tool() { }
|
virtual ~Element_LIGH_Tool() { }
|
||||||
virtual void Click(Simulation * sim, Brush * brush, ui::Point position) { }
|
void Click(Simulation * sim, Brush * brush, ui::Point position) override { }
|
||||||
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false);
|
void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override;
|
||||||
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 { }
|
||||||
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { }
|
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override { }
|
||||||
};
|
};
|
||||||
|
|
||||||
class Element_TESC_Tool: public ElementTool
|
class Element_TESC_Tool: public ElementTool
|
||||||
@ -133,8 +133,8 @@ public:
|
|||||||
ElementTool(id, name, description, r, g, b, identifier, textureGen)
|
ElementTool(id, name, description, r, g, b, identifier, textureGen)
|
||||||
{ }
|
{ }
|
||||||
virtual ~Element_TESC_Tool() {}
|
virtual ~Element_TESC_Tool() {}
|
||||||
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;
|
||||||
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position);
|
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class PlopTool: public ElementTool
|
class PlopTool: public ElementTool
|
||||||
@ -144,11 +144,11 @@ public:
|
|||||||
ElementTool(id, name, description, r, g, b, identifier, textureGen)
|
ElementTool(id, name, description, r, g, b, identifier, textureGen)
|
||||||
{ }
|
{ }
|
||||||
virtual ~PlopTool() { }
|
virtual ~PlopTool() { }
|
||||||
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position) { }
|
void Draw(Simulation * sim, Brush * brush, ui::Point position) override { }
|
||||||
virtual void Click(Simulation * sim, Brush * brush, ui::Point position);
|
void Click(Simulation * sim, Brush * brush, ui::Point position) override;
|
||||||
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) { }
|
void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override { }
|
||||||
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 { }
|
||||||
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { }
|
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override { }
|
||||||
};
|
};
|
||||||
|
|
||||||
class WallTool: public Tool
|
class WallTool: public Tool
|
||||||
@ -156,10 +156,10 @@ class WallTool: public Tool
|
|||||||
public:
|
public:
|
||||||
WallTool(int id, ByteString name, String description, int r, int g, int b, ByteString identifier, VideoBuffer * (*textureGen)(int, int, int) = NULL);
|
WallTool(int id, ByteString name, String description, int r, int g, int b, ByteString identifier, VideoBuffer * (*textureGen)(int, int, int) = NULL);
|
||||||
virtual ~WallTool();
|
virtual ~WallTool();
|
||||||
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position);
|
void Draw(Simulation * sim, Brush * brush, ui::Point position) override;
|
||||||
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false);
|
void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override;
|
||||||
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;
|
||||||
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position);
|
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class WindTool: public Tool
|
class WindTool: public Tool
|
||||||
@ -167,10 +167,10 @@ class WindTool: public Tool
|
|||||||
public:
|
public:
|
||||||
WindTool(int id, ByteString name, String description, int r, int g, int b, ByteString identifier, VideoBuffer * (*textureGen)(int, int, int) = NULL);
|
WindTool(int id, ByteString name, String description, int r, int g, int b, ByteString identifier, VideoBuffer * (*textureGen)(int, int, int) = NULL);
|
||||||
virtual ~WindTool() { }
|
virtual ~WindTool() { }
|
||||||
virtual void Draw(Simulation * sim, Brush * brush, ui::Point position) { }
|
void Draw(Simulation * sim, Brush * brush, ui::Point position) override { }
|
||||||
virtual void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false);
|
void DrawLine(Simulation * sim, Brush * brush, ui::Point position1, ui::Point position2, bool dragging = false) override;
|
||||||
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 { }
|
||||||
virtual void DrawFill(Simulation * sim, Brush * brush, ui::Point position) { }
|
void DrawFill(Simulation * sim, Brush * brush, ui::Point position) override { }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* TOOL_H_ */
|
#endif /* TOOL_H_ */
|
||||||
|
@ -9,10 +9,10 @@ class ToolButton: public ui::Button
|
|||||||
ByteString toolIdentifier;
|
ByteString toolIdentifier;
|
||||||
public:
|
public:
|
||||||
ToolButton(ui::Point position, ui::Point size, ByteString text_, ByteString toolIdentifier, String toolTip = String());
|
ToolButton(ui::Point position, ui::Point size, ByteString text_, ByteString toolIdentifier, String toolTip = String());
|
||||||
virtual void OnMouseUnclick(int x, int y, unsigned int button);
|
void OnMouseUnclick(int x, int y, unsigned int button) override;
|
||||||
virtual void OnMouseUp(int x, int y, unsigned int button);
|
void OnMouseUp(int x, int y, unsigned int button) override;
|
||||||
virtual void OnMouseClick(int x, int y, unsigned int button);
|
void OnMouseClick(int x, int y, unsigned int button) override;
|
||||||
virtual void Draw(const ui::Point& screenPos);
|
void Draw(const ui::Point& screenPos) override;
|
||||||
void SetSelectionState(int state);
|
void SetSelectionState(int state);
|
||||||
int GetSelectionState();
|
int GetSelectionState();
|
||||||
virtual ~ToolButton();
|
virtual ~ToolButton();
|
||||||
|
@ -19,7 +19,7 @@ public:
|
|||||||
{
|
{
|
||||||
SetRadius(size_);
|
SetRadius(size_);
|
||||||
};
|
};
|
||||||
virtual void GenerateBitmap()
|
void GenerateBitmap() override
|
||||||
{
|
{
|
||||||
delete[] bitmap;
|
delete[] bitmap;
|
||||||
bitmap = new unsigned char[size.X*size.Y];
|
bitmap = new unsigned char[size.X*size.Y];
|
||||||
|
@ -10,7 +10,7 @@ class ContextMenu::ItemSelectedAction: public ButtonAction
|
|||||||
int item;
|
int item;
|
||||||
public:
|
public:
|
||||||
ItemSelectedAction(ContextMenu * window, int itemID): window(window), item(itemID) { }
|
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);
|
window->ActionCallbackItem(sender, item);
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ public:
|
|||||||
String option;
|
String option;
|
||||||
public:
|
public:
|
||||||
ItemSelectedAction(DropDownWindow * window, String option): window(window), option(option) { }
|
ItemSelectedAction(DropDownWindow * window, String option): window(window), option(option) { }
|
||||||
virtual void ActionCallback(ui::Button *sender)
|
void ActionCallback(ui::Button *sender) override
|
||||||
{
|
{
|
||||||
window->CloseActiveWindow();
|
window->CloseActiveWindow();
|
||||||
window->setOption(option);
|
window->setOption(option);
|
||||||
@ -45,7 +45,7 @@ public:
|
|||||||
currentY += 16;
|
currentY += 16;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virtual void OnDraw()
|
void OnDraw() override
|
||||||
{
|
{
|
||||||
Graphics * g = GetGraphics();
|
Graphics * g = GetGraphics();
|
||||||
g->clearrect(Position.X, Position.Y, Size.X, Size.Y);
|
g->clearrect(Position.X, Position.Y, Size.X, Size.Y);
|
||||||
@ -64,7 +64,7 @@ public:
|
|||||||
dropDown->callback->OptionChanged(dropDown, dropDown->options[optionIndex]);
|
dropDown->callback->OptionChanged(dropDown, dropDown->options[optionIndex]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virtual void OnTryExit(ExitMethod method)
|
void OnTryExit(ExitMethod method) override
|
||||||
{
|
{
|
||||||
CloseActiveWindow();
|
CloseActiveWindow();
|
||||||
SelfDestruct();
|
SelfDestruct();
|
||||||
|
@ -81,7 +81,7 @@ void Engine::ConfirmExit()
|
|||||||
class ExitConfirmation: public ConfirmDialogueCallback {
|
class ExitConfirmation: public ConfirmDialogueCallback {
|
||||||
public:
|
public:
|
||||||
ExitConfirmation() {}
|
ExitConfirmation() {}
|
||||||
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
|
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
|
||||||
if (result == ConfirmPrompt::ResultOkay)
|
if (result == ConfirmPrompt::ResultOkay)
|
||||||
{
|
{
|
||||||
ui::Engine::Ref().Exit();
|
ui::Engine::Ref().Exit();
|
||||||
|
@ -58,22 +58,22 @@ class Component;
|
|||||||
//Get child of this component by index.
|
//Get child of this component by index.
|
||||||
Component* GetChild(unsigned idx);
|
Component* GetChild(unsigned idx);
|
||||||
|
|
||||||
void Tick(float dt);
|
void Tick(float dt) override;
|
||||||
void Draw(const Point& screenPos);
|
void Draw(const Point& screenPos) override;
|
||||||
|
|
||||||
void OnMouseHover(int localx, int localy);
|
void OnMouseHover(int localx, int localy) override;
|
||||||
void OnMouseMoved(int localx, int localy, int dx, int dy);
|
void OnMouseMoved(int localx, int localy, int dx, int dy) override;
|
||||||
void OnMouseMovedInside(int localx, int localy, int dx, int dy);
|
void OnMouseMovedInside(int localx, int localy, int dx, int dy) override;
|
||||||
void OnMouseEnter(int localx, int localy);
|
void OnMouseEnter(int localx, int localy) override;
|
||||||
void OnMouseLeave(int localx, int localy);
|
void OnMouseLeave(int localx, int localy) override;
|
||||||
void OnMouseDown(int x, int y, unsigned button);
|
void OnMouseDown(int x, int y, unsigned button) override;
|
||||||
void OnMouseUp(int x, int y, unsigned button);
|
void OnMouseUp(int x, int y, unsigned button) override;
|
||||||
void OnMouseClick(int localx, int localy, unsigned button);
|
void OnMouseClick(int localx, int localy, unsigned button) override;
|
||||||
void OnMouseUnclick(int localx, int localy, unsigned button);
|
void OnMouseUnclick(int localx, int localy, unsigned button) override;
|
||||||
void OnMouseWheel(int localx, int localy, int d);
|
void OnMouseWheel(int localx, int localy, int d) override;
|
||||||
void OnMouseWheelInside(int localx, int localy, int d);
|
void OnMouseWheelInside(int localx, int localy, int d) override;
|
||||||
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 OnKeyRelease(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;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// child components
|
// child components
|
||||||
|
@ -54,11 +54,11 @@ public:
|
|||||||
void OnContextMenuAction(int item) override;
|
void OnContextMenuAction(int item) override;
|
||||||
void OnMouseClick(int x, int y, unsigned button) override;
|
void OnMouseClick(int x, int y, unsigned button) override;
|
||||||
void OnMouseUp(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 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 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 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;
|
void Draw(const Point& screenPos) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -37,7 +37,7 @@ void LocalBrowserController::RemoveSelected()
|
|||||||
public:
|
public:
|
||||||
LocalBrowserController * c;
|
LocalBrowserController * c;
|
||||||
RemoveSelectedConfirmation(LocalBrowserController * c_) { c = c_; }
|
RemoveSelectedConfirmation(LocalBrowserController * c_) { c = c_; }
|
||||||
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
|
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
|
||||||
if (result == ConfirmPrompt::ResultOkay)
|
if (result == ConfirmPrompt::ResultOkay)
|
||||||
c->removeSelectedC();
|
c->removeSelectedC();
|
||||||
}
|
}
|
||||||
@ -60,7 +60,7 @@ void LocalBrowserController::removeSelectedC()
|
|||||||
LocalBrowserController * c;
|
LocalBrowserController * c;
|
||||||
public:
|
public:
|
||||||
RemoveSavesTask(LocalBrowserController * c, std::vector<ByteString> saves_) : c(c) { saves = saves_; }
|
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++)
|
for (size_t i = 0; i < saves.size(); i++)
|
||||||
{
|
{
|
||||||
@ -70,7 +70,7 @@ void LocalBrowserController::removeSelectedC()
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
virtual void after()
|
void after() override
|
||||||
{
|
{
|
||||||
Client::Ref().updateStamps();
|
Client::Ref().updateStamps();
|
||||||
c->RefreshSavesList();
|
c->RefreshSavesList();
|
||||||
@ -87,7 +87,7 @@ void LocalBrowserController::RescanStamps()
|
|||||||
public:
|
public:
|
||||||
LocalBrowserController * c;
|
LocalBrowserController * c;
|
||||||
RescanConfirmation(LocalBrowserController * c_) { c = c_; }
|
RescanConfirmation(LocalBrowserController * c_) { c = c_; }
|
||||||
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
|
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
|
||||||
if (result == ConfirmPrompt::ResultOkay)
|
if (result == ConfirmPrompt::ResultOkay)
|
||||||
c->rescanStampsC();
|
c->rescanStampsC();
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ LocalBrowserView::LocalBrowserView():
|
|||||||
LocalBrowserView * v;
|
LocalBrowserView * v;
|
||||||
public:
|
public:
|
||||||
PageNumAction(LocalBrowserView * _v) { v = _v; }
|
PageNumAction(LocalBrowserView * _v) { v = _v; }
|
||||||
void TextChangedCallback(ui::Textbox * sender)
|
void TextChangedCallback(ui::Textbox * sender) override
|
||||||
{
|
{
|
||||||
v->textChanged();
|
v->textChanged();
|
||||||
}
|
}
|
||||||
@ -55,7 +55,7 @@ LocalBrowserView::LocalBrowserView():
|
|||||||
int offset;
|
int offset;
|
||||||
public:
|
public:
|
||||||
RelativePageAction(LocalBrowserView * _v, int _offset): v(_v), offset(_offset) {}
|
RelativePageAction(LocalBrowserView * _v, int _offset): v(_v), offset(_offset) {}
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->SetPageRelative(offset);
|
v->c->SetPageRelative(offset);
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ LocalBrowserView::LocalBrowserView():
|
|||||||
LocalBrowserView * v;
|
LocalBrowserView * v;
|
||||||
public:
|
public:
|
||||||
UndeleteAction(LocalBrowserView * _v) { v = _v; }
|
UndeleteAction(LocalBrowserView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->RescanStamps();
|
v->c->RescanStamps();
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ LocalBrowserView::LocalBrowserView():
|
|||||||
LocalBrowserView * v;
|
LocalBrowserView * v;
|
||||||
public:
|
public:
|
||||||
RemoveSelectedAction(LocalBrowserView * _v) { v = _v; }
|
RemoveSelectedAction(LocalBrowserView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->RemoveSelected();
|
v->c->RemoveSelected();
|
||||||
}
|
}
|
||||||
@ -182,12 +182,12 @@ void LocalBrowserView::NotifySavesListChanged(LocalBrowserModel * sender)
|
|||||||
LocalBrowserView * v;
|
LocalBrowserView * v;
|
||||||
public:
|
public:
|
||||||
SaveOpenAction(LocalBrowserView * _v) { v = _v; }
|
SaveOpenAction(LocalBrowserView * _v) { v = _v; }
|
||||||
virtual void ActionCallback(ui::SaveButton * sender)
|
void ActionCallback(ui::SaveButton * sender) override
|
||||||
{
|
{
|
||||||
if(sender->GetSaveFile())
|
if(sender->GetSaveFile())
|
||||||
v->c->OpenSave(sender->GetSaveFile());
|
v->c->OpenSave(sender->GetSaveFile());
|
||||||
}
|
}
|
||||||
virtual void SelectedCallback(ui::SaveButton * sender)
|
void SelectedCallback(ui::SaveButton * sender) override
|
||||||
{
|
{
|
||||||
if(sender->GetSaveFile())
|
if(sender->GetSaveFile())
|
||||||
v->c->Selected(sender->GetSaveFile()->GetName(), sender->GetSelected());
|
v->c->Selected(sender->GetSaveFile()->GetName(), sender->GetSelected());
|
||||||
|
@ -32,14 +32,14 @@ class LocalBrowserView: public ui::Window {
|
|||||||
public:
|
public:
|
||||||
LocalBrowserView();
|
LocalBrowserView();
|
||||||
//virtual void OnDraw();
|
//virtual void OnDraw();
|
||||||
virtual void OnTick(float dt);
|
void OnTick(float dt) override;
|
||||||
void AttachController(LocalBrowserController * c_) { c = c_; }
|
void AttachController(LocalBrowserController * c_) { c = c_; }
|
||||||
void NotifyPageChanged(LocalBrowserModel * sender);
|
void NotifyPageChanged(LocalBrowserModel * sender);
|
||||||
void NotifySavesListChanged(LocalBrowserModel * sender);
|
void NotifySavesListChanged(LocalBrowserModel * sender);
|
||||||
void NotifySelectedChanged(LocalBrowserModel * sender);
|
void NotifySelectedChanged(LocalBrowserModel * sender);
|
||||||
virtual void OnMouseWheel(int x, int y, int d);
|
void OnMouseWheel(int x, int y, int d) override;
|
||||||
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;
|
||||||
virtual void OnKeyRelease(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;
|
||||||
virtual ~LocalBrowserView();
|
virtual ~LocalBrowserView();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ class LoginView::LoginAction : public ui::ButtonAction
|
|||||||
LoginView * v;
|
LoginView * v;
|
||||||
public:
|
public:
|
||||||
LoginAction(LoginView * _v) { v = _v; }
|
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());
|
v->c->Login(v->usernameField->GetText().ToUtf8(), v->passwordField->GetText().ToUtf8());
|
||||||
}
|
}
|
||||||
@ -23,7 +23,7 @@ class LoginView::CancelAction : public ui::ButtonAction
|
|||||||
LoginView * v;
|
LoginView * v;
|
||||||
public:
|
public:
|
||||||
CancelAction(LoginView * _v) { v = _v; }
|
CancelAction(LoginView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->Exit();
|
v->c->Exit();
|
||||||
}
|
}
|
||||||
|
@ -27,12 +27,12 @@ public:
|
|||||||
class LoginAction;
|
class LoginAction;
|
||||||
class CancelAction;
|
class CancelAction;
|
||||||
LoginView();
|
LoginView();
|
||||||
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;
|
||||||
virtual void OnTryExit(ExitMethod method);
|
void OnTryExit(ExitMethod method) override;
|
||||||
void AttachController(LoginController * c_) { c = c_; }
|
void AttachController(LoginController * c_) { c = c_; }
|
||||||
void NotifyStatusChanged(LoginModel * sender);
|
void NotifyStatusChanged(LoginModel * sender);
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
virtual void OnTick(float dt);
|
void OnTick(float dt) override;
|
||||||
virtual ~LoginView();
|
virtual ~LoginView();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -29,7 +29,9 @@ OptionsView::OptionsView():
|
|||||||
OptionsView * v;
|
OptionsView * v;
|
||||||
public:
|
public:
|
||||||
HeatSimulationAction(OptionsView * v_){ v = v_; }
|
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", "");
|
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;
|
OptionsView * v;
|
||||||
public:
|
public:
|
||||||
AmbientHeatSimulationAction(OptionsView * v_){ v = v_; }
|
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", "");
|
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;
|
OptionsView * v;
|
||||||
public:
|
public:
|
||||||
NewtonianGravityAction(OptionsView * v_){ v = v_; }
|
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", "");
|
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;
|
OptionsView * v;
|
||||||
public:
|
public:
|
||||||
WaterEqualisationAction(OptionsView * v_){ v = v_; }
|
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", "");
|
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;
|
OptionsView * v;
|
||||||
public:
|
public:
|
||||||
AirModeChanged(OptionsView * v): v(v) { }
|
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));
|
airMode = new ui::DropDown(ui::Point(Size.X-88, 146), ui::Point(80, 16));
|
||||||
AddComponent(airMode);
|
AddComponent(airMode);
|
||||||
@ -109,7 +119,9 @@ OptionsView::OptionsView():
|
|||||||
OptionsView * v;
|
OptionsView * v;
|
||||||
public:
|
public:
|
||||||
GravityModeChanged(OptionsView * v): v(v) { }
|
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));
|
gravityMode = new ui::DropDown(ui::Point(Size.X-88, 166), ui::Point(80, 16));
|
||||||
@ -128,7 +140,9 @@ OptionsView::OptionsView():
|
|||||||
OptionsView * v;
|
OptionsView * v;
|
||||||
public:
|
public:
|
||||||
EdgeModeChanged(OptionsView * v): v(v) { }
|
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));
|
edgeMode = new ui::DropDown(ui::Point(Size.X-88, 186), ui::Point(80, 16));
|
||||||
@ -147,7 +161,9 @@ OptionsView::OptionsView():
|
|||||||
OptionsView * v;
|
OptionsView * v;
|
||||||
public:
|
public:
|
||||||
ScaleAction(OptionsView * v): v(v) { }
|
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));
|
scale = new ui::DropDown(ui::Point(8, 210), ui::Point(40, 16));
|
||||||
{
|
{
|
||||||
@ -178,7 +194,7 @@ OptionsView::OptionsView():
|
|||||||
OptionsView * v;
|
OptionsView * v;
|
||||||
public:
|
public:
|
||||||
ResizableAction(OptionsView * v_){ v = v_; }
|
ResizableAction(OptionsView * v_){ v = v_; }
|
||||||
virtual void ActionCallback(ui::Checkbox * sender)
|
void ActionCallback(ui::Checkbox * sender) override
|
||||||
{
|
{
|
||||||
v->c->SetResizable(sender->GetChecked());
|
v->c->SetResizable(sender->GetChecked());
|
||||||
}
|
}
|
||||||
@ -196,7 +212,7 @@ OptionsView::OptionsView():
|
|||||||
OptionsView * v;
|
OptionsView * v;
|
||||||
public:
|
public:
|
||||||
FullscreenAction(OptionsView * v_){ v = v_; }
|
FullscreenAction(OptionsView * v_){ v = v_; }
|
||||||
virtual void ActionCallback(ui::Checkbox * sender)
|
void ActionCallback(ui::Checkbox * sender) override
|
||||||
{
|
{
|
||||||
v->c->SetFullscreen(sender->GetChecked());
|
v->c->SetFullscreen(sender->GetChecked());
|
||||||
}
|
}
|
||||||
@ -214,7 +230,7 @@ OptionsView::OptionsView():
|
|||||||
OptionsView * v;
|
OptionsView * v;
|
||||||
public:
|
public:
|
||||||
AltFullscreenAction(OptionsView * v_){ v = v_; }
|
AltFullscreenAction(OptionsView * v_){ v = v_; }
|
||||||
virtual void ActionCallback(ui::Checkbox * sender)
|
void ActionCallback(ui::Checkbox * sender) override
|
||||||
{
|
{
|
||||||
v->c->SetAltFullscreen(sender->GetChecked());
|
v->c->SetAltFullscreen(sender->GetChecked());
|
||||||
}
|
}
|
||||||
@ -232,7 +248,7 @@ OptionsView::OptionsView():
|
|||||||
OptionsView * v;
|
OptionsView * v;
|
||||||
public:
|
public:
|
||||||
ForceIntegerScalingAction(OptionsView * v_) { v = v_; }
|
ForceIntegerScalingAction(OptionsView * v_) { v = v_; }
|
||||||
virtual void ActionCallback(ui::Checkbox * sender)
|
void ActionCallback(ui::Checkbox * sender) override
|
||||||
{
|
{
|
||||||
v->c->SetForceIntegerScaling(sender->GetChecked());
|
v->c->SetForceIntegerScaling(sender->GetChecked());
|
||||||
}
|
}
|
||||||
@ -251,7 +267,9 @@ OptionsView::OptionsView():
|
|||||||
OptionsView * v;
|
OptionsView * v;
|
||||||
public:
|
public:
|
||||||
FastQuitAction(OptionsView * v_){ v = v_; }
|
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", "");
|
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;
|
OptionsView * v;
|
||||||
public:
|
public:
|
||||||
ShowAvatarsAction(OptionsView * v_){ v = v_; }
|
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", "");
|
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:
|
public:
|
||||||
DataFolderAction() { }
|
DataFolderAction() { }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
//one of these should always be defined
|
//one of these should always be defined
|
||||||
#ifdef WIN
|
#ifdef WIN
|
||||||
@ -310,7 +330,7 @@ OptionsView::OptionsView():
|
|||||||
public:
|
public:
|
||||||
OptionsView * v;
|
OptionsView * v;
|
||||||
CloseAction(OptionsView * v_) { v = v_; }
|
CloseAction(OptionsView * v_) { v = v_; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->Exit();
|
v->c->Exit();
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,8 @@ public:
|
|||||||
OptionsView();
|
OptionsView();
|
||||||
void NotifySettingsChanged(OptionsModel * sender);
|
void NotifySettingsChanged(OptionsModel * sender);
|
||||||
void AttachController(OptionsController * c_);
|
void AttachController(OptionsController * c_);
|
||||||
void OnDraw();
|
void OnDraw() override;
|
||||||
void OnTryExit(ExitMethod method);
|
void OnTryExit(ExitMethod method) override;
|
||||||
virtual ~OptionsView();
|
virtual ~OptionsView();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ class PreviewController: public ClientListener {
|
|||||||
LoginController * loginWindow;
|
LoginController * loginWindow;
|
||||||
ControllerCallback * callback;
|
ControllerCallback * callback;
|
||||||
public:
|
public:
|
||||||
virtual void NotifyAuthUserChanged(Client * sender);
|
void NotifyAuthUserChanged(Client * sender) override;
|
||||||
inline int SaveID() { return saveId; }
|
inline int SaveID() { return saveId; }
|
||||||
|
|
||||||
bool HasExited;
|
bool HasExited;
|
||||||
|
@ -9,11 +9,11 @@ struct PreviewModelException: public exception {
|
|||||||
String message;
|
String message;
|
||||||
public:
|
public:
|
||||||
PreviewModelException(String message_): message(message_) {}
|
PreviewModelException(String message_): message(message_) {}
|
||||||
const char * what() const throw()
|
const char * what() const throw() override
|
||||||
{
|
{
|
||||||
return message.ToUtf8().c_str();
|
return message.ToUtf8().c_str();
|
||||||
}
|
}
|
||||||
~PreviewModelException() throw() {};
|
~PreviewModelException() throw() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* PREVIEWMODELEXCEPTION_H_ */
|
#endif /* PREVIEWMODELEXCEPTION_H_ */
|
||||||
|
@ -22,7 +22,7 @@ class PreviewView::LoginAction: public ui::ButtonAction
|
|||||||
PreviewView * v;
|
PreviewView * v;
|
||||||
public:
|
public:
|
||||||
LoginAction(PreviewView * v_){ v = v_; }
|
LoginAction(PreviewView * v_){ v = v_; }
|
||||||
virtual void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->ShowLogin();
|
v->c->ShowLogin();
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@ class PreviewView::SubmitCommentAction: public ui::ButtonAction
|
|||||||
PreviewView * v;
|
PreviewView * v;
|
||||||
public:
|
public:
|
||||||
SubmitCommentAction(PreviewView * v_){ v = v_; }
|
SubmitCommentAction(PreviewView * v_){ v = v_; }
|
||||||
virtual void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->submitComment();
|
v->submitComment();
|
||||||
}
|
}
|
||||||
@ -44,7 +44,7 @@ class PreviewView::AutoCommentSizeAction: public ui::TextboxAction
|
|||||||
PreviewView * v;
|
PreviewView * v;
|
||||||
public:
|
public:
|
||||||
AutoCommentSizeAction(PreviewView * v): v(v) {}
|
AutoCommentSizeAction(PreviewView * v): v(v) {}
|
||||||
virtual void TextChangedCallback(ui::Textbox * sender) {
|
void TextChangedCallback(ui::Textbox * sender) override {
|
||||||
v->CheckComment();
|
v->CheckComment();
|
||||||
v->commentBoxAutoHeight();
|
v->commentBoxAutoHeight();
|
||||||
}
|
}
|
||||||
@ -55,7 +55,7 @@ class PreviewView::AvatarAction: public ui::AvatarButtonAction
|
|||||||
PreviewView * v;
|
PreviewView * v;
|
||||||
public:
|
public:
|
||||||
AvatarAction(PreviewView * v_){ v = v_; }
|
AvatarAction(PreviewView * v_){ v = v_; }
|
||||||
virtual void ActionCallback(ui::AvatarButton * sender)
|
void ActionCallback(ui::AvatarButton * sender) override
|
||||||
{
|
{
|
||||||
if(sender->GetUsername().size() > 0)
|
if(sender->GetUsername().size() > 0)
|
||||||
{
|
{
|
||||||
@ -84,7 +84,7 @@ PreviewView::PreviewView():
|
|||||||
PreviewView * v;
|
PreviewView * v;
|
||||||
public:
|
public:
|
||||||
FavAction(PreviewView * v_){ v = v_; }
|
FavAction(PreviewView * v_){ v = v_; }
|
||||||
virtual void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->FavouriteSave();
|
v->c->FavouriteSave();
|
||||||
}
|
}
|
||||||
@ -103,7 +103,7 @@ PreviewView::PreviewView():
|
|||||||
public:
|
public:
|
||||||
PreviewView * v;
|
PreviewView * v;
|
||||||
ReportPromptCallback(PreviewView * v_) { v = 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)
|
if (result == TextPrompt::ResultOkay)
|
||||||
v->c->Report(resultText);
|
v->c->Report(resultText);
|
||||||
}
|
}
|
||||||
@ -115,7 +115,7 @@ PreviewView::PreviewView():
|
|||||||
PreviewView * v;
|
PreviewView * v;
|
||||||
public:
|
public:
|
||||||
ReportAction(PreviewView * v_){ v = v_; }
|
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));
|
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;
|
PreviewView * v;
|
||||||
public:
|
public:
|
||||||
OpenAction(PreviewView * v_){ v = v_; }
|
OpenAction(PreviewView * v_){ v = v_; }
|
||||||
virtual void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->DoOpen();
|
v->c->DoOpen();
|
||||||
}
|
}
|
||||||
@ -148,7 +148,7 @@ PreviewView::PreviewView():
|
|||||||
PreviewView * v;
|
PreviewView * v;
|
||||||
public:
|
public:
|
||||||
BrowserOpenAction(PreviewView * v_){ v = v_; }
|
BrowserOpenAction(PreviewView * v_){ v = v_; }
|
||||||
virtual void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->OpenInBrowser();
|
v->c->OpenInBrowser();
|
||||||
}
|
}
|
||||||
|
@ -79,13 +79,13 @@ public:
|
|||||||
void NotifyCommentsPageChanged(PreviewModel * sender);
|
void NotifyCommentsPageChanged(PreviewModel * sender);
|
||||||
void NotifyCommentBoxEnabledChanged(PreviewModel * sender);
|
void NotifyCommentBoxEnabledChanged(PreviewModel * sender);
|
||||||
void SaveLoadingError(String errorMessage);
|
void SaveLoadingError(String errorMessage);
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
virtual void DoDraw();
|
void DoDraw() override;
|
||||||
virtual void OnTick(float dt);
|
void OnTick(float dt) override;
|
||||||
virtual void OnTryExit(ExitMethod method);
|
void OnTryExit(ExitMethod method) override;
|
||||||
virtual void OnMouseWheel(int x, int y, int d);
|
void OnMouseWheel(int x, int y, int d) override;
|
||||||
virtual void OnMouseUp(int x, int y, unsigned int button);
|
void OnMouseUp(int x, int y, unsigned int button) override;
|
||||||
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;
|
||||||
virtual ~PreviewView();
|
virtual ~PreviewView();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ ProfileActivity::ProfileActivity(ByteString username) :
|
|||||||
ProfileActivity * a;
|
ProfileActivity * a;
|
||||||
public:
|
public:
|
||||||
CloseAction(ProfileActivity * a) : a(a) { }
|
CloseAction(ProfileActivity * a) : a(a) { }
|
||||||
void ActionCallback(ui::Button * sender_)
|
void ActionCallback(ui::Button * sender_) override
|
||||||
{
|
{
|
||||||
a->Exit();
|
a->Exit();
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@ ProfileActivity::ProfileActivity(ByteString username) :
|
|||||||
ProfileActivity * a;
|
ProfileActivity * a;
|
||||||
public:
|
public:
|
||||||
SaveAction(ProfileActivity * a) : a(a) { }
|
SaveAction(ProfileActivity * a) : a(a) { }
|
||||||
void ActionCallback(ui::Button * sender_)
|
void ActionCallback(ui::Button * sender_) override
|
||||||
{
|
{
|
||||||
if (!a->loading && !a->saving && a->editable)
|
if (!a->loading && !a->saving && a->editable)
|
||||||
{
|
{
|
||||||
@ -79,7 +79,7 @@ void ProfileActivity::setUserInfo(UserInfo newInfo)
|
|||||||
class EditAvatarAction: public ui::ButtonAction
|
class EditAvatarAction: public ui::ButtonAction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void ActionCallback(ui::Button * sender_)
|
void ActionCallback(ui::Button * sender_) override
|
||||||
{
|
{
|
||||||
Platform::OpenURI("http://" SERVER "/Profile/Avatar.html");
|
Platform::OpenURI("http://" SERVER "/Profile/Avatar.html");
|
||||||
}
|
}
|
||||||
@ -206,7 +206,7 @@ void ProfileActivity::setUserInfo(UserInfo newInfo)
|
|||||||
public:
|
public:
|
||||||
ProfileActivity * profileActivity;
|
ProfileActivity * profileActivity;
|
||||||
BioChangedAction(ProfileActivity * profileActivity_) { profileActivity = profileActivity_; }
|
BioChangedAction(ProfileActivity * profileActivity_) { profileActivity = profileActivity_; }
|
||||||
virtual void TextChangedCallback(ui::Textbox * sender)
|
void TextChangedCallback(ui::Textbox * sender) override
|
||||||
{
|
{
|
||||||
profileActivity->ResizeArea();
|
profileActivity->ResizeArea();
|
||||||
}
|
}
|
||||||
|
@ -30,9 +30,9 @@ class ProfileActivity: public WindowActivity, public SaveUserInfoRequestMonitor,
|
|||||||
public:
|
public:
|
||||||
ProfileActivity(ByteString username);
|
ProfileActivity(ByteString username);
|
||||||
virtual ~ProfileActivity();
|
virtual ~ProfileActivity();
|
||||||
virtual void OnTick(float dt);
|
void OnTick(float dt) override;
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
virtual void OnTryExit(ExitMethod method);
|
void OnTryExit(ExitMethod method) override;
|
||||||
|
|
||||||
void OnResponse(bool saveUserInfoStatus) override;
|
void OnResponse(bool saveUserInfoStatus) override;
|
||||||
void OnResponse(std::unique_ptr<UserInfo> getUserInfoResult) override;
|
void OnResponse(std::unique_ptr<UserInfo> getUserInfoResult) override;
|
||||||
|
@ -13,7 +13,7 @@ public:
|
|||||||
v = v_;
|
v = v_;
|
||||||
renderMode = renderMode_;
|
renderMode = renderMode_;
|
||||||
}
|
}
|
||||||
virtual void ActionCallback(ui::Checkbox * sender)
|
void ActionCallback(ui::Checkbox * sender) override
|
||||||
{
|
{
|
||||||
if(sender->GetChecked())
|
if(sender->GetChecked())
|
||||||
v->c->SetRenderMode(renderMode);
|
v->c->SetRenderMode(renderMode);
|
||||||
@ -32,7 +32,7 @@ public:
|
|||||||
v = v_;
|
v = v_;
|
||||||
displayMode = displayMode_;
|
displayMode = displayMode_;
|
||||||
}
|
}
|
||||||
virtual void ActionCallback(ui::Checkbox * sender)
|
void ActionCallback(ui::Checkbox * sender) override
|
||||||
{
|
{
|
||||||
if(sender->GetChecked())
|
if(sender->GetChecked())
|
||||||
v->c->SetDisplayMode(displayMode);
|
v->c->SetDisplayMode(displayMode);
|
||||||
@ -51,7 +51,7 @@ public:
|
|||||||
v = v_;
|
v = v_;
|
||||||
colourMode = colourMode_;
|
colourMode = colourMode_;
|
||||||
}
|
}
|
||||||
virtual void ActionCallback(ui::Checkbox * sender)
|
void ActionCallback(ui::Checkbox * sender) override
|
||||||
{
|
{
|
||||||
if(sender->GetChecked())
|
if(sender->GetChecked())
|
||||||
v->c->SetColourMode(colourMode);
|
v->c->SetColourMode(colourMode);
|
||||||
@ -70,7 +70,7 @@ public:
|
|||||||
v = v_;
|
v = v_;
|
||||||
renderPreset = renderPreset_;
|
renderPreset = renderPreset_;
|
||||||
}
|
}
|
||||||
virtual void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->LoadRenderPreset(renderPreset);
|
v->c->LoadRenderPreset(renderPreset);
|
||||||
}
|
}
|
||||||
|
@ -33,12 +33,12 @@ public:
|
|||||||
void NotifyDisplayChanged(RenderModel * sender);
|
void NotifyDisplayChanged(RenderModel * sender);
|
||||||
void NotifyColourChanged(RenderModel * sender);
|
void NotifyColourChanged(RenderModel * sender);
|
||||||
void AttachController(RenderController * c_) { c = c_; }
|
void AttachController(RenderController * c_) { c = c_; }
|
||||||
void OnMouseDown(int x, int y, unsigned button);
|
void OnMouseDown(int x, int y, unsigned button) override;
|
||||||
void OnTryExit(ExitMethod method);
|
void OnTryExit(ExitMethod method) override;
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
virtual void OnTick(float dt);
|
void OnTick(float dt) override;
|
||||||
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;
|
||||||
virtual void ToolTip(ui::Point senderPosition, String toolTip);
|
void ToolTip(ui::Point senderPosition, String toolTip) override;
|
||||||
virtual ~RenderView();
|
virtual ~RenderView();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ class LocalSaveActivity::CancelAction: public ui::ButtonAction
|
|||||||
LocalSaveActivity * a;
|
LocalSaveActivity * a;
|
||||||
public:
|
public:
|
||||||
CancelAction(LocalSaveActivity * a) : a(a) {}
|
CancelAction(LocalSaveActivity * a) : a(a) {}
|
||||||
virtual void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
a->Exit();
|
a->Exit();
|
||||||
}
|
}
|
||||||
@ -30,7 +30,7 @@ class LocalSaveActivity::SaveAction: public ui::ButtonAction
|
|||||||
LocalSaveActivity * a;
|
LocalSaveActivity * a;
|
||||||
public:
|
public:
|
||||||
SaveAction(LocalSaveActivity * a) : a(a) {}
|
SaveAction(LocalSaveActivity * a) : a(a) {}
|
||||||
virtual void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
a->Save();
|
a->Save();
|
||||||
}
|
}
|
||||||
@ -97,7 +97,7 @@ void LocalSaveActivity::Save()
|
|||||||
LocalSaveActivity * a;
|
LocalSaveActivity * a;
|
||||||
ByteString filename;
|
ByteString filename;
|
||||||
FileOverwriteConfirmation(LocalSaveActivity * a, ByteString finalFilename) : a(a), filename(finalFilename) {}
|
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)
|
if (result == ConfirmPrompt::ResultOkay)
|
||||||
{
|
{
|
||||||
a->saveWrite(filename);
|
a->saveWrite(filename);
|
||||||
|
@ -35,8 +35,8 @@ class LocalSaveActivity: public WindowActivity
|
|||||||
public:
|
public:
|
||||||
LocalSaveActivity(SaveFile save, FileSavedCallback * callback);
|
LocalSaveActivity(SaveFile save, FileSavedCallback * callback);
|
||||||
void saveWrite(ByteString finalFilename);
|
void saveWrite(ByteString finalFilename);
|
||||||
virtual void Save();
|
void Save();
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
virtual void OnTick(float dt);
|
void OnTick(float dt) override;
|
||||||
virtual ~LocalSaveActivity();
|
virtual ~LocalSaveActivity();
|
||||||
};
|
};
|
||||||
|
@ -20,7 +20,7 @@ class ServerSaveActivity::CancelAction: public ui::ButtonAction
|
|||||||
ServerSaveActivity * a;
|
ServerSaveActivity * a;
|
||||||
public:
|
public:
|
||||||
CancelAction(ServerSaveActivity * a) : a(a) {}
|
CancelAction(ServerSaveActivity * a) : a(a) {}
|
||||||
virtual void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
a->Exit();
|
a->Exit();
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ class ServerSaveActivity::SaveAction: public ui::ButtonAction
|
|||||||
ServerSaveActivity * a;
|
ServerSaveActivity * a;
|
||||||
public:
|
public:
|
||||||
SaveAction(ServerSaveActivity * a) : a(a) {}
|
SaveAction(ServerSaveActivity * a) : a(a) {}
|
||||||
virtual void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
a->Save();
|
a->Save();
|
||||||
}
|
}
|
||||||
@ -42,7 +42,7 @@ class ServerSaveActivity::PublishingAction: public ui::ButtonAction
|
|||||||
ServerSaveActivity * a;
|
ServerSaveActivity * a;
|
||||||
public:
|
public:
|
||||||
PublishingAction(ServerSaveActivity * a) : a(a) {}
|
PublishingAction(ServerSaveActivity * a) : a(a) {}
|
||||||
virtual void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
a->ShowPublishingInfo();
|
a->ShowPublishingInfo();
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ class ServerSaveActivity::RulesAction: public ui::ButtonAction
|
|||||||
ServerSaveActivity * a;
|
ServerSaveActivity * a;
|
||||||
public:
|
public:
|
||||||
RulesAction(ServerSaveActivity * a) : a(a) {}
|
RulesAction(ServerSaveActivity * a) : a(a) {}
|
||||||
virtual void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
a->ShowRules();
|
a->ShowRules();
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ class ServerSaveActivity::NameChangedAction: public ui::TextboxAction
|
|||||||
public:
|
public:
|
||||||
ServerSaveActivity * a;
|
ServerSaveActivity * a;
|
||||||
NameChangedAction(ServerSaveActivity * a) : a(a) {}
|
NameChangedAction(ServerSaveActivity * a) : a(a) {}
|
||||||
virtual void TextChangedCallback(ui::Textbox * sender) {
|
void TextChangedCallback(ui::Textbox * sender) override {
|
||||||
a->CheckName(sender->GetText());
|
a->CheckName(sender->GetText());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -73,17 +73,17 @@ class SaveUploadTask: public Task
|
|||||||
{
|
{
|
||||||
SaveInfo save;
|
SaveInfo save;
|
||||||
|
|
||||||
virtual void before()
|
void before() override
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void after()
|
void after() override
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool doWork()
|
bool doWork() override
|
||||||
{
|
{
|
||||||
notifyProgress(-1);
|
notifyProgress(-1);
|
||||||
return Client::Ref().UploadSave(save) == RequestOkay;
|
return Client::Ref().UploadSave(save) == RequestOkay;
|
||||||
@ -233,7 +233,7 @@ void ServerSaveActivity::Save()
|
|||||||
public:
|
public:
|
||||||
ServerSaveActivity * a;
|
ServerSaveActivity * a;
|
||||||
PublishConfirmation(ServerSaveActivity * a) : a(a) {}
|
PublishConfirmation(ServerSaveActivity * a) : a(a) {}
|
||||||
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
|
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
|
||||||
if (result == ConfirmPrompt::ResultOkay)
|
if (result == ConfirmPrompt::ResultOkay)
|
||||||
{
|
{
|
||||||
a->Exit();
|
a->Exit();
|
||||||
|
@ -29,17 +29,17 @@ public:
|
|||||||
ServerSaveActivity(SaveInfo save, SaveUploadedCallback * callback);
|
ServerSaveActivity(SaveInfo save, SaveUploadedCallback * callback);
|
||||||
ServerSaveActivity(SaveInfo save, bool saveNow, SaveUploadedCallback * callback);
|
ServerSaveActivity(SaveInfo save, bool saveNow, SaveUploadedCallback * callback);
|
||||||
void saveUpload();
|
void saveUpload();
|
||||||
virtual void Save();
|
void Save();
|
||||||
virtual void Exit();
|
virtual void Exit() override;
|
||||||
virtual void ShowPublishingInfo();
|
void ShowPublishingInfo();
|
||||||
virtual void ShowRules();
|
void ShowRules();
|
||||||
virtual void CheckName(String newname);
|
void CheckName(String newname);
|
||||||
virtual void OnDraw();
|
virtual void OnDraw() override;
|
||||||
virtual void OnTick(float dt);
|
virtual void OnTick(float dt) override;
|
||||||
virtual ~ServerSaveActivity();
|
virtual ~ServerSaveActivity();
|
||||||
protected:
|
protected:
|
||||||
void AddAuthorInfo();
|
void AddAuthorInfo();
|
||||||
virtual void NotifyDone(Task * task);
|
void NotifyDone(Task * task) override;
|
||||||
ThumbnailRendererTask *thumbnailRenderer;
|
ThumbnailRendererTask *thumbnailRenderer;
|
||||||
std::unique_ptr<VideoBuffer> thumbnail;
|
std::unique_ptr<VideoBuffer> thumbnail;
|
||||||
SaveInfo save;
|
SaveInfo save;
|
||||||
|
@ -17,7 +17,7 @@ class SearchController::OpenCallback: public ControllerCallback
|
|||||||
SearchController * cc;
|
SearchController * cc;
|
||||||
public:
|
public:
|
||||||
OpenCallback(SearchController * cc_) { cc = cc_; }
|
OpenCallback(SearchController * cc_) { cc = cc_; }
|
||||||
virtual void ControllerExit()
|
void ControllerExit() override
|
||||||
{
|
{
|
||||||
if(cc->activePreview->GetDoOpen() && cc->activePreview->GetSaveInfo())
|
if(cc->activePreview->GetDoOpen() && cc->activePreview->GetSaveInfo())
|
||||||
{
|
{
|
||||||
@ -224,7 +224,7 @@ void SearchController::RemoveSelected()
|
|||||||
public:
|
public:
|
||||||
SearchController * c;
|
SearchController * c;
|
||||||
RemoveSelectedConfirmation(SearchController * c_) { c = c_; }
|
RemoveSelectedConfirmation(SearchController * c_) { c = c_; }
|
||||||
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
|
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
|
||||||
if (result == ConfirmPrompt::ResultOkay)
|
if (result == ConfirmPrompt::ResultOkay)
|
||||||
c->removeSelectedC();
|
c->removeSelectedC();
|
||||||
}
|
}
|
||||||
@ -247,7 +247,7 @@ void SearchController::removeSelectedC()
|
|||||||
std::vector<int> saves;
|
std::vector<int> saves;
|
||||||
public:
|
public:
|
||||||
RemoveSavesTask(std::vector<int> saves_, SearchController *c_) { saves = saves_; c = c_; }
|
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++)
|
for (size_t i = 0; i < saves.size(); i++)
|
||||||
{
|
{
|
||||||
@ -278,7 +278,7 @@ void SearchController::UnpublishSelected(bool publish)
|
|||||||
SearchController * c;
|
SearchController * c;
|
||||||
bool publish;
|
bool publish;
|
||||||
UnpublishSelectedConfirmation(SearchController * c_, bool publish_) { c = c_; publish = 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)
|
if (result == ConfirmPrompt::ResultOkay)
|
||||||
c->unpublishSelectedC(publish);
|
c->unpublishSelectedC(publish);
|
||||||
}
|
}
|
||||||
@ -319,7 +319,7 @@ void SearchController::unpublishSelectedC(bool publish)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool doWork()
|
bool doWork() override
|
||||||
{
|
{
|
||||||
bool ret;
|
bool ret;
|
||||||
for (size_t i = 0; i < saves.size(); i++)
|
for (size_t i = 0; i < saves.size(); i++)
|
||||||
@ -355,7 +355,7 @@ void SearchController::FavouriteSelected()
|
|||||||
std::vector<int> saves;
|
std::vector<int> saves;
|
||||||
public:
|
public:
|
||||||
FavouriteSavesTask(std::vector<int> saves_) { saves = saves_; }
|
FavouriteSavesTask(std::vector<int> saves_) { saves = saves_; }
|
||||||
virtual bool doWork()
|
bool doWork() override
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < saves.size(); i++)
|
for (size_t i = 0; i < saves.size(); i++)
|
||||||
{
|
{
|
||||||
@ -376,7 +376,7 @@ void SearchController::FavouriteSelected()
|
|||||||
std::vector<int> saves;
|
std::vector<int> saves;
|
||||||
public:
|
public:
|
||||||
UnfavouriteSavesTask(std::vector<int> saves_) { saves = saves_; }
|
UnfavouriteSavesTask(std::vector<int> saves_) { saves = saves_; }
|
||||||
virtual bool doWork()
|
bool doWork() override
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < saves.size(); i++)
|
for (size_t i = 0; i < saves.size(); i++)
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@ SearchView::SearchView():
|
|||||||
SearchView * v;
|
SearchView * v;
|
||||||
public:
|
public:
|
||||||
PageNumAction(SearchView * _v) { v = _v; }
|
PageNumAction(SearchView * _v) { v = _v; }
|
||||||
void TextChangedCallback(ui::Textbox * sender)
|
void TextChangedCallback(ui::Textbox * sender) override
|
||||||
{
|
{
|
||||||
v->textChanged();
|
v->textChanged();
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ SearchView::SearchView():
|
|||||||
SearchView * v;
|
SearchView * v;
|
||||||
public:
|
public:
|
||||||
SearchAction(SearchView * _v) { v = _v; }
|
SearchAction(SearchView * _v) { v = _v; }
|
||||||
void TextChangedCallback(ui::Textbox * sender)
|
void TextChangedCallback(ui::Textbox * sender) override
|
||||||
{
|
{
|
||||||
v->doSearch();
|
v->doSearch();
|
||||||
}
|
}
|
||||||
@ -77,7 +77,7 @@ SearchView::SearchView():
|
|||||||
SearchView * v;
|
SearchView * v;
|
||||||
public:
|
public:
|
||||||
SortAction(SearchView * _v) { v = _v; }
|
SortAction(SearchView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->ChangeSort();
|
v->c->ChangeSort();
|
||||||
}
|
}
|
||||||
@ -95,7 +95,7 @@ SearchView::SearchView():
|
|||||||
SearchView * v;
|
SearchView * v;
|
||||||
public:
|
public:
|
||||||
MyOwnAction(SearchView * _v) { v = _v; }
|
MyOwnAction(SearchView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->ShowOwn(sender->GetToggleState());
|
v->c->ShowOwn(sender->GetToggleState());
|
||||||
}
|
}
|
||||||
@ -113,7 +113,7 @@ SearchView::SearchView():
|
|||||||
SearchView * v;
|
SearchView * v;
|
||||||
public:
|
public:
|
||||||
FavAction(SearchView * _v) { v = _v; }
|
FavAction(SearchView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->ShowFavourite(sender->GetToggleState());
|
v->c->ShowFavourite(sender->GetToggleState());
|
||||||
}
|
}
|
||||||
@ -133,7 +133,7 @@ SearchView::SearchView():
|
|||||||
SearchView * v;
|
SearchView * v;
|
||||||
public:
|
public:
|
||||||
ClearSearchAction(SearchView * _v) { v = _v; }
|
ClearSearchAction(SearchView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->clearSearch();
|
v->clearSearch();
|
||||||
}
|
}
|
||||||
@ -154,7 +154,7 @@ SearchView::SearchView():
|
|||||||
int offset;
|
int offset;
|
||||||
public:
|
public:
|
||||||
RelativePageAction(SearchView * _v, int _offset): v(_v), offset(_offset) {}
|
RelativePageAction(SearchView * _v, int _offset): v(_v), offset(_offset) {}
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->SetPageRelative(offset);
|
v->c->SetPageRelative(offset);
|
||||||
}
|
}
|
||||||
@ -184,7 +184,7 @@ SearchView::SearchView():
|
|||||||
SearchView * v;
|
SearchView * v;
|
||||||
public:
|
public:
|
||||||
RemoveSelectedAction(SearchView * _v) { v = _v; }
|
RemoveSelectedAction(SearchView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->RemoveSelected();
|
v->c->RemoveSelected();
|
||||||
}
|
}
|
||||||
@ -195,7 +195,7 @@ SearchView::SearchView():
|
|||||||
SearchView * v;
|
SearchView * v;
|
||||||
public:
|
public:
|
||||||
UnpublishSelectedAction(SearchView * _v) { v = _v; }
|
UnpublishSelectedAction(SearchView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->UnpublishSelected(v->publishButtonShown);
|
v->c->UnpublishSelected(v->publishButtonShown);
|
||||||
}
|
}
|
||||||
@ -206,7 +206,7 @@ SearchView::SearchView():
|
|||||||
SearchView * v;
|
SearchView * v;
|
||||||
public:
|
public:
|
||||||
FavouriteSelectedAction(SearchView * _v) { v = _v; }
|
FavouriteSelectedAction(SearchView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->FavouriteSelected();
|
v->c->FavouriteSelected();
|
||||||
}
|
}
|
||||||
@ -217,7 +217,7 @@ SearchView::SearchView():
|
|||||||
SearchView * v;
|
SearchView * v;
|
||||||
public:
|
public:
|
||||||
ClearSelectionAction(SearchView * _v) { v = _v; }
|
ClearSelectionAction(SearchView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->ClearSelection();
|
v->c->ClearSelection();
|
||||||
}
|
}
|
||||||
@ -519,7 +519,7 @@ void SearchView::NotifyTagListChanged(SearchModel * sender)
|
|||||||
ByteString tag;
|
ByteString tag;
|
||||||
public:
|
public:
|
||||||
TagAction(SearchView * v, ByteString tag) : v(v), tag(tag) {}
|
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());
|
v->Search(tag.FromUtf8());
|
||||||
}
|
}
|
||||||
@ -668,19 +668,19 @@ void SearchView::NotifySaveListChanged(SearchModel * sender)
|
|||||||
SearchView * v;
|
SearchView * v;
|
||||||
public:
|
public:
|
||||||
SaveOpenAction(SearchView * _v) { v = _v; }
|
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());
|
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());
|
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()));
|
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()));
|
v->Search(String::Build("user:", sender->GetSave()->GetUserName().FromUtf8()));
|
||||||
}
|
}
|
||||||
|
@ -59,18 +59,18 @@ public:
|
|||||||
void NotifySortChanged(SearchModel * sender);
|
void NotifySortChanged(SearchModel * sender);
|
||||||
void NotifyShowOwnChanged(SearchModel * sender);
|
void NotifyShowOwnChanged(SearchModel * sender);
|
||||||
void NotifyShowFavouriteChanged(SearchModel * sender);
|
void NotifyShowFavouriteChanged(SearchModel * sender);
|
||||||
void NotifyAuthUserChanged(Client * sender);
|
void NotifyAuthUserChanged(Client * sender) override;
|
||||||
void NotifyMessageOfTheDay(Client * sender);
|
void NotifyMessageOfTheDay(Client * sender) override;
|
||||||
void CheckAccess();
|
void CheckAccess();
|
||||||
virtual void OnTryOkay(OkayMethod method);
|
void OnTryOkay(OkayMethod method) override;
|
||||||
SearchView();
|
SearchView();
|
||||||
virtual ~SearchView();
|
virtual ~SearchView();
|
||||||
void AttachController(SearchController * _c) { c = _c; }
|
void AttachController(SearchController * _c) { c = _c; }
|
||||||
virtual void Search(String);
|
virtual void Search(String);
|
||||||
virtual void OnTick(float dt);
|
void OnTick(float dt) override;
|
||||||
virtual void OnMouseWheel(int x, int y, int d);
|
void OnMouseWheel(int x, int y, int d) override;
|
||||||
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;
|
||||||
virtual void OnKeyRelease(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;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ TagsView::TagsView():
|
|||||||
TagsView * v;
|
TagsView * v;
|
||||||
public:
|
public:
|
||||||
CloseAction(TagsView * _v) { v = _v; }
|
CloseAction(TagsView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->c->Exit();
|
v->c->Exit();
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ TagsView::TagsView():
|
|||||||
TagsView * v;
|
TagsView * v;
|
||||||
public:
|
public:
|
||||||
AddTagAction(TagsView * _v) { v = _v; }
|
AddTagAction(TagsView * _v) { v = _v; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
v->addTag();
|
v->addTag();
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@ void TagsView::NotifyTagsChanged(TagsModel * sender)
|
|||||||
ByteString tag;
|
ByteString tag;
|
||||||
public:
|
public:
|
||||||
DeleteTagAction(TagsView * _v, ByteString tag) { v = _v; this->tag = tag; }
|
DeleteTagAction(TagsView * _v, ByteString tag) { v = _v; this->tag = tag; }
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -23,9 +23,9 @@ class TagsView: public ui::Window {
|
|||||||
void addTag();
|
void addTag();
|
||||||
public:
|
public:
|
||||||
TagsView();
|
TagsView();
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
void AttachController(TagsController * c_) { c = c_; }
|
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);
|
void NotifyTagsChanged(TagsModel * sender);
|
||||||
virtual ~TagsView();
|
virtual ~TagsView();
|
||||||
};
|
};
|
||||||
|
@ -16,14 +16,14 @@ public:
|
|||||||
private:
|
private:
|
||||||
UpdateActivity * a;
|
UpdateActivity * a;
|
||||||
ByteString updateName;
|
ByteString updateName;
|
||||||
virtual void notifyDoneMain(){
|
void notifyDoneMain() override {
|
||||||
a->NotifyDone(this);
|
a->NotifyDone(this);
|
||||||
}
|
}
|
||||||
virtual void notifyErrorMain()
|
void notifyErrorMain() override
|
||||||
{
|
{
|
||||||
a->NotifyError(this);
|
a->NotifyError(this);
|
||||||
}
|
}
|
||||||
virtual bool doWork()
|
bool doWork() override
|
||||||
{
|
{
|
||||||
String error;
|
String error;
|
||||||
http::Request *request = new http::Request(updateName);
|
http::Request *request = new http::Request(updateName);
|
||||||
@ -145,7 +145,7 @@ void UpdateActivity::NotifyError(Task * sender)
|
|||||||
UpdateActivity * a;
|
UpdateActivity * a;
|
||||||
public:
|
public:
|
||||||
ErrorMessageCallback(UpdateActivity * a_) { a = a_; }
|
ErrorMessageCallback(UpdateActivity * a_) { a = a_; }
|
||||||
virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) {
|
void ConfirmCallback(ConfirmPrompt::DialogueResult result) override {
|
||||||
if (result == ConfirmPrompt::ResultOkay)
|
if (result == ConfirmPrompt::ResultOkay)
|
||||||
{
|
{
|
||||||
#ifndef UPDATESERVER
|
#ifndef UPDATESERVER
|
||||||
|
@ -1529,7 +1529,7 @@ public:
|
|||||||
CharReaderBuilder();
|
CharReaderBuilder();
|
||||||
virtual ~CharReaderBuilder();
|
virtual ~CharReaderBuilder();
|
||||||
|
|
||||||
virtual CharReader* newCharReader() const;
|
CharReader* newCharReader() const override;
|
||||||
|
|
||||||
/** \return true if 'settings' are legal and consistent;
|
/** \return true if 'settings' are legal and consistent;
|
||||||
* otherwise, indicate bad settings via 'invalid'.
|
* otherwise, indicate bad settings via 'invalid'.
|
||||||
@ -1725,7 +1725,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* \throw std::exception if something goes wrong (e.g. invalid settings)
|
* \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;
|
/** \return true if 'settings' are legal and consistent;
|
||||||
* otherwise, indicate bad settings via 'invalid'.
|
* otherwise, indicate bad settings via 'invalid'.
|
||||||
@ -1780,7 +1780,7 @@ public:
|
|||||||
void omitEndingLineFeed();
|
void omitEndingLineFeed();
|
||||||
|
|
||||||
public: // overridden from Writer
|
public: // overridden from Writer
|
||||||
virtual std::string write(const Value& root);
|
std::string write(const Value& root) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void writeValue(const Value& value);
|
void writeValue(const Value& value);
|
||||||
@ -1825,7 +1825,7 @@ public: // overridden from Writer
|
|||||||
* \param root Value to serialize.
|
* \param root Value to serialize.
|
||||||
* \return String containing the JSON document that represents the root value.
|
* \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:
|
private:
|
||||||
void writeValue(const Value& value);
|
void writeValue(const Value& value);
|
||||||
|
@ -2060,9 +2060,9 @@ public:
|
|||||||
: collectComments_(collectComments)
|
: collectComments_(collectComments)
|
||||||
, reader_(features)
|
, reader_(features)
|
||||||
{}
|
{}
|
||||||
virtual bool parse(
|
bool parse(
|
||||||
char const* beginDoc, char const* endDoc,
|
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_);
|
bool ok = reader_.parse(beginDoc, endDoc, *root, collectComments_);
|
||||||
if (errs) {
|
if (errs) {
|
||||||
*errs = reader_.getFormattedErrorMessages();
|
*errs = reader_.getFormattedErrorMessages();
|
||||||
@ -2534,7 +2534,7 @@ class JSON_API Exception : public std::exception {
|
|||||||
public:
|
public:
|
||||||
Exception(std::string const& msg);
|
Exception(std::string const& msg);
|
||||||
virtual ~Exception() throw();
|
virtual ~Exception() throw();
|
||||||
virtual char const* what() const throw();
|
char const* what() const throw() override;
|
||||||
protected:
|
protected:
|
||||||
std::string const msg_;
|
std::string const msg_;
|
||||||
};
|
};
|
||||||
@ -4750,7 +4750,7 @@ struct BuiltStyledStreamWriter : public StreamWriter
|
|||||||
std::string const& colonSymbol,
|
std::string const& colonSymbol,
|
||||||
std::string const& nullSymbol,
|
std::string const& nullSymbol,
|
||||||
std::string const& endingLineFeedSymbol);
|
std::string const& endingLineFeedSymbol);
|
||||||
virtual int write(Value const& root, std::ostream* sout);
|
int write(Value const& root, std::ostream* sout) override;
|
||||||
private:
|
private:
|
||||||
void writeValue(Value const& value);
|
void writeValue(Value const& value);
|
||||||
void writeArrayValue(Value const& value);
|
void writeArrayValue(Value const& value);
|
||||||
|
@ -36,7 +36,7 @@ LuaButton::LuaButton(lua_State * l) :
|
|||||||
LuaButton * luaButton;
|
LuaButton * luaButton;
|
||||||
public:
|
public:
|
||||||
ClickAction(LuaButton * luaButton) : luaButton(luaButton) {}
|
ClickAction(LuaButton * luaButton) : luaButton(luaButton) {}
|
||||||
void ActionCallback(ui::Button * sender)
|
void ActionCallback(ui::Button * sender) override
|
||||||
{
|
{
|
||||||
luaButton->triggerAction();
|
luaButton->triggerAction();
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ LuaCheckbox::LuaCheckbox(lua_State * l) :
|
|||||||
LuaCheckbox * luaCheckbox;
|
LuaCheckbox * luaCheckbox;
|
||||||
public:
|
public:
|
||||||
ClickAction(LuaCheckbox * luaCheckbox) : luaCheckbox(luaCheckbox) {}
|
ClickAction(LuaCheckbox * luaCheckbox) : luaCheckbox(luaCheckbox) {}
|
||||||
void ActionCallback(ui::Checkbox * sender)
|
void ActionCallback(ui::Checkbox * sender) override
|
||||||
{
|
{
|
||||||
luaCheckbox->triggerAction();
|
luaCheckbox->triggerAction();
|
||||||
}
|
}
|
||||||
|
@ -188,13 +188,13 @@ public:
|
|||||||
lua_State *l;
|
lua_State *l;
|
||||||
LuaScriptInterface(GameController * c, GameModel * m);
|
LuaScriptInterface(GameController * c, GameModel * m);
|
||||||
|
|
||||||
virtual void OnTick();
|
void OnTick() override;
|
||||||
virtual bool HandleEvent(LuaEvents::EventTypes eventType, Event * event);
|
bool HandleEvent(LuaEvents::EventTypes eventType, Event * event) override;
|
||||||
|
|
||||||
virtual void Init();
|
void Init();
|
||||||
virtual void SetWindow(ui::Window * window);
|
void SetWindow(ui::Window * window);
|
||||||
virtual int Command(String command);
|
int Command(String command) override;
|
||||||
virtual String FormatCommand(String command);
|
String FormatCommand(String command) override;
|
||||||
virtual ~LuaScriptInterface();
|
virtual ~LuaScriptInterface();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ LuaSlider::LuaSlider(lua_State * l) :
|
|||||||
LuaSlider * luaSlider;
|
LuaSlider * luaSlider;
|
||||||
public:
|
public:
|
||||||
ValueAction(LuaSlider * luaSlider) : luaSlider(luaSlider) {}
|
ValueAction(LuaSlider * luaSlider) : luaSlider(luaSlider) {}
|
||||||
void ValueChangedCallback(ui::Slider * sender)
|
void ValueChangedCallback(ui::Slider * sender) override
|
||||||
{
|
{
|
||||||
luaSlider->triggerOnValueChanged();
|
luaSlider->triggerOnValueChanged();
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ LuaTextbox::LuaTextbox(lua_State * l) :
|
|||||||
LuaTextbox * t;
|
LuaTextbox * t;
|
||||||
public:
|
public:
|
||||||
TextChangedAction(LuaTextbox * t) : t(t) {}
|
TextChangedAction(LuaTextbox * t) : t(t) {}
|
||||||
void TextChangedCallback(ui::Textbox * sender)
|
void TextChangedCallback(ui::Textbox * sender) override
|
||||||
{
|
{
|
||||||
t->triggerOnTextChanged();
|
t->triggerOnTextChanged();
|
||||||
}
|
}
|
||||||
|
@ -80,26 +80,26 @@ LuaWindow::LuaWindow(lua_State * l) :
|
|||||||
LuaWindow * luaWindow;
|
LuaWindow * luaWindow;
|
||||||
public:
|
public:
|
||||||
DrawnWindow(ui::Point position, ui::Point size, LuaWindow * luaWindow) : ui::Window(position, size), luaWindow(luaWindow) {}
|
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;
|
Graphics * g = ui::Engine::Ref().g;
|
||||||
g->clearrect(Position.X-2, Position.Y-2, Size.X+4, Size.Y+4);
|
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);
|
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255);
|
||||||
luaWindow->triggerOnDraw();
|
luaWindow->triggerOnDraw();
|
||||||
}
|
}
|
||||||
virtual void OnInitialized() { luaWindow->triggerOnInitialized(); }
|
void OnInitialized() override { luaWindow->triggerOnInitialized(); }
|
||||||
virtual void OnExit() { luaWindow->triggerOnExit(); }
|
void OnExit() override { luaWindow->triggerOnExit(); }
|
||||||
virtual void OnTick(float dt) { luaWindow->triggerOnTick( dt); }
|
void OnTick(float dt) override { luaWindow->triggerOnTick( dt); }
|
||||||
virtual void OnFocus() { luaWindow->triggerOnFocus(); }
|
void OnFocus() override { luaWindow->triggerOnFocus(); }
|
||||||
virtual void OnBlur() { luaWindow->triggerOnBlur(); }
|
void OnBlur() override { luaWindow->triggerOnBlur(); }
|
||||||
virtual void OnTryExit(ExitMethod) { luaWindow->triggerOnTryExit(); }
|
void OnTryExit(ExitMethod) override { luaWindow->triggerOnTryExit(); }
|
||||||
virtual void OnTryOkay(OkayMethod) { luaWindow->triggerOnTryOkay(); }
|
void OnTryOkay(OkayMethod) override { luaWindow->triggerOnTryOkay(); }
|
||||||
virtual void OnMouseMove(int x, int y, int dx, int dy) { luaWindow->triggerOnMouseMove(x, y, dx, dy); }
|
void OnMouseMove(int x, int y, int dx, int dy) override { luaWindow->triggerOnMouseMove(x, y, dx, dy); }
|
||||||
virtual void OnMouseDown(int x, int y, unsigned button) { luaWindow->triggerOnMouseDown(x, y, button); }
|
void OnMouseDown(int x, int y, unsigned button) override { luaWindow->triggerOnMouseDown(x, y, button); }
|
||||||
virtual void OnMouseUp(int x, int y, unsigned button) { luaWindow->triggerOnMouseUp(x, y, button); }
|
void OnMouseUp(int x, int y, unsigned button) override { luaWindow->triggerOnMouseUp(x, y, button); }
|
||||||
virtual void OnMouseWheel(int x, int y, int d) { luaWindow->triggerOnMouseWheel(x, y, d); }
|
void OnMouseWheel(int x, int y, int d) override { 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); }
|
void OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) override { 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 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);
|
window = new DrawnWindow(ui::Point(posX, posY), ui::Point(sizeX, sizeY), this);
|
||||||
|
@ -18,9 +18,8 @@ protected:
|
|||||||
ValueType testType(String word);
|
ValueType testType(String word);
|
||||||
public:
|
public:
|
||||||
TPTScriptInterface(GameController * c, GameModel * m);
|
TPTScriptInterface(GameController * c, GameModel * m);
|
||||||
virtual void Tick() {}
|
int Command(String command) override;
|
||||||
virtual int Command(String command);
|
String FormatCommand(String command) override;
|
||||||
virtual String FormatCommand(String command);
|
|
||||||
virtual ~TPTScriptInterface();
|
virtual ~TPTScriptInterface();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ class CoordStackOverflowException: public std::exception
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CoordStackOverflowException() { }
|
CoordStackOverflowException() { }
|
||||||
virtual const char* what() const throw()
|
const char* what() const throw() override
|
||||||
{
|
{
|
||||||
return "Maximum number of entries in the coordinate stack was exceeded";
|
return "Maximum number of entries in the coordinate stack was exceeded";
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
class AbandonableTask : public Task
|
class AbandonableTask : public Task
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void Start();
|
void Start() override;
|
||||||
void Finish();
|
void Finish();
|
||||||
void Abandon();
|
void Abandon();
|
||||||
void Poll();
|
void Poll() override;
|
||||||
AbandonableTask();
|
AbandonableTask();
|
||||||
virtual ~AbandonableTask();
|
virtual ~AbandonableTask();
|
||||||
|
|
||||||
|
@ -10,13 +10,13 @@ class TaskListener;
|
|||||||
class Task {
|
class Task {
|
||||||
public:
|
public:
|
||||||
void AddTaskListener(TaskListener * listener);
|
void AddTaskListener(TaskListener * listener);
|
||||||
void Start();
|
virtual void Start();
|
||||||
int GetProgress();
|
int GetProgress();
|
||||||
bool GetDone();
|
bool GetDone();
|
||||||
bool GetSuccess();
|
bool GetSuccess();
|
||||||
String GetError();
|
String GetError();
|
||||||
String GetStatus();
|
String GetStatus();
|
||||||
void Poll();
|
virtual void Poll();
|
||||||
Task() : listener(NULL) { progress = 0; thProgress = 0; }
|
Task() : listener(NULL) { progress = 0; thProgress = 0; }
|
||||||
virtual ~Task();
|
virtual ~Task();
|
||||||
protected:
|
protected:
|
||||||
|
@ -17,13 +17,13 @@ class TaskWindow: public ui::Window, public TaskListener {
|
|||||||
String progressStatus;
|
String progressStatus;
|
||||||
public:
|
public:
|
||||||
TaskWindow(String title_, Task * task_, bool closeOnDone = true);
|
TaskWindow(String title_, Task * task_, bool closeOnDone = true);
|
||||||
virtual void NotifyStatus(Task * task);
|
void NotifyStatus(Task * task) override;
|
||||||
virtual void NotifyDone(Task * task);
|
void NotifyDone(Task * task) override;
|
||||||
virtual void NotifyProgress(Task * task);
|
void NotifyProgress(Task * task) override;
|
||||||
virtual void NotifyError(Task * task);
|
void NotifyError(Task * task) override;
|
||||||
virtual void OnTick(float dt);
|
void OnTick(float dt) override;
|
||||||
virtual void OnDraw();
|
void OnDraw() override;
|
||||||
virtual void Exit();
|
void Exit();
|
||||||
virtual ~TaskWindow();
|
virtual ~TaskWindow();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user