mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-01 08:05:07 -04:00
b26f2b21da
* Add `SohModalWindow` and `SohModal`. Runs as window, always "visible", but not drawing if no popups are registered. Adds error catching for save file corruption (malformed json) that renames the file in question to prevent future loading issues and uses `SohModalWindow` to inform the user of the error. * Apply suggestions from code review --------- Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
15 lines
544 B
C++
15 lines
544 B
C++
#pragma once
|
|
|
|
#include <libultraship/libultraship.h>
|
|
#include "window/gui/GuiMenuBar.h"
|
|
#include "window/gui/GuiElement.h"
|
|
|
|
class SohModalWindow : public LUS::GuiWindow {
|
|
public:
|
|
using LUS::GuiWindow::GuiWindow;
|
|
|
|
void InitElement() override {};
|
|
void DrawElement() override;
|
|
void UpdateElement() override {};
|
|
void RegisterPopup(std::string title, std::string message, std::string button1 = "OK", std::string button2 = "", std::function<void()> button1callback = nullptr, std::function<void()> button2callback = nullptr);
|
|
}; |