[Py] Butoane langa inventar

Deconectat
Avatar utilizator
Tokiame
Her King
Her King
Mesaje: 1580
Membru din: 24 Iul 2013
Reputație: Fondator
- Administrator
- Rege peste regi
Mulțumiri acordate: 35
Mulțumiri primite: 150

[Py] Butoane langa inventar

Mesajde Tokiame » 12 Mai 2018, 23:55

De pe vremea cand ma aveam bine cu "zeul" Vegas.



[File: root/uiInventory.py]
#1.) Search:
self.mallButton = self.GetChild2("MallButton")


#2.) Add bellow:
self.Button_Function_1 = self.GetChild2("Button_Function_1")			
self.Button_Function_2 = self.GetChild2("Button_Function_2")
self.Button_Function_3 = self.GetChild2("Button_Function_3")
self.Button_Function_4 = self.GetChild2("Button_Function_4")
self.Button_Function_5 = self.GetChild2("Button_Function_5")
self.Button_Function_6 = self.GetChild2("Button_Function_6")


#1.) Search:
if self.mallButton:
self.mallButton.SetEvent(ui.__mem_func__(self.ClickMallButton))


#2.) Add bellow:
if (self.Button_Function_1):
self.Button_Function_1.SetEvent(ui.__mem_func__(self.ClickButton_Function_1))
if (self.Button_Function_2):
self.Button_Function_2.SetEvent(ui.__mem_func__(self.ClickButton_Function_2))
if (self.Button_Function_3):
self.Button_Function_3.SetEvent(ui.__mem_func__(self.ClickButton_Function_3))
if (self.Button_Function_4):
self.Button_Function_4.SetEvent(ui.__mem_func__(self.ClickButton_Function_4))
if (self.Button_Function_5):
self.Button_Function_5.SetEvent(ui.__mem_func__(self.ClickButton_Function_5))
if (self.Button_Function_6):
self.Button_Function_6.SetEvent(ui.__mem_func__(self.ClickButton_Function_6))


#1.) Search:
def ClickMallButton(self):
print "click_mall_button"
net.SendChatPacket("/click_mall")


#2.) Add bellow:
def ClickButton_Function_1(self):	
pass

def ClickButton_Function_2(self):
pass

def ClickButton_Function_3(self):
pass

def ClickButton_Function_4(self):
pass

def ClickButton_Function_5(self):
pass

def ClickButton_Function_6(self):
pass


[File: locale/xx//InventoryWindow.py]
#1.) Search:
import uiScriptLocale
import item


#2.) Add bellow:
TEXT_VEGAS_1 = "Description button 1"
TEXT_VEGAS_2 = "Description button 2"
TEXT_VEGAS_3 = "Description button 3"
TEXT_VEGAS_4 = "Description button 4"
TEXT_VEGAS_5 = "Description button 5"
TEXT_VEGAS_6 = "Description button 6"

########################################
GET_IMAGE_BUTTON = "locale/xx/ui/button_inventory/"
########################################

position_button_1_x = 10
position_button_1_y = 10
position_button_2_x = 10
position_button_2_y = 42
position_button_3_x = 10
position_button_3_y = 72
position_button_4_x = 10
position_button_4_y = 102
position_button_5_x = 10
position_button_5_y = 134
position_button_6_x = 10
position_button_6_y = 166


#1.) Search:
window = {
"name" : "InventoryWindow",

"x" : SCREEN_WIDTH - 176 - 200,
"y" : SCREEN_HEIGHT - 37 - 565,

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

"width" : 176,
"height" : 565,

"children" :
(


#2.) Add bellow:
{
"name" : "vegas_board",
"type" : "board",
"style" : ("attach",),

"x" : 0,
"y" : +15,
"vertical_align":"center",

"width" : 40,
"height" : 210,

"children" :
(
{
"name" : "Button_Function_1",
"type" : "button",

"x" : position_button_1_x,
"y" : position_button_1_y,

"tooltip_text" : TEXT_VEGAS_1,

"default_image" : GET_IMAGE_BUTTON + "number_x1_01.tga",
"over_image" : GET_IMAGE_BUTTON + "number_x1_02.tga",
"down_image" : GET_IMAGE_BUTTON + "number_x1_03.tga",
},
{
"name" : "Button_Function_2",
"type" : "button",

"x" : position_button_2_x,
"y" : position_button_2_y,

"tooltip_text" : TEXT_VEGAS_2,

"default_image" : GET_IMAGE_BUTTON + "number_x2_01.tga",
"over_image" : GET_IMAGE_BUTTON + "number_x2_02.tga",
"down_image" : GET_IMAGE_BUTTON + "number_x2_03.tga",
},
{
"name" : "Button_Function_3",
"type" : "button",

"x" : position_button_3_x,
"y" : position_button_3_y,

"tooltip_text" : TEXT_VEGAS_3,

"default_image" : GET_IMAGE_BUTTON + "number_x3_01.tga",
"over_image" : GET_IMAGE_BUTTON + "number_x3_02.tga",
"down_image" : GET_IMAGE_BUTTON + "number_x3_03.tga",
},
{
"name" : "Button_Function_4",
"type" : "button",

"x" : position_button_4_x,
"y" : position_button_4_y,

"tooltip_text" : TEXT_VEGAS_4,

"default_image" : GET_IMAGE_BUTTON + "number_x4_01.tga",
"over_image" : GET_IMAGE_BUTTON + "number_x4_02.tga",
"down_image" : GET_IMAGE_BUTTON + "number_x4_03.tga",
},
{
"name" : "Button_Function_5",
"type" : "button",

"x" : position_button_5_x,
"y" : position_button_5_y,

"tooltip_text" : TEXT_VEGAS_5,

"default_image" : GET_IMAGE_BUTTON + "number_x5_01.tga",
"over_image" : GET_IMAGE_BUTTON + "number_x5_02.tga",
"down_image" : GET_IMAGE_BUTTON + "number_x5_03.tga",
},
{
"name" : "Button_Function_6",
"type" : "button",

"x" : position_button_6_x,
"y" : position_button_6_y,

"tooltip_text" : TEXT_VEGAS_6,

"default_image" : GET_IMAGE_BUTTON + "number_x6_01.tga",
"over_image" : GET_IMAGE_BUTTON + "number_x6_02.tga",
"down_image" : GET_IMAGE_BUTTON + "number_x6_03.tga",
},
),
},
Feonyr2 - The Reborn of Metin (in development stage - open beta soon)
Pentru intrebari sau nelamuriri, astept mesajele la singura adresa oficiala de mail, gmail@anisor.ro

Înapoi la “Altele”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: chris90909090, playgames2 și 4 vizitatori