ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Filtering Achievements Page (https://www.esoui.com/forums/showthread.php?t=9766)

pithka 06/02/21 07:34 AM

Filtering Achievements Page
 
I'm working on an achievement tracker and I'd like to add a feature that opens the journal to show ONLY a single achievement.

My current implementation is not quite what I want. I am using ShowAchievement() (shown below) to open the journal to the right place, but the scroll position is somewhat random so the achievement might be anywhere in the full pane and can still be hard to find.
Code:

control:SetHandler("OnMouseUp", function (control, mButton)
      SCENE_MANAGER:ShowBaseScene()
      ACHIEVEMENTS:ShowAchievement(aid)
    end)

What I would prefer to do is to update the achievement search bar with the name of the achievement so that it's the only result shown. I've been having trouble figuring out how to do this. Any thoughts?

Thanks,
@Pithka

pithka 06/19/21 12:29 PM

--ping--

just wondering if anyone has worked through this before.

Baertram 06/19/21 02:46 PM

You need to find out which scene is used as the achievements are shown.
Use a tool like merTorchbug or zgoo and inspect SCENE_MANAGER -> currentScene as you are at the achievements.
Find out how to call that scene to show the attached fragemnts and controls.
e.g. this shows the set collections:

Code:

MAIN_MENU_KEYBOARD:ToggleSceneGroup("collectionsSceneGroup", "itemSetsBook")
Maybe there is something simialr for the achievements.
I think it is defined as "achievements" here:
https://github.com/esoui/esoui/blob/...ments.lua#L972
Could work to show it via SCENE_MANAGER:Show("achievements")

Edit:
Here you see what I mind with the game menu:
https://github.com/esoui/esoui/blob/...ents.lua#L1345
This should be your code that you want to use. Checks if the achievement scene is not shown and then queues and shows it.

And for the searchbox you need to find the control for it via moving the mouse above it and use /tbugm or /zgoo mouse.
You can then searhc it within the achievmetns code.

But I think this already looks promising:
https://github.com/esoui/esoui/blob/...ments.lua#L984

Within the init of the Achievements there is ACHIEVEMENTS_MANAGER:SetSearchString(self.contentSearchEditBox:GetText())
selfshluld be ACHIEVEMENTS so ACHIEVEMENTS .contentSearchEditBox shuld be the search edit box where you need to set the text vis :SetText()
And this would then call the attached "changed" handler function, or you manually need to call ACHIEVEMENTS_MANAGER:SetSearchString(self.contentSearchEditBox:GetText()) as well.


All times are GMT -6. The time now is 03:14 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI