Skip to content
This repository has been archived by the owner on Sep 17, 2023. It is now read-only.

Commit

Permalink
Building files for 3.03 release
Browse files Browse the repository at this point in the history
  • Loading branch information
asdfusername committed Sep 14, 2022
1 parent 344b8db commit 9ad207b
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Installer.iss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; -- MtgaDraft.iss --
[Setup]
AppName=MTGA Draft Tool
AppVersion=3.02
AppVersion=3.03
WizardStyle=modern
DefaultDirName={sd}\MtgaDraftTool
DefaultGroupName=MtgaDraftTool
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ Magic: The Gathering Arena draft tool that utilizes 17Lands data.
- **Enable Card Colors:** Sets the row color to the card color.

- **Enable Color Identity:** When enabled, the Colors field will display the mana symbols for a card's mana cost AND abilities (i.e., kicker, activated abilities, etc.)
- The Colors field in the Suggested Decks window will always display the full color identity

- **Enable Draft Stats:** Displays the draft stats table and drop-down in the main window.

Expand Down
70 changes: 35 additions & 35 deletions card_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import json
import logging
import math
#import numpy
import numpy
import constants

logic_logger = logging.getLogger(constants.LOG_TYPE_DEBUG)
Expand Down Expand Up @@ -113,9 +113,9 @@ def return_results(self, card_list, colors, fields):
elif option == constants.DATA_FIELD_COLORS:
selected_card["results"][count] = self._process_colors(
card)
#elif option == constants.DATA_FIELD_WHEEL:
# selected_card["results"][count] = self._process_wheel_normalized(
# card, wheel_sum)
elif option == constants.DATA_FIELD_WHEEL:
selected_card["results"][count] = self._process_wheel_normalized(
card, wheel_sum)
elif option in card:
selected_card["results"][count] = card[option]
else:
Expand Down Expand Up @@ -166,37 +166,37 @@ def _retrieve_wheel_sum(self, card_list):

return total_sum

#def _process_wheel(self, card):
# """Calculate wheel percentage"""
# result = 0
#
# try:
# if self.pick_number <= len(constants.WHEEL_COEFFICIENTS):
# # 0 is treated as pick 1 for PremierDraft P1P1
# self.pick_number = max(self.pick_number, 1)
# alsa = card[constants.DATA_FIELD_DECK_COLORS][constants.FILTER_OPTION_ALL_DECKS][constants.DATA_FIELD_ALSA]
# coefficients = constants.WHEEL_COEFFICIENTS[self.pick_number - 1]
# # Exclude ALSA values below 2
# result = round(numpy.polyval(coefficients, alsa),
# 1) if alsa >= 2 else 0
# result = max(result, 0)
# except Exception as error:
# logic_logger.info("_process_wheel error: %s", error)
#
# return result

#def _process_wheel_normalized(self, card, total_sum):
# """Calculate the normalized wheel percentage using the sum of all percentages within the card list"""
# result = 0
#
# try:
# result = self._process_wheel(card)
#
# result = round((result / total_sum)*100, 1) if total_sum > 0 else 0
# except Exception as error:
# logic_logger.info("_process_wheel_normalized error: %s", error)
#
# return result
def _process_wheel(self, card):
"""Calculate wheel percentage"""
result = 0

try:
if self.pick_number <= len(constants.WHEEL_COEFFICIENTS):
# 0 is treated as pick 1 for PremierDraft P1P1
self.pick_number = max(self.pick_number, 1)
alsa = card[constants.DATA_FIELD_DECK_COLORS][constants.FILTER_OPTION_ALL_DECKS][constants.DATA_FIELD_ALSA]
coefficients = constants.WHEEL_COEFFICIENTS[self.pick_number - 1]
# Exclude ALSA values below 2
result = round(numpy.polyval(coefficients, alsa),
1) if alsa >= 2 else 0
result = max(result, 0)
except Exception as error:
logic_logger.info("_process_wheel error: %s", error)

return result

def _process_wheel_normalized(self, card, total_sum):
"""Calculate the normalized wheel percentage using the sum of all percentages within the card list"""
result = 0

try:
result = self._process_wheel(card)

result = round((result / total_sum)*100, 1) if total_sum > 0 else 0
except Exception as error:
logic_logger.info("_process_wheel_normalized error: %s", error)

return result

def _process_filter_fields(self, card, option, colors):
"""Retrieve win rate result based on the application settings"""
Expand Down
1 change: 1 addition & 0 deletions constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@
FIELD_LABEL_OHWR: DATA_FIELD_OHWR,
FIELD_LABEL_GPWR: DATA_FIELD_GPWR,
FIELD_LABEL_GIHWR: DATA_FIELD_GIHWR,
FIELD_LABEL_GDWR: DATA_FIELD_GDWR,
FIELD_LABEL_GNDWR: DATA_FIELD_GNDWR,
FIELD_LABEL_COLORS: DATA_FIELD_COLORS,
}
Expand Down
2 changes: 1 addition & 1 deletion overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -1972,7 +1972,7 @@ def _open_settings_window(self):
popup.protocol("WM_DELETE_WINDOW",
lambda window=popup: self._close_settings_window(window))
popup.attributes("-topmost", True)
popup.resizable(width=False, height=True)
popup.resizable(width=False, height=False)
location_x, location_y = identify_safe_coordinates(self.root,
self._scale_value(
400),
Expand Down
Binary file modified setup.exe
Binary file not shown.

0 comments on commit 9ad207b

Please sign in to comment.