Aller au contenu
Top-Metin2.org - Vous êtes à la recherche d'un serveur Metin 2 ? ×
×
×
  • Créer...

Python - Changeur d'Environnement


Messages recommandés

Centre de Téléchargement

Hidden Content

    Give reaction to this post to see the hidden content.
( Interne )

Bonjour,

Voici un petit changeur d'environnement, vous pouvez le modifier à votre guise. :)

 

Résultat :

https://metin2.download/picture/k4HDa5369caLIS4r2T70QArKt4eyd861/.jpg

 

1) Ouvrir uigameoption.py (-> dépack root)

Révélation

Cherchez :

import interfaceModule

À la suite :

import background

Cherchez :

self.RefreshShowSalesText()

À la suite :

self.RefreshShowNightText()

Cherchez :

self.showsalesTextButtonList = []

À la suite :

self.showNightButtonList = []

Cherchez :

self.showsalesTextButtonList.append(GetObject("salestext_on_button"))

self.showsalesTextButtonList.append(GetObject("salestext_off_button"))

À la suite :

self.showNightButtonList.append(GetObject("showNight_on_button"))

self.showNightButtonList.append(GetObject("showNight_off_button"))

Cherchez :

self.showsalesTextButtonList[0].SAFE_SetEvent(self.__OnClickSalesTextOnButton)

self.showsalesTextButtonList[1].SAFE_SetEvent(self.__OnClickSalesTextOffButton)

À la suite :

self.showNightButtonList[0].SAFE_SetEvent(self.__OnClickShowNightOnButton)

self.showNightButtonList[1].SAFE_SetEvent(self.__OnClickShowNightOffButton)

Cherchez :

    def __OnClickSalesTextOnButton(self):
        systemSetting.SetShowSalesTextFlag(TRUE)
        self.RefreshShowSalesText()
        uiPrivateShopBuilder.UpdateADBoard()

    def __OnClickSalesTextOffButton(self):
        systemSetting.SetShowSalesTextFlag(FALSE)
        self.RefreshShowSalesText()

À la suite :

    def __OnClickShowNightOnButton(self):
        background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
        background.SetEnvironmentData(1)
        constInfo.Night = 1
        self.RefreshShowNightText()

    def __OnClickShowNightOffButton(self):
        background.SetEnvironmentData(0)
        constInfo.Night = 0
        self.RefreshShowNightText()

Cherchez :

    def RefreshShowSalesText(self):
        if systemSetting.IsShowSalesText():
            self.showsalesTextButtonList[0].Down()
            self.showsalesTextButtonList[1].SetUp()
        else:
            self.showsalesTextButtonList[0].SetUp()
            self.showsalesTextButtonList[1].Down()

À la suite :

    def RefreshShowNightText(self):
        if constInfo.Night == 1:
            self.showNightButtonList[0].Down()
            self.showNightButtonList[1].SetUp()
        else:
            self.showNightButtonList[0].SetUp()
            self.showNightButtonList[1].Down()

 

 
 
2) Ouvrir constInfo.py (-> dépack root)
 
Révélation

Cherchez :

ENVIRONMENT_NIGHT="d:/ymir work/environment/moonlight04.msenv"

À la suite :

Night = 0

 

 

3) Ouvrir gameoptiondialog.py (-> dépack uiscript)

Révélation

Remplacez le début par ça

TEMPORARY_X = +14
BUTTON_TEMPORARY_X = 5
PVP_X = -10

LINE_LABEL_X     = 30
LINE_DATA_X     = 90
LINE_STEP    = 0
SMALL_BUTTON_WIDTH     = 45
MIDDLE_BUTTON_WIDTH     = 65

Cherchez :

26*11+8, ou 25*11+8,

Remplacez par :

28*11+8,

Puis ajoutez ça

                {
                    "name" : "showNight_on_off",
                    "type" : "text",

                    "x" : LINE_LABEL_X,
                    "y" : 265+2,

                    "text" : "Environment",
                },
                {
                    "name" : "showNight_on_button",
                    "type" : "radio_button",

                    "x" : LINE_DATA_X,
                    "y"    : 265,

                    "text" : "Night",

                    "default_image" : ROOT_PATH + "middle_button_01.sub",
                    "over_image" : ROOT_PATH + "middle_button_02.sub",
                    "down_image" : ROOT_PATH + "middle_button_03.sub",
                },
                {
                    "name" : "showNight_off_button",
                    "type" : "radio_button",

                    "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH,
                    "y" : 265,

                    "text" : "Day",

                    "default_image" : ROOT_PATH + "middle_button_01.sub",
                    "over_image" : ROOT_PATH + "middle_button_02.sub",
                    "down_image" : ROOT_PATH + "middle_button_03.sub",
                },

 

 

PS : ATTENTION AU TAB !

*** Ce tutoriel a été réédité pour la V6.***

  • Love 2
Lien vers le commentaire
Partager sur d’autres sites

  • 2 mois après...


  • brilliantdiscord_widget
  • Flux d'Activité

    1. 37
    2. 21

      Metin2 en 2020 peut-on en parler?

    3. 0

      METIN2Project

    4. 3

      Ressources - UnPack - Metin2 Client - Officiel

    5. 0

      Barre des tâches d'argent étendue

    6. 16

      Redémarrage automatique des channels

    7. 16

      Multi Logo GM / SGM / GA

  • En ligne récemment

    • Aucun utilisateur enregistré regarde cette page.

Information importante

Conditions d’utilisation / Politique de confidentialité / Règles / Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.