Files
fs2open.github.com/code/lab/dialogs/actions.h
T
BMagnu 12be7576f7 Animation Overhaul: Phase 2 (#3609)
* Add Generic Rotation Segment

* SEXPd rotations work

* Fully replace old animation system

* Add sound segment

* Fixes

* Trigger Hangarbay doors for lone player without AI

* Address Warnings

* Fix Docking ANimations + some bugs

* Fix sound issue + docking bug

* fix bugs, add multi handling

* Change direction into enum class

* Address feedback

* Futher clean aicode

* Address feedback

* Add Multi packet constexprs

* Fix multi constexprs

* Clarify AIS_DOCK comments

* Address multi issues

* Clang somehow detects issues where there are none...
2021-10-06 08:50:58 +09:00

151 lines
4.1 KiB
C++

#pragma once
#include "lab/dialogs/lab_dialog.h"
class DestroySubsystems : public LabDialog {
public:
~DestroySubsystems() override = default;
private:
// Called when this dialog is opened via the top toolbar
void open(Button* /*caller*/) override;
// Called when the dialog is closed
void close() override {
if (dialogWindow != nullptr) {
dialogWindow->DeleteChildren();
dialogWindow = nullptr;
}
}
// Called when the global state changes (e.g. other ship/weapon being selected)
void update(LabMode newLabMode, int classIndex) override;
// Returns the string to use for the top nav bar
SCP_string getTitle() override { return "Destroy Subsystems"; }
// Returns true if it is safe to open this dialog
bool safeToOpen(LabMode labMode) override { return labMode == LabMode::Ship; }
private:
DialogWindow* dialogWindow = nullptr;
};
class ChangeLoadout : public LabDialog {
public:
~ChangeLoadout() override = default;
private:
// Called when this dialog is opened via the top toolbar
void open(Button* /*caller*/) override;
// Called when the dialog is closed
void close() override {
if (dialogWindow != nullptr) {
dialogWindow->DeleteChildren();
dialogWindow = nullptr;
}
}
// Called when the global state changes (e.g. other ship/weapon being selected)
void update(LabMode newLabMode, int classIndex) override;
// Returns the string to use for the top nav bar
SCP_string getTitle() override { return "Change Loadout"; }
// Returns true if it is safe to open this dialog
bool safeToOpen(LabMode labMode) override { return labMode == LabMode::Ship; }
private:
DialogWindow* dialogWindow = nullptr;
};
class WeaponFire : public LabDialog {
public:
~WeaponFire() override = default;
private:
// Called when this dialog is opened via the top toolbar
void open(Button* /*caller*/) override;
// Called when the dialog is closed
void close() override {
if (dialogWindow != nullptr) {
dialogWindow->DeleteChildren();
dialogWindow = nullptr;
}
}
// Called when the global state changes (e.g. other ship/weapon being selected)
void update(LabMode newLabMode, int classIndex) override;
// Returns the string to use for the top nav bar
SCP_string getTitle() override { return "Fire Weapons"; }
// Returns true if it is safe to open this dialog
bool safeToOpen(LabMode labMode) override { return labMode == LabMode::Ship; }
private:
DialogWindow* dialogWindow = nullptr;
};
class AnimationTrigger : public LabDialog {
public:
~AnimationTrigger() override = default;
private:
// Called when this dialog is opened via the top toolbar
void open(Button* /*caller*/) override;
// Called when the dialog is closed
void close() override;
// Called when the global state changes (e.g. other ship/weapon being selected)
void update(LabMode newLabMode, int classIndex) override;
// Returns the string to use for the top nav bar
SCP_string getTitle() override { return "Trigger Animations"; }
// Returns true if it is safe to open this dialog
bool safeToOpen(LabMode labMode) override { return labMode == LabMode::Ship; }
private:
DialogWindow* dialogWindow = nullptr;
};
class Actions : public LabDialog {
public:
Actions() {
subDialogs.emplace_back(std::make_shared<DestroySubsystems>());
subDialogs.emplace_back(std::make_shared<ChangeLoadout>());
subDialogs.emplace_back(std::make_shared<WeaponFire>());
subDialogs.emplace_back(std::make_shared<AnimationTrigger>());
}
~Actions() override = default;
// Called when this dialog is opened via the top toolbar
void open(Button* /*caller*/) override;
// Called when the dialog is closed
void close() override {
if (dialogWindow != nullptr) {
dialogWindow->DeleteChildren();
dialogWindow = nullptr;
}
}
// Called when the global state changes (e.g. other ship/weapon being selected)
void update(LabMode newLabMode, int classIndex) override;
// Returns the string to use for the top nav bar
SCP_string getTitle() override { return "Actions"; }
// Returns true if it is safe to open this dialog
bool safeToOpen(LabMode /*labMode*/) override { return true; }
private:
DialogWindow* dialogWindow = nullptr;
SCP_vector<std::shared_ptr<LabDialog>> subDialogs;
};