コード例 #1
0
    def setLocalAvatarHand(self, cardValues):
        map(lambda card: card.hide(), self.localStatusPanel.hand)
        self.localStatusPanel.cardScaler.setScale(0.5)
        for card, newValue in zip(self.localStatusPanel.hand, cardValues):
            card.show()
            card.setValue(newValue)
            if newValue != PlayingCardGlobals.Unknown:
                card.turnUp()

        handNameLabel = self.localStatusPanel.handNameLabel
        communityCardValues = map(lambda card: card.getValue(),
                                  self.communityCards)
        if cardValues:
            if PlayingCardGlobals.Unknown not in cardValues and (
                    self.handId == PlayingCardGlobals.Nothing
                    or self.sortedCards == None):
                handNameLabel.hide()
            else:
                handName = PLocalizer.getHandNameFull(
                    self.table.handIdToHandCode(self.handId), self.sortedCards)
                handNameLabel['text'] = handName
                handNameLabel.show()
        else:
            handNameLabel.hide()
        return
コード例 #2
0
 def setLocalAvatarHand(self, cardValues):
     map(lambda card: card.hide(), self.localStatusPanel.hand)
     self.localStatusPanel.cardScaler.setScale(0.5)
     for (card, newValue) in zip(self.localStatusPanel.hand, cardValues):
         card.show()
         card.setValue(newValue)
         if newValue != PlayingCardGlobals.Unknown:
             card.turnUp()
             continue
     
     handNameLabel = self.localStatusPanel.handNameLabel
     communityCardValues = map(lambda card: card.getValue(), self.communityCards)
     if cardValues and PlayingCardGlobals.Unknown not in cardValues:
         if self.handId == PlayingCardGlobals.Nothing or self.sortedCards == None:
             handNameLabel.hide()
         else:
             handName = PLocalizer.getHandNameFull(self.table.handIdToHandCode(self.handId), self.sortedCards)
             handNameLabel['text'] = handName
             handNameLabel.show()
     else:
         handNameLabel.hide()
コード例 #3
0
    def setTableState(self, round, buttonSeat, communityCardValues,
                      playerHandValues, totalWinningsArray):
        self.clearTable()
        self.playerStatusPanels[self.getGuiIndex(buttonSeat)].anteLabel.show()
        self.playerStatusPanels[self.getGuiIndex(
            buttonSeat)].dealerButton.show()
        for i in range(len(self.communityCards)):
            card = self.communityCards[i]
            if i < len(communityCardValues):
                newValue = communityCardValues[i]
                card.show()
                card.setValue(newValue)
                if newValue != PlayingCardGlobals.Unknown:
                    card.turnUp()
            else:
                card.hide()
                card.setValue(PlayingCardGlobals.Unknown)

        for i in range(len(playerHandValues)):
            newHand = playerHandValues[i]
            guiIndex = self.getGuiIndex(i)
            panel = self.playerStatusPanels[guiIndex]
            hand = panel.hand
            handNameLabel = panel.handNameLabel
            allUnknown = 1
            for card, newValue in zip(hand, newHand):
                card.show()
                card.setValue(newValue)
                if newValue == PlayingCardGlobals.Unknown:
                    card.turnDown()
                else:
                    allUnknown = 0
                    card.turnUp()

            if allUnknown:
                panel.cardScaler.setScale(0.4)
            else:
                panel.cardScaler.setScale(0.5)
            if newHand:
                if PlayingCardGlobals.Unknown not in newHand:
                    if self.table.handIdArray:
                        seat = i
                        handId = self.table.handIdArray[seat]
                        sortedHand = handId > PlayingCardGlobals.Nothing and self.table.sortedCardsArray[
                            seat]
                        handName = PLocalizer.getHandNameFull(
                            self.table.handIdToHandCode(handId), sortedHand)
                        handNameLabel['text'] = handName
                        handNameLabel.show()

        end = False
        length = len(totalWinningsArray)
        for i in range(length):
            if totalWinningsArray[i] != 0:
                end = True
                break

        if (end and self).table.endOfHand:
            for i in range(length):
                if totalWinningsArray[i] > 0:
                    actor = self.table.actors[i]
                    if actor:
                        name = actor.getName()
                        win = totalWinningsArray[i]
                        message = PLocalizer.PokerChatWinGoldMessage % (name,
                                                                        win)
                        base.talkAssistant.receiveGameMessage(message)
                if totalWinningsArray[
                        i] == PlayingCardGlobals.PlayerCaughtCheating:
                    actor = self.table.actors[i]
                    if actor:
                        name = actor.getName()
                        message = PLocalizer.PokerChatCaughtCheatingMessage % name
                        base.talkAssistant.receiveGameMessage(message)
コード例 #4
0
 def setTableState(self, round, buttonSeat, communityCardValues, playerHandValues, totalWinningsArray):
     self.clearTable()
     self.playerStatusPanels[self.getGuiIndex(buttonSeat)].anteLabel.show()
     self.playerStatusPanels[self.getGuiIndex(buttonSeat)].dealerButton.show()
     for i in range(len(self.communityCards)):
         card = self.communityCards[i]
         if i < len(communityCardValues):
             newValue = communityCardValues[i]
             card.show()
             card.setValue(newValue)
             if newValue != PlayingCardGlobals.Unknown:
                 card.turnUp()
             
         newValue != PlayingCardGlobals.Unknown
         card.hide()
         card.setValue(PlayingCardGlobals.Unknown)
     
     for i in range(len(playerHandValues)):
         newHand = playerHandValues[i]
         guiIndex = self.getGuiIndex(i)
         panel = self.playerStatusPanels[guiIndex]
         hand = panel.hand
         handNameLabel = panel.handNameLabel
         allUnknown = 1
         for (card, newValue) in zip(hand, newHand):
             card.show()
             card.setValue(newValue)
             if newValue == PlayingCardGlobals.Unknown:
                 card.turnDown()
                 continue
             allUnknown = 0
             card.turnUp()
         
         if allUnknown:
             panel.cardScaler.setScale(0.40000000000000002)
         else:
             panel.cardScaler.setScale(0.5)
         if newHand and PlayingCardGlobals.Unknown not in newHand:
             if self.table.handIdArray:
                 seat = i
                 handId = self.table.handIdArray[seat]
                 if handId > PlayingCardGlobals.Nothing:
                     sortedHand = self.table.sortedCardsArray[seat]
                     handName = PLocalizer.getHandNameFull(self.table.handIdToHandCode(handId), sortedHand)
                     handNameLabel['text'] = handName
                     handNameLabel.show()
                 
             
     
     end = False
     length = len(totalWinningsArray)
     for i in range(length):
         if totalWinningsArray[i] != 0:
             end = True
             break
             continue
     
     if end and self.table.endOfHand:
         for i in range(length):
             if totalWinningsArray[i] > 0:
                 actor = self.table.actors[i]
                 if actor:
                     name = actor.getName()
                     win = totalWinningsArray[i]
                     message = PLocalizer.PokerChatWinGoldMessage % (name, win)
                     base.talkAssistant.receiveGameMessage(message)
                 
             
             if totalWinningsArray[i] == PlayingCardGlobals.PlayerCaughtCheating:
                 actor = self.table.actors[i]
                 if actor:
                     name = actor.getName()
                     message = PLocalizer.PokerChatCaughtCheatingMessage % name
                     base.talkAssistant.receiveGameMessage(message)