Sukritact's Enhanced Modding Screen

Hello, I'm new on the forum but interested in many things and started to work with collecting mods in one big project for my own to play. What i'm trying to said is that i haved a terrible feelings to turn on all mods - one by one. I worked with that enhanced modding screen and added enable all button working perfectly for me and some more filters ( my own propositions because i changed name of all my collected mods from you people.

https://forums.civfanatics.com/reso...able-all-version.26441/download?version=25004

Oh man you are awesome! I really loved this mod but I always thought it needed an "enable all" button as it does get tedious to enable dozens of mods by hand. I tried to do it myself in the past but couldn't figure out the coding. Appreciate you posting it to the forums and glad to have you on :D
 
Hello, I'm new on the forum but interested in many things and started to work with collecting mods in one big project for my own to play. What i'm trying to said is that i haved a terrible feelings to turn on all mods - one by one. I worked with that enhanced modding screen and added enable all button working perfectly for me and some more filters ( my own propositions because i changed name of all my collected mods from you people.

https://forums.civfanatics.com/reso...able-all-version.26441/download?version=25004
Thanks mate! :goodjob:
 
This Psuedo DLC replaces the vanilla modding screen with an interface somewhat better suited for frequent mod users.

Spoiler :

CIo9ou2.png
vLHI5Po.png


It has features such as a search bar, custom mod filters, a disable all button, and the ability to enable a mod's dependencies directly from the details panel.

THIS IS AN ALPHA and is not being actively developed. You may post bug reports if you so wish, but I will not be actively trying to fix them. A couple of things users of this will have to be aware of this that the screen does NOT automatically refresh when mods have been added or deleted, and the inability to delete mods from this screen. There may be other quirks I have forgotten to mention. But for the enabling and disabling of mods alone, I believe this to be a superior experience.

Custom filters may be made using Lua in the "ModBrowser_SortFilters.lua". You can add Mod IDs, or specify search terms as needed.

Hello, I could add an author filter functionality mut I'm not exactly sure how to do that. Do you think you will be able to help me with it? I'm not super familiar with LUA but I'm not sure if simply adding another clause to the or statement:

Code:
if (g_SortOptions[g_CurrentSortOption].FilterTerms) or (g_SortOptions[g_CurrentSortOption].ModIDs) then

would it be .Authors?
 
Hello, I could add an author filter functionality...

The statement you reference is looking in the table created by ModBrowser_SortFilters.lua. You could certainly add .Authors as a new subtable, but then you'd still need to wire it up in the "Filter" section of ModBrowser.lua, something like [not tested]:
Spoiler :
Code:
        ------------------------------------------------------------------------------------------------
        -- Filter
        ------------------------------------------------------------------------------------------------
        local tFilteredMods = {}
        if g_SortOptions[g_CurrentSortOption].bAll then
            tFilteredMods = tMods
        else
            if (g_SortOptions[g_CurrentSortOption].FilterTerms) or (g_SortOptions[g_CurrentSortOption].Authors) or (g_SortOptions[g_CurrentSortOption].ModIDs) then
                for iKey, tMod in pairs(tMods) do
                    local sName = Locale.ToLower(tMod.Name)
                    local sAuthors = Locale.ToLower(tMod.Authors)
                    local iModID = tMod.ModId
                    local bInclude = false
                    -- Filter IDs
                    if g_SortOptions[g_CurrentSortOption].ModIDs then
                        for _, iCheckID in ipairs(g_SortOptions[g_CurrentSortOption].ModIDs) do
                            if iModID == iCheckID then
                                bInclude = true
                                table.insert(tFilteredMods, tMod)
                                tMods[iKey] = nil
                                break
                            end
                        end
                    end
                    -- Filter Authors
                    if not(bInclude) and (g_SortOptions[g_CurrentSortOption].Authors) then
                        for _, sAuth in ipairs(g_SortOptions[g_CurrentSortOption].Authors) do

                            sAuth = Locale.ToLower(sAuth)

                            if string.find(sAuthors, sAuth) then
                                bInclude = true
                                table.insert(tFilteredMods, tMod)
                                tMods[iKey] = nil
                                break
                            end
                        end                 
                    end
                    -- Filter Terms
                    if not(bInclude) and (g_SortOptions[g_CurrentSortOption].FilterTerms) then
                        for _, sFilter in ipairs(g_SortOptions[g_CurrentSortOption].FilterTerms) do

                            sFilter = Locale.ToLower(sFilter)

                            if string.find(sName, sFilter) then
                                bInclude = true
                                table.insert(tFilteredMods, tMod)
                                tMods[iKey] = nil
                                break
                            end
                        end
                    end
                    ----
                end
            end
        end

Alternatively (and I think I prefer this method), you could extend filter terms to search both the mod's name AND the authors field, something like [also not tested]:
Spoiler :
Code:
        ------------------------------------------------------------------------------------------------
        -- Filter
        ------------------------------------------------------------------------------------------------
        local tFilteredMods = {}
        if g_SortOptions[g_CurrentSortOption].bAll then
            tFilteredMods = tMods
        else
            if (g_SortOptions[g_CurrentSortOption].FilterTerms) or (g_SortOptions[g_CurrentSortOption].ModIDs) then
                for iKey, tMod in pairs(tMods) do
                    local sName = Locale.ToLower(tMod.Name)
                    local sAuthors = Locale.ToLower(tMod.Authors)
                    local iModID = tMod.ModId
                    local bInclude = false
                    -- Filter IDs
                    if g_SortOptions[g_CurrentSortOption].ModIDs then
                        for _, iCheckID in ipairs(g_SortOptions[g_CurrentSortOption].ModIDs) do
                            if iModID == iCheckID then
                                bInclude = true
                                table.insert(tFilteredMods, tMod)
                                tMods[iKey] = nil
                                break
                            end
                        end
                    end
                    -- Filter Terms
                    if not(bInclude) and (g_SortOptions[g_CurrentSortOption].FilterTerms) then
                        for _, sFilter in ipairs(g_SortOptions[g_CurrentSortOption].FilterTerms) do

                            sFilter = Locale.ToLower(sFilter)

                            if string.find(sName, sFilter) then
                                bInclude = true
                                table.insert(tFilteredMods, tMod)
                                tMods[iKey] = nil
                                break
                            end
                            if string.find(sAuthors, sFilter) then
                                bInclude = true
                                table.insert(tFilteredMods, tMod)
                                tMods[iKey] = nil
                                break
                            end
                        end
                    end
                    ----
                end
            end
        end
 
The statement you reference is looking in the table created by ModBrowser_SortFilters.lua. You could certainly add .Authors as a new subtable, but then you'd still need to wire it up in the "Filter" section of ModBrowser.lua, something like [not tested]:
Spoiler :
Code:
        ------------------------------------------------------------------------------------------------
        -- Filter
        ------------------------------------------------------------------------------------------------
        local tFilteredMods = {}
        if g_SortOptions[g_CurrentSortOption].bAll then
            tFilteredMods = tMods
        else
            if (g_SortOptions[g_CurrentSortOption].FilterTerms) or (g_SortOptions[g_CurrentSortOption].Authors) or (g_SortOptions[g_CurrentSortOption].ModIDs) then
                for iKey, tMod in pairs(tMods) do
                    local sName = Locale.ToLower(tMod.Name)
                    local sAuthors = Locale.ToLower(tMod.Authors)
                    local iModID = tMod.ModId
                    local bInclude = false
                    -- Filter IDs
                    if g_SortOptions[g_CurrentSortOption].ModIDs then
                        for _, iCheckID in ipairs(g_SortOptions[g_CurrentSortOption].ModIDs) do
                            if iModID == iCheckID then
                                bInclude = true
                                table.insert(tFilteredMods, tMod)
                                tMods[iKey] = nil
                                break
                            end
                        end
                    end
                    -- Filter Authors
                    if not(bInclude) and (g_SortOptions[g_CurrentSortOption].Authors) then
                        for _, sAuth in ipairs(g_SortOptions[g_CurrentSortOption].Authors) do

                            sAuth = Locale.ToLower(sAuth)

                            if string.find(sAuthors, sAuth) then
                                bInclude = true
                                table.insert(tFilteredMods, tMod)
                                tMods[iKey] = nil
                                break
                            end
                        end                
                    end
                    -- Filter Terms
                    if not(bInclude) and (g_SortOptions[g_CurrentSortOption].FilterTerms) then
                        for _, sFilter in ipairs(g_SortOptions[g_CurrentSortOption].FilterTerms) do

                            sFilter = Locale.ToLower(sFilter)

                            if string.find(sName, sFilter) then
                                bInclude = true
                                table.insert(tFilteredMods, tMod)
                                tMods[iKey] = nil
                                break
                            end
                        end
                    end
                    ----
                end
            end
        end

Alternatively (and I think I prefer this method), you could extend filter terms to search both the mod's name AND the authors field, something like [also not tested]:
Spoiler :
Code:
        ------------------------------------------------------------------------------------------------
        -- Filter
        ------------------------------------------------------------------------------------------------
        local tFilteredMods = {}
        if g_SortOptions[g_CurrentSortOption].bAll then
            tFilteredMods = tMods
        else
            if (g_SortOptions[g_CurrentSortOption].FilterTerms) or (g_SortOptions[g_CurrentSortOption].ModIDs) then
                for iKey, tMod in pairs(tMods) do
                    local sName = Locale.ToLower(tMod.Name)
                    local sAuthors = Locale.ToLower(tMod.Authors)
                    local iModID = tMod.ModId
                    local bInclude = false
                    -- Filter IDs
                    if g_SortOptions[g_CurrentSortOption].ModIDs then
                        for _, iCheckID in ipairs(g_SortOptions[g_CurrentSortOption].ModIDs) do
                            if iModID == iCheckID then
                                bInclude = true
                                table.insert(tFilteredMods, tMod)
                                tMods[iKey] = nil
                                break
                            end
                        end
                    end
                    -- Filter Terms
                    if not(bInclude) and (g_SortOptions[g_CurrentSortOption].FilterTerms) then
                        for _, sFilter in ipairs(g_SortOptions[g_CurrentSortOption].FilterTerms) do

                            sFilter = Locale.ToLower(sFilter)

                            if string.find(sName, sFilter) then
                                bInclude = true
                                table.insert(tFilteredMods, tMod)
                                tMods[iKey] = nil
                                break
                            end
                            if string.find(sAuthors, sFilter) then
                                bInclude = true
                                table.insert(tFilteredMods, tMod)
                                tMods[iKey] = nil
                                break
                            end
                        end
                    end
                    ----
                end
            end
        end

Yes I will definitely try the second method first because that's what I thought the filter terms originally did, I'll let you know how it works.
 
Hello, I'm new on the forum but interested in many things and started to work with collecting mods in one big project for my own to play. What i'm trying to said is that i haved a terrible feelings to turn on all mods - one by one. I worked with that enhanced modding screen and added enable all button working perfectly for me and some more filters ( my own propositions because i changed name of all my collected mods from you people.

https://forums.civfanatics.com/reso...able-all-version.26441/download?version=25004
A must have for anyone that uses mods regularly, nice!
 
After I tried it, it's impossible to play without it.
 
Back
Top Bottom