From 6449af32f080d3f4babe1422e81f60e39e9c4c1b Mon Sep 17 00:00:00 2001 From: Barinade Date: Sun, 10 Jan 2021 21:24:50 -0600 Subject: [PATCH] Add NoteFieldPreview class controllable by lua --- src/Etterna/Actor/CMakeLists.txt | 2 ++ src/Etterna/Actor/Gameplay/NoteField.h | 2 +- src/Etterna/Actor/Gameplay/NoteFieldPreview.cpp | 12 ++++++++++++ src/Etterna/Actor/Gameplay/NoteFieldPreview.h | 12 ++++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/Etterna/Actor/Gameplay/NoteFieldPreview.cpp create mode 100644 src/Etterna/Actor/Gameplay/NoteFieldPreview.h diff --git a/src/Etterna/Actor/CMakeLists.txt b/src/Etterna/Actor/CMakeLists.txt index cce5b68dc7..2dbbd0ea49 100644 --- a/src/Etterna/Actor/CMakeLists.txt +++ b/src/Etterna/Actor/CMakeLists.txt @@ -46,6 +46,7 @@ list(APPEND ACTOR_GAMEPLAY_SRC "Gameplay/LyricDisplay.cpp" "Gameplay/NoteDisplay.cpp" "Gameplay/NoteField.cpp" + "Gameplay/NoteFieldPreview.cpp" "Gameplay/Player.cpp" "Gameplay/PlayerPractice.cpp" "Gameplay/PlayerReplay.cpp" @@ -63,6 +64,7 @@ list(APPEND ACTOR_GAMEPLAY_HPP "Gameplay/LyricDisplay.h" "Gameplay/NoteDisplay.h" "Gameplay/NoteField.h" + "Gameplay/NoteFieldPreview.h" "Gameplay/Player.h" "Gameplay/PlayerPractice.h" "Gameplay/PlayerReplay.h" diff --git a/src/Etterna/Actor/Gameplay/NoteField.h b/src/Etterna/Actor/Gameplay/NoteField.h index a985156e1b..4d18441889 100644 --- a/src/Etterna/Actor/Gameplay/NoteField.h +++ b/src/Etterna/Actor/Gameplay/NoteField.h @@ -11,7 +11,7 @@ class NoteData; /** @brief An Actor that renders NoteData. */ -class NoteField final : public ActorFrame +class NoteField : public ActorFrame { public: NoteField(); diff --git a/src/Etterna/Actor/Gameplay/NoteFieldPreview.cpp b/src/Etterna/Actor/Gameplay/NoteFieldPreview.cpp new file mode 100644 index 0000000000..e504d41e5b --- /dev/null +++ b/src/Etterna/Actor/Gameplay/NoteFieldPreview.cpp @@ -0,0 +1,12 @@ +#include "Etterna/Globals/global.h" +#include "Etterna/Models/Lua/LuaBinding.h" +#include "Etterna/Actor/Base/ActorUtil.h" +#include "NoteFieldPreview.h" + +REGISTER_ACTOR_CLASS(NoteFieldPreview); + +void +NoteFieldPreview::LoadFromNode(const XNode* pNode) +{ + Actor::LoadFromNode(pNode); +} diff --git a/src/Etterna/Actor/Gameplay/NoteFieldPreview.h b/src/Etterna/Actor/Gameplay/NoteFieldPreview.h new file mode 100644 index 0000000000..a42ee1a33a --- /dev/null +++ b/src/Etterna/Actor/Gameplay/NoteFieldPreview.h @@ -0,0 +1,12 @@ +#ifndef NOTE_FIELDPREVIEW_H +#define NOTE_FIELDPREVIEW_H + +#include "NoteField.h" + +class NoteFieldPreview : public NoteField +{ + void LoadFromNode(const XNode* pNode) override; + [[nodiscard]] auto Copy() const -> NoteFieldPreview* override; +}; + +#endif