Made application fullscreen
This commit is contained in:
+4
-3
@@ -72,13 +72,10 @@ def run():
|
|||||||
|
|
||||||
app.setStyleSheet(style)
|
app.setStyleSheet(style)
|
||||||
|
|
||||||
geometry = app.screens()[0].size()
|
|
||||||
clipboard = app.clipboard()
|
clipboard = app.clipboard()
|
||||||
|
|
||||||
widget = MainWidget(clipboard)
|
widget = MainWidget(clipboard)
|
||||||
widget.setWindowOpacity(window_config['opacity'])
|
widget.setWindowOpacity(window_config['opacity'])
|
||||||
widget.resize(WIDTH, HEIGHT)
|
|
||||||
widget.move(0, geometry.height() - HEIGHT - 280)
|
|
||||||
|
|
||||||
widget.setWindowTitle('Albion Online Stats')
|
widget.setWindowTitle('Albion Online Stats')
|
||||||
widget.setWindowIcon(QtGui.QIcon(path('albion-stats-icon.png')))
|
widget.setWindowIcon(QtGui.QIcon(path('albion-stats-icon.png')))
|
||||||
@@ -88,6 +85,10 @@ def run():
|
|||||||
if window_config['frameless']:
|
if window_config['frameless']:
|
||||||
widget.setWindowFlag(Qt.FramelessWindowHint)
|
widget.setWindowFlag(Qt.FramelessWindowHint)
|
||||||
|
|
||||||
|
if window_config.get('fullscreen', True):
|
||||||
|
widget.showFullScreen()
|
||||||
|
else:
|
||||||
|
widget.resize(WIDTH, HEIGHT)
|
||||||
widget.show()
|
widget.show()
|
||||||
|
|
||||||
current_version, latest_version = (
|
current_version, latest_version = (
|
||||||
|
|||||||
+357
-97
@@ -1,153 +1,413 @@
|
|||||||
import sys
|
|
||||||
import functools
|
import functools
|
||||||
|
import sys
|
||||||
|
|
||||||
from PySide6 import QtGui # type: ignore
|
from PySide6 import QtGui # type: ignore
|
||||||
from PySide6.QtCore import Qt # type: ignore
|
from PySide6.QtCore import Qt # type: ignore
|
||||||
from PySide6.QtCore import QTimer # type: ignore
|
from PySide6.QtCore import QTimer # type: ignore
|
||||||
from PySide6.QtWidgets import QComboBox # type: ignore
|
from PySide6.QtWidgets import QButtonGroup # type: ignore
|
||||||
|
from PySide6.QtWidgets import QFrame # type: ignore
|
||||||
|
from PySide6.QtWidgets import QGridLayout # type: ignore
|
||||||
from PySide6.QtWidgets import QHBoxLayout # type: ignore
|
from PySide6.QtWidgets import QHBoxLayout # type: ignore
|
||||||
|
from PySide6.QtWidgets import QLabel # type: ignore
|
||||||
from PySide6.QtWidgets import QPushButton # type: ignore
|
from PySide6.QtWidgets import QPushButton # type: ignore
|
||||||
|
from PySide6.QtWidgets import QScrollArea # type: ignore
|
||||||
from PySide6.QtWidgets import QVBoxLayout # type: ignore
|
from PySide6.QtWidgets import QVBoxLayout # type: ignore
|
||||||
from PySide6.QtWidgets import QWidget # type: ignore
|
from PySide6.QtWidgets import QWidget # type: ignore
|
||||||
|
|
||||||
from ... import engine
|
from ... import engine
|
||||||
|
|
||||||
from ...utils import assets
|
from ...utils import assets
|
||||||
from ...utils.config import config
|
from ...utils.config import config
|
||||||
|
from ...utils.number import Number
|
||||||
from .view_type import ViewType
|
|
||||||
from .views import ModeBasedListView
|
|
||||||
from .views import StatsType
|
|
||||||
|
|
||||||
from . import about
|
from . import about
|
||||||
|
from .view_type import ViewType
|
||||||
|
from .views import StatsType
|
||||||
|
from .views.list_view import ListItemView
|
||||||
|
|
||||||
|
|
||||||
class AboutButton(QPushButton):
|
class Page:
|
||||||
def __init__(self):
|
Overview = 'overview'
|
||||||
QPushButton.__init__(self)
|
Damage = 'damage'
|
||||||
|
Healing = 'healing'
|
||||||
self.about = about.About()
|
Economy = 'economy'
|
||||||
self.setIcon(QtGui.QIcon(assets.path('about.png')))
|
Items = 'items'
|
||||||
self.setToolTip("About")
|
Settings = 'settings'
|
||||||
self.clicked.connect(self.about.show)
|
|
||||||
|
|
||||||
|
|
||||||
class CloseButton(QPushButton):
|
PAGE_LABELS = {
|
||||||
def __init__(self, is_visible):
|
Page.Overview: ('O', 'Overview'),
|
||||||
QPushButton.__init__(self)
|
Page.Damage: ('D', 'Damage Done'),
|
||||||
|
Page.Healing: ('H', 'Healing Done'),
|
||||||
self.setIcon(QtGui.QIcon(assets.path('close.png')))
|
Page.Economy: ('$', 'Economy'),
|
||||||
self.setToolTip("Close")
|
Page.Items: ('I', 'Items Collected'),
|
||||||
self.clicked.connect(self.close)
|
Page.Settings: ('S', 'Settings'),
|
||||||
if not is_visible:
|
}
|
||||||
self.hide()
|
|
||||||
|
|
||||||
def close(self):
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
|
|
||||||
class ViewTypeWidget(QComboBox):
|
SCOPE_LABELS = {
|
||||||
def __init__(self):
|
StatsType.ZONE: 'Current Zone',
|
||||||
QComboBox.__init__(self)
|
StatsType.LAST_FIGHT: 'Last Fight',
|
||||||
self.addItem(ViewType.DMG)
|
StatsType.OVERALL: 'Overall Session',
|
||||||
self.addItem(ViewType.HEALING_DONE)
|
}
|
||||||
|
|
||||||
def get_view_type(self):
|
|
||||||
return self.currentText()
|
|
||||||
|
|
||||||
|
|
||||||
class TopBar(QWidget):
|
class Sidebar(QWidget):
|
||||||
|
def __init__(self, on_page_changed, on_scope_changed):
|
||||||
|
QWidget.__init__(self)
|
||||||
|
self.setObjectName('Sidebar')
|
||||||
|
self.expanded = True
|
||||||
|
self.on_page_changed = on_page_changed
|
||||||
|
self.on_scope_changed = on_scope_changed
|
||||||
|
self.page_buttons = {}
|
||||||
|
self.scope_buttons = {}
|
||||||
|
|
||||||
|
self.layout = QVBoxLayout()
|
||||||
|
self.layout.setContentsMargins(14, 14, 14, 14)
|
||||||
|
self.layout.setSpacing(8)
|
||||||
|
|
||||||
|
self.toggle_button = QPushButton('Collapse')
|
||||||
|
self.toggle_button.setObjectName('SidebarToggle')
|
||||||
|
self.toggle_button.clicked.connect(self.toggle)
|
||||||
|
self.layout.addWidget(self.toggle_button)
|
||||||
|
|
||||||
|
self.title = QLabel('AO Stats')
|
||||||
|
self.title.setObjectName('SidebarTitle')
|
||||||
|
self.layout.addWidget(self.title)
|
||||||
|
|
||||||
|
self.page_group = QButtonGroup(self)
|
||||||
|
self.page_group.setExclusive(True)
|
||||||
|
for page, (_short, label) in PAGE_LABELS.items():
|
||||||
|
button = QPushButton(label)
|
||||||
|
button.setCheckable(True)
|
||||||
|
button.clicked.connect(functools.partial(self._select_page, page))
|
||||||
|
self.page_group.addButton(button)
|
||||||
|
self.page_buttons[page] = button
|
||||||
|
self.layout.addWidget(button)
|
||||||
|
|
||||||
|
self.scope_label = QLabel('Scope')
|
||||||
|
self.scope_label.setObjectName('SidebarSection')
|
||||||
|
self.layout.addWidget(self.scope_label)
|
||||||
|
|
||||||
|
self.scope_group = QButtonGroup(self)
|
||||||
|
self.scope_group.setExclusive(True)
|
||||||
|
for scope, label in SCOPE_LABELS.items():
|
||||||
|
button = QPushButton(label)
|
||||||
|
button.setCheckable(True)
|
||||||
|
button.clicked.connect(functools.partial(self._select_scope, scope))
|
||||||
|
self.scope_group.addButton(button)
|
||||||
|
self.scope_buttons[scope] = button
|
||||||
|
self.layout.addWidget(button)
|
||||||
|
|
||||||
|
self.layout.addStretch(1)
|
||||||
|
self.setLayout(self.layout)
|
||||||
|
|
||||||
|
def set_initial(self, page, scope):
|
||||||
|
self.page_buttons[page].setChecked(True)
|
||||||
|
self.scope_buttons[scope].setChecked(True)
|
||||||
|
|
||||||
|
def _select_page(self, page):
|
||||||
|
self.on_page_changed(page)
|
||||||
|
|
||||||
|
def _select_scope(self, scope):
|
||||||
|
self.on_scope_changed(scope)
|
||||||
|
|
||||||
|
def toggle(self):
|
||||||
|
self.expanded = not self.expanded
|
||||||
|
self.setFixedWidth(220 if self.expanded else 72)
|
||||||
|
self.toggle_button.setText('Collapse' if self.expanded else '>>')
|
||||||
|
self.title.setVisible(self.expanded)
|
||||||
|
self.scope_label.setVisible(self.expanded)
|
||||||
|
for page, button in self.page_buttons.items():
|
||||||
|
short, label = PAGE_LABELS[page]
|
||||||
|
button.setText(label if self.expanded else short)
|
||||||
|
for scope, button in self.scope_buttons.items():
|
||||||
|
button.setText(SCOPE_LABELS[scope] if self.expanded else scope[:1])
|
||||||
|
|
||||||
|
|
||||||
|
class StatCard(QFrame):
|
||||||
|
def __init__(self, title):
|
||||||
|
QFrame.__init__(self)
|
||||||
|
self.setObjectName('StatCard')
|
||||||
|
self.layout = QVBoxLayout()
|
||||||
|
self.layout.setContentsMargins(16, 12, 16, 12)
|
||||||
|
self.title = QLabel(title)
|
||||||
|
self.title.setObjectName('CardTitle')
|
||||||
|
self.value = QLabel('0')
|
||||||
|
self.value.setObjectName('CardValue')
|
||||||
|
self.layout.addWidget(self.title)
|
||||||
|
self.layout.addWidget(self.value)
|
||||||
|
self.setLayout(self.layout)
|
||||||
|
|
||||||
|
def update_value(self, value):
|
||||||
|
self.value.setText(str(value))
|
||||||
|
|
||||||
|
|
||||||
|
class HeaderBar(QWidget):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
QWidget.__init__(self)
|
QWidget.__init__(self)
|
||||||
self.view_type = ViewTypeWidget()
|
|
||||||
self.layout = QHBoxLayout()
|
self.layout = QHBoxLayout()
|
||||||
self.layout.setSpacing(0)
|
|
||||||
self.layout.setContentsMargins(0, 0, 0, 0)
|
self.layout.setContentsMargins(0, 0, 0, 0)
|
||||||
self.layout.addWidget(self.view_type)
|
self.title = QLabel('Albion Online Stats')
|
||||||
|
self.title.setObjectName('HeaderTitle')
|
||||||
|
self.status = QLabel('Waiting for zone change')
|
||||||
|
self.status.setObjectName('HeaderStatus')
|
||||||
|
self.layout.addWidget(self.title)
|
||||||
|
self.layout.addStretch(1)
|
||||||
|
self.layout.addWidget(self.status)
|
||||||
|
self.setLayout(self.layout)
|
||||||
|
|
||||||
self.about_button = AboutButton()
|
def update_status(self):
|
||||||
self.layout.addWidget(self.about_button)
|
if engine.is_ready():
|
||||||
|
self.status.setText('Tracking live Albion Online traffic')
|
||||||
|
else:
|
||||||
|
self.status.setText('Waiting for zone change to identify your character')
|
||||||
|
|
||||||
self.close_button = CloseButton(config()['window']['frameless'])
|
|
||||||
self.layout.addWidget(self.close_button)
|
|
||||||
|
|
||||||
|
class ItemsPanel(QFrame):
|
||||||
|
def __init__(self):
|
||||||
|
QFrame.__init__(self)
|
||||||
|
self.setObjectName('ItemsPanel')
|
||||||
|
self.layout = QVBoxLayout()
|
||||||
|
self.layout.setContentsMargins(16, 16, 16, 16)
|
||||||
|
title = QLabel('Items Collected')
|
||||||
|
title.setObjectName('PanelTitle')
|
||||||
|
body = QLabel(
|
||||||
|
'Looted item tracking will appear here once item pickup packets are mapped.\n\n'
|
||||||
|
'This panel stays visible while you review damage, healing, and economy stats.')
|
||||||
|
body.setObjectName('MutedText')
|
||||||
|
body.setWordWrap(True)
|
||||||
|
self.layout.addWidget(title)
|
||||||
|
self.layout.addWidget(body)
|
||||||
|
self.layout.addStretch(1)
|
||||||
|
self.setLayout(self.layout)
|
||||||
|
|
||||||
|
|
||||||
|
class SettingsPanel(QWidget):
|
||||||
|
def __init__(self, clipboard):
|
||||||
|
QWidget.__init__(self)
|
||||||
|
self.clipboard = clipboard
|
||||||
|
self.about = about.About()
|
||||||
|
self.layout = QVBoxLayout()
|
||||||
|
self.layout.setSpacing(12)
|
||||||
|
|
||||||
|
description = QLabel(
|
||||||
|
'Use this page for session actions. Fullscreen dashboard mode is the default; '
|
||||||
|
'set window.fullscreen = false in the config file to use a normal window.')
|
||||||
|
description.setWordWrap(True)
|
||||||
|
description.setObjectName('PageDescription')
|
||||||
|
self.layout.addWidget(description)
|
||||||
|
|
||||||
|
reset_zone = QPushButton('Reset Current Zone')
|
||||||
|
reset_zone.clicked.connect(engine.reset_zone_stats)
|
||||||
|
self.layout.addWidget(reset_zone)
|
||||||
|
|
||||||
|
reset_fight = QPushButton('Reset Last Fight')
|
||||||
|
reset_fight.clicked.connect(engine.reset_last_fight_stats)
|
||||||
|
self.layout.addWidget(reset_fight)
|
||||||
|
|
||||||
|
reset_all = QPushButton('Reset Overall Session')
|
||||||
|
reset_all.clicked.connect(engine.reset_stats)
|
||||||
|
self.layout.addWidget(reset_all)
|
||||||
|
|
||||||
|
about_button = QPushButton('About Albion Online Stats')
|
||||||
|
about_button.clicked.connect(self.about.show)
|
||||||
|
self.layout.addWidget(about_button)
|
||||||
|
|
||||||
|
if not config()['window']['fullscreen']:
|
||||||
|
close_button = QPushButton('Close')
|
||||||
|
close_button.setIcon(QtGui.QIcon(assets.path('close.png')))
|
||||||
|
close_button.clicked.connect(lambda: sys.exit(0))
|
||||||
|
self.layout.addWidget(close_button)
|
||||||
|
|
||||||
|
self.layout.addStretch(1)
|
||||||
self.setLayout(self.layout)
|
self.setLayout(self.layout)
|
||||||
|
|
||||||
|
|
||||||
class MainWidget(QWidget):
|
class MainWidget(QWidget):
|
||||||
def __init__(self, clipboard):
|
def __init__(self, clipboard):
|
||||||
QWidget.__init__(self)
|
QWidget.__init__(self)
|
||||||
|
self.clipboard = clipboard
|
||||||
|
self.current_page = Page.Overview
|
||||||
|
self.current_scope = StatsType.ZONE
|
||||||
|
|
||||||
self.mouse_pos = None
|
self.root_layout = QHBoxLayout()
|
||||||
|
self.root_layout.setContentsMargins(0, 0, 0, 0)
|
||||||
|
self.root_layout.setSpacing(0)
|
||||||
|
|
||||||
self.layout = QVBoxLayout()
|
self.sidebar = Sidebar(self.set_page, self.set_scope)
|
||||||
self.top_bar = TopBar()
|
self.sidebar.set_initial(self.current_page, self.current_scope)
|
||||||
self.layout.addWidget(self.top_bar)
|
self.root_layout.addWidget(self.sidebar)
|
||||||
|
|
||||||
self.view = ModeBasedListView(clipboard)
|
self.main_area = QWidget()
|
||||||
self.layout.addWidget(self.view)
|
self.main_layout = QVBoxLayout()
|
||||||
|
self.main_layout.setContentsMargins(22, 18, 22, 18)
|
||||||
|
self.main_layout.setSpacing(14)
|
||||||
|
self.main_area.setLayout(self.main_layout)
|
||||||
|
|
||||||
|
self.header = HeaderBar()
|
||||||
|
self.main_layout.addWidget(self.header)
|
||||||
|
|
||||||
|
self.cards_layout = QGridLayout()
|
||||||
|
self.cards_layout.setSpacing(12)
|
||||||
|
self.elapsed_card = StatCard('Time in selected scope')
|
||||||
|
self.fame_card = StatCard('Fame gained')
|
||||||
|
self.fph_card = StatCard('Fame per hour')
|
||||||
|
self.ready_card = StatCard('Tracking status')
|
||||||
|
self.cards_layout.addWidget(self.elapsed_card, 0, 0)
|
||||||
|
self.cards_layout.addWidget(self.fame_card, 0, 1)
|
||||||
|
self.cards_layout.addWidget(self.fph_card, 0, 2)
|
||||||
|
self.cards_layout.addWidget(self.ready_card, 0, 3)
|
||||||
|
self.main_layout.addLayout(self.cards_layout)
|
||||||
|
|
||||||
|
self.page_title = QLabel('Overview')
|
||||||
|
self.page_title.setObjectName('PageTitle')
|
||||||
|
self.page_description = QLabel('')
|
||||||
|
self.page_description.setObjectName('PageDescription')
|
||||||
|
self.page_description.setWordWrap(True)
|
||||||
|
self.main_layout.addWidget(self.page_title)
|
||||||
|
self.main_layout.addWidget(self.page_description)
|
||||||
|
|
||||||
|
self.primary_label = QLabel('')
|
||||||
|
self.primary_label.setObjectName('PanelTitle')
|
||||||
|
self.main_layout.addWidget(self.primary_label)
|
||||||
|
|
||||||
|
self.primary_list = ListItemView()
|
||||||
|
self.main_layout.addWidget(self.primary_list, 1)
|
||||||
|
|
||||||
|
self.total_healing_label = QLabel('Total Healing')
|
||||||
|
self.total_healing_label.setObjectName('PanelTitle')
|
||||||
|
self.total_healing_list = ListItemView()
|
||||||
|
self.main_layout.addWidget(self.total_healing_label)
|
||||||
|
self.main_layout.addWidget(self.total_healing_list, 1)
|
||||||
|
|
||||||
|
self.placeholder = QLabel('')
|
||||||
|
self.placeholder.setObjectName('MutedText')
|
||||||
|
self.placeholder.setWordWrap(True)
|
||||||
|
self.main_layout.addWidget(self.placeholder, 1)
|
||||||
|
|
||||||
|
self.settings_panel = SettingsPanel(clipboard)
|
||||||
|
self.main_layout.addWidget(self.settings_panel, 1)
|
||||||
|
|
||||||
|
self.root_layout.addWidget(self.main_area, 1)
|
||||||
|
self.root_layout.addWidget(ItemsPanel())
|
||||||
|
self.setLayout(self.root_layout)
|
||||||
|
|
||||||
self.setLayout(self.layout)
|
|
||||||
self.refresh()
|
self.refresh()
|
||||||
|
|
||||||
timer = QTimer(self)
|
timer = QTimer(self)
|
||||||
timer.timeout.connect(self.refresh)
|
timer.timeout.connect(self.refresh)
|
||||||
timer.start(500)
|
timer.start(500)
|
||||||
|
|
||||||
|
def set_page(self, page):
|
||||||
|
self.current_page = page
|
||||||
|
self.refresh()
|
||||||
|
|
||||||
|
def set_scope(self, scope):
|
||||||
|
self.current_scope = scope
|
||||||
|
self.refresh()
|
||||||
|
|
||||||
def refresh(self):
|
def refresh(self):
|
||||||
player_list_items, fame_stat, elapsed = self.damage_stats()
|
players, fame_stat, elapsed = self.primary_stats()
|
||||||
self.view.update(
|
total_healing = self.total_healing_stats()
|
||||||
self.top_bar.view_type.get_view_type(),
|
|
||||||
elapsed,
|
|
||||||
fame_stat.fame,
|
|
||||||
fame_stat.fame_per_hour,
|
|
||||||
player_list_items,
|
|
||||||
self.total_healing_stats()
|
|
||||||
)
|
|
||||||
|
|
||||||
def mousePressEvent(self, event):
|
self.header.update_status()
|
||||||
self.mouse_pos = event.pos()
|
self.elapsed_card.update_value(self._format_time(elapsed))
|
||||||
|
self.fame_card.update_value(fame_stat.fame)
|
||||||
|
self.fph_card.update_value(fame_stat.fame_per_hour)
|
||||||
|
self.ready_card.update_value('Ready' if engine.is_ready() else 'Not ready')
|
||||||
|
|
||||||
def mouseMoveEvent(self, event):
|
self._set_page_copy(players, total_healing)
|
||||||
invalid_regions = (
|
|
||||||
self.top_bar.geometry(),
|
|
||||||
self.view.geometry(),
|
|
||||||
)
|
|
||||||
|
|
||||||
if any(region.contains(event.pos()) for region in invalid_regions):
|
def primary_stats(self):
|
||||||
return
|
stat_kind = {
|
||||||
if not self.mouse_pos:
|
Page.Overview: engine.CombatStatType.Damage,
|
||||||
return
|
Page.Damage: engine.CombatStatType.Damage,
|
||||||
if any(region.contains(self.mouse_pos) for region in invalid_regions):
|
Page.Healing: engine.CombatStatType.Healing,
|
||||||
return
|
Page.Economy: engine.CombatStatType.Damage,
|
||||||
|
Page.Items: engine.CombatStatType.Damage,
|
||||||
if event.buttons() & Qt.LeftButton:
|
Page.Settings: engine.CombatStatType.Damage,
|
||||||
diff = event.pos() - self.mouse_pos
|
}[self.current_page]
|
||||||
newpos = self.pos() + diff
|
getters = {
|
||||||
|
StatsType.ZONE: functools.partial(engine.zone_stats, stat_kind),
|
||||||
self.move(newpos)
|
StatsType.LAST_FIGHT: functools.partial(engine.last_fight_stats, stat_kind),
|
||||||
|
StatsType.OVERALL: functools.partial(engine.overall_stats, stat_kind),
|
||||||
def damage_stats(self):
|
|
||||||
stats = {
|
|
||||||
ViewType.DMG: {
|
|
||||||
StatsType.ZONE: functools.partial(engine.zone_stats, engine.CombatStatType.Damage),
|
|
||||||
StatsType.LAST_FIGHT: functools.partial(engine.last_fight_stats, engine.CombatStatType.Damage),
|
|
||||||
StatsType.OVERALL: functools.partial(engine.overall_stats, engine.CombatStatType.Damage),
|
|
||||||
},
|
|
||||||
ViewType.HEALING_DONE: {
|
|
||||||
StatsType.ZONE: functools.partial(engine.zone_stats, engine.CombatStatType.Healing),
|
|
||||||
StatsType.LAST_FIGHT: functools.partial(engine.last_fight_stats, engine.CombatStatType.Healing),
|
|
||||||
StatsType.OVERALL: functools.partial(engine.overall_stats, engine.CombatStatType.Healing),
|
|
||||||
}
|
}
|
||||||
}
|
return getters[self.current_scope]()
|
||||||
|
|
||||||
return stats[self.top_bar.view_type.get_view_type()][self.view.get_mode()]()
|
|
||||||
|
|
||||||
def total_healing_stats(self):
|
def total_healing_stats(self):
|
||||||
stats = {
|
getters = {
|
||||||
StatsType.ZONE: engine.zone_total_healing_stats,
|
StatsType.ZONE: engine.zone_total_healing_stats,
|
||||||
StatsType.LAST_FIGHT: engine.last_fight_total_healing_stats,
|
StatsType.LAST_FIGHT: engine.last_fight_total_healing_stats,
|
||||||
StatsType.OVERALL: engine.overall_total_healing_stats,
|
StatsType.OVERALL: engine.overall_total_healing_stats,
|
||||||
}
|
}
|
||||||
|
return getters[self.current_scope]()
|
||||||
|
|
||||||
return stats[self.view.get_mode()]()
|
def _set_page_copy(self, players, total_healing):
|
||||||
|
self.primary_list.hide()
|
||||||
|
self.primary_label.hide()
|
||||||
|
self.total_healing_label.hide()
|
||||||
|
self.total_healing_list.hide()
|
||||||
|
self.placeholder.hide()
|
||||||
|
self.settings_panel.hide()
|
||||||
|
|
||||||
|
if self.current_page == Page.Overview:
|
||||||
|
self.page_title.setText('Overview')
|
||||||
|
self.page_description.setText(
|
||||||
|
'A quick session summary for the selected scope. Use the left menu to inspect damage, healing, economy, and loot in more detail.')
|
||||||
|
self.primary_label.setText('Top Damage Dealers')
|
||||||
|
self.primary_label.show()
|
||||||
|
self.primary_list.show()
|
||||||
|
self.primary_list.update(players)
|
||||||
|
return
|
||||||
|
|
||||||
|
if self.current_page == Page.Damage:
|
||||||
|
self.page_title.setText('Damage Done')
|
||||||
|
self.page_description.setText(
|
||||||
|
'Damage attributed to each visible tracked player during the selected scope. DPS is based on combat time.')
|
||||||
|
self.primary_label.setText('Damage by Player')
|
||||||
|
self.primary_label.show()
|
||||||
|
self.primary_list.show()
|
||||||
|
self.primary_list.update(players)
|
||||||
|
return
|
||||||
|
|
||||||
|
if self.current_page == Page.Healing:
|
||||||
|
self.page_title.setText('Healing Done')
|
||||||
|
self.page_description.setText(
|
||||||
|
'Combat healing counts healing during fights. Total healing includes self-healing and post-fight recovery.')
|
||||||
|
self.primary_label.setText('Combat Healing')
|
||||||
|
self.primary_label.show()
|
||||||
|
self.primary_list.show()
|
||||||
|
self.primary_list.update(players)
|
||||||
|
self.total_healing_label.show()
|
||||||
|
self.total_healing_list.show()
|
||||||
|
self.total_healing_list.update(total_healing)
|
||||||
|
return
|
||||||
|
|
||||||
|
if self.current_page == Page.Economy:
|
||||||
|
self.page_title.setText('Economy')
|
||||||
|
self.page_description.setText(
|
||||||
|
'Fame is tracked now. Looted silver and other silver categories will appear here after their packet fields are mapped.')
|
||||||
|
self.placeholder.setText(
|
||||||
|
'Silver tracking is not active yet. Planned categories: Looted Silver, Looted Silver per Hour, Other Silver, and Other Silver per Hour.')
|
||||||
|
self.placeholder.show()
|
||||||
|
return
|
||||||
|
|
||||||
|
if self.current_page == Page.Items:
|
||||||
|
self.page_title.setText('Items Collected')
|
||||||
|
self.page_description.setText(
|
||||||
|
'Collected item quantities will be shown here after item pickup packets are mapped. The right panel remains visible on every page.')
|
||||||
|
self.placeholder.setText(
|
||||||
|
'No item pickup data is available yet. Once enabled, this page will show item name, quantity, and session scope totals.')
|
||||||
|
self.placeholder.show()
|
||||||
|
return
|
||||||
|
|
||||||
|
self.page_title.setText('Settings')
|
||||||
|
self.page_description.setText('Reset scopes, view app information, and configure dashboard behavior.')
|
||||||
|
self.settings_panel.show()
|
||||||
|
|
||||||
|
def _format_time(self, seconds):
|
||||||
|
seconds = int(seconds or 0)
|
||||||
|
hours = seconds // 3600
|
||||||
|
minutes = (seconds % 3600) // 60
|
||||||
|
remainder = seconds % 60
|
||||||
|
if hours:
|
||||||
|
return f'{hours}h {minutes}m {remainder}s'
|
||||||
|
return f'{minutes}m {remainder}s'
|
||||||
|
|||||||
+113
-16
@@ -6,31 +6,128 @@ font_size = cfg['window']['font-size']
|
|||||||
style = """
|
style = """
|
||||||
QWidget {
|
QWidget {
|
||||||
font-size: %s;
|
font-size: %s;
|
||||||
background-color: black;
|
background-color: #0f172a;
|
||||||
color: white;
|
color: #e5edf8;
|
||||||
}
|
}
|
||||||
|
|
||||||
#Motd, #Motd > * {
|
QPushButton {
|
||||||
background-color: none;
|
background-color: #182235;
|
||||||
color: none;
|
border: 1px solid #2a3a54;
|
||||||
font-size: auto;
|
border-radius: 8px;
|
||||||
|
padding: 10px 12px;
|
||||||
|
text-align: left;
|
||||||
|
color: #e5edf8;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:hover {
|
||||||
|
background-color: #24324a;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton:checked {
|
||||||
|
background-color: #f5b942;
|
||||||
|
border-color: #f5b942;
|
||||||
|
color: #111827;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
#Sidebar {
|
||||||
|
background-color: #111827;
|
||||||
|
border-right: 1px solid #263449;
|
||||||
|
min-width: 220px;
|
||||||
|
max-width: 220px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#SidebarToggle {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#SidebarTitle {
|
||||||
|
color: #f5b942;
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: 800;
|
||||||
|
padding: 10px 4px 16px 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#SidebarSection {
|
||||||
|
color: #93a4bd;
|
||||||
|
font-weight: 700;
|
||||||
|
padding: 18px 4px 4px 4px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
#HeaderTitle {
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 800;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#HeaderStatus {
|
||||||
|
color: #9fb0c8;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
#StatCard, #ItemsPanel {
|
||||||
|
background-color: #182235;
|
||||||
|
border: 1px solid #293951;
|
||||||
|
border-radius: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ItemsPanel {
|
||||||
|
min-width: 300px;
|
||||||
|
max-width: 360px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#CardTitle {
|
||||||
|
color: #9fb0c8;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 700;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
#CardValue {
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 800;
|
||||||
|
}
|
||||||
|
|
||||||
|
#PageTitle {
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: 800;
|
||||||
|
color: #ffffff;
|
||||||
|
padding-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#PageDescription, #MutedText {
|
||||||
|
color: #a9b7ca;
|
||||||
|
line-height: 1.35;
|
||||||
|
}
|
||||||
|
|
||||||
|
#PanelTitle {
|
||||||
|
color: #f5b942;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 800;
|
||||||
|
padding-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QListView {
|
QListView {
|
||||||
min-height: 100px;
|
background-color: #121c2e;
|
||||||
|
border: 1px solid #293951;
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 8px;
|
||||||
|
min-height: 160px;
|
||||||
}
|
}
|
||||||
|
|
||||||
QListView::item:selected:active {
|
QListView::item {
|
||||||
background-color: black;
|
min-height: 36px;
|
||||||
}
|
border-radius: 6px;
|
||||||
|
margin: 3px;
|
||||||
QListView::item:selected {
|
padding: 4px;
|
||||||
background-color: black;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QListView::item:selected:active,
|
||||||
|
QListView::item:selected,
|
||||||
QListView::item:selected:!active {
|
QListView::item:selected:!active {
|
||||||
background-color: black;
|
background-color: #24324a;
|
||||||
color: white;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
""" % (font_size)
|
""" % (font_size)
|
||||||
|
|||||||
+5
-4
@@ -4,13 +4,14 @@ import toml
|
|||||||
|
|
||||||
from . import platform_utils
|
from . import platform_utils
|
||||||
|
|
||||||
CFG_VERSION = '0.7'
|
CFG_VERSION = '0.8'
|
||||||
|
|
||||||
default = """
|
default = """
|
||||||
[window]
|
[window]
|
||||||
width = 300
|
width = 1280
|
||||||
height = 220
|
height = 720
|
||||||
font-size = '10px'
|
font-size = '14px'
|
||||||
|
fullscreen = true
|
||||||
|
|
||||||
# Note: do not change!
|
# Note: do not change!
|
||||||
# options bellow are here only for testing purposes
|
# options bellow are here only for testing purposes
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ def test_config_creates_missing_directory(monkeypatch, tmp_path):
|
|||||||
cfg = config.config()
|
cfg = config.config()
|
||||||
|
|
||||||
assert os.path.isfile(expected)
|
assert os.path.isfile(expected)
|
||||||
assert cfg['window']['width'] == 300
|
assert cfg['window']['width'] == 1280
|
||||||
|
assert cfg['window']['height'] == 720
|
||||||
|
assert cfg['window']['fullscreen'] is True
|
||||||
|
|
||||||
config._config = None
|
config._config = None
|
||||||
|
|||||||
Reference in New Issue
Block a user