Jump to content
×
×
  • Create New...

Python - Sélection de l'Empire


Recommended Posts

Centre de Téléchargement

Télécharger ( Interne )

Bien le bonjour, comme son nom l'indique, je viens vous proposer ce tutoriel détaillé pour modifier votre Selection Empire, sur un serveur files 2014.

 

Tout d'abord il faut télécharger cette archive: ICI

 

-Commençons avec le plus simple, il suffit de suivre l'emplacement des dossier.

-Pour la modification du selectempirewindow.py, si vous avez un fichier modifier, plutôt que de remplacer le fichier ou que vous n'avez pas envie de chercher, il suffit de modifier comme ceci :

 

Remplacez :

## Alpha
{
"name" : "Alpha",
"type" : "expanded_image",

"x" : 0,
"y" : 0,

"image" : "d:/ymir work/ui/intro/select/background_alpha.sub",

"x_scale" : float(SCREEN_WIDTH) / 100.0,
"y_scale" : float(SCREEN_HEIGHT) / 69.0,
},
Par ceci :
## Alpha
{
"name" : "Alpha",
"type" : "expanded_image",

"x" : 0,
"y" : 0,

"image" : "d:/ymir work/ui/intro/select/background_alpha.sub",

"x_scale" : float(SCREEN_WIDTH) / 100.0,
"y_scale" : float(SCREEN_HEIGHT) / 69.0,
},

{
"name" : "bg_A", "type" : "expanded_image", "x" : 0, "y" : 0,
"x_scale" : float(SCREEN_WIDTH) / 1024.0, "y_scale" : float(SCREEN_HEIGHT) / 768.0,
"image" : "d:/ymir work/ui/intro/select/empire_A.jpg",
},
{
"name" : "bg_B", "type" : "expanded_image", "x" : 0, "y" : 0,
"x_scale" : float(SCREEN_WIDTH) / 1024.0, "y_scale" : float(SCREEN_HEIGHT) / 768.0,
"image" : "d:/ymir work/ui/intro/select/empire_B.jpg",
},
{
"name" : "bg_C", "type" : "expanded_image", "x" : 0, "y" : 0,
"x_scale" : float(SCREEN_WIDTH) / 1024.0, "y_scale" : float(SCREEN_HEIGHT) / 768.0,
"image" : "d:/ymir work/ui/intro/select/empire_C.jpg",
},
Voila pour le selectempirewindow.py.

 

-Concernant le root, modifiez introempire.py et, pareil, remplacer ceci :

def __init__(self, stream):
print "NEW EMPIRE WINDOW  ----------------------------------------------------------------------------"
ui.ScriptWindow.__init__(self)
net.SetPhaseWindow(net.PHASE_WINDOW_EMPIRE, self)

self.stream=stream
self.empireID=app.GetRandom(1, 3)
self.descIndex=0
self.empireArea = {}
self.empireAreaFlag = {}
self.empireFlag = {}
self.empireAreaButton = {}
self.empireAreaCurAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
self.empireAreaDestAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
self.empireAreaFlagCurAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
self.empireAreaFlagDestAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
self.empireFlagCurAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
self.empireFlagDestAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
Par ceci :
def __init__(self, stream):
print "NEW EMPIRE WINDOW  ----------------------------------------------------------------------------"
ui.ScriptWindow.__init__(self)
net.SetPhaseWindow(net.PHASE_WINDOW_EMPIRE, self)

