!1930 优化:画洞时显示当前尺寸

pull/1940/head
黄诗津 2 years ago committed by ChenX
parent 2e682d1bbe
commit f095ebc5d0

@ -91,7 +91,7 @@ export class Command_DrawHole implements Command
if (!helper._Walls.length) if (!helper._Walls.length)
{ {
AppToaster.show({ AppToaster.show({
message: "没有墙可以放置窗户!", message: `没有墙可以放置${this._HoleIType === IHoleType.Door ? "门洞" : "窗户"}!`,
timeout: 5000, timeout: 5000,
intent: Intent.WARNING, intent: Intent.WARNING,
}); });
@ -221,6 +221,7 @@ export class Command_DrawHole implements Command
let pRes = await app.Editor.GetPoint({ let pRes = await app.Editor.GetPoint({
Callback: UpdateHole, Callback: UpdateHole,
Raycast: true, Raycast: true,
Msg: `请输入放置的位置<H:${hole.Height}, L:${this.holeLength}, D:${this.offGround}>:`,
KeyWordList: [{ key: "H", msg: "高度" }, { key: "L", msg: "长度" }, { key: "D", msg: "离地" }], KeyWordList: [{ key: "H", msg: "高度" }, { key: "L", msg: "长度" }, { key: "D", msg: "离地" }],
RaycastPreExecFunc: () => RaycastPreExecFunc: () =>
{ {
@ -260,8 +261,7 @@ export class Command_DrawHole implements Command
else if (pRes.StringResult === "L") else if (pRes.StringResult === "L")
{ {
let LRes = await app.Editor.GetDistance({ Msg: "请输入洞长度:", Default: this.holeLength }); let LRes = await app.Editor.GetDistance({ Msg: "请输入洞长度:", Default: this.holeLength });
if (LRes.Status === PromptStatus.Cancel) return; if (LRes.Status === PromptStatus.OK)
else if (LRes.Status === PromptStatus.OK)
{ {
if (LRes.Distance > 0) if (LRes.Distance > 0)
this.holeLength = LRes.Distance; this.holeLength = LRes.Distance;
@ -473,7 +473,7 @@ export class Command_DrawHole implements Command
Callback: UpdateHole, Callback: UpdateHole,
Raycast: true, Raycast: true,
KeyWordList: [{ key: "H", msg: "高度" }, { key: "D", msg: "离地" }], KeyWordList: [{ key: "H", msg: "高度" }, { key: "D", msg: "离地" }],
Msg: "请选择一个点,用来放置L型窗户", Msg: `请选择一个点,用来放置L型窗户<H:${hole.Height}, D:${this.offGround}>:`,
RaycastPreExecFunc: () => RaycastPreExecFunc: () =>
{ {
//TODO:PERF 已知问题,圆弧墙的功能消耗了8ms //TODO:PERF 已知问题,圆弧墙的功能消耗了8ms
@ -716,7 +716,7 @@ export class Command_DrawHole implements Command
Callback: UpdateHole, Callback: UpdateHole,
Raycast: true, Raycast: true,
KeyWordList: [{ key: "H", msg: "高度" }, { key: "D", msg: "离地" }], KeyWordList: [{ key: "H", msg: "高度" }, { key: "D", msg: "离地" }],
Msg: "请选择一个点,用来放置U型窗户", Msg: `请选择一个点,用来放置U型窗户<H:${hole.Height}, D:${this.offGround}>:`,
RaycastPreExecFunc: () => RaycastPreExecFunc: () =>
{ {
//TODO:PERF 已知问题,圆弧墙的功能消耗了8ms //TODO:PERF 已知问题,圆弧墙的功能消耗了8ms
@ -776,8 +776,7 @@ export class Command_DrawHole implements Command
GetHoleHeight = async (hole: RoomHolePolyline) => GetHoleHeight = async (hole: RoomHolePolyline) =>
{ {
let hRes = await app.Editor.GetDistance({ Msg: "请输入洞高度:", Default: hole.Height }); let hRes = await app.Editor.GetDistance({ Msg: "请输入洞高度:", Default: hole.Height });
if (hRes.Status === PromptStatus.Cancel) return; if (hRes.Status === PromptStatus.OK)
else if (hRes.Status === PromptStatus.OK)
{ {
if (hRes.Distance > 0) if (hRes.Distance > 0)
this.holeHeight = hRes.Distance; this.holeHeight = hRes.Distance;
@ -788,8 +787,7 @@ export class Command_DrawHole implements Command
GetHoleoffGround = async () => GetHoleoffGround = async () =>
{ {
let DRes = await app.Editor.GetDistance({ Msg: "请输入离地距离:", Default: this.offGround }); let DRes = await app.Editor.GetDistance({ Msg: "请输入离地距离:", Default: this.offGround });
if (DRes.Status === PromptStatus.Cancel) return; if (DRes.Status === PromptStatus.OK)
else if (DRes.Status === PromptStatus.OK)
{ {
if (DRes.Distance >= 0) if (DRes.Distance >= 0)
this.offGround = DRes.Distance; this.offGround = DRes.Distance;

Loading…
Cancel
Save