Skocz do zawartości
Opublikowano

Cześć, problem polega na tym że wgrałem system zmiany kanałów lecz sysser pokazuje mi to:

 

0909 13:27:12647 :: UISCRIPT_LOAD_ERROR: name 'constInfo' is not defined [filename locale/pl/ui/SystemDialog.py]
0909 13:27:12648 :: Traceback (most recent call last):

0909 13:27:12648 ::   File "networkModule.py", line 236, in SetGamePhase

0909 13:27:12648 ::   File "game.py", line 86, in __init__

0909 13:27:12648 ::   File "interfaceModule.py", line 308, in MakeInterface

0909 13:27:12648 ::   File "interfaceModule.py", line 230, in __MakeDialogs

0909 13:27:12648 ::   File "uiSystem.py", line 33, in LoadDialog

0909 13:27:12648 ::   File "uiSystem.py", line 52, in __LoadSystemMenu_Default

0909 13:27:12648 ::   File "ui.py", line 2768, in GetChild

0909 13:27:12648 :: KeyError
0909 13:27:12648 :: : 
0909 13:27:12648 :: 'CH1_Button'
0909 13:27:12648 :: 


SystemDialog.py ->
 

Spoiler

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" : 288,

            "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" : "mall_button",
                    "type" : "button",

                    "x" : 10,
                    "y" : 57,

                    "text" : uiScriptLocale.SYSTEM_MALL,
                    "text_color" : 0xffF8BF24,

                    "default_image" : ROOT + "XLarge_Button_02.sub",
                    "over_image" : ROOT + "XLarge_Button_02.sub",
                    "down_image" : ROOT + "XLarge_Button_02.sub",
                },

                {
                    "name" : "system_option_button",
                    "type" : "button",

                    "x" : 10,
                    "y" : 87,

                    "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" : 117,

                    "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" : 147,

                    "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" : 177,

                    "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" : "exit_button",
                    "type" : "button",

                    "x" : 10,
                    "y" : 217,

                    "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" : 247,

                    "text" : uiScriptLocale.CANCEL,

                    "default_image" : ROOT + "XLarge_Button_01.sub",
                    "over_image" : ROOT + "XLarge_Button_02.sub",
                    "down_image" : ROOT + "XLarge_Button_03.sub",
                },
            ),
        },
    ),
}

if constInfo.CHANNEL_CHANGER_MODE == 2 or constInfo.CHANNEL_CHANGER_MODE == 3:
    window["height"] = window["height"] + 30
    window["children"][0]["height"] = window["children"][0]["height"] + 30
    
    window["children"][0]["children"][0]["y"] = window["children"][0]["children"][0]["y"] + 30
    window["children"][0]["children"][1]["y"] = window["children"][0]["children"][1]["y"] + 30
    window["children"][0]["children"][2]["y"] = window["children"][0]["children"][2]["y"] + 30
    window["children"][0]["children"][3]["y"] = window["children"][0]["children"][3]["y"] + 30
    window["children"][0]["children"][4]["y"] = window["children"][0]["children"][4]["y"] + 30
    window["children"][0]["children"][5]["y"] = window["children"][0]["children"][5]["y"] + 30
    window["children"][0]["children"][6]["y"] = window["children"][0]["children"][6]["y"] + 30
    window["children"][0]["children"][7]["y"] = window["children"][0]["children"][7]["y"] + 30
    
    
    window["children"][0]["children"] = window["children"][0]["children"] + (
                {"name" : "CH1_Button","type" : "button","x" : 0 + 10,"y" : 17,"text" : "CH1","default_image" : ROOT + "small_button_01.sub","over_image" : ROOT + "small_button_02.sub","down_image" : ROOT + "small_button_03.sub",},
                {"name" : "CH2_Button","type" : "button","x" : 45 + 10,"y" : 17,"text" : "CH2","default_image" : ROOT + "small_button_01.sub","over_image" : ROOT + "small_button_02.sub","down_image" : ROOT + "small_button_03.sub",},
                {"name" : "CH3_Button","type" : "button","x" : 90 + 10,"y" : 17,"text" : "CH3","default_image" : ROOT + "small_button_01.sub","over_image" : ROOT + "small_button_02.sub","down_image" : ROOT + "small_button_03.sub",},
                {"name" : "CH4_Button","type" : "button","x" : 135 + 10,"y" : 17,"text" : "CH4","default_image" : ROOT + "small_button_01.sub","over_image" : ROOT + "small_button_02.sub","down_image" : ROOT + "small_button_03.sub",},
    )
 



 

Rozwiązane przez Sevence

Przejdź do rozwiązania

Featured Replies

Opublikowano

Prosta sprawa, używasz stałej z constInfo - CHANNEL_CHANGER_MODE i ta część kodu jest wykonana gdy masz ją ustawioną na 2 lub 3. 

 

Tu masz błąd:

UISCRIPT_LOAD_ERROR: name 'constInfo' is not defined [filename locale/pl/ui/SystemDialog.py]

 

Ten plik nie widzi stałej CHANNEL_CHANGER_MODE musisz na początku SystemDialog.py zaimportować plik:

import constInfo

 

Opublikowano
  • Autor
3 minuty temu, Sevence napisał(a):

Prosta sprawa, używasz stałej z constInfo - CHANNEL_CHANGER_MODE i ta część kodu jest wykonana gdy masz ją ustawioną na 2 lub 3. 

 

