Skip to content

Commit

Permalink
- fixing commas in some list items
Browse files Browse the repository at this point in the history
  • Loading branch information
Graveflo committed Jul 20, 2021
1 parent 5e11746 commit e5c3e12
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
2 changes: 1 addition & 1 deletion installer_rems.txt

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions src/BDO_Enhancement_Tool/WidgetTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,16 @@ def __lt__(self, other):


class comma_seperated_twi(numeric_twi):
def __init__(self, text):
super(comma_seperated_twi, self).__init__(text)
self.setText(text)
def __init__(self, numba):
super(comma_seperated_twi, self).__init__(MONNIES_FORMAT.format(numba))

def setData(self, role, p_str):
if role == Qt.DisplayRole:
p_str = remove_numeric_modifiers(p_str)
if p_str is None or p_str == '':
return super(comma_seperated_twi, self).setData(role, MONNIES_FORMAT.format(int(float(p_str))))
return super(comma_seperated_twi, self).setData(role, MONNIES_FORMAT.format(p_str))
return super(comma_seperated_twi, self).setData(role, p_str)

# def setText(self, p_str):


def text(self):
return super(comma_seperated_twi, self).text().replace(',','')

Expand Down Expand Up @@ -537,7 +533,7 @@ def set_cell_color_compare(twi_gt, gt_str):


def monnies_twi_factory(i_f_val):
twi = comma_seperated_twi(str(int(round(i_f_val))))
twi = comma_seperated_twi(i_f_val)
return twi


Expand Down
2 changes: 1 addition & 1 deletion src/BDO_Enhancement_Tool/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# TODO: Tooltip
# TODO: Custom gear in compact window
# TODO: issue: accept button not always present in guide overlay
RELEASE_VER = '1.1a9'
RELEASE_VER = '1.2a1'


if __name__ == "__main__":
Expand Down
25 changes: 20 additions & 5 deletions src/BDO_Enhancement_Tool/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,25 @@ def iter_best_solutions(self, start_fs=None, saves=True):
best_fs_vec_idx = self.sort_map_balance_vec_fs[0]
enh_gear = self.enh_gear
fs_items = self.fs_items
balance_vec = self.balance_vec[0]
balance_vec = self.balance_vec
balance_vec_fs = self.balance_vec_fs[0]
for i in range(start_fs, len(best_balance_vec_idx)):
idx_enh_gear = best_balance_vec_idx[i]
this_enh_gear = enh_gear[idx_enh_gear]
enh_balance = balance_vec[0][i]
if (not saves) and self.is_fake(this_enh_gear):
for j in range(0, len(self.sort_map_balance_vec)):
idx_enh_gear = sort_map_balance_vec[j][i]
this_enh_gear = enh_gear[idx_enh_gear]
enh_balance = balance_vec[j][i]
if not self.is_fake(this_enh_gear):
break

idx_fs_gear = best_fs_vec_idx[i]

fs_gear = fs_items[idx_fs_gear]
is_cron = idx_enh_gear >= self.cron_start
yield fs_gear, balance_vec_fs[i], this_enh_gear, balance_vec[i], is_cron
yield fs_gear, balance_vec_fs[i], this_enh_gear, enh_balance, is_cron

def it_sort_enh_fs_lvl(self, fs_lvl):
balance_vec = self.balance_vec
Expand Down Expand Up @@ -160,8 +162,10 @@ def get_loss_prevs(self, fs):
def eval_fs_attempt(self, start_fs, saves=False, collapse=False, loss_prev=False) -> Tuple[Union[List[Solution], None], Union[Solution,None]]:
balance_vec_unsort = self.balance_vec_unsort
best_balance_vec = self.balance_vec[0]
balance_vec = self.balance_vec
sort_map_balance_vec = self.sort_map_balance_vec
sort_map_balance_vec_T = self.sort_map_balance_vec.T
best_sort_map_balance_vec = self.sort_map_balance_vec[0]
best_balance_vec_idx = self.sort_map_balance_vec[0]
settings = self.settings
if start_fs < settings[settings.P_QUEST_FS_INC]:
start_fs = settings[settings.P_QUEST_FS_INC]
Expand All @@ -172,7 +176,18 @@ def eval_fs_attempt(self, start_fs, saves=False, collapse=False, loss_prev=False
def loop_life_nom(_fs):
if _fs > num_fs:
return False
return best_balance_vec[_fs] > 0 or (not saves and self.is_fake(enh_gear[best_sort_map_balance_vec[_fs]]))

idx_enh_gear = best_balance_vec_idx[_fs]
this_enh_gear = enh_gear[idx_enh_gear]
enh_balance = balance_vec[0][_fs]
if (not saves) and self.is_fake(this_enh_gear):
for j in range(0, len(self.sort_map_balance_vec)):
idx_enh_gear = sort_map_balance_vec[j][_fs]
this_enh_gear = enh_gear[idx_enh_gear]
enh_balance = balance_vec[j][_fs]
if not self.is_fake(this_enh_gear):
break
return best_balance_vec_idx[_fs] <= enh_balance

def loop_life_loss_prv(_fs):
if _fs > num_fs:
Expand Down Expand Up @@ -239,7 +254,7 @@ def loop_life_loss_prv(_fs):

ret_sol_enh = None
try:
gear_dx = best_sort_map_balance_vec[end_fs]
gear_dx = best_balance_vec_idx[end_fs]
ret_sol_enh = Solution(enh_gear[gear_dx], best_balance_vec[end_fs], is_cron=gear_dx >= self.cron_start)
except IndexError:
pass
Expand Down

0 comments on commit e5c3e12

Please sign in to comment.