增加预览页介绍信息显示
This commit is contained in:
29
client/core/domain/EntityIntro.h
Normal file
29
client/core/domain/EntityIntro.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
namespace core {
|
||||
|
||||
/// 实体在「预览展示」模式下点击后显示的介绍内容(可持久化到 .hfe)
|
||||
struct EntityIntroContent {
|
||||
QString title;
|
||||
QString bodyText;
|
||||
QVector<QString> imagePathsRelative;
|
||||
/// 预留:相对项目根的视频路径,将来可用 QMediaPlayer 播放
|
||||
QString videoPathRelative;
|
||||
|
||||
void clear() {
|
||||
title.clear();
|
||||
bodyText.clear();
|
||||
imagePathsRelative.clear();
|
||||
videoPathRelative.clear();
|
||||
}
|
||||
|
||||
bool hasDisplayableContent() const {
|
||||
return !title.trimmed().isEmpty() || !bodyText.trimmed().isEmpty() ||
|
||||
!imagePathsRelative.isEmpty() || !videoPathRelative.trimmed().isEmpty();
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace core
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "domain/EntityIntro.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QPointF>
|
||||
#include <QVector>
|
||||
@@ -47,8 +49,11 @@ public:
|
||||
int depth = 0; // 0..255
|
||||
QString imagePath; // 相对路径,例如 "assets/entities/entity-1.png"
|
||||
QPointF imageTopLeftWorld; // 贴图左上角 world 坐标
|
||||
// 人为整体缩放,与深度驱动的距离缩放相乘(画布中 visualScale = distanceScale * userScale)
|
||||
// 人为整体缩放,与深度驱动的距离缩放相乘(画布中 visualScale = distanceScale * userScale;
|
||||
// distanceScale 在有 distanceScaleCalibMult 时为 (0.5+depth01)/calib,使抠图处为 1.0)
|
||||
double userScale = 1.0;
|
||||
// 抠图创建时该位置对应的原始距离乘子(0.5+depth01),用于校准:该处 distanceScale==1.0。0 表示未校准(兼容旧工程)
|
||||
double distanceScaleCalibMult = 0.0;
|
||||
|
||||
struct KeyframeVec2 {
|
||||
int frame = 0;
|
||||
@@ -76,6 +81,8 @@ public:
|
||||
QVector<KeyframeFloat01> depthScaleKeys;
|
||||
QVector<KeyframeDouble> userScaleKeys;
|
||||
QVector<ImageFrame> imageFrames;
|
||||
|
||||
EntityIntroContent intro;
|
||||
};
|
||||
|
||||
void setEntities(const QVector<Entity>& entities) { m_entities = entities; }
|
||||
|
||||
Reference in New Issue
Block a user