[Py] Butoane langa inventar

Deconectat
Avatar utilizator
Anişor
Her King
Her King
Mesaje: 1614
Membru din: 24 Iul 2013
Reputație: Fondator
- Administrator
- Coralya e sefa mea
Mulțumiri acordate: 37
Mulțumiri primite: 171

[Py] Butoane langa inventar

Mesajde Anişor » 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

Deconectat
Avatar utilizator
danielionut
Nivel 2
Nivel 2
Mesaje: 177
Membru din: 19 Oct 2018
Status: Sunt bine mersi
Server Metin2: nam
Regat: Shinsoo
Mulțumiri acordate: 21
Mulțumiri primite: 0

Re: [Py] Butoane langa inventar

Mesajde danielionut » 03 Ian 2019, 12:18

nu apare nimic langa inventar ..

Deconectat
Avatar utilizator
Vladii
Nivel 2
Nivel 2
Mesaje: 266
Membru din: 03 Iun 2018
Localitate: Bistrita
Reputație: Nume anterior: xDx, Ţepeş No Die
Membru Club (9 apr)
Status: Nu am
Server Metin2: no :D
Regat: Chunjo
Mulțumiri acordate: 14
Mulțumiri primite: 28
Contact:

Re: [Py] Butoane langa inventar

Mesajde Vladii » 14 Ian 2019, 13:57

danielionut scrie:nu apare nimic langa inventar ..

GET_IMAGE_BUTTON = "locale/xx/ui/button_inventory/"
in locale/xx/ui/ faci un folder numit button_inventory si acolo bagi imaginile dar sa fie .tga.

Deconectat
Avatar utilizator
[Wild]
Membru Club
Membru Club
Mesaje: 76
Membru din: 06 Ian 2019
Localitate: Germania
Reputație: Membru Club ( 12 Feb )
Status: Lucrez la proiect
Server Metin2: http://wildhunt2.com
Regat: Jinno
Mulțumiri acordate: 6
Mulțumiri primite: 2
Contact:

Re: [Py] Butoane langa inventar

Mesajde [Wild] » 14 Ian 2019, 14:02

Functioneaza perfect . Recomand is mai old dar is numa bune.

[ Postat de pe Linux Laptop ] Imagine

[ Postat de pe Linux Laptop ] Imagine

Deconectat
Avatar utilizator
C-Zeus
Nivel 1
Nivel 1
Mesaje: 79
Membru din: 27 Ian 2015
Regat: Jinno
Mulțumiri acordate: 7
Mulțumiri primite: 1

Re: [Py] Butoane langa inventar

Mesajde C-Zeus » 18 Mar 2019, 14:50

Ţepeş No Die scrie:
danielionut scrie:nu apare nimic langa inventar ..

GET_IMAGE_BUTTON = "locale/xx/ui/button_inventory/"
in locale/xx/ui/ faci un folder numit button_inventory si acolo bagi imaginile dar sa fie .tga.

Si unde gasesc imaginile? Download, ceva? :D

Deconectat
Avatar utilizator
CASTIGLIONE
Miracolul Crăciunului
Miracolul Crăciunului
Mesaje: 4274
Membru din: 06 Noi 2015
Mulțumiri acordate: 213
Mulțumiri primite: 248

Re: [Py] Butoane langa inventar

Mesajde CASTIGLIONE » 19 Mar 2019, 18:19

C-Zeus scrie:
Ţepeş No Die scrie:
danielionut scrie:nu apare nimic langa inventar ..

GET_IMAGE_BUTTON = "locale/xx/ui/button_inventory/"
in locale/xx/ui/ faci un folder numit button_inventory si acolo bagi imaginile dar sa fie .tga.

Si unde gasesc imaginile? Download, ceva? :D


el ţi-a făcut codul pentru bara clean fără butoane.. tu iţi adaugi butoanele care vrei .. gen unele au la butoane:
M
E
T
I
N
2
şi poate tu vrei altceva deci tu trebuie să ţi le faci


Înapoi la “Altele”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Pain., WinrraR, єиєму și 10 vizitatori