Skip to content

Commit 66c790f

Browse files
committed
Adding game links to match history
1 parent d964421 commit 66c790f

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

src/AoE4_Overlay.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
logger = get_logger(__name__)
1818

19-
VERSION = "1.4.0"
19+
VERSION = "1.4.1"
2020

2121
# Might or might not help
2222
os.environ["PYTHONIOENCODING"] = "utf-8"
@@ -35,11 +35,11 @@ def excepthook(exc_type: Type[BaseException], exc_value: Exception,
3535
exc_info=(exc_type, exc_value, exc_tback))
3636

3737
# If compiled, send email log
38-
try:
39-
if is_compiled() and settings.send_email_logs:
40-
send_email_log(VERSION, exc_type, exc_value, exc_tback)
41-
except Exception:
42-
logger.exception("Failed to send a log through email")
38+
# try:
39+
# if is_compiled() and settings.send_email_logs:
40+
# send_email_log(VERSION, exc_type, exc_value, exc_tback)
41+
# except Exception:
42+
# logger.exception("Failed to send a log through email")
4343

4444
# Try to save settings
4545
try:
@@ -107,12 +107,12 @@ def initUI(self):
107107
file_menu.addAction(exitAction)
108108

109109
# Report crashes
110-
email_action = QtWidgets.QAction('Report crashes', self)
111-
email_action.setCheckable(True)
112-
email_action.setChecked(settings.send_email_logs)
113-
email_action.triggered.connect(lambda: setattr(
114-
settings, "send_email_logs", not settings.send_email_logs))
115-
settings_menu.addAction(email_action)
110+
# email_action = QtWidgets.QAction('Report crashes', self)
111+
# email_action.setCheckable(True)
112+
# email_action.setChecked(settings.send_email_logs)
113+
# email_action.triggered.connect(lambda: setattr(
114+
# settings, "send_email_logs", not settings.send_email_logs))
115+
# settings_menu.addAction(email_action)
116116

117117
# Log matches
118118
mach_log_action = QtWidgets.QAction('Log match data', self)

src/overlay/tab_games.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,19 @@ def __init__(self, layout: QtWidgets.QGridLayout, match_data: Dict[str,
7474
'rating_diff'] else "?"
7575
elo_change = QtWidgets.QLabel(str(diff))
7676

77+
# aoe4world Link
78+
game_id = match_data["game_id"]
79+
link = QtWidgets.QLabel(
80+
f'<a href="https://aoe4world.com/players/{settings.profile_id}/games/{game_id}"> game link</a>'
81+
)
82+
link.setOpenExternalLinks(True)
83+
7784
self.widgets = (*team_widgets, map_name, date, mode, result,
78-
elo_change)
85+
elo_change, link)
7986

8087
for item in self.widgets:
81-
item.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
88+
if item != link:
89+
item.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
8290
if item not in team_widgets:
8391
item.setAlignment(QtCore.Qt.AlignCenter)
8492

@@ -90,7 +98,7 @@ def add_to_layout(self, row: int):
9098
self.in_layout = True
9199
for column, widget in enumerate(self.widgets):
92100
self.main_layout.addWidget(widget, row, column)
93-
self.main_layout.addWidget(self.line, row + 1, 0, 1, 7)
101+
self.main_layout.addWidget(self.line, row + 1, 0, 1, len(self.widgets))
94102

95103
def remove_from_layout(self):
96104
""" Removes its widgets from the layout"""
@@ -135,6 +143,7 @@ def __init__(self, parent):
135143
self.scroll_layout.addWidget(QtWidgets.QLabel("Mode"), 0, 4)
136144
self.scroll_layout.addWidget(QtWidgets.QLabel("Result"), 0, 5)
137145
self.scroll_layout.addWidget(QtWidgets.QLabel("Rating diff"), 0, 6)
146+
self.scroll_layout.addWidget(QtWidgets.QLabel("AoE4World"), 0, 7)
138147

139148
self.header_widgets = set()
140149
for i in range(self.scroll_layout.count()):

0 commit comments

Comments
 (0)