实验用品菜单使用说明
<p>[TOC]</p>
<table>
<thead>
<tr>
<th>作者</th>
<th>刘备(594682)</th>
</tr>
</thead>
<tbody>
<tr>
<td>更新日期</td>
<td>2024-12-11</td>
</tr>
<tr>
<td>版本</td>
<td>V1.0.0</td>
</tr>
</tbody>
</table>
<h4>策划文档</h4>
<p><a href="https://www.figma.com/design/0AhFgbes7FvYU8cZtnN7Fe/%E5%A4%AE%E9%A6%86-X-%E6%92%AD%E6%94%BE%E5%99%A8?node-id=428-4574&node-type=canvas&t=diQskJWilrVkJeLc-0">https://www.figma.com/design/0AhFgbes7FvYU8cZtnN7Fe/%E5%A4%AE%E9%A6%86-X-%E6%92%AD%E6%94%BE%E5%99%A8?node-id=428-4574&node-type=canvas&t=diQskJWilrVkJeLc-0</a></p>
<h4>快速创建</h4>
<p>快速创建请参考 BP_TemplateElement的MenuInfo。
然后编辑MenuInfo即可实现菜单功能
菜单中所有文本读取自Language语言包,默认为zh_CN.json。
<img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=8d4e4006c0d440c591923c359300974a&amp;file=file.png" alt="" />
<img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=c505273372943b2a7bae24a7fc3dd270&amp;file=file.png" alt="" /></p>
<h4>功能按钮</h4>
<h5>1.1 功能按钮数量</h5>
<p>功能按钮理论上没有数量限制,需要人工判断UI不允许超出屏幕
<img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=4d352a8b46ed6422d4506b0254a0c3c7&amp;file=file.png" alt="" /></p>
<h5>1.2 功能按钮参数说明</h5>
<p>参数与说明如下:</p>
<pre><code class="language-cpp"> // 点击后触发的蓝图函数名
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FName ParaKey;
// 是否可编辑操作
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool CanOperate;
// 显示名称
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString DisplayName;</code></pre>
<p>> 要注意DisplayName的内容要在语言包配置中存在
> 是否可编辑操作属性,可以通过函数,SetBtnOperate(const int Index, const bool CanOperate)来修改</p>
<h4>功能菜单说明</h4>
<h5>2.1 功能菜单一共两个</h5>
<p>子菜单按钮
<img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=0f97c67651bda4ee85b1810ec8965978&amp;file=file.png" alt="" />
观察按钮
<img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=5dd22c72e54a169729400b8f9f0884cc&amp;file=file.png" alt="" />
<del>删除按钮</del>(永弟说不要删除功能)
<img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=855daceb7755d986ac43e9804fcfeaf3&amp;file=file.png" alt="" /></p>
<h4>子菜单条目</h4>
<h5>3.1 子菜单条目限制</h5>
<p>子菜单条目理论上没有数量限制,需要人工判断UI不允许超出屏幕.UI太高会显示不下
<img src="https://www.showdoc.com.cn/server/api/attachment/visitFile?sign=0e16d761a3e5336c80a52a3ab730196b&amp;file=file.png" alt="" /></p>
<h5>3.2 子菜单条目说明</h5>
<p>菜单标题的宽度和内容的宽度可以自定义,但是有限制范围,太宽会显示不下。</p>
<pre><code class="language-cpp">// 标题名称
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString DisplayName;
// 显示类型 目前支持:LabelBox[文本框],RadioBox[单选框]
UPROPERTY(EditAnywhere, BlueprintReadWrite)
EParaType ParaType;
// 标题宽度 限制在80到200之间
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (ClampMin = &quot;80&quot;, ClampMax = &quot;200&quot;, UIMin = &quot;80&quot;, UIMax = &quot;200&quot;))
float TitleWidth;
// 内容宽度 限制在180到380之间
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (ClampMin = &quot;180&quot;, ClampMax = &quot;380&quot;, UIMin = &quot;180&quot;, UIMax = &quot;380&quot;))
float ContentWidth;
// 是否可编辑(LabelBox不支持编辑)
UPROPERTY(EditAnywhere, BlueprintReadWrite)
bool Editable;
// 类型值数组,用于显示多个文本内容,例如:RadioBox的&quot;开&quot;,&quot;关&quot;文本
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray&lt;FString&gt; TypeValue;
// 关联变量, 用于获取蓝图变量
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FName ParaKey;
// 关联回调函数名,当操作后调用的函数名,例如点击RadioBox后的函数
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FName CallBack;
// 显示的值,显示部分控件的默认文本,例如:LabelBox的语言包Key
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FString DisplayValue;</code></pre>