Tu masz błąd:

UISCRIPT_LOAD_ERROR: name 'constInfo' is not defined [filename locale/pl/ui/SystemDialog.py]

 

Ten plik nie widzi stałej CHANNEL_CHANGER_MODE musisz na początku SystemDialog.py zaimportować plik:

import constInfo

 


Dopisałem import constInfo lecz nic się nie zmienilo oprócz w sysserze : 

0909 15:12:11650 :: UISCRIPT_LOAD_ERROR: 'NoneType' object has no attribute 'CHANNEL_CHANGER_MODE' [filename locale/pl/ui/SystemDialog.py]

Opublikowano
  • Rozwiązanie

Spróbuj tak:

CHANNEL_CHANGER_MODE = 2
if CHANNEL_CHANGER_MODE == 2 or CHANNEL_CHANGER_MODE == 3:
    window["height"] = window["height"] + 30
    window["children"][0]["height"] = window["children"][0]["height"] + 30

    window["children"][0]["children"][0]["y"] = window["children"][0]["children"][0]["y"] + 30
    window["children"][0]["children"][1]["y"] = window["children"][0]["children"][1]["y"] + 30
    window["children"][0]["children"][2]["y"] = window["children"][0]["children"][2]["y"] + 30
    window["children"][0]["children"][3]["y"] = window["children"][0]["children"][3]["y"] + 30
    window["children"][0]["children"][4]["y"] = window["children"][0]["children"][4]["y"] + 30
    window["children"][0]["children"][5]["y"] = window["children"][0]["children"][5]["y"] + 30
    window["children"][0]["children"][6]["y"] = window["children"][0]["children"][6]["y"] + 30
    window["children"][0]["children"][7]["y"] = window["children"][0]["children"][7]["y"] + 30


    window["children"][0]["children"] = window["children"][0]["children"] + (
                {"name" : "CH1_Button","type" : "button","x" : 0 + 10,"y" : 17,"text" : "CH1","default_image" : ROOT + "small_button_01.sub","over_image" : ROOT + "small_button_02.sub","down_image" : ROOT + "small_button_03.sub",},
                {"name" : "CH2_Button","type" : "button","x" : 45 + 10,"y" : 17,"text" : "CH2","default_image" : ROOT + "small_button_01.sub","over_image" : ROOT + "small_button_02.sub","down_image" : ROOT + "small_button_03.sub",},
                {"name" : "CH3_Button","type" : "button","x" : 90 + 10,"y" : 17,"text" : "CH3","default_image" : ROOT + "small_button_01.sub","over_image" : ROOT + "small_button_02.sub","down_image" : ROOT + "small_button_03.sub",},
                {"name" : "CH4_Button","type" : "button","x" : 135 + 10,"y" : 17,"text" : "CH4","default_image" : ROOT + "small_button_01.sub","over_image" : ROOT + "small_button_02.sub","down_image" : ROOT + "small_button_03.sub",},
    )

 

Opublikowano
  • Autor
10 minut temu, Sevence napisał(a):

Spróbuj tak:

CHANNEL_CHANGER_MODE = 2
if CHANNEL_CHANGER_MODE == 2 or CHANNEL_CHANGER_MODE == 3:
    window["height"] = window["height"] + 30
    window["children"][0]["height"] = window["children"][0]["height"] + 30

    window["children"][0]["children"][0]["y"] = window["children"][0]["children"][0]["y"] + 30
    window["children"][0]["children"][1]["y"] = window["children"][0]["children"][1]["y"] + 30
    window["children"][0]["children"][2]["y"] = window["children"][0]["children"][2]["y"] + 30
    window["children"][0]["children"][3]["y"] = window["children"][0]["children"][3]["y"] + 30
    window["children"][0]["children"][4]["y"] = window["children"][0]["children"][4]["y"] + 30
    window["children"][0]["children"][5]["y"] = window["children"][0]["children"][5]["y"] + 30
    window["children"][0]["children"][6]["y"] = window["children"][0]["children"][6]["y"] + 30
    window["children"][0]["children"][7]["y"] = window["children"][0]["children"][7]["y"] + 30


    window["children"][0]["children"] = window["children"][0]["children"] + (
                {"name" : "CH1_Button","type" : "button","x" : 0 + 10,"y" : 17,"text" : "CH1","default_image" : ROOT + "small_button_01.sub","over_image" : ROOT + "small_button_02.sub","down_image" : ROOT + "small_button_03.sub",},
                {"name" : "CH2_Button","type" : "button","x" : 45 + 10,"y" : 17,"text" : "CH2","default_image" : ROOT + "small_button_01.sub","over_image" : ROOT + "small_button_02.sub","down_image" : ROOT + "small_button_03.sub",},
                {"name" : "CH3_Button","type" : "button","x" : 90 + 10,"y" : 17,"text" : "CH3","default_image" : ROOT + "small_button_01.sub","over_image" : ROOT + "small_button_02.sub","down_image" : ROOT + "small_button_03.sub",},
                {"name" : "CH4_Button","type" : "button","x" : 135 + 10,"y" : 17,"text" : "CH4","default_image" : ROOT + "small_button_01.sub","over_image" : ROOT + "small_button_02.sub","down_image" : ROOT + "small_button_03.sub",},
    )

 


Zadziałało, dziękuje 😉

  • Januszek zablokował(a) ten temat
Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.