Edward™ Publicado 1 de Agosto del 2016 Reportar Compartir Publicado 1 de Agosto del 2016 Os voy a enseñar a poner un botón de salida rápida en la pestaña de "Cambiar personaje, salir, fin del juego...". 1-> Vamos a buscar: locale/ui/systemdialog.py 2-> Si no tenéis ningún botón nuevo en esa ventana os dejo mi script si lo tenéis os dejo el código.Script completo: import uiScriptLocale ROOT = "d:/ymir work/ui/public/" window = { "name" : "SystemDialog", "style" : ("float",), "x" : (SCREEN_WIDTH - 200) /2, "y" : (SCREEN_HEIGHT - 288) /2, "width" : 200, "height" : 288, "children" : ( { "name" : "board", "type" : "thinboard", "x" : 0, "y" : 0, "width" : 200, "height" : 258, "children" : ( { "name" : "help_button", "type" : "button", "x" : 10, "y" : 17, "text" : uiScriptLocale.SYSTEM_HELP, "default_image" : ROOT + "XLarge_Button_01.sub", "over_image" : ROOT + "XLarge_Button_02.sub", "down_image" : ROOT + "XLarge_Button_03.sub", }, { "name" : "system_option_button", "type" : "button", "x" : 10, "y" : 57, "text" : uiScriptLocale.SYSTEMOPTION_TITLE, "default_image" : ROOT + "XLarge_Button_01.sub", "over_image" : ROOT + "XLarge_Button_02.sub", "down_image" : ROOT + "XLarge_Button_03.sub", }, { "name" : "game_option_button", "type" : "button", "x" : 10, "y" : 87, "text" : uiScriptLocale.GAMEOPTION_TITLE, "default_image" : ROOT + "XLarge_Button_01.sub", "over_image" : ROOT + "XLarge_Button_02.sub", "down_image" : ROOT + "XLarge_Button_03.sub", }, { "name" : "change_button", "type" : "button", "x" : 10, "y" : 117, "text" : uiScriptLocale.SYSTEM_CHANGE, "default_image" : ROOT + "XLarge_Button_01.sub", "over_image" : ROOT + "XLarge_Button_02.sub", "down_image" : ROOT + "XLarge_Button_03.sub", }, { "name" : "logout_button", "type" : "button", "x" : 10, "y" : 147, "text" : uiScriptLocale.SYSTEM_LOGOUT, "default_image" : ROOT + "XLarge_Button_01.sub", "over_image" : ROOT + "XLarge_Button_02.sub", "down_image" : ROOT + "XLarge_Button_03.sub", }, { "name": "salida_rapida_button", "type": "button", "x": 10, "y": 174, "text": "Salida Rapida", "text_color": 0xffF8BF24, "default_image": ROOT + "XLarge_Button_01.sub", "over_image": ROOT + "XLarge_Button_02.sub", "down_image": ROOT + "XLarge_Button_03.sub" }, { "name" : "exit_button", "type" : "button", "x" : 10, "y" : 202, "text" : uiScriptLocale.SYSTEM_EXIT, "default_image" : ROOT + "XLarge_Button_01.sub", "over_image" : ROOT + "XLarge_Button_02.sub", "down_image" : ROOT + "XLarge_Button_03.sub", }, { "name" : "cancel_button", "type" : "button", "x" : 10, "y" : 230, "text" : uiScriptLocale.CANCEL, "default_image" : ROOT + "XLarge_Button_01.sub", "over_image" : ROOT + "XLarge_Button_02.sub", "down_image" : ROOT + "XLarge_Button_03.sub", }, ), }, ), } Script solo del botón: { "name": "salida_rapida_button", "type": "button", "x": 10, "y": 174, "text": "Salida Rapida", "text_color": 0xffF8BF24, "default_image": ROOT + "XLarge_Button_01.sub", "over_image": ROOT + "XLarge_Button_02.sub", "down_image": ROOT + "XLarge_Button_03.sub" }, 3-> Ya podéis cerrar el "systemdialog.py" y vamos al archivo "uisystem.py" del root. Dentro buscamos: self.GetChild("cancel_button").SAFE_SetEvent(self.Close) y agregamos: self.GetChild("salida_rapida_button").SAFE_SetEvent(self.SalidaRapida) Quedaría así: 4-> Ahora en el mismo archivo buscamos: def SetOpenHelpWindowEvent(self, event): Y encima de esa linea escribimos: def SalidaRapida(self): app.Exit() Quedaría así: Y ya estaría listo. matietk2015, oscar caballero y wille damare reacciono a esto 2 1 Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
MiGueLiT0 Publicado 1 de Agosto del 2016 Reportar Compartir Publicado 1 de Agosto del 2016 Se agredece Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
Mensajes recomendados
Unirse a la conversación
Puedes publicar ahora y registrarte más tarde. Si tienes una cuenta, regístrate para publicar con su cuenta.