Honorable Member Mali 41912 Posted May 24, 2019 Honorable Member Share Posted May 24, 2019 M2 Download Center This is the hidden content, please Sign In or Sign Up ( Internal ) This is the hidden content, please Sign In or Sign Up ( GitHub ) Before: After: 73 1 1 17 2 62 Link to comment Share on other sites More sharing options...
txtxtx 16 Posted May 24, 2019 Share Posted May 24, 2019 Good work. Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10280 Posted May 24, 2019 Forum Moderator Share Posted May 24, 2019 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 This is the hidden content, please Sign In or Sign Up : This is the hidden content, please Sign In or Sign Up 23 1 4 1 25 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Honorable Member Mali 41912 Posted May 24, 2019 Author Honorable Member Share Posted May 24, 2019 Thanks for your support I'm not a python developer like you. I will edit topic in a short time. Edit:Updated 2 Link to comment Share on other sites More sharing options...
flexivk123 0 Posted May 26, 2019 Share Posted May 26, 2019 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 Share on other sites More sharing options...
Honorable Member Mali 41912 Posted May 26, 2019 Author Honorable Member Share Posted May 26, 2019 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 1 Link to comment Share on other sites More sharing options...
flexivk123 0 Posted May 26, 2019 Share Posted May 26, 2019 1 hour ago, Mali61 said: I think you are looking for: Change 160 for your gauge thank you. Solved. Link to comment Share on other sites More sharing options...
Kori 170 Posted May 26, 2019 Share Posted May 26, 2019 I have add on my files thanks works great Link to comment Share on other sites More sharing options...
Active Member ReFresh 2340 Posted September 29, 2019 Active Member Share Posted September 29, 2019 @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 :: I'll be always helpful! Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10280 Posted October 1, 2019 Forum Moderator Share Posted October 1, 2019 @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: This is the hidden content, please Sign In or Sign Up 7 17 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Vincent Griffith 10 Posted October 28, 2019 Share Posted October 28, 2019 Good work! Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10280 Posted November 14, 2019 Forum Moderator Share Posted November 14, 2019 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. This is the hidden content, please Sign In or Sign Up 21 2 22 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
Chookez 72 Posted April 30, 2023 Share Posted April 30, 2023 Optimized version for best performance. tmpLoadStepList = [step[0] for step in self.loadStepList] missingSteps = set(range(tmpLoadStepList[0], tmpLoadStepList[-1] + 1)).difference(tmpLoadStepList) self.loadStepList += [(progress, lambda: None) for progress in missingSteps] self.loadStepList.sort() 1 Link to comment Share on other sites More sharing options...
Recommended Posts