Jump to content

Recommended Posts

Hello.

Is there a way to make the shop price when a user inputs a number more than 1999999999 in shop price, instantly the price to return to the max value ( in this case1999999999 ) 

If it is possible to happen with our uicommon   https://pastebin.com/d9Fveck4 and not the new official one.

Thanks 

Edited by dako12
Link to comment
https://metin2.dev/topic/24175-uicommon-like-official-price/
Share on other sites

32 minutes ago, WeedHex said:

Incomprehensible ?

Sorry if I am not understood, because at that time I was experimenting with it I thought it would be obvious but it isn't your are right :P
The uicommon i have uploaded in pastebin is from 40k client, so most likely it will not be the same with the 2020 one the official uses, I want to believe I 've became comprehensible haha, thanks for your time :)

This is from official and the second is from my files

vidc703319755621262.gifnooff.gif

Edited by Metin2 Dev
Core X - External 2 Internal
  • Premium
17 minutes ago, dako12 said:

Sorry if I am not understood, because at that time I was experimenting with it I thought it would be obvious but it isn't your are right :P

This is from official

vidc703319755621262.gif

Dude you told shop input.

"If a user insert a number bigger than MAX GOLD, in shop price input, instantly the price will be returned to the MAX GOLD value".

 

From your gif I understand you're speaking about inventory.

Is Offline shop? Show us the input functy.

---------------

 

game.py

def __DropMoney(self, attachedType, attachedMoney):

 

Edited by Metin2 Dev
Core X - External 2 Internal

@WeedHex

It is normal shop "shop input price dialog" and in the official files the above class in the official uicommon.py has changed defs but I can't seem to understand them so I can change my uicommon.py too.

class MoneyInputDialog(ui.ScriptWindow):


Here is the official uicommon.py if you want to compare the class with the 40k from my original post and maybe you can understand what needs to be changed.
(btw the official use some new variables in the last fuctions that I tend to believe are source sided so I cant use the official defs as they are.

https://pastebin.com/C7Y2qES9

the answer is in __OnValueUpdate function.

Just add a check for the money variable. If it's higher than GOLD_MAX then set it to GOLD_MAX.

In your case you've hardcoded the limit to 199999999. This should do the trick. But note, it's untested:

 



	    def __OnValueUpdate(self):

	        ui.EditLine.OnIMEUpdate(self.inputValue)



	        text = self.inputValue.GetText()



	        money = 0

	        if text and text.isdigit():

	            try:

	                money = int(text)

	            except ValueError:

	                money = 199999999

	        if money >= 199999999:

	            money = 199999999



	        self.moneyText.SetText(self.moneyHeaderText + localeInfo.NumberToMoneyString(money))
Edited by Vanilla
  • Love 2

We are the tortured.
We're not your friends.
As long as we're not visible.
We are unfixable.

@Vanilla Thanks it did the trick for me ❤️ As it seems to have fixed the price visually when you click accept it sets the price typed (9.999.999.999)
Visually------------------->Works
(9.999.999.999) --->(1.999.999.999)
Actually-----------> Not working
(9.999.999.999) --->(9.999.999.999)

I tried it but I used somehow like this and I messed up :P also after the above did not work I tried messing with other fuctions before this and as a result I understood them and used some of them, but I couldn't figure this out, one time some ident error, then syntax error so I asked for your help guys.

 

Spoiler

	    def __OnValueUpdate(self):

	        ui.EditLine.OnIMEUpdate(self.inputValue)



	        text = self.inputValue.GetText()



	        money = 0

	        if text and text.isdigit() and money < 199999999:

	            try:

	                money = int(text)
         if money >= 199999999:

	            except ValueError:

	                money = 1999999999



	        self.moneyText.SetText(self.moneyHeaderText + localeInfo.NumberToMoneyString(money))

 

Edited by dako12
Added stuff about the fact that is not entirelly completed.

yeah, my bad. You'd correct the value in inputbox.

 

self.inputValue.SetText(str(money))

 

It'd look like this:

	def __OnValueUpdate(self):
		ui.EditLine.OnIMEUpdate(self.inputValue)

		text = self.inputValue.GetText()

		money = 0
		if text and text.isdigit():
			try:
				money = int(text)
			except ValueError:
				money = 199999999
		if money >= 199999999:
			money = 199999999
			self.inputValue.SetText(str(money))

		self.moneyText.SetText(self.moneyHeaderText + localeInfo.NumberToMoneyString(money))

 

 

Edited by Vanilla
  • Love 1

We are the tortured.
We're not your friends.
As long as we're not visible.
We are unfixable.

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.