Jump to content

Recommended Posts

Hello,

I have created my own game settings. But when I click on button for example: "OFF" and close the game, button returns into "ON" position.
But when I change character / log out, it does not return. I refresh buttons in init and after calling, functions of buttons are working.. Only does not save.

 

It is named SkillButton and StatusButton

My files:
constinfo.py:

Spoiler

[...]

DISABLE_STATUS_BUTTON = 0
DISABLE_SKILL_BUTTON = 0

[..]

########################

def GET_STATUS_BUTTON():
    global DISABLE_STATUS_BUTTON
    return DISABLE_STATUS_BUTTON

def SET_STATUS_BUTTON(i):
    global DISABLE_STATUS_BUTTON
    DISABLE_STATUS_BUTTON = i
    
########################

def GET_SKILL_BUTTON():
    global DISABLE_SKILL_BUTTON
    return DISABLE_SKILL_BUTTON

def SET_SKILL_BUTTON(i):
    global DISABLE_SKILL_BUTTON
    DISABLE_SKILL_BUTTON = i
    
########################    

uigameoption.py:

Spoiler

[...]

        def __SetStatusButton(self, index):
            constInfo.SET_STATUS_BUTTON(index)
            self.__ClickRadioButton(self.statusButtonList, index)

        def __OnClickStatusButtonOn(self):
            self.__SetStatusButton(0)
            self.RefreshStatusButton()

        def __OnClickStatusButtonOff(self):
            self.__SetStatusButton(1)
            self.RefreshStatusButton()
            
        def __SetSkillButton(self, index):
            constInfo.SET_SKILL_BUTTON(index)
            self.__ClickRadioButton(self.skillButtonList, index)

        def __OnClickSkillButtonOn(self):
            self.__SetSkillButton(0)
            self.RefreshSkillButton()

        def __OnClickSkillButtonOff(self):
            self.__SetSkillButton(1)
            self.RefreshSkillButton()

[...]

    def RefreshStatusButton(self):
        if constInfo.GET_STATUS_BUTTON() == 0:
            self.statusButtonList[0].Down()
            self.statusButtonList[1].SetUp()
        else:
            self.statusButtonList[0].SetUp()
            self.statusButtonList[1].Down()
            
    def RefreshSkillButton(self):
        if constInfo.GET_SKILL_BUTTON() == 0:
            self.skillButtonList[0].Down()
            self.skillButtonList[1].SetUp()
        else:
            self.skillButtonList[0].SetUp()
            self.skillButtonList[1].Down()

Thats all important.. Of course there are more lines, but functions of that buttons are ok and working properly. There is only problem with "saving" or "loading" after client exit.

Could you help me, please?

If I helped you, do not forget to press "Thanks" button! 

Link to comment
https://metin2.dev/topic/18170-game-option-does-not-save/
Share on other sites

  • Active Member

I don't think you will reach succes with this kind of method. Client doesn't remember the settings after next use, unless it reads them from somewhere and then sets them.

You have to connect the settings with another client file, for example metin2.cfg and make the system read them from there, then you will always have them saved. Try to use source, there is a tutorial for fog setting ~ on/off type and adapt it to your needs.

Good luck! ;)

  • Love 1
Link to comment
https://metin2.dev/topic/18170-game-option-does-not-save/#findComment-99251
Share on other sites

3 minutes ago, Sonitex said:

I don't think you will reach succes with this kind of method. Client doesn't remember the settings after next use, unless it reads them from somewhere and then sets them.

You have to connect the settings with another client file, for example metin2.cfg and make the system read them from there, then you will always have them saved. Try to use source, there is a tutorial for fog setting ~ on/off type and adapt it to your needs.

Good luck! ;)

Ok, thank you very much! I will try it using a new file..
Best regards

If I helped you, do not forget to press "Thanks" button! 

Link to comment
https://metin2.dev/topic/18170-game-option-does-not-save/#findComment-99252
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.