Scaffold for dialog previews in the scen editor

This commit is contained in:
2025-04-30 11:07:16 -05:00
parent f83c49d073
commit 203edc46f1
5 changed files with 25 additions and 1 deletions

View File

@@ -37,7 +37,8 @@ namespace {
.ex1a(STRT_BUTTON)
.ex2a(STRT_BUTTON)
.ex1b(eSpecPicker::NODE)
.ex2b(eSpecPicker::NODE);
.ex2b(eSpecPicker::NODE)
.preview();
node_properties_t S_ITEM_DIALOG = node_builder_t(eSpecType::ONCE_GIVE_ITEM_DIALOG)
.sdf()
.msg()

View File

@@ -575,6 +575,7 @@ bool node_category_info_t::contains(eSpecType spec) const {
node_properties_t::node_properties_t(eSpecType type)
: self(type)
, cat(getNodeCategory(type))
, can_preview(false)
{
set(eSpecField::JUMP, eSpecPicker::NODE);
}
@@ -872,6 +873,11 @@ node_builder_t& node_builder_t::loc(eSpecField a, eSpecField b, eLocType type, e
return *this;
}
node_builder_t& node_builder_t::preview() {
node.can_preview = true;
return *this;
}
node_builder_t::operator node_properties_t() {
std::map<eSpecType, node_properties_t>& allNodeProps = nodeProps();
allNodeProps.emplace(node.self, node);

View File

@@ -213,6 +213,7 @@ struct node_properties_t {
node_function_t ex1a(const cSpecial&) const, ex1b(const cSpecial&) const, ex1c(const cSpecial&) const;
node_function_t ex2a(const cSpecial&) const, ex2b(const cSpecial&) const, ex2c(const cSpecial&) const;
node_properties_t() : node_properties_t(eSpecType::INVALID) {}
bool can_preview;
private:
node_properties_t(eSpecType type);
node_function_t get(const cSpecial& spec, eSpecField fld) const;
@@ -267,6 +268,8 @@ struct node_builder_t {
node_builder_t& loc(eSpecField a, eSpecField b, eLocType type);
// As above, but also notes that the area the location is in will be specified by the indicated field.
node_builder_t& loc(eSpecField a, eSpecField b, eLocType type, eSpecField where);
// Specifies that the node defines a dialog which can be previewed
node_builder_t& preview();
node_condition_builder_t when(node_condition_t cond, int lbl_sub);
operator node_properties_t();
private: