[Python]How To BonusBoard + Minimierbar im Inventar

10/21/2016 14:47 thespeedyy#16
Damit difniere ich welche bonis wie? und wo einfügen?
Code:
MAX_LEN_BONUS = 23
LIST_VALUE_BONUS = {
	0	: 69,   1	: 70,
	2	: 71,   3	: 74,
	4	: 72,   5	: 73,
	6	: 77,   7	: 81,
	8	: 59,   9	: 60,
	10	: 61,   11	: 62,
	12	: 40,   13	: 41,
	14	: 122,  15	: 121,
	16	: 43,   17	: 47,
	18	: 48,   19	: 54,
	20	: 55,   21	: 56,
	22	: 57
}

for tmp in xrange(1, MAX_LEN_BONUS + 1):
	self.GetChild("bonus_%d" % (str(tmp))).SetText(str(player.GetStatus(LIST_VALUE_BONUS[tmp-1])))
10/31/2016 00:56 Cyber36#17
Code:
1030 22:25:02829 :: Traceback (most recent call last):

1030 22:25:02830 ::   File "uiInventory.py", line 742, in OnUpdate

1030 22:25:02831 ::   File "uiInventory.py", line 441, in ReloadBonus

1030 22:25:02832 ::   File "ui.py", line 2603, in GetChild

1030 22:25:02832 :: KeyError
1030 22:25:02832 :: : 
1030 22:25:02832 :: bonus_1
1030 22:25:02832 ::
Entweder ich stelle mich doof an, oder das System ist verbuggt.
Kennt jemand eine Lösung für dieses Problem?`

Folgend sieht es bei mir aktuell aus:

Code:
	def ReloadBonus(self):
		BONUS_LIST = [ 69, 70, 71, 74, 72, 73, 77, 81, 59, 60, 61, 62, 40, 41, 122, 121, 43, 47, 48, 54, 55, 56, 57 ]
		for i in range(1, len(BONUS_LIST)+1):
			self.GetChild("bonus_%d" % i).SetText(str(player.GetStatus(BONUS_LIST[i-1])
Vielen Dank im Vorraus!

MfG
Cyber
10/31/2016 09:45 .Dany-#18
Wurde eigentlich alles richtig eingefügt, nach dem einloggen schließt sich aber der Client direkt wieder.


Meine Syserr:


Code:
1031 09:41:06027 :: 
networkModule.py(line:200) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:18) <module>
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - <type 'exceptions.IndentationError'>:unindent does not match any outer indentation level (uiInventory.py, line 299)

1031 09:41:06028 :: ============================================================================================================
1031 09:41:06028 :: Abort!!!!
11/13/2016 09:33 ηєχσ™#19
Was tun?

HTML Code:
1113 09:28:24218 :: 
uiInventory.py(line:299) __LoadWindow

InventoryWindow.LoadWindow.BindObject - <type 'exceptions.AttributeError'>:'NoneType' object has no attribute 'SetEvent'

1113 09:28:24218 :: ============================================================================================================
1113 09:28:24218 :: Abort!!!!

11/14/2016 20:27 ηєχσ™#20
Quote:
Originally Posted by ηєχσ™ View Post
Was tun?

HTML Code:
1113 09:28:24218 :: 
uiInventory.py(line:299) __LoadWindow

InventoryWindow.LoadWindow.BindObject - <type 'exceptions.AttributeError'>:'NoneType' object has no attribute 'SetEvent'

1113 09:28:24218 :: ============================================================================================================
1113 09:28:24218 :: Abort!!!!

#push
11/15/2016 10:46 ProfessorEnte#21
Hatten wir damals bei unserem Pserver auch.
Allerdings etwas anders geloest.

Nett, dass du das teilst. ;)
11/17/2016 13:11 kronzu#22
Thanks, a little change but look good.
GIF: [Only registered and activated users can see links. Click Here To Register...]
11/18/2016 09:56 CHXENVS#23
Hey,

danke für den RLS! Können einige bestimmt gebrauchen, jedoch gibts meines Wissen schon einige von diesen Dingern :P
11/18/2016 13:55 »DeneX«#24
Bei mir gibt es EQUIPMENT_START_INDEX nicht, wo stattdessen einfügen?

PHP Code:
import uiScriptLocale
import item
import player

window 
= {
    
"name" "InventoryWindow",

    
## 600 - (width + ????? ?? ??? 24 px)
    
"x" SCREEN_WIDTH 176 38 72 70,
    
"y" SCREEN_HEIGHT 50 565 -2,

    
"style" : ("movable""float",),

    
"width" 176 70,
    
"height" 585,

    
"children" :
    (
        {
            
"name" "buttonboard",
            
"type" "board",
            
"style" : ("attach",),

            
"x" 73 70,
            
"y" 5,

            
"width" 60,
            
"height" 118+35+35+35+35 ,
            
"children" 
            (
                
#Pierœcieñ Gracza
                
{
                    
"name" "ui_panel_gracza",
                    
"type" "button",
                    
"x" 8,
                    
"y" 9,
                    
"tooltip_text" "User Panel",
                    
"tooltip_x" : -50-30,
                    
"tooltip_y" 0,
                    
"default_image" "locale/pl/ui/buttons/pierscien01.tga",
                    
"over_image" "locale/pl/ui/buttons/pierscien02.tga",
                    
"down_image" "locale/pl/ui/buttons/pierscien03.tga",
                },    
                
#Koñ
                
{
                    
"name" "kon",
                    
"type" "button",
                    
"x" ,
                    
"y" 9+35,
                    
"tooltip_x" : -50,
                    
"tooltip_y" 0,    
                    
"tooltip_text" "Pferd rufen",
                    
"default_image" "locale/pl/ui/buttons/kon01.tga",
                    
"over_image" "locale/pl/ui/buttons/kon02.tga",
                    
"down_image" "locale/pl/ui/buttons/kon03.tga",
                },    
                
#Teleportacja
                
{
                    
"name" "uiTP",
                    
"type" "button",
                    
"x" ,
                    
"y" 9+35+35,
                    
"tooltip_x" : -50,
                    
"tooltip_y" 0,    
                    
"tooltip_text" "Teleport",
                    
"default_image" "locale/pl/ui/buttons/teleportacja01.tga",
                    
"over_image" "locale/pl/ui/buttons/teleportacja02.tga",
                    
"down_image" "locale/pl/ui/buttons/teleportacja03.tga",
                },    
                
## Smocze kamienie  
                
{
                    
"name" "ui_kamienia",
                    
"type" "button",
                    
"x" ,
                    
"y" 9+35+35+35,
                    
"tooltip_x" : -50,
                    
"tooltip_y" 0,    
                    
"tooltip_text" "Drachensteinalchemie",
                    
"default_image" "locale/pl/ui/buttons/smocze_kamienia01.tga",
                    
"over_image" "locale/pl/ui/buttons/smocze_kamienia02.tga",
                    
"down_image" "locale/pl/ui/buttons/smocze_kamienia03.tga",
                },    
                
#Bs
                
{
                    
"name" "bonusswitcher",
                    
"type" "button",
                    
"x" ,
                    
"y" 9+35+35+35+35,
                    
"tooltip_x" : -50,
                    
"tooltip_y" 0,    
                    
"tooltip_text" "Switchbot ",
                    
"default_image" "locale/pl/ui/buttons/zmiana_eq01.tga",
                    
"over_image" "locale/pl/ui/buttons/zmiana_eq02.tga",
                    
"down_image" "locale/pl/ui/buttons/zmiana_eq03.tga",
                },
                
#Statystyki
                
{
                    
"name" "staty",
                    
"type" "button",
                    
"x" ,
                    
"y" 9+35+35+35+35+35,
                    
"tooltip_text" "Statistik",
                    
"tooltip_x" : -50-15-5,
                    
"tooltip_y" 0,
                    
"default_image" "locale/pl/ui/buttons/stat01.tga",
                    
"over_image" "locale/pl/ui/buttons/stat02.tga",
                    
"down_image" "locale/pl/ui/buttons/stat03.tga",
                },    
                
#Eventy
                
{
                    
"name" "ui_panel_eventy",
                    
"type" "button",
                    
"x" ,
                    
"y" 9+35+35+35+35+35+35,
                    
"tooltip_text" "Event Panel",
                    
"tooltip_x" : -50-15-5,
                    
"tooltip_y" 0,
                    
"default_image" "locale/pl/ui/buttons/eventy01.tga",
                    
"over_image" "locale/pl/ui/buttons/eventy02.tga",
                    
"down_image" "locale/pl/ui/buttons/eventy03.tga",
                },                    
            ),    
        },    
        
## Inventory, Equipment Slots
        
{
            
"name" "board",
            
"type" "board",
            
"style" : ("attach",),

            
"x" 37 45 30 70,
            
"y" 0,

            
"width" 176,
            
"height" 580,

            
"children" :
            (
                
## Title
                
{
                    
"name" "TitleBar",
                    
"type" "titlebar",
                    
"style" : ("attach",),

                    
"x" 8,
                    
"y" 7,

                    
"width" 161,
                    
"color" "yellow",

                    
"children" :
                    (
                        { 
"name":"TitleName""type":"text""x":77"y":3"text":uiScriptLocale.INVENTORY_TITLE"text_horizontal_align":"center" },
                    ),
                },

                
## Equipment Slot
                
{
                    
"name" "Equipment_Base",
                    
"type" "image",

                    
"x" 10,
                    
"y" 33,

                    
"image" "d:/ymir work/ui/equipment_bg_without_ring.tga",

                    
"children" :
                    (

                        {
                            
"name" "EquipmentSlot",
                            
"type" "slot",

                            
"x" 3,
                            
"y" 3,

                            
"width" 150,
                            
"height" 182,

                            
"slot" : (
                                        {
"index":player.EQUIPMENT_SLOT_START+0"x":39"y":37"width":32"height":64},
                                        {
"index":player.EQUIPMENT_SLOT_START+1"x":39"y":2"width":32"height":32},
                                        {
"index":player.EQUIPMENT_SLOT_START+2"x":39"y":145"width":32"height":32},
                                        {
"index":player.EQUIPMENT_SLOT_START+3"x":75"y":67"width":32"height":32},
                                        {
"index":player.EQUIPMENT_SLOT_START+4"x":3"y":3"width":32"height":96},
                                        {
"index":player.EQUIPMENT_SLOT_START+5"x":114"y":67"width":32"height":32},
                                        {
"index":player.EQUIPMENT_SLOT_START+6"x":114"y":35"width":32"height":32},
                                        {
"index":player.EQUIPMENT_SLOT_START+7"x":2"y":145"width":32"height":32},
                                        {
"index":player.EQUIPMENT_SLOT_START+8"x":75"y":145"width":32"height":32},
                                        {
"index":player.EQUIPMENT_SLOT_START+9"x":114"y":2"width":32"height":32},
                                        {
"index":player.EQUIPMENT_SLOT_START+10"x":75"y":35"width":32"height":32},
                                        {
"index":item.EQUIPMENT_RING1"x":2"y":106"width":32"height":32},
                                        {
"index":item.EQUIPMENT_RING2"x":75"y":106"width":32"height":32},
                                        {
"index":item.EQUIPMENT_RING3"x":111"y":106"width":32"height":32},
                                        {
"index":item.EQUIPMENT_BELT"x":39"y":106"width":32"height":32},
                                    ),
                        },        
                        
## Magazyn 
                        
{
                            
"name" "magazyn",
                            
"type" "button",
                            
"x" 118,
                            
"y" 148-35,
                            
"tooltip_text" "Lager",
                            
"default_image" "d:/ymir work/ui/game/TaskBar/Mall_Button_01.tga",
                            
"over_image" "d:/ymir work/ui/game/TaskBar/Mall_Button_02.tga",
                            
"down_image" "d:/ymir work/ui/game/TaskBar/Mall_Button_03.tga",
                        },
                        
## CostumeButton
                        
{
                            
"name" "CostumeButton",
                            
"type" "button",

                            
"x" 78,
                            
"y" 5,

                            
"tooltip_text" uiScriptLocale.COSTUME_TITLE,

                            
"default_image" "d:/ymir work/ui/game/taskbar/costume_Button_01.tga",
                            
"over_image" "d:/ymir work/ui/game/taskbar/costume_Button_02.tga",
                            
"down_image" "d:/ymir work/ui/game/taskbar/costume_Button_03.tga",
                        },                                
                        {
                            
"name" "Equipment_Tab_01",
                            
"type" "radio_button",

                            
"x" 86,
                            
"y" 161,

                            
"default_image" "d:/ymir work/ui/game/windows/tab_button_small_01.sub",
                            
"over_image" "d:/ymir work/ui/game/windows/tab_button_small_02.sub",
                            
"down_image" "d:/ymir work/ui/game/windows/tab_button_small_03.sub",

                            
"children" :
                            (
                                {
                                    
"name" "Equipment_Tab_01_Print",
                                    
"type" "text",

                                    
"x" 0,
                                    
"y" 0,

                                    
"all_align" "center",

                                    
"text" "I",
                                },
                            ),
                        },
                        {
                            
"name" "Equipment_Tab_02",
                            
"type" "radio_button",

                            
"x" 86 32,
                            
"y" 161,

                            
"default_image" "d:/ymir work/ui/game/windows/tab_button_small_01.sub",
                            
"over_image" "d:/ymir work/ui/game/windows/tab_button_small_02.sub",
                            
"down_image" "d:/ymir work/ui/game/windows/tab_button_small_03.sub",

                            
"children" :
                            (
                                {
                                    
"name" "Equipment_Tab_02_Print",
                                    
"type" "text",

                                    
"x" 0,
                                    
"y" 0,

                                    
"all_align" "center",

                                    
"text" "II",
                                },
                            ),
                        },

                    ),
                },

                {
                    
"name" "Inventory_Tab_01",
                    
"type" "radio_button",

                    
"x" 8,
                    
"y" 33 191,

                    
"default_image" "d:/ymir work/ui/game/windows/tab_button_small_01.sub",
                    
"over_image" "d:/ymir work/ui/game/windows/tab_button_small_02.sub",
                    
"down_image" "d:/ymir work/ui/game/windows/tab_button_small_03.sub",
                    
"tooltip_text" uiScriptLocale.INVENTORY_PAGE_BUTTON_TOOLTIP_1,

                    
"children" :
                    (
                        {
                            
"name" "Inventory_Tab_01_Print",
                            
"type" "text",

                            
"x" 0,
                            
"y" 0,

                            
"all_align" "center",

                            
"text" "I",
                        },
                    ),
                },
                {
                    
"name" "Inventory_Tab_02",
                    
"type" "radio_button",

                    
"x" 32,
                    
"y" 33 191,

                    
"default_image" "d:/ymir work/ui/game/windows/tab_button_small_01.sub",
                    
"over_image" "d:/ymir work/ui/game/windows/tab_button_small_02.sub",
                    
"down_image" "d:/ymir work/ui/game/windows/tab_button_small_03.sub",
                    
"tooltip_text" uiScriptLocale.INVENTORY_PAGE_BUTTON_TOOLTIP_2,

                    
"children" :
                    (
                        {
                            
"name" "Inventory_Tab_02_Print",
                            
"type" "text",

                            
"x" 0,
                            
"y" 0,

                            
"all_align" "center",

                            
"text" "II",
                        },
                    ),
                },
                {
                    
"name" "Inventory_Tab_03",
                    
"type" "radio_button",

                    
"x" 32*2,
                    
"y" 33 191,

                    
"default_image" "d:/ymir work/ui/game/windows/tab_button_small_01.sub",
                    
"over_image" "d:/ymir work/ui/game/windows/tab_button_small_02.sub",
                    
"down_image" "d:/ymir work/ui/game/windows/tab_button_small_03.sub",
                    
"tooltip_text" uiScriptLocale.INVENTORY_PAGE_BUTTON_TOOLTIP_3,

                    
"children" :
                    (
                        {
                            
"name" "Inventory_Tab_02_Print",
                            
"type" "text",

                            
"x" 0,
                            
"y" 0,

                            
"all_align" "center",

                            
"text" "III",
                        },
                    ),
                },
                {
                    
"name" "Inventory_Tab_04",
                    
"type" "radio_button",

                    
"x" 32*3,
                    
"y" 33 191,

                    
"default_image" "d:/ymir work/ui/game/windows/tab_button_small_01.sub",
                    
"over_image" "d:/ymir work/ui/game/windows/tab_button_small_02.sub",
                    
"down_image" "d:/ymir work/ui/game/windows/tab_button_small_03.sub",
                    
"tooltip_text" uiScriptLocale.INVENTORY_PAGE_BUTTON_TOOLTIP_4,

                    
"children" :
                    (
                        {
                            
"name" "Inventory_Tab_02_Print",
                            
"type" "text",

                            
"x" 0,
                            
"y" 0,

                            
"all_align" "center",

                            
"text" "IV",
                        },
                    ),
                },
                {
                    
"name" "Inventory_Tab_05",
                    
"type" "radio_button",

                    
"x" 32*4,
                    
"y" 33 191,

                    
"default_image" "d:/ymir work/ui/game/windows/tab_button_small_01.sub",
                    
"over_image" "d:/ymir work/ui/game/windows/tab_button_small_02.sub",
                    
"down_image" "d:/ymir work/ui/game/windows/tab_button_small_03.sub",
                    
"tooltip_text" uiScriptLocale.INVENTORY_PAGE_BUTTON_TOOLTIP_5,

                    
"children" :
                    (
                        {
                            
"name" "Inventory_Tab_02_Print",
                            
"type" "text",

                            
"x" 0,
                            
"y" 0,

                            
"all_align" "center",

                            
"text" "V",
                        },
                    ),
                },

                
## Item Slot
                
{
                    
"name" "ItemSlot",
                    
"type" "grid_table",

                    
"x" 8,
                    
"y" 246,

                    
"start_index" 0,
                    
"x_count" 5,
                    
"y_count" 9,
                    
"x_step" 32,
                    
"y_step" 32,

                    
"image" "d:/ymir work/ui/public/Slot_Base.sub"
                
},

                {
                    
"name":"Money_Slot",
                    
"type":"button",

                    
"x":8,
                    
"y":45,

                    
"horizontal_align":"center",
                    
"vertical_align":"bottom",

                    
"default_image" "d:/ymir work/ui/public/parameter_slot_05.sub",
                    
"over_image" "d:/ymir work/ui/public/parameter_slot_05.sub",
                    
"down_image" "d:/ymir work/ui/public/parameter_slot_05.sub",

                    
"children" :
                    (

                        {
                            
"name" "Money",
                            
"type" "text",

                            
"x" 2,
                            
"y" 2,

                            
"horizontal_align" "right",
                            
"text_horizontal_align" "right",

                            
"text" "123456789",
                        },
                        {
                            
"name":"ikonnkandiajidj23",
                            
"type" "image",

                            
"x":-18,
                            
"y":2,

                            
"image":"d:/ymir work/ui/game/windows/money_icon.sub",
                        },
                    ),
                },
                {
                    
"name":"IS_Slot",
                    
"type":"button",

                    
"x":8,
                    
"y":25,

                    
"horizontal_align":"center",
                    
"vertical_align":"bottom",

                    
"default_image" "d:/ymir work/ui/public/parameter_slot_05.sub",
                    
"over_image" "d:/ymir work/ui/public/parameter_slot_05.sub",
                    
"down_image" "d:/ymir work/ui/public/parameter_slot_05.sub",

                    
"children" :
                    (
                        {
                            
"name":"Money_Icon2",
                            
"type":"image",

                            
"x":-18,
                            
"y":2,

                            
"image":"d:/ymir work/ui/game/windows/money_icon.sub",
                        },

                        {
                            
"name" "IS",
                            
"type" "text",

                            
"x" 2,
                            
"y" 2,

                            
"horizontal_align" "right",
                            
"text_horizontal_align" "right",

                            
"text" "",
                        },                    
                    ),
                },
            ),
        },
    ),

11/19/2016 12:53 AcronicDesign#25
Good feature
01/06/2017 01:29 VegaS ♆#26
Code:
//@Replace function MinimierenInfoTable with:
	def ReferencePages(self, token):
		GetObject = self.GetChild
		
		ar_ListObjects = [
			GetObject("Defensiv"),GetObject("Schwert"),GetObject("Schwert_info"),GetObject("2Hand"),GetObject("2Hand_info"),GetObject("Dolch"),GetObject("Dolch_info"),GetObject("Pfeilwiderstand"),GetObject("Pfeilwiderstand_info"),GetObject("Glocke"),GetObject("Glocke_info"),GetObject("Faecher"),GetObject("Faecher_info"),GetObject("Magiewiederstand"),GetObject("Magiewiederstand_info"),GetObject("Giftwiederstand"),GetObject("Giftwiederstand_info"),GetObject("Krieger"),GetObject("Krieger_info"),GetObject("Ninja"),GetObject("Ninja_info"),GetObject("Sura"),GetObject("Sura_info"),GetObject("Schamane"),GetObject("Schamane_info"),GetObject("Offensive"),GetObject("Krit"),GetObject("Krit_info"),GetObject("DB"),GetObject("DB_info"),GetObject("DSS"),GetObject("DSS_info"),GetObject("FKS"),GetObject("FKS_info"),GetObject("Halbmenschen"),GetObject("Halbmenschen_info"),GetObject("Untote"),GetObject("Untote_info"),GetObject("Teufel"),GetObject("Teufel_info"),GetObject("KriegerO"),GetObject("KriegerO_info"),GetObject("NinjaO"),GetObject("NinjaO_info"),GetObject("SuraO"),GetObject("SuraO_info"),GetObject("SchamaneO"),GetObject("SchamaneO_info"),GetObject("SERVER_NAME")
		]
		for it in ar_ListObjects:
			if token == 0:
				it.Hide()
			else:
				it.Show()

	def MinimierenInfoTable(self, arg):
		if arg == True:
			self.ReferencePages(0)
		else:
			self.ReferencePages(1)
  
//@Replace function ReloadBonus with:
	def ReloadBonus(self):
		ar_ListBonus = [ 69, 70, 71, 74, 72, 73, 77, 81, 59, 60, 61, 62, 40, 41, 122, 121, 43, 47, 48, 54, 55, 56, 57 ]

		for it in range(1, len(ar_ListBonus) + 1):
			self.GetChild("bonus_%d" % it).SetText(str(player.GetStatus(ar_ListBonus[it - 1])))
01/06/2017 11:21 thespeedyy#27
can i show the list with all boni/name and value from boni?
i will switch :/
08/20/2017 16:29 Titan_Phantom#28
Die Yanganzeige "snapt" nicht richtig nach dem Einlogen, Porten
[Only registered and activated users can see links. Click Here To Register...]
08/21/2017 15:24 MaLLaH95#29
How To Fix

Quote:
1030 22:25:02829 :: Traceback (most recent call last):

1030 22:25:02830 :: File "uiInventory.py", line 742, in OnUpdate

1030 22:25:02831 :: File "uiInventory.py", line 441, in ReloadBonus

1030 22:25:02832 :: File "ui.py", line 2603, in GetChild

1030 22:25:02832 :: KeyError
1030 22:25:02832 :: :
1030 22:25:02832 :: bonus_1
1030 22:25:02832 ::
Suchen nach def OnUpdate(self):

und die Zeile bzw die function löschen
Quote:
def OnUpdate(self):
self.ReloadBonus()
Sucht nach def RefreshItemSlot(self):

und fügt unten das ein
Quote:
self.ReloadBonus()
es muss so aussehen
Quote:
def RefreshItemSlot(self):
self.RefreshBagSlotWindow()
self.RefreshEquipSlotWindow()
self.ReloadBonus()
Verpacken und fertig.
der Error wird nicht mehr auftauschen und eure Bonuspage reloaded von automatisch ;)
08/24/2017 17:09 LovecKrys#30
Quote:
Originally Posted by mq1n4 View Post
If you want 2x memory usage with len, no problem you can use what do you want.
lmao. we aren't in 2005 anymore.