Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions CustomPP.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from PyQt5.QtGui import QPixmap
from osr2mp4.ImageProcess.Objects.Scores.PPCounter import PPCounter
from osr2mp4.ImageProcess.Objects.Scores.HitresultCounter import HitresultCounter
from osr2mp4.ImageProcess.Objects.Scores.URCounter import URCounter
from osr2mp4.ImageProcess.Objects.Scores.StrainGraph import StrainGraph
from osr2mp4.Utils.Resolution import get_screensize
from osr2mp4.global_var import Settings
from PyQt5.QtWidgets import QLabel, QMainWindow, QApplication
Expand Down Expand Up @@ -43,12 +45,23 @@ def __init__(self, width, ppsettings):

self.hitresultcounter = HitresultCounter(settings)
self.hitresultcounter.set({100: 17, 50: 70, 0: 13})

settings.settings['Enable Strain Graph'] = True
self.urcounter = URCounter(settings)
self.urcounter.ur = 420.69

self.straingraph = StrainGraph(settings, 0, 1000)
self.straingraph.set_strain_graph(os.path.join(abspath, 'res/StrainExample.png'))
self.settings = settings

def draw(self):
background = self.background.copy()
self.ppcounter.add_to_frame(background)
self.hitresultcounter.add_to_frame(background)
for drawable in [self.ppcounter, self.hitresultcounter, self.urcounter]:
drawable.add_to_frame(background)

""" #IMNOTLIKEOTHERFUNCTIONS """
self.straingraph.add_to_frame(background, 500)

background.save(self.outputpath)


Expand Down
19 changes: 11 additions & 8 deletions PPComponents/Menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ def save(self):
ppsettings = copy(current_ppsettings)
ppsettings["Rgb"] = eval(str(ppsettings["Rgb"]))
ppsettings["Hitresult Rgb"] = eval(str(ppsettings["Hitresult Rgb"]))
self.parent.ppsample.ppcounter.loadsettings(ppsettings)
self.parent.ppsample.ppcounter.loadimg()
self.parent.ppsample.hitresultcounter.loadsettings(ppsettings)
self.parent.ppsample.hitresultcounter.loadimg()

for drawable in [self.parent.ppsample.ppcounter, self.parent.ppsample.hitresultcounter, self.parent.ppsample.urcounter, self.parent.ppsample.straingraph]:
drawable.loadsettings(ppsettings)
drawable.loadimg()


self.parent.updatepp()
except Exception as e:
print(repr(e))
Expand All @@ -53,10 +55,11 @@ def reset(self):
ppsettings = defaultppconfig
for k in ppsettings.keys():
current_ppsettings[k] = ppsettings[k]
self.parent.ppsample.ppcounter.loadsettings(current_ppsettings)
self.parent.ppsample.ppcounter.loadimg()
self.parent.ppsample.hitresultcounter.loadsettings(current_ppsettings)
self.parent.ppsample.hitresultcounter.loadimg()

for drawable in [self.parent.ppsample.ppcounter, self.parent.ppsample.hitresultcounter, self.parent.ppsample.urcounter, self.parent.ppsample.straingraph]:
drawable.loadsettings(ppsettings)
drawable.loadimg()

self.parent.pplayout.updatevalue()
self.parent.updatepp()
with open(pppath, 'w+') as f:
Expand Down
1 change: 1 addition & 0 deletions helper/datahelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def loadsettings(config, settings, ppsettings):
else:
config["Output path"] = os.path.dirname(outputpath)

# not sure why this is a thing but oka
ppsettings["Rgb"] = eval(str(ppsettings["Rgb"]))
ppsettings["Hitresult Rgb"] = eval(str(ppsettings["Hitresult Rgb"]))

Expand Down
11 changes: 10 additions & 1 deletion options_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
"Height": {"type": "SmallTextBox", "Column": 1},
"FPS": {"type": "SmallTextBox", "Column": 1},
"Video codec": {"type": "SmallTextBox", "Column": 1},
"Audio codec": {"type": "SmallTextBox"}
"Audio codec": {"type": "SmallTextBox"},
"ffmpeg path": {"type": "PathBox", "filetype": "Folder"}
},

