Metin2 Onaylı Ticaret

FarquesFarques doğrulanmış üyedir.

~ Everything has an end

Konu Sahibi

Katılım
6 Haziran 2025
Mesajlar
68
Tepkime puanı
23
Puan
8
Web sitesi
darkmmo.tr
Discord
farques6
Resimleri ekte görebilmek için kayıtlı olmanız gerekmektedir

locale_tr > locale > tr > locale_game.txt açılır ve herhangi bir yere eklenir.
YAZI1 Birilerine birşeyler teslim etmek üzeresin. Bu işlem
YAZI2 geri alınamaz. Herşeyin doğru olduğuna, emin misin ?
root -> uiexchange.py açılır
def AcceptExchange(self):
kod satırı silinir veya değiştirilir ;
Python:
def AcceptExchange(self):
 import uiCommon
 questionDialog = uiCommon.TicONAY()
 questionDialog.SetText1(localeInfo.YAZI1)
 questionDialog.SetText1(localeInfo.YAZI2)
 questionDialog.SetAcceptEvent(ui.__mem_func__(self.Evet))
 questionDialog.SetCancelEvent(ui.__mem_func__(self.Hayir))
 questionDialog.Open()
 self.questionDialog = questionDialog

 def Evet(self):
 self.questionDialog.Close()
 net.SendExchangeAcceptPacket()
 self.AcceptButton.Disable()

 def Hayir(self):
 self.questionDialog.Close()
root -> uicommon.py açılır ve dosyanın en altına kodlar eklenir ;
Python:
class TicONAY(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/tic_onay.py")

 self.board = self.GetChild("board")
 self.textLine1 = self.GetChild("message1")
 self.textLine2 = self.GetChild("message2")
 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)
uiscript -> yeni py dosyası oluştur ( tic_onay.py )
aç ve içine yapıştır
Python:
import uiScriptLocale

window = {
 "name" : "QuestionDialog",
 "style" : ("movable", "float",),

 "x" : SCREEN_WIDTH/2 - 125,
 "y" : SCREEN_HEIGHT/2 - 52,

 "width" : 280,
 "height" : 130,

 "children" :
 (
 {
 "name" : "board",
 "type" : "board",

 "x" : 0,
 "y" : 0,

 "width" : 280,
 "height" : 130,

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

 "x" : -40,
 "y" : 93,

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

 "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",
 },
 ),
 },
 ),
}