Skip to content

Commit 91c03d8

Browse files
committed
update
1 parent 0989b72 commit 91c03d8

File tree

3 files changed

+67
-15
lines changed

3 files changed

+67
-15
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
splits/*
22
splits_save/*
33
releases/*
4-
output/*
4+
output/*
5+
notes.txt

no_damage_tracker.py

Lines changed: 64 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,16 @@ def wheelEvent(self,event):
9595

9696
class MainApp(object):
9797

98-
size = 1
98+
size = 1
9999

100100
if size == 1:
101101
SCREEN_HEIGHT = 480
102102
SCREEN_WIDTH = 480
103-
RESET_X = 125
103+
RESET_X = 95
104104
INPUT_X = 220
105-
UNDO_X = 280
105+
UNDO_X = 355
106+
DECREMENT_X = 185
107+
INCREMENT_X = 265
106108
LOAD_X = 40
107109
CREATE_X = 140
108110
SAVE_X = 240
@@ -133,13 +135,16 @@ class MainApp(object):
133135
SCREEN_WIDTH = 540
134136
RESET_X = 140
135137
INPUT_X = 250
136-
UNDO_X = 325
138+
UNDO_X = 355
137139
LOAD_X = 60
138-
CREATE_X = 230
139-
SAVE_X = 390
140-
SETTINGS_X = 480
140+
CREATE_X = 150
141+
SAVE_X = 240
142+
SETTINGS_X = 330
141143
BOTTOM_BUTTON_Y = 440
142144

145+
DECREMENT_X = 210
146+
INCREMENT_X = 270
147+
143148
CURRENT_LABEL_X = 180
144149
PB_LABEL_X = 320
145150
COMPARE_LABEL_X = 400
@@ -156,9 +161,9 @@ class MainApp(object):
156161
ENTRY_COMPARE_X = TOTAL_COMPARE_X + 0
157162

158163

159-
FONT_SIZE = 16
164+
FONT_SIZE = 14
160165

161-
ENTRY_X_SIZE = 200
166+
ENTRY_X_SIZE = 220
162167

163168

164169
def __init__(self):
@@ -227,6 +232,18 @@ def __init__(self):
227232

228233

229234

235+
self.increment_button = QPushButton("+",self.window)
236+
self.increment_button.setGeometry(QtCore.QRect(self.INCREMENT_X, 5, 30, 30))
237+
self.increment_button.clicked.connect(self.increment_click)
238+
# self.increment_button.returnPressed.connect(self.post_current_entry)
239+
self.increment_button.hide()
240+
241+
self.decrement_button = QPushButton("-",self.window)
242+
self.decrement_button.setGeometry(QtCore.QRect(self.DECREMENT_X, 5, 30, 30))
243+
self.decrement_button.clicked.connect(self.decrement_click)
244+
# self.decrement_button.returnPressed.connect(self.post_current_entry)
245+
self.decrement_button.hide()
246+
230247

231248
# self.video_button.clicked.connect(self.video_input_click)
232249
self.current_split_input = QLineEdit("",self.window)
@@ -403,7 +420,9 @@ def start_click(self):
403420
style = "%s;background-color:black;" % style
404421
i.setStyleSheet(style)
405422

406-
self.current_split_input.show()
423+
self.current_split_input.show()
424+
self.increment_button.show()
425+
self.decrement_button.show()
407426
self.current_split_input.setFocus()
408427
self.start_button.hide()
409428
self.undo_button.show()
@@ -474,8 +493,32 @@ def create_splits_click(self):
474493
def settings_click(self):
475494
self.settings_window.show()
476495

477-
496+
497+
def increment_click(self):
498+
cur_num = self.current_split_input.text()
499+
try:
500+
cur_num = int(cur_num)
501+
except:
502+
cur_num = 0
503+
504+
cur_num += 1
505+
self.current_split_input.setText(str(cur_num))
506+
self.current_split_input.setFocus()
507+
508+
def decrement_click(self):
509+
cur_num = self.current_split_input.text()
478510

511+
if cur_num:
512+
try:
513+
cur_num = int(cur_num)
514+
except:
515+
cur_num = 0
516+
517+
cur_num -= 1
518+
if cur_num < 0:
519+
cur_num = 0
520+
self.current_split_input.setText(str(cur_num))
521+
self.current_split_input.setFocus()
479522

480523
def update_pb_splits(self):
481524

@@ -498,10 +541,11 @@ def update_pb_splits(self):
498541

499542
def confirm_pb_save(self):
500543
qm = QMessageBox
544+
501545
ret = qm.question(self.window,'Save splits?', "Save splits to current split file?", qm.Yes | qm.No)
502546

503547
if ret == qm.Yes:
504-
self.save_splits(use_splits_path=True)
548+
self.save_splits(use_splits_path=True, bypass=True)
505549

506550

507551
def reset_splits(self):
@@ -528,6 +572,9 @@ def reset_splits(self):
528572
self.total_compare.setStyleSheet(style)
529573

530574
self.current_split_input.hide()
575+
self.increment_button.hide()
576+
self.decrement_button.hide()
577+
531578
self.undo_button.hide()
532579
self.total_hits = 0
533580
self.current_split_input.setText("")
@@ -755,6 +802,10 @@ def undo_split(self):
755802
self.update_total()
756803
self.calculate_total_compare()
757804
self.current_split_input.show()
805+
self.increment_button.show()
806+
self.decrement_button.show()
807+
808+
758809

759810

760811
self.show_current_splits()
@@ -765,7 +816,7 @@ def undo_split(self):
765816

766817
def save_splits(self, bypass=False, use_splits_path=False):
767818

768-
if self.current_status == 'finished':
819+
if self.current_status == 'finished' and not bypass:
769820
QMessageBox.about(self.window, "Error", "Finish/Reset splits before saving")
770821

771822
elif self.current_status != 'waiting_for_splits' or bypass:

settings.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
compare_column_sum_choice: Current Split
1+
compare_column_sum_choice: Total

0 commit comments

Comments
 (0)