Compare commits
	
		
			No commits in common. "63f13183d069af9a4351995ebacdf4b939cae4b7" and "c44c10ad4215f4ed79a4b74482d8fd1028bdedfb" have entirely different histories.
		
	
	
		
			63f13183d0
			...
			c44c10ad42
		
	
		
| @ -4,7 +4,7 @@ div.color-input { | ||||
| 
 | ||||
|     div.color-view { | ||||
|         width: $line-min-height; | ||||
|         min-width: $line-min-height; | ||||
|         max-width: $line-min-height; | ||||
|         display: flex; | ||||
|         justify-content: center; | ||||
|         align-items: center; | ||||
| @ -24,12 +24,7 @@ div.color-input { | ||||
|         align-items: center; | ||||
| 
 | ||||
|         div.text-box { | ||||
|             max-width: calc( 100% - 24px); | ||||
|             text-overflow: ellipsis; | ||||
|             overflow: hidden; | ||||
|             padding-left: 1px; | ||||
|             white-space: nowrap; | ||||
|             word-break: keep-all; | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -13,7 +13,7 @@ import "./ObjectPicker.scss"; | ||||
| type IObjectType = Label | Group | Range | CtrlObject; | ||||
| 
 | ||||
| interface IObjectPickerProps extends ITextFieldProps { | ||||
|     type: string; | ||||
|     type: Array<"L" | "G" | "R">; | ||||
|     value?: IObjectType; | ||||
|     valueChange?: (value: IObjectType) => any; | ||||
|     cleanValue?: () => any; | ||||
| @ -28,23 +28,17 @@ class ObjectPicker extends Component<IObjectPickerProps & IMixinStatusProps, IOb | ||||
| 
 | ||||
|     private getAllOption() { | ||||
|         let option: Array<IObjectType> = []; | ||||
|         if (!this.props.status) return option; | ||||
|         if (this.props.status) { | ||||
| 
 | ||||
|         if (this.props.type.includes("L")) { | ||||
|             for (let i = 0; i < this.props.type.length; i++) { | ||||
| 
 | ||||
|                 if (this.props.type[i] === "L") { | ||||
|                     for (let j = 0; j < this.props.status.model.labelPool.length; j++) { | ||||
|                         option.push(this.props.status.model.labelPool[j]); | ||||
|                     } | ||||
| 
 | ||||
|             if (this.props.type.includes("R")) { | ||||
|                 option.push(this.props.status.model.allRangeLabel); | ||||
|                 } | ||||
| 
 | ||||
|             if (this.props.type.includes("G")) { | ||||
|                 option.push(this.props.status.model.allGroupLabel); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         if (this.props.type.includes("R")) { | ||||
|                 if (this.props.type[i] === "R") { | ||||
|                     for (let j = 0; j < this.props.status.model.objectPool.length; j++) { | ||||
|                         if (this.props.status.model.objectPool[j] instanceof Range) { | ||||
|                             option.push(this.props.status.model.objectPool[j]); | ||||
| @ -52,14 +46,15 @@ class ObjectPicker extends Component<IObjectPickerProps & IMixinStatusProps, IOb | ||||
|                     }     | ||||
|                 } | ||||
| 
 | ||||
|         if (this.props.type.includes("G")) { | ||||
|                 if (this.props.type[i] === "G") { | ||||
|                     for (let j = 0; j < this.props.status.model.objectPool.length; j++) { | ||||
|                         if (this.props.status.model.objectPool[j] instanceof Group) { | ||||
|                             option.push(this.props.status.model.objectPool[j]); | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|          | ||||
|             } | ||||
|         } | ||||
|         return option; | ||||
|     } | ||||
| 
 | ||||
| @ -105,10 +100,9 @@ class ObjectPicker extends Component<IObjectPickerProps & IMixinStatusProps, IOb | ||||
|             isDelete = this.props.value.isDeleted(); | ||||
|         } else { | ||||
|             disPlayInfo = { | ||||
|                 name: "Input.Error.Select", | ||||
|                 name: "", | ||||
|                 icon: "Label", | ||||
|                 color: "transparent", | ||||
|                 needI18n: true | ||||
|                 color: "rgba(0,0,0,0)" | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
| @ -145,9 +139,9 @@ class ObjectPicker extends Component<IObjectPickerProps & IMixinStatusProps, IOb | ||||
|                     }} | ||||
|                 > | ||||
|                     {    | ||||
|                         disPlayInfo.needI18n ?  | ||||
|                             <Localization i18nKey={disPlayInfo.name as any}/> : | ||||
|                             <span>{disPlayInfo.name}</span> | ||||
|                         disPlayInfo.name ?  | ||||
|                             <span>{disPlayInfo.name}</span> : | ||||
|                             <Localization i18nKey="Input.Error.Select"/> | ||||
|                     } | ||||
|                 </div> | ||||
|                 <div | ||||
|  | ||||
| @ -7,15 +7,9 @@ import { Range } from "@Model/Range"; | ||||
| import { Component, ReactNode, RefObject } from "react"; | ||||
| import "./PickerList.scss"; | ||||
| 
 | ||||
| type IDisplayInfo = Record<"color" | "icon" | "name", string>; | ||||
| type IPickerListItem = CtrlObject | Label | Range | Group; | ||||
| interface IDisplayInfo { | ||||
|     color: string; | ||||
|     icon: string; | ||||
|     name: string; | ||||
|     needI18n?: boolean; | ||||
| }; | ||||
| 
 | ||||
| interface IDisplayItem { | ||||
| type IDisplayItem = { | ||||
|     nameKey: AllI18nKeys; | ||||
|     key: string; | ||||
| 	mark?: boolean; | ||||
| @ -26,7 +20,6 @@ function getObjectDisplayInfo(item: IPickerListItem): IDisplayInfo { | ||||
| 	let color: number[] = []; | ||||
| 	let icon: string = "tag"; | ||||
| 	let name: string = ""; | ||||
|     let needI18n: boolean = false; | ||||
| 
 | ||||
| 	if (item instanceof Range) { | ||||
| 		icon = "CubeShape" | ||||
| @ -41,30 +34,15 @@ function getObjectDisplayInfo(item: IPickerListItem): IDisplayInfo { | ||||
| 		name = item.displayName; | ||||
| 	} | ||||
| 	if (item instanceof Label) { | ||||
| 
 | ||||
| 		if (item.isBuildIn) { | ||||
|             needI18n = true; | ||||
|             if (item.id === "AllRange") { | ||||
|                 icon = "ProductList"; | ||||
|                 name = "Build.In.Label.Name.All.Range"; | ||||
|             } else if (item.id === "AllGroup") { | ||||
|                 icon = "SizeLegacy"; | ||||
|                 name = "Build.In.Label.Name.All.Group"; | ||||
|             } | ||||
|         }  | ||||
|          | ||||
|         else { | ||||
| 		icon = "tag"; | ||||
| 		color = item.color.concat([]); | ||||
| 		name = item.name; | ||||
| 	} | ||||
| 	} | ||||
| 
 | ||||
| 	return { | ||||
| 		color: needI18n ? "transparent" : `rgb(${color[0]},${color[1]},${color[2]})`, | ||||
| 		color: `rgb(${color[0]},${color[1]},${color[2]})`, | ||||
| 		icon: icon, | ||||
| 		name: name, | ||||
|         needI18n: needI18n | ||||
| 		name: name | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| @ -101,11 +79,7 @@ class PickerList extends Component<IPickerListProps> { | ||||
| 				<Icon iconName={displayInfo.icon}/> | ||||
| 			</div> | ||||
| 			<div className="list-item-name"> | ||||
| 				{ | ||||
|                     displayInfo.needI18n ?  | ||||
|                         <Localization i18nKey={displayInfo.name as any}/> :  | ||||
|                         displayInfo.name | ||||
|                 } | ||||
| 				{displayInfo.name} | ||||
| 			</div> | ||||
| 		</div>; | ||||
| 	} | ||||
|  | ||||
| @ -44,8 +44,6 @@ const EN_US = { | ||||
|     "Panel.Info.Label.Details.View": "Edit view label attributes", | ||||
|     "Panel.Title.Group.Details.View": "Group", | ||||
|     "Panel.Info.Group.Details.View": "Edit view group attributes", | ||||
|     "Build.In.Label.Name.All.Group": "All group", | ||||
|     "Build.In.Label.Name.All.Range": "All range", | ||||
|     "Common.No.Data": "No Data", | ||||
|     "Common.No.Unknown.Error": "Unknown error", | ||||
|     "Common.Attr.Title.Basic": "Basic properties", | ||||
| @ -75,10 +73,6 @@ const EN_US = { | ||||
|     "Common.Attr.Key.Generation.Point.X": "Generation Point X", | ||||
|     "Common.Attr.Key.Generation.Point.Y": "Generation Point Y", | ||||
|     "Common.Attr.Key.Generation.Point.Z": "Generation Point Z", | ||||
|     "Common.Attr.Key.Generation.Error.Empty.Object": "Please select a range object or label to add to the object", | ||||
|     "Common.Attr.Key.Generation.Error.Empty.Range.List": "The specified label does not contain any scope objects", | ||||
|     "Common.Attr.Key.Generation.Error.Invalid.Range": "The specified scope object is invalid", | ||||
|     "Common.Attr.Key.Generation.Error.Invalid.Label": "The specified label has expired", | ||||
|     "Panel.Info.Range.Details.Attr.Error.Not.Range": "Object is not a Range", | ||||
|     "Panel.Info.Range.Details.Attr.Error.Unspecified": "Unspecified range object", | ||||
|     "Panel.Info.Group.Details.Attr.Error.Not.Group": "Object is not a Group", | ||||
|  | ||||
| @ -44,8 +44,6 @@ const ZH_CN = { | ||||
|     "Panel.Info.Label.Details.View": "编辑查看标签属性", | ||||
|     "Panel.Title.Group.Details.View": "群", | ||||
|     "Panel.Info.Group.Details.View": "编辑查看群属性", | ||||
|     "Build.In.Label.Name.All.Group": "全部群", | ||||
|     "Build.In.Label.Name.All.Range": "全部范围", | ||||
|     "Common.No.Data": "暂无数据", | ||||
|     "Common.No.Unknown.Error": "未知错误", | ||||
|     "Common.Attr.Title.Basic": "基础属性", | ||||
| @ -75,10 +73,6 @@ const ZH_CN = { | ||||
|     "Common.Attr.Key.Generation.Point.X": "生成位置 X 坐标", | ||||
|     "Common.Attr.Key.Generation.Point.Y": "生成位置 Y 坐标", | ||||
|     "Common.Attr.Key.Generation.Point.Z": "生成位置 Z 坐标", | ||||
|     "Common.Attr.Key.Generation.Error.Empty.Object": "请选择一个范围对象或添加至对象的标签", | ||||
|     "Common.Attr.Key.Generation.Error.Empty.Range.List": "指定的标签中没有包含任何范围对象", | ||||
|     "Common.Attr.Key.Generation.Error.Invalid.Range": "指定的范围对象已失效", | ||||
|     "Common.Attr.Key.Generation.Error.Invalid.Label": "指定的标签已失效", | ||||
|     "Panel.Info.Range.Details.Attr.Error.Not.Range": "对象不是一个范围", | ||||
|     "Panel.Info.Range.Details.Attr.Error.Unspecified": "未指定范围对象", | ||||
|     "Panel.Info.Group.Details.Attr.Error.Not.Group": "对象不是一个群", | ||||
|  | ||||
| @ -47,9 +47,9 @@ class Group extends CtrlObject { | ||||
|     /** | ||||
|      * 生成错误信息 | ||||
|      */ | ||||
|     public genErrorMessageShowCount: number = 0; | ||||
|     public genErrorMessageShowCount?: string; | ||||
| 
 | ||||
|     private genInSingleRange(count: number, range: Range) { | ||||
|     private genInSingelRange(count: number, range: Range) { | ||||
|         for (let i = 0; i < count; i++) { | ||||
|             let individual = new Individual(this); | ||||
|             individual.position[0] = range.position[0] + (Math.random() - .5) * 2 * range.radius[0]; | ||||
| @ -75,44 +75,18 @@ class Group extends CtrlObject { | ||||
| 
 | ||||
|         // 单一范围对象
 | ||||
|         if (this.genRange instanceof Range) { | ||||
| 
 | ||||
|             // 无效的对象
 | ||||
|             if (this.genRange.isDeleted()) { | ||||
|                 this.genErrorMessage = "Common.Attr.Key.Generation.Error.Invalid.Range"; | ||||
|                 return false; | ||||
|             } | ||||
|              | ||||
|             else { | ||||
|             rangeList = [this.genRange]; | ||||
|         } | ||||
|         } | ||||
| 
 | ||||
|         // 多重范围对象
 | ||||
|         else if (this.genRange instanceof Label) { | ||||
| 
 | ||||
|             // 无效的标签
 | ||||
|             if (this.genRange.isDeleted()) { | ||||
|                 this.genErrorMessage = "Common.Attr.Key.Generation.Error.Invalid.Label"; | ||||
|                 return false; | ||||
|             } | ||||
|              | ||||
|             else { | ||||
|         if (this.genRange instanceof Label) { | ||||
|             let objList: CtrlObject[] = this.model.getObjectByLabel(this.genRange); | ||||
|                 rangeList = objList.filter((obj) => { | ||||
|                     return obj instanceof Range | ||||
|                 }) as Range[]; | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         // 空对象
 | ||||
|         else { | ||||
|             this.genErrorMessage = "Common.Attr.Key.Generation.Error.Empty.Object"; | ||||
|             return false; | ||||
|             rangeList = objList.filter((obj) => obj instanceof Range) as Range[] | ||||
|         } | ||||
| 
 | ||||
|         // 单一范围生成
 | ||||
|         if (rangeList.length === 1) { | ||||
|             this.genInSingleRange(this.genCount, rangeList[0]); | ||||
|             this.genInSingelRange(this.genCount, rangeList[0]); | ||||
|             return true; | ||||
|         } | ||||
| 
 | ||||
| @ -153,19 +127,12 @@ class Group extends CtrlObject { | ||||
| 
 | ||||
|             // 数据生成
 | ||||
|             for (let i = 0; i < rangeList.length; i++) { | ||||
|                 this.genInSingleRange(genData[i], rangeList[i]); | ||||
|                 this.genInSingelRange(genData[i], rangeList[i]); | ||||
|             } | ||||
|              | ||||
|             return true; | ||||
|         } | ||||
| 
 | ||||
|         // 空数据
 | ||||
|         else { | ||||
|             this.genErrorMessage = "Common.Attr.Key.Generation.Error.Empty.Range.List"; | ||||
|             return false; | ||||
|         } | ||||
| 
 | ||||
|         this.genErrorMessage = "Common.No.Unknown.Error"; | ||||
|         return false; | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -6,11 +6,6 @@ import { ObjectID } from "./Renderer"; | ||||
|  */ | ||||
| class Label { | ||||
|      | ||||
|     /** | ||||
|      * 是否为内置标签 | ||||
|      */ | ||||
|     public isBuildIn: boolean = false; | ||||
|      | ||||
|     /** | ||||
|      * 唯一标识符 | ||||
|      */ | ||||
| @ -46,7 +41,6 @@ class Label { | ||||
|      * 判断是否为相同标签 | ||||
|      */ | ||||
|     public equal(label: Label): boolean { | ||||
|         if (this.isDeleted() || label.isDeleted()) return false; | ||||
|         return this === label || this.id === label.id; | ||||
|     } | ||||
| 
 | ||||
| @ -56,32 +50,16 @@ class Label { | ||||
|     private deleteFlag: boolean = false; | ||||
| 
 | ||||
|     /** | ||||
|      * 测试是否被删除 | ||||
|      * 是否被删除 | ||||
|      */ | ||||
|     public testDelete() { | ||||
|     public isDeleted(): boolean { | ||||
|         if (this.deleteFlag) return true; | ||||
|         for (let i = 0; i < this.model.labelPool.length; i++) { | ||||
|             if (this.model.labelPool[i].equal(this)) return false; | ||||
|         } | ||||
|         this.deleteFlag = true; | ||||
|         return true; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 是否被删除 | ||||
|      */ | ||||
|     public isDeleted(): boolean { | ||||
|         if (this.isBuildIn) return false; | ||||
|         if (this.deleteFlag) return true; | ||||
|         return false; | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * 设置为内置标签 | ||||
|      */ | ||||
|     public setBuildInLabel(): this { | ||||
|         this.isBuildIn = true; | ||||
|         return this; | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| /** | ||||
| @ -123,10 +101,9 @@ class LabelObject { | ||||
|      * 是否存在标签 | ||||
|      */ | ||||
|     public hasLabel(label: Label): boolean { | ||||
|         if (label.isDeleted()) return false; | ||||
|         let has = false; | ||||
|         this.labels.forEach((localLabel) => { | ||||
|             if (!localLabel.isDeleted() && localLabel.equal(label)) has = true; | ||||
|             if (localLabel.equal(label)) has = true; | ||||
|         }); | ||||
|         return has; | ||||
|     } | ||||
|  | ||||
| @ -51,16 +51,6 @@ class Model extends Emitter<ModelEvent> { | ||||
|      */ | ||||
|     public labelPool: Label[] = []; | ||||
| 
 | ||||
|     /** | ||||
|      * 内置标签-全部范围标签 | ||||
|      */ | ||||
|     public allRangeLabel = new Label(this, "AllRange").setBuildInLabel(); | ||||
| 
 | ||||
|     /** | ||||
|      * 内置标签-全部群标签 | ||||
|      */ | ||||
|     public allGroupLabel = new Label(this, "AllGroup").setBuildInLabel(); | ||||
| 
 | ||||
|     /** | ||||
|      * 添加标签 | ||||
|      */ | ||||
| @ -95,7 +85,6 @@ class Model extends Emitter<ModelEvent> { | ||||
| 
 | ||||
|         if (deletedLabel) { | ||||
|             this.labelPool.splice(index, 1); | ||||
|             deletedLabel.testDelete(); | ||||
|             console.log(`Model: Delete label ${deletedLabel.name ?? deletedLabel.id}`); | ||||
|             this.emit("labelDelete", deletedLabel); | ||||
|             this.emit("labelChange", this.labelPool); | ||||
| @ -105,24 +94,23 @@ class Model extends Emitter<ModelEvent> { | ||||
|     /** | ||||
|      * 通过标签获取指定类型的对象 | ||||
|      * @param label 标签 | ||||
|      * @param type 筛选类型 | ||||
|      */ | ||||
|     public getObjectByLabel(label: Label): CtrlObject[] { | ||||
| 
 | ||||
|         if (label.isDeleted()) return []; | ||||
| 
 | ||||
|     public getObjectByLabel( | ||||
|         label: Label, type?:  | ||||
|             (new (...p: any) => Range) |  | ||||
|             (new (...p: any) => Group) | ||||
|     ): CtrlObject[] { | ||||
|         const res: CtrlObject[] = []; | ||||
|         for (let i = 0; i < this.objectPool.length; i++) { | ||||
| 
 | ||||
|             if (label.equal(this.allGroupLabel) && this.objectPool[i] instanceof Group) { | ||||
|             if (this.objectPool[i].hasLabel(label)) { | ||||
|                 if (type) { | ||||
|                     if (this.objectPool[i] instanceof type) { | ||||
|                         res.push(this.objectPool[i]); | ||||
|                     } | ||||
| 
 | ||||
|             else if (label.equal(this.allRangeLabel) && this.objectPool[i] instanceof Range) { | ||||
|                 } else { | ||||
|                     res.push(this.objectPool[i]); | ||||
|                 } | ||||
| 
 | ||||
|             else if (this.objectPool[i].hasLabel(label)) { | ||||
|                 res.push(this.objectPool[i]); | ||||
|             } | ||||
|         } | ||||
|         return res; | ||||
|  | ||||
| @ -130,9 +130,7 @@ class GroupDetails extends Component<IGroupDetailsProps & IMixinStatusProps> { | ||||
| 				keyI18n="Common.Attr.Key.Generation" | ||||
| 				onIconName="BuildDefinition" offIconName="BuildDefinition" | ||||
| 				valueChange={() => { | ||||
| 					if(!group.genIndividuals()) { | ||||
|                         this.props.status?.changeGroupAttrib(group.id, "genErrorMessageShowCount", 1); | ||||
|                     } | ||||
| 					group.genIndividuals(); | ||||
| 				}} | ||||
| 			/> | ||||
| 
 | ||||
| @ -171,23 +169,11 @@ class GroupDetails extends Component<IGroupDetailsProps & IMixinStatusProps> { | ||||
|     } | ||||
| 
 | ||||
|     private renderRangeGenOption(group: Group) { | ||||
| 
 | ||||
|         let isRenderErrorInfo: boolean = false; | ||||
|         if (group.genErrorMessageShowCount > 0) { | ||||
|             group.genErrorMessageShowCount --; | ||||
|             if (group.genErrorMessage) { | ||||
|                 isRenderErrorInfo = true; | ||||
|             } | ||||
|         } else { | ||||
|             group.genErrorMessage = undefined; | ||||
|         } | ||||
| 
 | ||||
|         return <> | ||||
|             <ObjectPicker | ||||
|                 keyI18n="Common.Attr.Key.Generation.Use.Range" | ||||
|                 type={"LR"} | ||||
|                 type={["L", "R"]} | ||||
|                 value={group.genRange} | ||||
|                 errorI18n={isRenderErrorInfo ? group.genErrorMessage as any : undefined} | ||||
|                 valueChange={(value) => { | ||||
|                     this.props.status?.changeGroupAttrib(group.id, "genRange", value); | ||||
|                 }} | ||||
|  | ||||
| @ -13,24 +13,50 @@ import "./RangeDetails.scss"; | ||||
| @useStatusWithEvent("rangeAttrChange", "focusObjectChange", "rangeLabelChange") | ||||
| class RangeDetails extends Component<IMixinStatusProps> { | ||||
| 
 | ||||
|     private renderAttrInput( | ||||
|         id: ObjectID, key: AllI18nKeys, val: string | number | undefined, | ||||
|         change: (val: string, status: Status) => any, | ||||
|         step?: number, max?: number, min?: number | ||||
|     ) { | ||||
|         const handelFunc = (e: string) => { | ||||
|             if (this.props.status) { | ||||
|                 change(e, this.props.status); | ||||
|             } | ||||
|         } | ||||
|         if (step) { | ||||
|             return <AttrInput | ||||
|                 id={id} isNumber={true} step={step} keyI18n={key} | ||||
|                 value={val} max={max} min={min} | ||||
|                 valueChange={handelFunc} | ||||
|             /> | ||||
|         } else { | ||||
|             return <AttrInput | ||||
|                 id={id} keyI18n={key} value={val} | ||||
|                 valueChange={handelFunc} | ||||
|             /> | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     private renderFrom(range: Range) { | ||||
| 
 | ||||
|         return <> | ||||
| 
 | ||||
|             <Message i18nKey="Common.Attr.Title.Basic" isTitle first/> | ||||
| 
 | ||||
|             <AttrInput | ||||
|                 id={range.id} keyI18n="Common.Attr.Key.Display.Name" value={range.displayName} | ||||
|                 valueChange={(val) => { | ||||
|                     this.props.status?.changeRangeAttrib(range.id, "displayName", val); | ||||
|                 }} | ||||
|             /> | ||||
|             {this.renderAttrInput( | ||||
|                 range.id, "Common.Attr.Key.Display.Name", range.displayName, | ||||
|                 (val, status) => { | ||||
|                     status.changeRangeAttrib(range.id, "displayName", val); | ||||
|                 } | ||||
|             )} | ||||
| 
 | ||||
|             <ColorInput | ||||
|                 keyI18n="Common.Attr.Key.Color" | ||||
|                 value={range.color} normal | ||||
|                 valueChange={(color) => { | ||||
|                     this.props.status?.changeRangeAttrib(range.id, "color", color); | ||||
|                     if (this.props.status) { | ||||
|                         this.props.status.changeRangeAttrib(range.id, "color", color); | ||||
|                     } | ||||
|                 }} | ||||
|             /> | ||||
| 
 | ||||
| @ -38,17 +64,32 @@ class RangeDetails extends Component<IMixinStatusProps> { | ||||
|                 keyI18n="Common.Attr.Key.Label" | ||||
|                 labels={range.allLabels()} | ||||
|                 labelAdd={(label) => { | ||||
|                     this.props.status?.addRangeLabel(range.id, label); | ||||
|                     if (this.props.status) { | ||||
|                         this.props.status.addRangeLabel(range.id, label); | ||||
|                     } | ||||
|                 }} | ||||
|                 labelDelete={(label) => { | ||||
|                     this.props.status?.deleteRangeLabel(range.id, label); | ||||
|                     if (this.props.status) { | ||||
|                         this.props.status.deleteRangeLabel(range.id, label); | ||||
|                     } | ||||
|                 }} | ||||
|             /> | ||||
|              | ||||
|             <TogglesInput | ||||
|                 keyI18n="Common.Attr.Key.Display" | ||||
|                 value={range.display} valueChange={(val) => { | ||||
|                     this.props.status?.changeRangeAttrib(range.id, "display", val); | ||||
|                     if (this.props.status) { | ||||
|                         this.props.status.changeRangeAttrib(range.id, "display", val); | ||||
|                     } | ||||
|                 }} | ||||
|             /> | ||||
| 
 | ||||
|             <TogglesInput | ||||
|                 keyI18n="Common.Attr.Key.Update" | ||||
|                 value={range.update} valueChange={(val) => { | ||||
|                     if (this.props.status) { | ||||
|                         this.props.status.changeRangeAttrib(range.id, "update", val); | ||||
|                     } | ||||
|                 }} | ||||
|             /> | ||||
| 
 | ||||
| @ -65,59 +106,53 @@ class RangeDetails extends Component<IMixinStatusProps> { | ||||
| 
 | ||||
|             <Message i18nKey="Common.Attr.Title.Spatial" isTitle/> | ||||
| 
 | ||||
|             <AttrInput | ||||
|                 id={range.id} isNumber={true} step={.1} keyI18n={"Common.Attr.Key.Position.X"} | ||||
|                 value={range.position[0]} | ||||
|                 valueChange={(val) => { | ||||
|             {this.renderAttrInput( | ||||
|                 range.id, "Common.Attr.Key.Position.X",  | ||||
|                 range.position[0], (val, status) => { | ||||
|                     range.position[0] = (val as any) / 1; | ||||
|                     this.props.status?.changeRangeAttrib(range.id, "position", range.position); | ||||
|                 }} | ||||
|             /> | ||||
|                     status.changeRangeAttrib(range.id, "position", range.position); | ||||
|                 }, .1 | ||||
|             )} | ||||
| 
 | ||||
|             <AttrInput | ||||
|                 id={range.id} isNumber={true} step={.1} keyI18n={"Common.Attr.Key.Position.Y"} | ||||
|                 value={range.position[1]} | ||||
|                 valueChange={(val) => { | ||||
|             {this.renderAttrInput( | ||||
|                 range.id, "Common.Attr.Key.Position.Y", | ||||
|                 range.position[1],(val, status) => { | ||||
|                     range.position[1] = (val as any) / 1; | ||||
|                     this.props.status?.changeRangeAttrib(range.id, "position", range.position); | ||||
|                 }} | ||||
|             /> | ||||
|                     status.changeRangeAttrib(range.id, "position", range.position); | ||||
|                 }, .1 | ||||
|             )} | ||||
| 
 | ||||
|             <AttrInput | ||||
|                 id={range.id} isNumber={true} step={.1} keyI18n={"Common.Attr.Key.Position.Z"} | ||||
|                 value={range.position[2]} | ||||
|                 valueChange={(val) => { | ||||
|             {this.renderAttrInput( | ||||
|                 range.id, "Common.Attr.Key.Position.Z", | ||||
|                 range.position[2], (val, status) => { | ||||
|                     range.position[2] = (val as any) / 1; | ||||
|                     this.props.status?.changeRangeAttrib(range.id, "position", range.position); | ||||
|                 }} | ||||
|             /> | ||||
|                     status.changeRangeAttrib(range.id, "position", range.position); | ||||
|                 }, .1 | ||||
|             )} | ||||
| 			 | ||||
|             <AttrInput | ||||
|                 id={range.id} isNumber={true} step={.1} keyI18n={"Common.Attr.Key.Radius.X"} | ||||
|                 value={range.radius[0]} min={0} | ||||
|                 valueChange={(val) => { | ||||
|             {this.renderAttrInput( | ||||
|                 range.id, "Common.Attr.Key.Radius.X", | ||||
|                 range.radius[0], (val, status) => { | ||||
|                     range.radius[0] = (val as any) / 1; | ||||
|                     this.props.status?.changeRangeAttrib(range.id, "radius", range.radius); | ||||
|                 }} | ||||
|             /> | ||||
|                     status.changeRangeAttrib(range.id, "radius", range.radius); | ||||
|                 }, .1, undefined, 0 | ||||
|             )} | ||||
| 
 | ||||
|             <AttrInput | ||||
|                 id={range.id} isNumber={true} step={.1} keyI18n={"Common.Attr.Key.Radius.Y"} | ||||
|                 value={range.radius[1]} min={0} | ||||
|                 valueChange={(val) => { | ||||
|             {this.renderAttrInput( | ||||
|                 range.id, "Common.Attr.Key.Radius.Y", | ||||
|                 range.radius[1], (val, status) => { | ||||
|                     range.radius[1] = (val as any) / 1; | ||||
|                     this.props.status?.changeRangeAttrib(range.id, "radius", range.radius); | ||||
|                 }} | ||||
|             /> | ||||
|                     status.changeRangeAttrib(range.id, "radius", range.radius); | ||||
|                 }, .1, undefined, 0 | ||||
|             )} | ||||
| 
 | ||||
|             <AttrInput | ||||
|                 id={range.id} isNumber={true} step={.1} keyI18n={"Common.Attr.Key.Radius.Z"} | ||||
|                 value={range.radius[2]} min={0} | ||||
|                 valueChange={(val) => { | ||||
|             {this.renderAttrInput( | ||||
|                 range.id, "Common.Attr.Key.Radius.Z", | ||||
|                 range.radius[2], (val, status) => { | ||||
|                     range.radius[2] = (val as any) / 1; | ||||
|                     this.props.status?.changeRangeAttrib(range.id, "radius", range.radius); | ||||
|                 }} | ||||
|             /> | ||||
|                     status.changeRangeAttrib(range.id, "radius", range.radius); | ||||
|                 }, .1, undefined, 0 | ||||
|             )} | ||||
| 		</> | ||||
|     } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user