vault backup: 2024-12-20 12:30:04
This commit is contained in:
parent
d022f52097
commit
b31e31cb88
76
02-Note/ASoul/导播台笔记/搜索功能.md
Normal file
76
02-Note/ASoul/导播台笔记/搜索功能.md
Normal file
@ -0,0 +1,76 @@
|
||||
Content/UIAssets/MapEnvironments/Prop/WBP_MapEnvironmentSelectPropPopupView
|
||||
|
||||
搜索逻辑:
|
||||
```c++
|
||||
private ChangeSource(source: number/**@cpp:int*/): void {
|
||||
|
||||
this.curSelect = null;
|
||||
|
||||
MapEnvironmentSetting.SelectPropType = source;
|
||||
|
||||
this.widget.List.ClearListItems();
|
||||
this.widget.List.BP_ClearSelection();
|
||||
this.widget.Effect.SetVisibility((source == UE.EScenePropType.Item || source == UE.EScenePropType.LiveLink)? UE.ESlateVisibility.Visible: UE.ESlateVisibility.Collapsed);
|
||||
|
||||
let colorNormal = new UE.LinearColor(0, 0, 0, 0);
|
||||
let colorSelect = new UE.LinearColor(73/255, 73/255, 73/255, 1);
|
||||
for (let index = 0; index < this.btnBgs.Num(); index++) {
|
||||
const element = this.btnBgs.GetRef(index);
|
||||
element.SetBrushColor(index == source? colorSelect: colorNormal);
|
||||
}
|
||||
|
||||
if (this.manager == null) {
|
||||
return
|
||||
}
|
||||
|
||||
let search =this.widget.SearchBox.GetText();
|
||||
|
||||
let assets = this.manager.AssetManager.AllScenePropAssetList
|
||||
for (let index = 0; index < assets.Num(); index++) {
|
||||
const element = assets.GetRef(index);
|
||||
if (element.PropType === source) {
|
||||
if (search === "" || element.DisplayName.includes(search)) {
|
||||
this.widget.List.AddItem(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
- WBP_AreaSelectPopupView
|
||||
- WBP_MapEnvironmentSingleSelectItemView
|
||||
|
||||
```c++
|
||||
private SetSelectLevel(levelData: UE.MapEnvironmentLevelItem): void {
|
||||
|
||||
this.curSelectLevelName = levelData.LevelData.LevelName;
|
||||
this.curSelectAreaName = "";
|
||||
this.curSelectAreaGuid = new UE.Guid();
|
||||
this.bAreaIsDynamic = false;
|
||||
|
||||
this.widget.AreaList.ClearListItems();
|
||||
this.widget.AreaList.BP_ClearSelection();
|
||||
|
||||
let areas = levelData.LevelData.Areas;
|
||||
|
||||
// let selectIdx = -1;
|
||||
for (let i = 0; i < areas.Num(); i++) {
|
||||
const area = areas.GetRef(i);
|
||||
|
||||
let data = new UE.MapEnvironmentAreaItem();
|
||||
data.AreaData = area;
|
||||
|
||||
this.widget.AreaList.AddItem(data);
|
||||
// if (DirectorCamUtil.IsGuidEqual(area.UUID, this.curSelectAreaGuid)) {
|
||||
// selectIdx = i;
|
||||
// }
|
||||
}
|
||||
|
||||
// if (selectIdx >= 0) {
|
||||
// this.widget.AreaList.SetSelectedIndex(selectIdx);
|
||||
// }
|
||||
|
||||
this.RefreshDynamicBtn();
|
||||
}
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user