コード例 #1
0
    def createExitingRegionLabels(self):
        # Label should be "To" + entranceTo.
        # Box should be leads to region
        if self.isSpawn or self.isOwl:
            exitLabelText = self.entranceFrom
        elif self.isWarpSong:
            warpSong = self.entranceFrom.split()
            warpSong = ' '.join(warpSong[:3])
            exitLabelText = warpSong
        else:
            exitLabelText = 'To ' + self.entranceTo

        exitLabel = QLabel(exitLabelText)
        exitLabel.setMinimumHeight(32)
        font = getFont('label')
        exitLabel.setFont(font)

        if self.isInterior:
            exitBoxText = self.leadsToRegion
        else:
            exitBoxText = self.leadsFromRegion + ' -> ' + self.leadsToRegion

        exitBox = QLineEdit()
        exitBox.setReadOnly(True)
        exitBox.setFixedHeight(32)
        font = getFont('box')
        exitBox.setText(exitBoxText)
        exitBox.setFont(font)

        return exitLabel, exitBox
コード例 #2
0
 def createItemLabel(self):
     itemLabel = QLabel()
     itemLabel.setMinimumHeight(32)
     if self.image is not None and os.path.isfile("./assets/" + self.image):
         pixmap = QPixmap("./assets/" + self.image)
         pixmap.scaled(itemLabel.size(), Qt.KeepAspectRatio)
         itemLabel.setPixmap(pixmap)
     else:
         itemLabel.setText(self.name)
         itemLabel.setFixedHeight(32)
         font = getFont('label')
         itemLabel.setFont(font)
     return itemLabel
コード例 #3
0
    def createItemBox(self):
        item = self.item
        price = self.price

        itemBox = QLineEdit()
        itemBox.setReadOnly(True)
        itemBox.setFixedHeight(32)
        font = getFont('box')
        if "Buy" in item.name:
            font = getFont('italic')
            itemBox.setStyleSheet("background-color: #ADADAD;")
        elif price > 500:
            itemBox.setStyleSheet("background-color: #FFADFF;")
        elif price > 200:
            itemBox.setStyleSheet("background-color: #FFADAD;")
        elif price > 99:
            itemBox.setStyleSheet("background-color: #ADADFF;")
        else:
            itemBox.setStyleSheet("background-color: #ADFFAD;")
        itemBox.setText('[' + str(price) + '] ' + item.name)
        itemBox.setFont(font)
        return itemBox
コード例 #4
0
    def createEnteringRegionLabels(self):
        # Label should be "From" + leads from region. If interior, then label should be leadsTo
        # Box should be entrance text
        dungeons = {
            'Deku Tree Lobby': 'Deku Tree',
            'Dodongos Cavern Beginning': 'Dodongo\'s Cavern',
            'Jabu Jabus Belly Beginning': 'Jabu\'s Jabu Belly',
            'Forest Temple Lobby': 'Forest Temple',
            'Fire Temple Lower': 'Fire Temple',
            'Water Temple Lobby': 'Water Temple',
            'Shadow Temple Entryway': 'Shadow Temple',
            'Spirit Temple Lobby': 'Spirit Temple',
            'Ice Cavern Beginning': 'Ice Cavern',
            'Bottom of the Well': 'Bottom of the Well',
            'Gerudo Training Grounds Lobby': 'Gerudo Training Grounds'
        }

        if self.leadsToRegion in dungeons:
            entranceText = dungeons[self.leadsToRegion]
        elif self.isInterior:
            entranceText = self.leadsToRegion
        else:
            entranceText = 'From ' + self.leadsFromRegion

        entranceLabel = QLabel(entranceText)
        entranceLabel.setMinimumHeight(32)
        font = getFont('label')
        entranceLabel.setFont(font)

        entranceBox = QLineEdit()
        entranceBox.setReadOnly(True)
        entranceBox.setFixedHeight(32)
        font = getFont('box')
        entranceBox.setText(self.entrance)
        entranceBox.setFont(font)

        return entranceLabel, entranceBox
