Adauga un popup de confirmare la fereastra de negociere / exchange.
*Poze / Video:
*Link download / Code:
Deschidem uiexchange.py si cautam:
Code:
def AcceptExchange(self):Deschidem uicommon.py si adaugam urmatorul class:
Code:
class QuestionDialog3(QuestionDialog):
def __init__(self):
QuestionDialog.__init__(self)
self.__CreateDialog()
def __del__(self):
QuestionDialog.__del__(self)
def __CreateDialog(self):
pyScrLoader = ui.PythonScriptLoader()
pyScrLoader.LoadScriptFile(self, "uiscript/questiondialog3.py")
self.board = self.GetChild("board")
self.textLine1 = self.GetChild("message1")
self.textLine2 = self.GetChild("message2")
self.textLine3 = self.GetChild("message3")
self.textLine4 = self.GetChild("message4")
self.textLine5 = self.GetChild("message5")
self.acceptButton = self.GetChild("accept")
self.cancelButton = self.GetChild("cancel")
def SetText1(self, text):
self.textLine1.SetText(text)
def SetText2(self, text):
self.textLine2.SetText(text)
def SetText3(self, text):
self.textLine3.SetText(text)
def SetText4(self, text):
self.textLine4.SetText(text)
def SetText5(self, text):
self.textLine5.SetText(text)Code:
HANDELN_FRAGE1 Ești momentan la schimb cu un alt jucător.
HANDELN_FRAGE2 Schimbul nu poate fi anulat ulterior.
HANDELN_FRAGE3 Îți recomandăm să îți verifici lucrurile încă o dată.
HANDELN_FRAGE4 Vrei să efectuezi schimbul?
HANDELN_FRAGE5 PS: Jucătorul este responsabil pentru propriile acțiuni!questiondialog3.py - il aduagam in uiscript:
Code:
import uiScriptLocale
window = {
"name" : "QuestionDialog",
"style" : ("movable", "float",),
"x" : SCREEN_WIDTH/2 - 125,
"y" : SCREEN_HEIGHT/2 - 52,
"width" : 300,
"height" : 180,
"children" :
(
{
"name" : "board",
"type" : "board",
"x" : 0,
"y" : 0,
"width" : 300,
"height" : 180,
"children" :
(
{
"name" : "message1",
"type" : "text",
"x" : 0,
"y" : 25,
"text" : uiScriptLocale.MESSAGE,
"horizontal_align" : "center",
"text_horizontal_align" : "center",
"text_vertical_align" : "center",
},
{
"name" : "message2",
"type" : "text",
"x" : 0,
"y" : 50,
"text" : uiScriptLocale.MESSAGE,
"horizontal_align" : "center",
"text_horizontal_align" : "center",
"text_vertical_align" : "center",
},
{
"name" : "message3",
"type" : "text",
"x" : 0,
"y" : 75,
"text" : uiScriptLocale.MESSAGE,
"horizontal_align" : "center",
"text_horizontal_align" : "center",
"text_vertical_align" : "center",
},
{
"name" : "message4",
"type" : "text",
"x" : 0,
"y" : 100,
"text" : uiScriptLocale.MESSAGE,
"horizontal_align" : "center",
"text_horizontal_align" : "center",
"text_vertical_align" : "center",
},
{
"name" : "message5",
"type" : "text",
"x" : 0,
"y" : 125,
"text" : uiScriptLocale.MESSAGE,
"horizontal_align" : "center",
"text_horizontal_align" : "center",
"text_vertical_align" : "center",
},
{
"name" : "accept",
"type" : "button",
"x" : -40,
"y" : 143,
"width" : 61,
"height" : 21,
"horizontal_align" : "center",
"text" : uiScriptLocale.YES,
"default_image" : "d:/ymir work/ui/public/middle_button_01.sub",
"over_image" : "d:/ymir work/ui/public/middle_button_02.sub",
"down_image" : "d:/ymir work/ui/public/middle_button_03.sub",
},
{
"name" : "cancel",
"type" : "button",
"x" : +40,
"y" : 143,
"width" : 61,
"height" : 21,
"horizontal_align" : "center",
"text" : uiScriptLocale.NO,
"default_image" : "d:/ymir work/ui/public/middle_button_01.sub",
"over_image" : "d:/ymir work/ui/public/middle_button_02.sub",
"down_image" : "d:/ymir work/ui/public/middle_button_03.sub",
},
),
},
),
}

la acest mesaj și conținutul se va afișa automat.

