Jump to content
Forgot your email address? ×
×
×
  • Create New...

Loading Gauge Improvement


Recommended Posts

  • Honorable Member

M2 Download Center

Hidden Content

    Give reaction to this post to see the hidden content.
( Internal )

Hidden Content

    Give reaction to this post to see the hidden content.
( GitHub )

Before:

 

250034giphy.gif

After:

250034giphy-1-.gif

  • Metin2 Dev 6
  • Love 27
  • Good 5

I will be offline for an indefinite period.

Never forget that I love this community❤️

Link to comment
  • Moderator

First one, thanks for release and good idea, here are some advices for the next time, how you should use zip method and lambda instead of __mem__func__ and others empty functions.

  • Since the loadStepList is declared with ascending numbers from 0 to 100 (by default), we don't have to use min and max method for get the values for range, just the first value and the last value from list.
  • __mem_func__ and the function 'bos' are useless in that case, we can replace it with a null lambda, will do the same job too.
  • Using an list comprehension with conditions inside, isn't so readable.

Good idea for zip method to get all the progresses values, but we don't need to initialize like that, you can acces the first reference by using index [0] from iterator.

Spoiler
# checkin, _ = zip(*self.loadStepList)

lst = [[1, None], [2, None]]
first, second = zip(*lst)
print (first, second)
>>> (1, 2) (None, None)

lst = [[1, None], [2, None]]
first = tuple(zip(*lst))[0]
print (first)
>>> (1, 2)

# I would use a bitwise and set method to get the missing values without doing a check for progress value.
print (list(set([0, 2]) ^ set([0, 1, 2, 3, 4, 5])))
>>> [1, 3, 4, 5]

 

On 5/25/2019 at 12:03 AM, Mali61 said:
def bos(self):
	pass

checkin, _ = zip(*self.loadStepList)
self.loadStepList = sorted(self.loadStepList+[(i, ui.__mem_func__(self.bos)) for i in range(min(checkin), max(checkin)+1) if i not in checkin])

Should look like

Hidden Content

    Give reaction to this post to see the hidden content.
:

Hidden Content

    Give reaction to this post to see the hidden content.

  • Metin2 Dev 3
  • Love 17
  • Good 1
  • Sad 1
Link to comment
  • Honorable Member

Thanks for your support :) I'm not a python developer like you. I will edit topic in a short time.

Edit:Updated

  • Love 2

I will be offline for an indefinite period.

Never forget that I love this community❤️

Link to comment

Thanks a lot! cool stuff but i have expanded loading bar which is barely larger it loads just to 70% of gauge then it enters the game. Since im new to python i do not know how to solve it. 

Could you guys help me please?

Link to comment
  • Honorable Member
18 minutes ago, flexivk123 said:

Thanks a lot! cool stuff but i have expanded loading bar which is barely larger it loads just to 70% of gauge then it enters the game. Since im new to python i do not know how to solve it. 

Could you guys help me please?

I think you are looking for:

Quote

self.loadingGage.SetPercentage(p, 160)

Change 160 for your gauge

  • Love 1

I will be offline for an indefinite period.

Never forget that I love this community❤️

Link to comment
  • 4 months later...
  • Moon

 @VegaS™ I got  some error with this improvement:

Spoiler
1001 20:48:17180 :: Traceback (most recent call last):

1001 20:48:17180 ::   File "introLoading.py", line 287, in OnUpdate

1001 20:48:17181 ::   File "introLoading.py", line 196, in __SetProgress

1001 20:48:17181 :: KeyError
1001 20:48:17181 :: : 
0929 11:34:15143 :: 1 (load progress number so in sysser it's showing key errors from 1 to 99)
0929 11:34:15143 :: 

 

 

Link to comment
  • Moderator

@ReFresh  You used a small extension which i did for you 3 years ago.

Spoiler

If somebody still have this problem, you need to check the key of the dictionary like:

Hidden Content

    Give reaction to this post to see the hidden content.

  • Love 12
Link to comment
  • 4 weeks later...
  • 3 weeks later...
  • Moderator
On 5/24/2019 at 11:49 PM, VegaS™ said:
tmpLoadStepList = tuple(zip(*self.loadStepList))[0]
for progress in range(tmpLoadStepList[0], tmpLoadStepList[-1] + 1):
	if progress not in tmpLoadStepList:
		self.loadStepList.append((progress, lambda: None))
	
self.loadStepList.sort()

 

There's a better version instead of what i did some time ago, which find the differences directly, without check each progress index.

Hidden Content

    Give reaction to this post to see the hidden content.

  • Metin2 Dev 3
  • Love 16
  • Good 1
Link to comment

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

Announcements

  • -15% Discount in Metin2 Dev Store (01/10/2021 => 31/12/2021) => Code => 15_PCT_OCT_TO_DEC_2021


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.