コード例 #5
0
    def createLocationBox(self):
        locationBox = QLineEdit()
        locationBox.setReadOnly(True)
        locationBox.setFixedHeight(32)
        locationBox.setStyleSheet(self.color)
        font = getFont('box')
        if self.isWOTH:
            font.setBold(True)
        locationBox.setFont(font)

        if self.display is None:
            self.setDisplay()

        locationBox.setText(self.display)

        return locationBox
コード例 #6
0
    def createRegionBox(self):
        regionBox = QLineEdit()
        regionBox.setReadOnly(True)
        regionBox.setFixedHeight(32)
        font = getFont('box')
        regionBox.setFont(font)

        displayText = self.name
        if self.dungeonType is not None:
            if self.dungeonType == 'Major':
                if self.isMQ:
                    displayText = '[MQ] ' + displayText
            elif self.dungeonType == 'Minor':
                if self.isMQ:
                    displayText = 'Master Quest'
                else:
                    displayText = 'Vanilla'

        regionBox.setText(displayText)

        return regionBox
コード例 #7
0
 def createHeaderLabel(text):
     label = QLabel(text)
     label.setFont(getFont('header'))
     label.setAlignment(Qt.AlignCenter)
     return label
コード例 #8
0
    def createTopMatter(self):
        topMatterLayout = QHBoxLayout()

        # Create Version Display
        versionLayout = QFormLayout()
        versionLabel = self.createHeaderLabel('Version')
        version = self.spoilerData.version
        versionBox = QLineEdit()
        versionBox.setReadOnly(True)
        versionBox.setFixedHeight(32)
        versionBox.setFont(getFont('box'))
        versionBox.setText(version)
        versionLayout.addRow(versionLabel, versionBox)
        versionWidget = QWidget()
        versionWidget.setFixedWidth(500)
        versionWidget.setLayout(versionLayout)

        # Create Settings String
        settingsLayout = QFormLayout()
        settingsLabel = self.createHeaderLabel('Setting String')
        settingString = self.spoilerData.settingsString
        settingsBox = QLineEdit()
        settingsBox.setReadOnly(True)
        settingsBox.setFixedHeight(32)
        settingsBox.setFont(getFont('box'))
        settingsBox.setText(settingString)
        settingsLayout.addRow(settingsLabel, settingsBox)
        settingsWidget = QWidget()
        settingsWidget.setLayout(settingsLayout)

        # Create Seed Hash display
        hashOptions = {
            'Deku Stick': 'Deku Stick',
            'Deku Nut': 'Deku Nut',
            'Bombchu': 'Bombchus',
            'Longshot': 'Longshot',
            'Beans': 'Magic Bean Pack',
            'Bottled Fish': 'Bottle with Fish',
            'Bottled Milk': 'Bottle with Milk',
            'Cucco': 'Pocket Cucco',
            'Mushroom': 'Odd Mushroom',
            'Saw': 'Poachers Saw',
            'Frog': 'Eyeball Frog',
            'Skull Token': 'Gold Skulltula Token'
        }

        hashLayout = QHBoxLayout()
        seedHash = self.spoilerData.hash
        hashLabel = self.createHeaderLabel('Hash: ')
        hashLayout.addWidget(hashLabel)
        for icon in seedHash:
            if icon in self.spoilerData.items:
                item = icon
            else:
                item = hashOptions[icon]
            iconLabel = self.spoilerData.items[item].createItemLabel()
            hashLayout.addWidget(iconLabel)
        hashWidget = QWidget()
        hashWidget.setLayout(hashLayout)
        hashWidget.setFixedWidth(275)

        topMatterLayout.addWidget(versionWidget)
        topMatterLayout.addWidget(settingsWidget)
        topMatterLayout.addWidget(hashWidget)

        self.generalLayout.addLayout(topMatterLayout)