-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Bone Search #85
base: main
Are you sure you want to change the base?
Add Bone Search #85
Conversation
- Bullet will only show if the text matches. - Selected will show if it or a descendant is the current target. + OpenOnArrow still works if Bullet is shown in its place. ! Unsure about the style in themselves, but they should be uniquely distinct from each other.
* Unsure on preference, but mainly for selecting bones when the empty space is selected... rather than the text.
* Bullet would have shown as if it had children to expand upon.
* new enum added specific for selection and query results
* search results for both are quite agressive when adding the icons * intention is to have colors mapped to these results and then pick the first one it matches to * additional possibility to add ancestor query results on top of child results
c0c4aa4
to
19e24e0
Compare
var criteria = HighlightCriteria.None; | ||
|
||
var show = DrawBoneNode(bone, flag, () => OverlayWindow.SetGizmoOwner(bone.UniqueName)); | ||
if (show) { | ||
if (isSelected) criteria ^= HighlightCriteria.Selected; | ||
if (isQueried) criteria ^= HighlightCriteria.Queried; | ||
if (hasChildSelected) criteria ^= HighlightCriteria.ChildSelected; | ||
if (hasChildInQuery) criteria ^= HighlightCriteria.ChildQueried; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attempts to unify this into a single method, went well initially - but hit a wall with CS0315 when the generic was not satisfied with using the enum (the XOR operator wasn't satisfied either, which would have required each value of the enum to be type cast as an integer).
var criteria = ApplyMulti(
HighlightCriteria.None,
new [] {
(HighlightCriteria.Selected, Skeleton.IsBoneSelected(bone)),
(HighlightCriteria.Queried, BoneDoesMatch(bone)),
(HighlightCriteria.ChildSelected, decendents.Any(BoneDoesMatch)),
(HighlightCriteria.ChildQueried, decendents.Any(bone => Skeleton.IsBoneSelected(bone)))
}
);
private static T ApplyMulti<T>(T initial, (T, bool)[] pairs) where T : IBitwiseOperators<T, T, T> {
T result = initial;
foreach (var (value, condition) in pairs) {
if (condition) result ^= value;
}
return result;
}
The use of an array only for this, would also have been excessive for its repeated calls, overall performance and impact on garbage collection.
Co-Authored-By: Fayti1703 <[email protected]>
Co-Authored-By: Fayti1703 <[email protected]>
Co-Authored-By: Fayti1703 <[email protected]>
Co-Authored-By: Fayti1703 <[email protected]>
Co-Authored-By: Fayti1703 <[email protected]>
private static Vector2 _FrameMin; | ||
private static Vector2 _FrameMax; | ||
|
||
private static string SearchText = ""; | ||
|
||
public static unsafe void Draw(Actor* actor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDE0036 was raised in accordance with .editorconfig
.
public static unsafe void Draw(Actor* actor) { | |
public unsafe static void Draw(Actor* actor) { |
SearchText
matches regardless of text case. (Thanks @Fayti1703)Changes between ab3c6a1...19e24e0
ImGuiTreeNodeFlags
was abandoned for a new enum associated to bone relationships.This currently encompasses Self and Child / Descendant, but can be expanded to include:
FontAwesomeIcon
to describe its association, if any exists - but can be changed to use colours or utilize both in varying capacities.Representation is expected to change to be more accessible, as is the core functionality and quality of code if this is to merge.