|
You last visited: Today at 15:55
Advertisement
[RELEASE]Item zerstören Dialog mit erneuter Abfrage
Discussion on [RELEASE]Item zerstören Dialog mit erneuter Abfrage within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.
11/23/2016, 21:39
|
#1
|
elite*gold: 0
Join Date: Jun 2011
Posts: 3,364
Received Thanks: 1,743
|
[RELEASE]Item zerstören Dialog mit erneuter Abfrage
Huhu,
Es geht um das Release von Mr. 'Avenue™
So wie dort releast wird das Item sofort nach dem klick auf "Zerstören" zerstört. Mit dieser "Erweiterung" oder nennen wir es Änderung hier wird nochmal gefragt, ob man das Item wirklich zerstören möchte..
An sich erstmal alles aus dem Release von Mr. 'Avenue™ so wie dort übernehmen. Die Änderungen sind wie folgt:
root/game.py
ORIGINAL:
Code:
def RequestDestroyItem(self, answer):
if not self.itemDropQuestionDialog:
return
if answer:
dropType = self.itemDropQuestionDialog.dropType
dropNumber = self.itemDropQuestionDialog.dropNumber
if player.SLOT_TYPE_INVENTORY == dropType:
if dropNumber == player.ITEM_MONEY:
return
else:
self.__SendDestroyItemPacket(dropNumber)
self.itemDropQuestionDialog.Close()
self.itemDropQuestionDialog = None
constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(0)
Wird mit folgendem ersetzt:
Code:
def RequestDestroyItem(self, answer):
if not self.itemDropQuestionDialog:
return
if answer:
dropType = self.itemDropQuestionDialog.dropType
dropCount = self.itemDropQuestionDialog.dropCount
dropNumber = self.itemDropQuestionDialog.dropNumber
self.itemDropQuestionDialog.Close()
self.itemDropQuestionDialog = None
questionText = "Bist du sicher?"
itemDestroyQuestionDialog = uiCommon.QuestionDialog()
itemDestroyQuestionDialog.SetText(questionText)
itemDestroyQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDestroyItemFinaly(arg))
itemDestroyQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDestroyItemFinaly(arg))
itemDestroyQuestionDialog.dropType = dropType
itemDestroyQuestionDialog.dropNumber = dropNumber
itemDestroyQuestionDialog.dropCount = dropCount
itemDestroyQuestionDialog.Open()
self.itemDestroyQuestionDialog = itemDestroyQuestionDialog
Zusätzlich wird eine neue Funktion unter die oben genannte Funktion hinzugefügt:
Code:
def RequestDestroyItemFinaly(self, answer):
if not self.itemDestroyQuestionDialog:
return
if answer:
dropType = self.itemDestroyQuestionDialog.dropType
dropNumber = self.itemDestroyQuestionDialog.dropNumber
if player.SLOT_TYPE_INVENTORY == dropType:
if dropNumber == player.ITEM_MONEY:
return
else:
self.__SendDestroyItemPacket(dropNumber)
self.itemDestroyQuestionDialog.Close()
self.itemDestroyQuestionDialog = None
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
Wer den Text ändern möchte kann dies unter
Code:
questionText = "Bist du sicher?"
machen.
MfG
|
|
|
11/24/2016, 22:49
|
#2
|
elite*gold: 0
Join Date: May 2016
Posts: 8,679
Received Thanks: 1,638
|
Kann man gut gebrauchen
Danke für den RLS
|
|
|
11/27/2016, 08:20
|
#3
|
elite*gold: 150
Join Date: Feb 2009
Posts: 643
Received Thanks: 613
|
Ich danke.
MfG
Cyber
|
|
|
11/27/2016, 18:18
|
#4
|
elite*gold: 0
Join Date: May 2012
Posts: 18
Received Thanks: 3
|
I can't click on yes or no at the confirmation dialog. Any soulution for that?
|
|
|
11/27/2016, 23:46
|
#5
|
Trade Restricted
elite*gold: 0
Join Date: Jun 2013
Posts: 1,332
Received Thanks: 534
|
Kann man echt gut gebrauchen danke dir sehr nett!
|
|
|
12/27/2016, 00:48
|
#6
|
elite*gold: 157
Join Date: May 2014
Posts: 504
Received Thanks: 603
|
Du hattest einen kleinen Fehler in deinem Code, der Teil muss ersetzt werden:
Code:
def RequestDestroyItemFinaly(self, answer):
if not self.itemDestroyQuestionDialog:
return
if answer:
dropType = self.itemDestroyQuestionDialog.dropType
dropNumber = self.itemDestroyQuestionDialog.dropNumber
if player.SLOT_TYPE_INVENTORY == dropType:
if dropNumber == player.ITEM_MONEY:
return
else:
self.__SendDestroyItemPacket(dropNumber)
self.itemDestroyQuestionDialog.Close()
self.itemDestroyQuestionDialog = None
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
]
durch:
Code:
def RequestDestroyItemFinaly(self, answer):
if not self.itemDestroyQuestionDialog:
return
if answer:
dropType = self.itemDestroyQuestionDialog.dropType
dropNumber = self.itemDestroyQuestionDialog.dropNumber
if player.SLOT_TYPE_INVENTORY == dropType:
if dropNumber == player.ITEM_MONEY:
return
else:
self.__SendDestroyItemPacket(dropNumber)
self.itemDestroyQuestionDialog.Close()
self.itemDestroyQuestionDialog = None
constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(0)
]
ersetzen.
|
|
|
12/27/2016, 18:25
|
#7
|
elite*gold: 0
Join Date: Jun 2013
Posts: 196
Received Thanks: 50
|
This is from Legend:
locale_game.py
Code:
HOW_MANY_ITEM_DO_YOU_DESTROY1 Do you want to destroy that item %s;
HOW_MANY_ITEM_DO_YOU_DESTROY2 Do you want to destroy %s %d;
localeinfo.py
Code:
def HOW_MANY_ITEM_DO_YOU_DESTROY(dropItemName, dropItemCount) :
if dropItemCount > 1 :
return HOW_MANY_ITEM_DO_YOU_DESTROY2 % (dropItemName, dropItemCount)
else :
return HOW_MANY_ITEM_DO_YOU_DESTROY1 % (dropItemName)
game.py
Code:
def RequestDestroyItemConfirm(self, answer):
if not self.itemDropQuestionDialog:
return
if answer:
dropType = self.itemDropQuestionDialog.dropType
dropCount = self.itemDropQuestionDialog.dropCount
dropNumber = self.itemDropQuestionDialog.dropNumber
self.itemDropQuestionDialog.Close()
self.itemDropQuestionDialog = None
dropItemIndex = player.GetItemIndex(dropNumber)
item.SelectItem(dropItemIndex)
dropItemName = item.GetItemName()
## Question Text
questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DESTROY(dropItemName, dropCount)
## Dialog
itemDestroyQuestionDialog = uiCommon.QuestionDialog()
itemDestroyQuestionDialog.SetText(questionText)
itemDestroyQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDestroyItem(arg))
itemDestroyQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDestroyItem(arg))
itemDestroyQuestionDialog.dropType = dropType
itemDestroyQuestionDialog.dropNumber = dropNumber
itemDestroyQuestionDialog.dropCount = dropCount
itemDestroyQuestionDialog.Open()
self.itemDestroyQuestionDialog = itemDestroyQuestionDialog
def RequestDestroyItem(self, answer):
if not self.itemDestroyQuestionDialog:
return
if answer:
dropType = self.itemDestroyQuestionDialog.dropType
dropNumber = self.itemDestroyQuestionDialog.dropNumber
if player.SLOT_TYPE_INVENTORY == dropType:
if dropNumber == player.ITEM_MONEY:
return
else:
self.__SendDestroyItemPacket(dropNumber)
self.itemDestroyQuestionDialog.Close()
self.itemDestroyQuestionDialog = None
constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(0)
|
|
|
12/27/2016, 21:01
|
#8
|
elite*gold: 0
Join Date: Jun 2011
Posts: 3,364
Received Thanks: 1,743
|
Quote:
Originally Posted by EULOG1SON
This is from Legend:
locale_game.py
Code:
HOW_MANY_ITEM_DO_YOU_DESTROY1 Do you want to destroy that item %s;
HOW_MANY_ITEM_DO_YOU_DESTROY2 Do you want to destroy %s %d;
localeinfo.py
Code:
def HOW_MANY_ITEM_DO_YOU_DESTROY(dropItemName, dropItemCount) :
if dropItemCount > 1 :
return HOW_MANY_ITEM_DO_YOU_DESTROY2 % (dropItemName, dropItemCount)
else :
return HOW_MANY_ITEM_DO_YOU_DESTROY1 % (dropItemName)
game.py
Code:
def RequestDestroyItemConfirm(self, answer):
if not self.itemDropQuestionDialog:
return
if answer:
dropType = self.itemDropQuestionDialog.dropType
dropCount = self.itemDropQuestionDialog.dropCount
dropNumber = self.itemDropQuestionDialog.dropNumber
self.itemDropQuestionDialog.Close()
self.itemDropQuestionDialog = None
dropItemIndex = player.GetItemIndex(dropNumber)
item.SelectItem(dropItemIndex)
dropItemName = item.GetItemName()
## Question Text
questionText = localeInfo.HOW_MANY_ITEM_DO_YOU_DESTROY(dropItemName, dropCount)
## Dialog
itemDestroyQuestionDialog = uiCommon.QuestionDialog()
itemDestroyQuestionDialog.SetText(questionText)
itemDestroyQuestionDialog.SetAcceptEvent(lambda arg=True: self.RequestDestroyItem(arg))
itemDestroyQuestionDialog.SetCancelEvent(lambda arg=False: self.RequestDestroyItem(arg))
itemDestroyQuestionDialog.dropType = dropType
itemDestroyQuestionDialog.dropNumber = dropNumber
itemDestroyQuestionDialog.dropCount = dropCount
itemDestroyQuestionDialog.Open()
self.itemDestroyQuestionDialog = itemDestroyQuestionDialog
def RequestDestroyItem(self, answer):
if not self.itemDestroyQuestionDialog:
return
if answer:
dropType = self.itemDestroyQuestionDialog.dropType
dropNumber = self.itemDestroyQuestionDialog.dropNumber
if player.SLOT_TYPE_INVENTORY == dropType:
if dropNumber == player.ITEM_MONEY:
return
else:
self.__SendDestroyItemPacket(dropNumber)
self.itemDestroyQuestionDialog.Close()
self.itemDestroyQuestionDialog = None
constInfo.SET_ITEM_DROP_QUESTION_DIALOG_STATUS(0)
|
Same result ..
|
|
|
12/27/2016, 21:30
|
#9
|
elite*gold: 0
Join Date: Jun 2013
Posts: 196
Received Thanks: 50
|
This is how should be.
|
|
|
12/27/2016, 21:32
|
#10
|
elite*gold: 0
Join Date: Sep 2013
Posts: 1,527
Received Thanks: 233
|
Sehr nett von dir ! danke!
|
|
|
01/06/2017, 11:03
|
#11
|
elite*gold: 434
Join Date: May 2013
Posts: 6,912
Received Thanks: 1,065
|
Sehr nett, danke für den Release!
|
|
|
03/30/2017, 22:22
|
#12
|
elite*gold: 0
Join Date: Dec 2016
Posts: 29
Received Thanks: 6
|
Nett nett aber nach dem Wegwerfen kann man kein item mehr anklicken
|
|
|
03/31/2017, 19:26
|
#13
|
elite*gold: 0
Join Date: Jun 2011
Posts: 3,364
Received Thanks: 1,743
|
Quote:
Originally Posted by Titan_Phantom
Nett nett aber nach dem Wegwerfen kann man kein item mehr anklicken
|
Dann hast du irgendwas falsch gemacht. Bei mir geht alles wunderbar.
|
|
|
03/31/2017, 20:10
|
#14
|
elite*gold: 0
Join Date: Dec 2016
Posts: 29
Received Thanks: 6
|
Ich hab es mehrmal gecheckt und ist auch richtig drin...
Kann durch Änderung der Kodierung so ein fehler kommen?
|
|
|
04/01/2017, 02:43
|
#15
|
elite*gold: 0
Join Date: Jun 2011
Posts: 3,364
Received Thanks: 1,743
|
Poste mal bitte die Syserr ausm Client nachdem du ein Item zerstört hast und ein andere anklicken willst was ja bei dir aktuell buggt..
|
|
|
|
|
Similar Threads
|
[RELEASE] Item zerstören 'neuer Dropdialog' (Python, C++)
04/04/2019 - Metin2 PServer Guides & Strategies - 24 Replies
Screenshot
http://puu.sh/kTlIn/ca41d0cbf2.jpg
Serverside - C++
packet.h: sucht nach HEADER_CG_ITEM_DROP2 = 20, & fügt darunter HEADER_CG_ITEM_DESTROY = 21, ein.
packet.h: sucht nach typedef struct command_item_drop2
{
} TPacketCGItemDrop2; & fügt darunter typedef struct command_item_destroy
|
[Python-Release] Inventory Bonus Dialog
04/26/2015 - Metin2 PServer Guides & Strategies - 91 Replies
Hey e*pvper's!
I saw like this window on a pic on this forum, and I wrote it for all.
So I make pub is my which I wrote 3-4 or 5 hrs and I translate to english and german languages.
I think not needed too big instruction for the usage, only put the files their correct places and perfect.
uiinventory.py --> root files
inventorywindow.py --> locale/** files (locale/**/ui/)
+ My little portable/injectable version, but that a new window, not inventory.
|
Warp Quest item abfrage
04/07/2013 - Metin2 Private Server - 7 Replies
Hey,
such eine Warp quest :
map XY
ab level XY
ITEM :XY
|
[Release!]NPC Dialog Creator!
07/30/2011 - CO2 PServer Guides & Releases - 11 Replies
NPC Creator
Credits:
xBlackPlaug3x For the Console Code ( I had permission to use the code and release after I got finished.)
drakejoe67 For help when needed
Me(FatalAddiction/xTwiztedKidx) Making GUI and what not.
Do NOT post this on any other forum without my permission.
The source coding will not be given at this time.
Pictures Below. (Click Spoiler.)
|
All times are GMT +1. The time now is 15:55.
|
|