Skip to content

Commit

Permalink
mainwindow: Make it so that we can move the LODs at the end of the li…
Browse files Browse the repository at this point in the history
…st by holding Shift while clicking on Tools > Sort entries. Suggested by @cokjan.

--

cokjan
 —
05/10/2024 10:53 AM
hello swy, sorry to bother but is it possible for openbrf redux to have an option where making LODs automatically put the LODs on the very bottom?

Swyter
 —
05/10/2024 10:57 AM
What's the use case for this?
cokjan
 —
05/10/2024 11:01 AM
its very niche ngl, i have hundred of atlassed submeshes and it could be annoying to tidy them up since lods could fill up the space between the meshes

Swyter
 —
05/15/2024 6:21 AM
Would something like holding Shift while using Tools > Sort entries to move all the LODs to the end of the file help?
cokjan
 —
05/15/2024 6:40 AM
wow i didn't know there's a sort button in tools
that would help so much!
so when holding shift + sort, all the lods go into the end
  • Loading branch information
Swyter committed May 18, 2024
1 parent d756d1b commit 62551ed
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,15 @@ static bool _copy(vector<T> &t, const QModelIndexList &l, vector<T> &d){

template< class T >
bool _compareName(const T &ta, const T &tb){
/* swy: make it so that we can move the LODs at the end of the list by holding Shift while clicking on Tools > Sort entries */
if (T::tokenIndex() == MESH && (QApplication::keyboardModifiers() & Qt::ShiftModifier)) {
bool ta_has_lod = strstr(ta.name, ".lod") != NULL;
bool tb_has_lod = strstr(tb.name, ".lod") != NULL;

if (!ta_has_lod && tb_has_lod) return true; /* swy: if A doesn't have LOD it will always go first */
if ( ta_has_lod && !tb_has_lod) return false; /* swy: if B has LOD it will always go last */
}

return strcmp(ta.name,tb.name)<0;
}

Expand Down

0 comments on commit 62551ed

Please sign in to comment.