Forged Alliance Forever Forged Alliance Forever Forums 2012-08-24T23:06:42+02:00 /feed.php?f=42&t=1756 2012-08-23T11:27:55+02:00 2012-08-23T11:27:55+02:00 /viewtopic.php?t=1756&p=18546#p18546 <![CDATA[Re: lobby code suggestion about avatars]]>
First thing to do is to implement :

- A function that request all the avatars for the users (like the admin function)
- A windows that display it all and send back to the server the infos.

And lot of work server-side.

If something copy the admin function for the user, but with a nicer interface, I can make the apprioriate function.
But now that the lobby is open sourced, someone must do all the lobby work, I don't have time for this.

Statistics: Posted by Ze_PilOt — 23 Aug 2012, 11:27


]]>
2012-08-23T11:23:52+02:00 2012-08-23T11:23:52+02:00 /viewtopic.php?t=1756&p=18545#p18545 <![CDATA[Re: lobby code suggestion about avatars]]>
i don't know where, but there must be a function checking if the player who's logging in is in the top 3 of his division/league, so adding another if-then which will decide whether to send the ranked avatar shouldn't be a big problem

Statistics: Posted by Myxir — 23 Aug 2012, 11:23


]]>
2012-08-22T20:02:37+02:00 2012-08-22T20:02:37+02:00 /viewtopic.php?t=1756&p=18498#p18498 <![CDATA[Re: lobby code suggestion about avatars]]>
Also, your solution, if it was true, will only change the avatar for you (all the other will see whatever the server send first).

Statistics: Posted by Ze_PilOt — 22 Aug 2012, 20:02


]]>
2012-08-22T19:56:26+02:00 2012-08-22T19:56:26+02:00 /viewtopic.php?t=1756&p=18495#p18495 <![CDATA[Re: lobby code suggestion about avatars]]> Statistics: Posted by pip — 22 Aug 2012, 19:56


]]>
2012-08-24T23:06:42+02:00 2012-08-22T18:51:33+02:00 /viewtopic.php?t=1756&p=18491#p18491 <![CDATA[lobby code suggestion about avatars]]> uploaded a .py file in this post


i honestly have no idea where to post code suggestions so i just post it in general discussions, sadly i also don't know how to test my idea :/

since many people complain "i don't want a ranked avatar but keeping my own" and whatsoever, i've taken a look into the lobby code and have an idea:
(i've only looked into the code for few hours and i'm looking at python for the first time, so i'm not quite sure if it works like i imagine)


as it looks, this code decides if you have an avatar, and will use the ranked avatar if you got two

Code:
    def updateAvatar(self):
        self.avatarTip = self.avatar["tooltip"]
        url = self.avatar["url"]
        avatarPix = util.respix(url)
        if avatarPix :
            self.avatarItem.setIcon(QtGui.QIcon(avatarPix))           
            self.avatarItem.setToolTip(self.avatarTip)
        else :
           
            if util.addcurDownloadAvatar(url, self.name) :
               
                self.nam = QNetworkAccessManager()
                self.nam.finished.connect(self.lobby.finishDownloadAvatar)
                self.nam.get(QNetworkRequest(QtCore.QUrl(url)))           
                self.avatarItem.setToolTip(self.avatarTip)


so, adding an "avatar choice number" to each player which will decide which avatar will be loaded:

Code:
    def updateAvatar(self):
        self.avatarTip = self.avatar["tooltip"]
        url = self.avatar["url"]
        avatarPix = util.respix(url)
        if avatarPix :
            self.avatarItem.setIcon(QtGui.QIcon(avatarPix))           
            self.avatarItem.setToolTip(self.avatarTip)
        else :
           
            if util.addcurDownloadAvatar(url, self.name) :
                if [playeravatarnumber] == 1:
               
                self.nam = QNetworkAccessManager()
                self.nam.finished.connect(self.lobby.finishDownloadAvatar)
                self.nam.get(QNetworkRequest(QtCore.QUrl(url)))           
                self.avatarItem.setToolTip(self.avatarTip)



and players beeing able to decide their avatar:

Code:

        # Avatar settings
        if self.lobby.client.login != self.name:
            actionChangeAvatarNumber.setDisabled(1)

        # Actions for the Friend List
        actionAddFriend = QtGui.QAction("Add friend", menu)
        actionRemFriend = QtGui.QAction("Remove friend", menu)
       
        # Don't allow self to be added or removed from friends
        if self.lobby.client.login == self.name:
            actionAddFriend.setDisabled(1)
            actionRemFriend.setDisabled(1)
             
        # Enable / Disable actions according to friend status 
        if self.lobby.client.isFriend(self.name):
            actionAddFriend.setDisabled(1)
        else :
            actionRemFriend.setDisabled(1)


the thing left here would be to add an AvatarChoiceNumber for each player which will get saved (so the right avatar will be loaded after you relog) and very little coding to add a function which makes the AvatarChoiceNumber change between two values (like 0 and 1)

Statistics: Posted by Myxir — 22 Aug 2012, 18:51


]]>