Looks reasonable to me. Yes, you'll get the "different assets" warning unless both the Pitboss host and you put that in place. So I'm not sure how to test it without disrupting the live game.
As for the scoreboard itself, that's really simple. In CvMainInterface.py, change the line "iBtnHeight = 22" to a smaller number. Here's what it looks like at 14.
I'll let Krill or whoever handle the editing and packaging and distribution of that change.
I'm still thinking about the ranking. Give me a few hours and then we can decide when we pull the trigger on these changes.
I have finally decided to put down some cash and register a website. It is www.ruffhi.com. Now I remain free to move the hosting options without having to change the name of the site.
(October 22nd, 2014, 10:52)Caledorn Wrote: And ruff is officially banned from playing in my games as a reward for ruining my big surprise by posting silly and correct theories in the PB18 tech thread.
If people think it's worth the hassle to have everybody update for these changes, I would also like to add a dll fix (just one line of code changed) which makes a player's score changes get logged immediately instead of when he logs out.
As much as I think I'd like these fixes, is this something that will create a problem if even one person doesn't update? We've finally got things moving, and if there's a chance we'd cause a train wreck, I would be hesitant to do so.
def getRank(self, aiGroup):
aiGroup.sort()
aiGroup.reverse()
iRank = 1
for (iLoopValue, iLoopPlayer) in aiGroup:
if iLoopPlayer == self.iActivePlayer:
return iRank
iRank += 1
return 0
It is a bit of a mess as it doesn't really return the rank. If everyone has the same value, it returns where you are in the array (ie everyone gets a different number) instead of everyone being #1.
iRequiredValue = 0
for (iLoopValue, iLoopPlayer) in aiGroup:
if iLoopPlayer == self.iActivePlayer:
iRequiredValue = iLoopValue
break #'exit for loop'
return 0 <-- this line needs to be removed (thx for the code review Novice)
iRank = 1
for (iLoopValue, iLoopPlayer) in aiGroup:
if iLoopValue == iRequiredValue:
return iRank
iRank += 1
return 0
... that way everyone gets their values rank and not where they ended up in the sorted array. Only really a change when players have the same value.
Re the lurker civ, I think the right change is that their value in the aiGroup collective is set to zero. They will get the bottom rank each and every time .
I have finally decided to put down some cash and register a website. It is www.ruffhi.com. Now I remain free to move the hosting options without having to change the name of the site.
(October 22nd, 2014, 10:52)Caledorn Wrote: And ruff is officially banned from playing in my games as a reward for ruining my big surprise by posting silly and correct theories in the PB18 tech thread.
(March 23rd, 2014, 15:49)novice Wrote: Ruff: Your code has everybody get a rank of 0.
Edit: That said, if you remove the first "return 0" your code looks good.
Doh. This is why you shouldn't cut and paste code. It is also illustrates that you should have others look over your code (or even run some tests).
Here is the final file, again with the compare back to the base file. I've tested it in a SP game and it works fine (assuming the lurker civ is #16).
I have finally decided to put down some cash and register a website. It is www.ruffhi.com. Now I remain free to move the hosting options without having to change the name of the site.
(October 22nd, 2014, 10:52)Caledorn Wrote: And ruff is officially banned from playing in my games as a reward for ruining my big surprise by posting silly and correct theories in the PB18 tech thread.