Esempio n. 1
0
 def populate_list(self, listwidget, items):
     if items is None:
         items = self.items
     for item in items:
         list_item = QListWidgetItem(item.name)
         list_item.item = item
         listwidget.addItem(list_item)
Esempio n. 2
0
    def __init__(self, elder):
        super().__init__()
        self.elder = elder
        self.layout = QGridLayout(self)
        self.settings = elder.settings
        self.listener = elder.listener

        paths = QGroupBox(self)
        paths.setTitle('Paths')
        paths_layout = QGridLayout(paths)
        self.layout.addWidget(paths)

        label = QLabel(paths)
        label.setText('Fiddler')
        paths_layout.addWidget(label, 0, 0, 1, 1)

        self.fiddler_path = QLineEdit(paths)
        self.fiddler_path.setText(self.settings.paths['Fiddler'])
        self.fiddler_path.setDisabled(True)
        paths_layout.addWidget(self.fiddler_path, 0, 1, 1, 1)

        button = QPushButton(paths)
        button.setText('...')
        button.clicked.connect(lambda: self.set_path('fiddler'))
        paths_layout.addWidget(button, 0, 2, 1, 1)

        label = QLabel(paths)
        label.setText('TurboHUD')
        paths_layout.addWidget(label, 1, 0, 1, 1)

        self.turbohud_path = QLineEdit(paths)
        self.turbohud_path.setText(self.settings.paths['TurboHUD'])
        self.turbohud_path.setDisabled(True)
        paths_layout.addWidget(self.turbohud_path, 1, 1, 1, 1)

        button = QPushButton(paths)
        button.setText('...')
        button.clicked.connect(lambda: self.set_path('turbohud'))
        paths_layout.addWidget(button, 1, 2, 1, 1)

        label = QLabel(paths)
        label.setText('pHelper')
        paths_layout.addWidget(label, 2, 0, 1, 1)

        self.phelper_path = QLineEdit(paths)
        self.phelper_path.setText(self.settings.paths['pHelper'])
        self.phelper_path.setDisabled(True)
        paths_layout.addWidget(self.phelper_path, 2, 1, 1, 1)

        button = QPushButton(paths)
        button.setText('...')
        button.clicked.connect(lambda: self.set_path('phelper'))
        paths_layout.addWidget(button, 2, 2, 1, 1)

        image_recognition = QGroupBox(self)
        image_recognition.setTitle('Auto Stuff (Image Recognition)')
        image_recognition_layout = QGridLayout(image_recognition)
        self.layout.addWidget(image_recognition, 0, 1)

        checkbox = QCheckBox(image_recognition)
        checkbox.setText('Auto start Game')
        checkbox.setChecked(self.settings.special['auto_start'])
        checkbox.clicked.connect(lambda: self.checkbox_clicked('auto_start'))
        image_recognition_layout.addWidget(checkbox, 0, 0)

        checkbox = QCheckBox(image_recognition)
        checkbox.setText('Auto open Rift / Grift')
        checkbox.setChecked(self.settings.special['auto_open'])
        checkbox.clicked.connect(lambda: self.checkbox_clicked('auto_open'))
        image_recognition_layout.addWidget(checkbox, 1, 0)

        radio = QRadioButton(image_recognition)
        radio.setText('Rift')
        radio.setChecked(self.settings.special['auto_open_option'] == 'rift')
        radio.clicked.connect(lambda: self.radio_clicked('rift'))
        image_recognition_layout.addWidget(radio, 2, 0)

        radio = QRadioButton(image_recognition)
        radio.setText('Grift')
        radio.setChecked(self.settings.special['auto_open_option'] == 'grift')
        radio.clicked.connect(lambda: self.radio_clicked('grift'))
        image_recognition_layout.addWidget(radio, 2, 1)

        checkbox = QCheckBox(image_recognition)
        checkbox.setText('Auto accept Grift')
        checkbox.setChecked(self.settings.special['auto_accept_gr'])
        checkbox.clicked.connect(
            lambda: self.checkbox_clicked('auto_accept_gr'))
        image_recognition_layout.addWidget(checkbox, 3, 0)

        checkbox = QCheckBox(image_recognition)
        checkbox.setText('Auto upgrade Gem')
        checkbox.setChecked(self.settings.special['auto_upgrade_gem'])
        checkbox.clicked.connect(
            lambda: self.checkbox_clicked('auto_upgrade_gem'))
        image_recognition_layout.addWidget(checkbox, 4, 0)

        checkbox = QCheckBox(image_recognition)
        checkbox.setText('Auto gamble')
        checkbox.setChecked(self.settings.special['auto_gamble'])
        checkbox.clicked.connect(lambda: self.checkbox_clicked('auto_gamble'))
        image_recognition_layout.addWidget(checkbox, 5, 0)

        poolspots = QGroupBox(self)
        poolspots.setTitle('Poolspots')
        poolspots_layout = QGridLayout(poolspots)
        self.layout.addWidget(poolspots, 1, 0)

        self.poolspot_list = QListWidget(poolspots)
        self.poolspot_list.setSelectionMode(QListWidget.MultiSelection)
        for act, ps in ressources.poolspots().items():
            for poolspot in ps:
                item = QListWidgetItem(self.poolspot_list)
                item.setText(
                    f'Act {act}: {string.capwords(poolspot.replace("_", " "))}'
                )
                item.poolspot = poolspot
                if poolspot in self.settings.poolspots:
                    item.setSelected(True)
        self.poolspot_list.itemSelectionChanged.connect(self.update_poolspots)
        poolspots_layout.addWidget(self.poolspot_list)

        # button = QPushButton(poolspots)
        # button.setText('Save')
        # button.clicked.connect(self.update_poolspots)
        # poolspots_layout.addWidget(button)

        gamble_item = QGroupBox(self)
        gamble_item.setTitle('Gamble Item')
        gamble_item_layout = QGridLayout(gamble_item)
        self.layout.addWidget(gamble_item, 1, 1)

        self.gamble_item_list = QListWidget(gamble_item)
        self.gamble_item_list.setSelectionMode(QListWidget.SingleSelection)
        for _item in ressources.items():
            item = QListWidgetItem(self.gamble_item_list)
            item.setText(string.capwords(_item.replace('_', ' ')))
            item.item = _item
            if _item == self.settings.special['gamble_item']:
                item.setSelected(True)
        self.gamble_item_list.itemSelectionChanged.connect(
            self.update_gamble_item)
        gamble_item_layout.addWidget(self.gamble_item_list)

        self.setLayout(self.layout)
Esempio n. 3
0
 def populate_list(self, listwidget, items):
     for item in items:
         list_item = QListWidgetItem(item.name +
                                     "({})".format(item.place.name))
         list_item.item = item
         listwidget.addItem(list_item)