Jump to content
  • Register Now

    Sign up and take advantage of the features of our community! Some forums are only accessible to our members!

  • 0

Uicommon like official price


dako12

Question

9 answers to this question

Recommended Posts

  • 0
Posted (edited)
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 dako12 (see edit history)
Link to post
  • 0
  • VIP
Posted (edited)
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 WeedHex (see edit history)
Link to post
  • 0

@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

Link to post
  • 0

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 (see edit history)
  • Love 2

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

Link to post
  • 0
Posted (edited)

@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. (see edit history)
Link to post
  • 0

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 (see edit history)
  • Love 1

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

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing

    No registered users viewing this page.

  • Topics

  • Posts

    • image = ui.ExpandedImageBox() image.SetParent(self) image.LoadImage(...) image.Show() image.SAFE_SetStringEvent('MOUSE_OVER_IN', self.OnMouseOverIn) image.SAFE_SetStringEvent('MOUSE_OVER_OUT', self.OnMouseOverOut) You don't need new class for that.
    • Hy, I have a problem with the compile this system ! I have problem with this : [TABLES.H]   typedef struct SShopItemTable { DWORD vnum; BYTE count; TItemPos pos; // PC 상점에만 이용 long long price; // PC, shop_table_ex.txt 상점에만 이용 BYTE display_pos; // PC, shop_table_ex.txt 상점에만 이용, 보일 위치. long alSockets[ITEM_SOCKET_MAX_NUM]; TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_MAX_NUM]; DWORD price_type = 1;
    • There are no ui.py files in the release. I already changed the characterwindow.py as you can see in the screen, I just need the new imagebox class so that i can show a tooltip when i hover above the image. The picture is already from my client Learn how to read
×
×
  • 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.