Jump to content

Recommended Posts

Hey pals,

I just finished another mod: https://steamcommunity.com/sharedfiles/filedetails/?id=1757258298

It's a client mod for one simple automation which I thought was helpful. In the last couple days I forgot to choose a nice new skin I received for a firepit. So I looked up the code and saw, that the default skin is chosen even if there is a new skin. So why not choosing it automatically? So now - using this mod - you don't have to click the right arrow in the item skins spinner.

The logic is: 

CallTheOldRefreshMethod()

local preferred = 2
if there are item options then

    while iterating over options i do
        if option has a new_indicator then
            preferred = i
            break
        end
        i = i + 1
    end
    
    local skin_index = spinner:GetSelectedIndex()
    if skin_index is default then
        self.skins_spinner.spinner:SetSelectedIndex(preferred)
    end
end

I achieved that using the AddClassPostConstruct method.

Do you think this is helpful? I find the default items skins too boring compared to every item skin!

icon.png

Edited by s1m13
typo
Link to comment
https://forums.kleientertainment.com/forums/topic/106953-mod-prefer-new-skins/
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...