Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3bbbce3
commit 04e7e38
Showing
290 changed files
with
38,232 additions
and
24,787 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
© 2023 ZENIMAX MEDIA INC. TRADEMARKS BELONG TO THEIR RESPECTIVE OWNERS. ALL RIGHTS RESERVED. | ||
© 2024 ZENIMAX MEDIA INC. TRADEMARKS BELONG TO THEIR RESPECTIVE OWNERS. ALL RIGHTS RESERVED. | ||
|
||
This is the source code for "The Elder Scrolls Online" user interface and it's presented here unchanged for reference only. | ||
|
||
If you're a Zenimax Media Inc. representative and have any objection to any of the contents in this repository please let me know. | ||
|
||
This repo is also available at http://www.esoui.com/downloads/info1213-ESOUI-TheElderScrollsOnlinesourcecode.html | ||
|
||
**Last update: 9.3.7 (API 101041) on 08 Apr 2024.** | ||
**Last update: 10.0.0 (API 101042) on 16 Apr 2024.** | ||
|
||
*Join ESOUI Dev Community on Gitter :* | ||
|
||
[![Join the chat at https://gitter.im/esoui/esoui](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ESOUI/ESOUI?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
*Join the ESOUI Dev Community on Matrix:* | ||
|
||
[![Matrix](https://img.shields.io/matrix/esoui_esoui%3Agitter.im?server_fqdn=matrix.org)](https://matrix.to/#/#esoui_esoui:gitter.im) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
ZO_TextSearchObject = ZO_InitializingObject:Subclass() | ||
|
||
function ZO_TextSearchObject:Initialize(searchContext, searchEditBox) | ||
self.searchContext = searchContext | ||
self.searchEditBox = searchEditBox | ||
|
||
self:SetupContextTextSearch() | ||
self:SetupOnTextChangedHandler() | ||
end | ||
|
||
function ZO_TextSearchObject:SetupContextTextSearch() | ||
-- Can be overridden | ||
-- Context can be setup elsewhere in the code to be used here. | ||
-- The TEXT_SEARCH_MANAGER function will override the filter target descriptors for a context that already exists. | ||
--[[ | ||
Expected format for filterTargetDescriptors: | ||
filterTargetDescriptors = | ||
{ | ||
[<FilterTarget>] = | ||
{ | ||
searchFilterList = | ||
{ | ||
BACKGROUND_LIST_FILTER_TYPE_<FilterType>, | ||
... | ||
}, | ||
primaryKeys = | ||
{ | ||
<List of keys> (ie. BAG_BACKPACK, BAG_BANK for FILTER_TARGET_BAG_SLOT or filterFunction() for filter like slottable in FILTER_TARGET_COLLECTIBLE) | ||
}, | ||
}, | ||
} | ||
TEXT_SEARCH_MANAGER:SetupContextTextSearch(self.searchContext, filterTargetDescriptor) | ||
]]-- | ||
end | ||
|
||
function ZO_TextSearchObject:SetupOnTextChangedHandler() | ||
local currentSearchEditBox = self:GetSearchEditBox() | ||
if currentSearchEditBox then | ||
local function OnTextSearchTextChanged(editBox) | ||
self:OnTextSearchTextChanged(editBox) | ||
end | ||
currentSearchEditBox:SetHandler("OnTextChanged", OnTextSearchTextChanged) | ||
end | ||
end | ||
|
||
function ZO_TextSearchObject:SetTextSearchContext(context) | ||
self.searchContext = context | ||
end | ||
|
||
function ZO_TextSearchObject:SetSearchEditBox(searchEditBox) | ||
self.searchEditBox = searchEditBox | ||
self:SetupOnTextChangedHandler() | ||
end | ||
|
||
function ZO_TextSearchObject:GetSearchEditBox() | ||
return self.searchEditBox | ||
end | ||
|
||
function ZO_TextSearchObject:SetSearchCriteria(filterType, context, editBox) | ||
local previousContextActive = TEXT_SEARCH_MANAGER:IsActiveTextSearch(self.searchContext) | ||
if previousContextActive then | ||
self:DeactivateTextSearch() | ||
end | ||
self.searchFilterType = filterType | ||
self.searchContext = context | ||
if editBox then | ||
self:SetSearchEditBox(editBox) | ||
end | ||
if previousContextActive then | ||
self:ActivateTextSearch() | ||
end | ||
end | ||
|
||
function ZO_TextSearchObject:OnTextSearchTextChanged(editBox) | ||
if self.searchContext then | ||
TEXT_SEARCH_MANAGER:SetSearchText(self.searchContext, editBox:GetText()) | ||
end | ||
end | ||
|
||
function ZO_TextSearchObject:OnUpdateSearchResults() | ||
-- To be overridden | ||
end | ||
|
||
function ZO_TextSearchObject:SetSearchText() | ||
if self.searchContext then | ||
TEXT_SEARCH_MANAGER:SetSearchText(self.searchContext, self:GetTextSearchText()) | ||
end | ||
end | ||
|
||
function ZO_TextSearchObject:GetTextSearchText() | ||
local searchEditBox = self:GetSearchEditBox() | ||
if searchEditBox then | ||
return searchEditBox:GetText() | ||
end | ||
return "" | ||
end | ||
|
||
function ZO_TextSearchObject:UpdateSearchText() | ||
if self.searchEditBox and self.searchContext then | ||
self.searchEditBox:SetText(TEXT_SEARCH_MANAGER:GetSearchText(self.searchContext)) | ||
end | ||
end | ||
|
||
function ZO_TextSearchObject:ActivateTextSearch() | ||
if self.searchContext and not TEXT_SEARCH_MANAGER:IsActiveTextSearch(self.searchContext) then | ||
self:UpdateSearchText() | ||
|
||
local function OnTextSearchResults() | ||
self.dirty = true | ||
self:OnUpdateSearchResults() | ||
end | ||
self.onTextSearchResults = OnTextSearchResults | ||
|
||
TEXT_SEARCH_MANAGER:ActivateTextSearch(self.searchContext) | ||
TEXT_SEARCH_MANAGER:RegisterCallback("UpdateSearchResults", OnTextSearchResults) | ||
end | ||
end | ||
|
||
function ZO_TextSearchObject:DeactivateTextSearch() | ||
if self.searchContext then | ||
TEXT_SEARCH_MANAGER:DeactivateTextSearch(self.searchContext) | ||
TEXT_SEARCH_MANAGER:UnregisterCallback("UpdateSearchResults", self.onTextSearchResults) | ||
end | ||
end | ||
|
||
function ZO_TextSearchObject:HasSearchFilter() | ||
return TEXT_SEARCH_MANAGER:HasSearchFilter(self.searchContext) | ||
end | ||
|
||
function ZO_TextSearchObject:SetSearchFilterType(searchFilterType) | ||
self.searchFilterType = searchFilterType | ||
end | ||
|
||
function ZO_TextSearchObject:IsDataInSearchTextResults(dataId) | ||
if self.searchContext and self.searchFilterType then | ||
return TEXT_SEARCH_MANAGER:IsDataInSearchTextResults(self.searchContext, self.searchFilterType, dataId) | ||
end | ||
-- Return true for every result if we don't have a context search | ||
return true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.