Skip to content

Commit c31306c

Browse files
committed
v2.0-beta1.0.1
1 parent a81312e commit c31306c

12 files changed

+21
-16
lines changed

curve_editor/constants.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace curve_editor::global {
2626
inline constexpr auto PLUGIN_VERSION = mkaul::Version{
2727
mkaul::VersionNumber{2},
2828
mkaul::PreviewType{mkaul::PreviewType::Type::Beta},
29-
mkaul::VersionNumber{1}
29+
mkaul::VersionNumber{1, 0, 1}
3030
};
3131
inline constexpr auto PLUGIN_DEVELOPER = "mimaraka";
3232
inline constexpr auto PLUGIN_TRANSLATOR = "Deepdive";

curve_editor/curve_base.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include "curve_id_manager.hpp"
4+
#include "enum.hpp"
45
#include <cereal/cereal.hpp>
56
#include <nlohmann/json.hpp>
67

@@ -45,6 +46,8 @@ namespace curve_editor {
4546
virtual void set_locked(bool locked) noexcept { locked_ = locked; }
4647
[[nodiscard]] virtual bool is_default() const noexcept = 0;
4748
[[nodiscard]] auto get_id() const noexcept { return id_; }
49+
// TODO: CurveTypeというenumにする
50+
[[nodiscard]] constexpr virtual EditMode get_type() const noexcept = 0;
4851
[[nodiscard]] constexpr virtual std::string get_name() const noexcept = 0;
4952
[[nodiscard]] virtual std::string get_disp_name() const noexcept = 0;
5053
[[nodiscard]] virtual nlohmann::json create_json() const noexcept;

curve_editor/curve_bezier.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ namespace curve_editor {
4343
[[nodiscard]] std::unique_ptr<GraphCurve> clone_graph() const noexcept override { return std::make_unique<BezierCurve>(*this); }
4444
[[nodiscard]] std::unique_ptr<Curve> clone() const noexcept override { return clone_graph(); }
4545

46-
// カーブの名前を取得する
46+
[[nodiscard]] constexpr EditMode get_type() const noexcept override { return EditMode::Bezier; }
4747
[[nodiscard]] constexpr std::string get_name() const noexcept override { return global::CURVE_NAME_BEZIER; }
4848
[[nodiscard]] std::string get_disp_name() const noexcept override { return global::string_table[global::StringTable::StringId::LabelEditModeBezier]; }
4949

curve_editor/curve_bounce.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ namespace curve_editor {
3838
[[nodiscard]] std::unique_ptr<GraphCurve> clone_graph() const noexcept override { return std::make_unique<BounceCurve>(*this); }
3939
[[nodiscard]] std::unique_ptr<Curve> clone() const noexcept override { return clone_graph(); }
4040

41+
[[nodiscard]] constexpr EditMode get_type() const noexcept override { return EditMode::Bounce; }
4142
[[nodiscard]] constexpr std::string get_name() const noexcept override { return global::CURVE_NAME_BOUNCE; }
4243
[[nodiscard]] std::string get_disp_name() const noexcept override { return global::string_table[global::StringTable::StringId::LabelEditModeBounce]; }
4344

curve_editor/curve_elastic.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ namespace curve_editor {
4040
[[nodiscard]] std::unique_ptr<GraphCurve> clone_graph() const noexcept override { return std::make_unique<ElasticCurve>(*this); }
4141
[[nodiscard]] std::unique_ptr<Curve> clone() const noexcept override { return clone_graph(); }
4242

43+
[[nodiscard]] constexpr EditMode get_type() const noexcept override { return EditMode::Elastic; }
4344
[[nodiscard]] constexpr std::string get_name() const noexcept override { return global::CURVE_NAME_ELASTIC; }
4445
[[nodiscard]] std::string get_disp_name() const noexcept override { return global::string_table[global::StringTable::StringId::LabelEditModeElastic]; }
4546

curve_editor/curve_linear.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ namespace curve_editor {
3636
[[nodiscard]] std::unique_ptr<GraphCurve> clone_graph() const noexcept override { return std::make_unique<LinearCurve>(*this); }
3737
[[nodiscard]] std::unique_ptr<Curve> clone() const noexcept override { return clone_graph(); }
3838

39+
// TODO: CurveTypeに直す際にここも直す
40+
[[nodiscard]] constexpr EditMode get_type() const noexcept override { return EditMode::Normal; }
3941
[[nodiscard]] constexpr std::string get_name() const noexcept override { return global::CURVE_NAME_LINEAR; }
4042
[[nodiscard]] std::string get_disp_name() const noexcept override { return global::string_table[global::StringTable::StringId::LabelCurveSegmentTypeLinear]; }
4143

curve_editor/curve_normal.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ namespace curve_editor {
3232
[[nodiscard]] std::unique_ptr<GraphCurve> clone_graph() const noexcept override { return std::make_unique<NormalCurve>(*this); }
3333
[[nodiscard]] std::unique_ptr<Curve> clone() const noexcept override { return clone_graph(); }
3434

35+
[[nodiscard]] constexpr EditMode get_type() const noexcept override { return EditMode::Normal; }
3536
[[nodiscard]] constexpr std::string get_name() const noexcept override { return global::CURVE_NAME_NORMAL; }
3637
[[nodiscard]] std::string get_disp_name() const noexcept override { return global::string_table[global::StringTable::StringId::LabelEditModeNormal]; }
3738

curve_editor/curve_script.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ namespace curve_editor {
3737

3838
[[nodiscard]] std::unique_ptr<Curve> clone() const noexcept override { return std::make_unique<ScriptCurve>(*this); }
3939

40+
[[nodiscard]] constexpr EditMode get_type() const noexcept override { return EditMode::Script; }
4041
[[nodiscard]] constexpr std::string get_name() const noexcept override { return global::CURVE_NAME_SCRIPT; }
4142
[[nodiscard]] std::string get_disp_name() const noexcept override { return global::string_table[global::StringTable::StringId::LabelEditModeScript]; }
4243
[[nodiscard]] double curve_function(double, double start, double) const noexcept override;

curve_editor/curve_value.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ namespace curve_editor {
2828
[[nodiscard]] std::unique_ptr<GraphCurve> clone_graph() const noexcept override { return std::make_unique<ValueCurve>(*this); }
2929
[[nodiscard]] std::unique_ptr<Curve> clone() const noexcept override { return clone_graph(); }
3030

31+
[[nodiscard]] constexpr EditMode get_type() const noexcept override { return EditMode::Value; }
3132
[[nodiscard]] constexpr std::string get_name() const noexcept override { return global::CURVE_NAME_VALUE; }
3233
[[nodiscard]] std::string get_disp_name() const noexcept override { return global::string_table[global::StringTable::StringId::LabelEditModeValue]; }
3334

curve_editor/drag_and_drop.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,7 @@ namespace curve_editor {
5252

5353
auto curve = global::id_manager.get_curve<NumericGraphCurve>(curve_id_);
5454
if (curve) {
55-
// TODO: get_type()を実装し次第変更
56-
if (curve->get_name() == global::CURVE_NAME_BEZIER) {
57-
mode = EditMode::Bezier;
58-
}
59-
else if (curve->get_name() == global::CURVE_NAME_ELASTIC) {
60-
mode = EditMode::Elastic;
61-
}
62-
else if (curve->get_name() == global::CURVE_NAME_BOUNCE) {
63-
mode = EditMode::Bounce;
64-
}
55+
mode = curve->get_type();
6556
param = curve->encode();
6657
}
6758
else {
@@ -165,7 +156,7 @@ namespace curve_editor {
165156
buttons_[idx].unhighlight();
166157
}
167158
for (const auto idx : track_idcs) {
168-
buttons_[idx].highlight(p_render_target_);
159+
buttons_[idx].highlight(p_render_target_, curve_id_);
169160
}
170161
track_idcs_buffer_ = track_idcs;
171162
}

0 commit comments

Comments
 (0)