self.stream=stream
self.empireID=app.GetRandom(1, 3)
self.descIndex=0
self.bg = {}
self.empireArea = {}
self.empireAreaFlag = {}
self.empireFlag = {}
self.empireAreaButton = {}
self.empireBGCurAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
self.empireBGDestAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
self.empireAreaCurAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
self.empireAreaDestAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
self.empireAreaFlagCurAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
self.empireAreaFlagDestAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
self.empireFlagCurAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
self.empireFlagDestAlpha = { net.EMPIRE_A:0.0, net.EMPIRE_B:0.0, net.EMPIRE_C:0.0 }
-Ensuite cherchez
def OnSelectEmpire(self, arg):
for key in self.empireArea.keys():
self.empireAreaDestAlpha[key] = 0.0
self.empireAreaFlagDestAlpha[key] = 0.0
self.empireFlagDestAlpha[key] = 0.0
self.empireAreaDestAlpha[arg] = 1.0
self.empireAreaFlagDestAlpha[arg] = 1.0
self.empireFlagDestAlpha[arg] = 1.0
self.empireID = arg
et remplacez par :
def OnSelectEmpire(self, arg):
for key in self.empireArea.keys():
self.empireBGDestAlpha[key] = 0.0
self.empireAreaDestAlpha[key] = 0.0
self.empireAreaFlagDestAlpha[key] = 0.0
self.empireFlagDestAlpha[key] = 0.0
self.empireBGDestAlpha[arg] = 1.0
self.empireAreaDestAlpha[arg] = 1.0
self.empireAreaFlagDestAlpha[arg] = 1.0
self.empireFlagDestAlpha[arg] = 1.0
self.empireID = arg
Continuons, cherchez :
try:
GetObject=self.GetChild
self.leftButton = GetObject("left_button")
self.rightButton = GetObject("right_button")
self.selectButton = GetObject("select_button")
self.exitButton = GetObject("exit_button")
self.textBoard = GetObject("text_board")
self.empireArea[net.EMPIRE_A] = GetObject("EmpireArea_A")
self.empireArea[net.EMPIRE_B] = GetObject("EmpireArea_B")
self.empireArea[net.EMPIRE_C] = GetObject("EmpireArea_C")
self.empireAreaFlag[net.EMPIRE_A] = GetObject("EmpireAreaFlag_A")
self.empireAreaFlag[net.EMPIRE_B] = GetObject("EmpireAreaFlag_B")
self.empireAreaFlag[net.EMPIRE_C] = GetObject("EmpireAreaFlag_C")
self.empireFlag[net.EMPIRE_A] = GetObject("EmpireFlag_A")
self.empireFlag[net.EMPIRE_B] = GetObject("EmpireFlag_B")
self.empireFlag[net.EMPIRE_C] = GetObject("EmpireFlag_C")
GetObject("prev_text_button").SetEvent(ui.__mem_func__(self.PrevDescriptionPage))
GetObject("next_text_button").SetEvent(ui.__mem_func__(self.NextDescriptionPage))
et remplacez par : 
try:
GetObject=self.GetChild
self.leftButton = GetObject("left_button")
self.rightButton = GetObject("right_button")
self.selectButton = GetObject("select_button")
self.exitButton = GetObject("exit_button")
self.textBoard = GetObject("text_board")
self.bg[net.EMPIRE_A] = GetObject("bg_A")
self.bg[net.EMPIRE_B] = GetObject("bg_B")
self.bg[net.EMPIRE_C] = GetObject("bg_C")
self.empireArea[net.EMPIRE_A] = GetObject("EmpireArea_A")
self.empireArea[net.EMPIRE_B] = GetObject("EmpireArea_B")
self.empireArea[net.EMPIRE_C] = GetObject("EmpireArea_C")
self.empireAreaFlag[net.EMPIRE_A] = GetObject("EmpireAreaFlag_A")
self.empireAreaFlag[net.EMPIRE_B] = GetObject("EmpireAreaFlag_B")
self.empireAreaFlag[net.EMPIRE_C] = GetObject("EmpireAreaFlag_C")
self.empireFlag[net.EMPIRE_A] = GetObject("EmpireFlag_A")
self.empireFlag[net.EMPIRE_B] = GetObject("EmpireFlag_B")
self.empireFlag[net.EMPIRE_C] = GetObject("EmpireFlag_C")
GetObject("prev_text_button").SetEvent(ui.__mem_func__(self.PrevDescriptionPage))
GetObject("next_text_button").SetEvent(ui.__mem_func__(self.NextDescriptionPage))
Pour finir il suffit de chercher : 
def OnUpdate(self):
(xposEventSet, yposEventSet) = self.textBoard.GetGlobalPosition()
event.UpdateEventSet(self.descIndex, xposEventSet+7, -(yposEventSet+7))
self.descriptionBox.SetIndex(self.descIndex)

self.__UpdateAlpha(self.empireArea, self.empireAreaCurAlpha, self.empireAreaDestAlpha)
self.__UpdateAlpha(self.empireAreaFlag, self.empireAreaFlagCurAlpha, self.empireAreaFlagDestAlpha)
self.__UpdateAlpha(self.empireFlag, self.empireFlagCurAlpha, self.empireFlagDestAlpha)
et de rajouter ceci juste en dessous :
self.__UpdateAlpha(self.bg, self.empireBGCurAlpha, self.empireBGDestAlpha)
Et voila, plus qu'a repacker etc, local_fr et root, petit reboot et vous aurez une jolie selection d'empire, aperçus de mon sp

 

Je sais que le tuto existe, enfin si on peut dire "tuto", mais c'est un peu mode "j'vous le donne et demerdez vous".

Au moins là, même les débutants peuvent se débrouiller ;)

 

Amusez vous bien !

  • J'adore 15
Link to comment
  • 1 year later...
  • 1 month later...
  • 1 month later...
  • 1 month later...

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


  • Flux d'Activité

    1. 38

      Rodnia.net | PVM | International | The Great Conqueror |

    2. 0

      [JAVA] Starloco

    3. 0

      Recherche CMS arkalys 2021

    4. 0

      AresiaCMS

    5. 62

      [CMS] Acamar Cms

    6. 3

      Éditeur Item 2.43 à 2.53

  • Recently Browsing

    • No registered users viewing this page.

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.