"Visual options": {
"Cursor size": {"type": "Slider", "min": 0.1, "max": 2, "step": 0.1},
"In-game interface": {"type": "CheckBox"},
"Show scoreboard": {"type": "CheckBox"},
"Background dim": {"type": "Slider", "min": 0, "max": 100, "step": 1},
"Background blur": {"type": "Slider", "min": 0, "max": 10, "step": 1},
"Always show key overlay": {"type": "CheckBox"},
"Automatic cursor size": {"type": "CheckBox"},
"Score meter size": {"type": "Slider", "min": 0.5, "max": 5, "step": 0.1},
Expand All @@ -43,6 +45,13 @@
"Slider quality": {"type": "SmallTextBox"}
},

"Experimental options": {
"Resample": {"type": "CheckBox"},
"Blend frames": {"type": "SmallTextBox", "Column": 1},
"Show background video": {"type": "CheckBox"},
"Enable Strain Graph": {"type": "CheckBox"}
},

"Advanced render options": {
"Use FFmpeg video writer": {"type": "CheckBox"},
"FFmpeg codec": {"type": "AverageTextBox"},
Expand Down
24 changes: 24 additions & 0 deletions ppoptions_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"y": {"type": "Small_Textbox"},
"Size": {"type": "Small_Textbox"},
"Rgb": {"type": "Big_Textbox"},
"Origin": {"type": "Small_Textbox"},
"Alpha": {"type": "Small_Textbox"},
"Font": {"type": "Small_Textbox"},
"Background": {"type": "PathBox", "filetype": [".png", ".jpg", ".jpeg"]}
Expand All @@ -13,9 +14,32 @@
"Hitresult y": {"type": "Small_Textbox"},
"Hitresult Size": {"type": "Small_Textbox"},
"Hitresult Rgb": {"type": "Big_Textbox"},
"Hitresult Origin": {"type": "Small_Textbox"},
"Hitresult Alpha": {"type": "Small_Textbox"},
"Hitresult Font": {"type": "Small_Textbox"},
"Hitresult Background": {"type": "PathBox", "filetype": [".png", ".jpg", ".jpeg"]},
"Hitresult Gap": {"type": "Small_Textbox"}
},

"UnstableRate counter": {
"URCounter x": {"type": "Small_Textbox"},
"URCounter y": {"type": "Small_Textbox"},
"URCounter Size": {"type": "Small_Textbox"},
"URCounter Rgb": {"type": "Big_Textbox"},
"URCounter Origin": {"type": "Small_Textbox"},
"URCounter Alpha": {"type": "Small_Textbox"},
"URCounter Font": {"type": "Small_Textbox"},
"URCounter Background": {"type": "PathBox", "filetype": [".png", ".jpg", ".jpeg"]}
},

"Strain Visualizer": {
"Strain x": {"type": "Small_Textbox"},
"Strain y": {"type": "Small_Textbox"},
"Strain Size": {"type": "Small_Textbox"},
"Strain AspectRatio": {"type": "Small_Textbox"},
"Strain Rgb": {"type": "Big_Textbox"},
"Strain Smoothing": {"type": "Small_Textbox"},
"Strain ProgressAlpha": {"type": "Small_Textbox"},
"Strain GraphDensity": {"type": "Small_Textbox"}
}
}
7 changes: 6 additions & 1 deletion updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import QLabel, QApplication, QSizePolicy, QDesktopWidget, QWidget

from abspath import abspath

class Window(QWidget):
def __init__(self):
super().__init__()
Expand All @@ -25,8 +27,10 @@ def __init__(self):
self.a = threading.Thread(target=self.install)

self.osrLogoUpdater()

def osrLogoUpdater(self):
pixmap = QPixmap('res/OsrUpdater.png')
pixmap = QPixmap(os.path.join(abspath, 'res/OsrUpdater.png'))
self.setFixedSize(pixmap.width(), pixmap.height())
self.label.setPixmap(pixmap)
self.setAttribute(PyQt5.QtCore.Qt.WA_TranslucentBackground)
self.setWindowFlags(PyQt5.QtCore.Qt.FramelessWindowHint)
Expand All @@ -42,6 +46,7 @@ def center(self):
def install(self):
for i in self.upgradelist:
subprocess.call([sys.executable, "-m", "pip", "install", i, "--upgrade"])

QApplication.quit()


Expand Down