Skip to content

Commit

Permalink
Mass bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Polishchuk committed Sep 25, 2023
1 parent cae99f7 commit 48e2332
Show file tree
Hide file tree
Showing 12 changed files with 179 additions and 65 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
Simple and nice keyboard to chat message bindings maker.
Made especially for RAGE:MP.

(для тех у кого не работает - выключите проверку на RAGE MP в настройках)

![image](https://github.com/denipolis/arci-binder/assets/52839937/e09b6b9e-f7d9-4554-b910-ddfdcf23f75e)

## How to use source code:
Expand All @@ -14,10 +12,10 @@ Made especially for RAGE:MP.
5. Install `pip` requirements using `pip install -r requirements.txt`
6. Enjoy!

## Converting .ui (**QT Designer**) to .py:
## Translating .ui (**QT Designer**) to .py:
1. Go to root of project.
2. Execute `tools\compileUI.py`
2. Execute `tools\translateUI.bat`

## Building:
1. Go to root of project.
2. Execute `tools\build_full.bat`
2. Execute `tools\build.bat`
6 changes: 3 additions & 3 deletions installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{9D6C1B9B-8B69-4803-9761-F4DA08BBB0B1}
AppName=ArciBinder
AppVersion=1.2.1
;AppVerName=ArciBinder 1.2.1
AppVersion=1.2.2
;AppVerName=ArciBinder 1.2.2
AppPublisher=Denipolis
DefaultDirName={autopf}\ArciBinder
DisableProgramGroupPage=yes
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
OutputDir=build\
OutputBaseFilename=ArciBinder_win32_installer
OutputBaseFilename=arcibinder{#SetupSetting("AppVersion")}_setup
SetupIconFile=src\ui\images\logo.ico
Compression=lzma
SolidCompression=yes
Expand Down
2 changes: 1 addition & 1 deletion src/binder.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def updateProfiles(self):
keyboard.add_hotkey(profile[2], self.playProfile, args=(str(profile[1]),))

def playProfile(self, profileName: str):
if self.database.isSettingEnabled('dontCheckForName') or (rageMpTitle in utils.getActiveWindowTitle()):
if not self.database.isSettingEnabled('checkFullScreen') or utils.isAppFullScreen():
profileStrings = self.database.findStringsInProfile(profileName)

for profileString in profileStrings:
Expand Down
7 changes: 4 additions & 3 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def __showWithUuid(self, uuid: str) -> None:
currentRowCooldown.setText(str(profileStrings[i][1]))
else:
self.uuid = uuidlib.uuid4().hex
self.ui.createProfileButton.setText('Создать')

def createProfileButtonCallback(self):
if not self.ui.profileName.text():
Expand Down Expand Up @@ -135,8 +136,8 @@ def rebuildUI(self):
self.ui.autorunCheckbox.setChecked(utils.isAutoRun())
self.ui.autorunCheckbox.stateChanged.connect(lambda state: utils.enableAutoRun() if state == 2 else utils.disableAutoRun())

self.ui.nameCheckbox.setChecked(database.isSettingEnabled('dontCheckForName'))
self.ui.nameCheckbox.stateChanged.connect(lambda state: database.setSettingValue('dontCheckForName', state))
self.ui.nameCheckbox.setChecked(database.isSettingEnabled('checkFullScreen'))
self.ui.nameCheckbox.stateChanged.connect(lambda state: database.setSettingValue('checkFullScreen', state))

for profile in database.findAllProfiles():
self.ui.listWidget.addItem(profile[0])
Expand Down Expand Up @@ -198,7 +199,7 @@ def main():

app.setApplicationName('ArciBinder')
app.setApplicationDisplayName('ArciBinder')
app.setApplicationVersion('1.2.1')
app.setApplicationVersion('1.2.2')
app.setWindowIcon(QIcon(os.path.join(basedir, "ui/images/logo.ico")))
if QFontDatabase.addApplicationFont(u":/fonts/fonts/Rubik-SemiBold.ttf") < 0: print('Unable to load font!')

Expand Down
34 changes: 32 additions & 2 deletions src/ui/mainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ QPushButton::pressed {
<height>41</height>
</rect>
</property>
<property name="toolTip">
<string>Профили</string>
</property>
<property name="text">
<string/>
</property>
Expand All @@ -171,6 +174,9 @@ QPushButton::pressed {
<height>41</height>
</rect>
</property>
<property name="toolTip">
<string>Настройки</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
Expand Down Expand Up @@ -203,6 +209,9 @@ QPushButton::pressed {
<pointsize>-1</pointsize>
</font>
</property>
<property name="toolTip">
<string>GitHub разработчика</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
Expand Down Expand Up @@ -289,6 +298,9 @@ QPushButton::pressed {
<pointsize>-1</pointsize>
</font>
</property>
<property name="toolTip">
<string>При нажатии крестика приложение будет не выключаться, а скрываться в панель задач.</string>
</property>
<property name="text">
<string>Прятать приложение в трей при нажатии кнопки &quot;Закрыть&quot;</string>
</property>
Expand All @@ -308,8 +320,11 @@ QPushButton::pressed {
<pointsize>-1</pointsize>
</font>
</property>
<property name="toolTip">
<string>Запускает приложение автоматически вместе с системой.</string>
</property>
<property name="text">
<string>Запускать приложение вместе с системой (автозапуск)</string>
<string>Запускать приложение вместе с системой (автозагрузка)</string>
</property>
</widget>
<widget class="QCheckBox" name="nameCheckbox">
Expand All @@ -327,8 +342,11 @@ QPushButton::pressed {
<pointsize>-1</pointsize>
</font>
</property>
<property name="toolTip">
<string>Нужно, если вы хотите что бы биндер работал только в игре. Не работает, если игра запущена в окне.</string>
</property>
<property name="text">
<string>Использовать бинды не только в RAGE Multiplayer</string>
<string>Проверять, открыто ли полноэкранное приложение</string>
</property>
</widget>
</widget>
Expand Down Expand Up @@ -368,6 +386,9 @@ QPushButton::pressed {
<pointsize>-1</pointsize>
</font>
</property>
<property name="toolTip">
<string>Создать новый профиль</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
Expand Down Expand Up @@ -403,6 +424,9 @@ QPushButton::pressed {
<pointsize>-1</pointsize>
</font>
</property>
<property name="toolTip">
<string>Изменить выбранный профиль</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
Expand Down Expand Up @@ -438,6 +462,9 @@ QPushButton::pressed {
<pointsize>-1</pointsize>
</font>
</property>
<property name="toolTip">
<string>Удалить выбранный профиль</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
Expand Down Expand Up @@ -486,6 +513,9 @@ QPushButton::pressed {
<height>321</height>
</rect>
</property>
<property name="toolTip">
<string>Список ваших созданных профилей, пусто если нету ни одного созданного профиля.</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
Expand Down
63 changes: 51 additions & 12 deletions src/ui/profileEditWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>967</width>
<height>503</height>
<height>518</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -52,8 +52,8 @@ QListWidget {
<widget class="QPushButton" name="createProfileButton">
<property name="geometry">
<rect>
<x>410</x>
<y>460</y>
<x>400</x>
<y>470</y>
<width>181</width>
<height>31</height>
</rect>
Expand Down Expand Up @@ -86,8 +86,8 @@ QListWidget {
<widget class="QLabel" name="shortcutlabel">
<property name="geometry">
<rect>
<x>550</x>
<y>400</y>
<x>540</x>
<y>410</y>
<width>91</width>
<height>21</height>
</rect>
Expand All @@ -106,12 +106,15 @@ QListWidget {
<property name="text">
<string>Клавиша</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QKeySequenceEdit" name="shortcut">
<property name="geometry">
<rect>
<x>550</x>
<y>430</y>
<x>540</x>
<y>440</y>
<width>91</width>
<height>21</height>
</rect>
Expand All @@ -132,8 +135,8 @@ QListWidget {
<widget class="QLineEdit" name="profileName">
<property name="geometry">
<rect>
<x>340</x>
<y>430</y>
<x>330</x>
<y>440</y>
<width>181</width>
<height>21</height>
</rect>
Expand All @@ -145,8 +148,8 @@ QListWidget {
<widget class="QLabel" name="profiileNameLabel">
<property name="geometry">
<rect>
<x>340</x>
<y>400</y>
<x>330</x>
<y>410</y>
<width>191</width>
<height>20</height>
</rect>
Expand All @@ -170,7 +173,7 @@ QListWidget {
<property name="geometry">
<rect>
<x>20</x>
<y>50</y>
<y>60</y>
<width>921</width>
<height>341</height>
</rect>
Expand Down Expand Up @@ -744,6 +747,42 @@ QListWidget {
<string>Редактор</string>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>30</x>
<y>50</y>
<width>41</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Текст</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>810</x>
<y>50</y>
<width>61</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Задержка</string>
</property>
</widget>
</widget>
</widget>
<resources>
Expand Down
23 changes: 12 additions & 11 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import os
import winreg as reg
import sys
from ctypes import wintypes, windll, create_unicode_buffer
from ctypes import windll
import win32gui

def singleKeyPress(key: str) -> None:
keyboard.press(key)
Expand All @@ -14,16 +15,16 @@ def singleKeyPress(key: str) -> None:
def quit() -> None:
os._exit(0)

def getActiveWindowTitle() -> str:
hWnd = windll.user32.GetForegroundWindow()
length = windll.user32.GetWindowTextLengthW(hWnd)
buf = create_unicode_buffer(length + 1)
windll.user32.GetWindowTextW(hWnd, buf, length + 1)

if buf.value:
return buf.value
else:
return "NOTHING"
def isAppFullScreen():
user32 = windll.user32
user32.SetProcessDPIAware()

try:
hWnd = user32.GetForegroundWindow()
rect = win32gui.GetWindowRect(hWnd)
return rect == (0, 0, windll.user32.GetSystemMetrics(0), windll.user32.GetSystemMetrics(1))
except:
return False

def openURL(link: str) -> None:
os.system(f"start \"\" {link}")
Expand Down
34 changes: 32 additions & 2 deletions src/windows/mainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,48 @@ def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"\u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u043c\u0435\u043d\u044e", None))
self.closeButton.setText("")
self.minimizeButton.setText("")
#if QT_CONFIG(tooltip)
self.profilesButton.setToolTip(QCoreApplication.translate("MainWindow", u"\u041f\u0440\u043e\u0444\u0438\u043b\u0438", None))
#endif // QT_CONFIG(tooltip)
self.profilesButton.setText("")
#if QT_CONFIG(tooltip)
self.settingsButton.setToolTip(QCoreApplication.translate("MainWindow", u"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438", None))
#endif // QT_CONFIG(tooltip)
self.settingsButton.setText("")
#if QT_CONFIG(tooltip)
self.adButton.setToolTip(QCoreApplication.translate("MainWindow", u"GitHub \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430", None))
#endif // QT_CONFIG(tooltip)
self.adButton.setText("")
self.title.setText("")
self.settingsTitle.setText(QCoreApplication.translate("MainWindow", u"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438", None))
#if QT_CONFIG(tooltip)
self.trayCheckbox.setToolTip(QCoreApplication.translate("MainWindow", u"\u041f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u0440\u0435\u0441\u0442\u0438\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f, \u0430 \u0441\u043a\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u0430\u043d\u0435\u043b\u044c \u0437\u0430\u0434\u0430\u0447.", None))
#endif // QT_CONFIG(tooltip)
self.trayCheckbox.setText(QCoreApplication.translate("MainWindow", u"\u041f\u0440\u044f\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0442\u0440\u0435\u0439 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \"\u0417\u0430\u043a\u0440\u044b\u0442\u044c\"", None))
self.autorunCheckbox.setText(QCoreApplication.translate("MainWindow", u"\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 (\u0430\u0432\u0442\u043e\u0437\u0430\u043f\u0443\u0441\u043a)", None))
self.nameCheckbox.setText(QCoreApplication.translate("MainWindow", u"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u043d\u0434\u044b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 RAGE Multiplayer", None))
#if QT_CONFIG(tooltip)
self.autorunCheckbox.setToolTip(QCoreApplication.translate("MainWindow", u"\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439.", None))
#endif // QT_CONFIG(tooltip)
self.autorunCheckbox.setText(QCoreApplication.translate("MainWindow", u"\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 (\u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430)", None))
#if QT_CONFIG(tooltip)
self.nameCheckbox.setToolTip(QCoreApplication.translate("MainWindow", u"\u041d\u0443\u0436\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0447\u0442\u043e \u0431\u044b \u0431\u0438\u043d\u0434\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0438\u0433\u0440\u0435. \u041d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0435\u0441\u043b\u0438 \u0438\u0433\u0440\u0430 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430 \u0432 \u043e\u043a\u043d\u0435.", None))
#endif // QT_CONFIG(tooltip)
self.nameCheckbox.setText(QCoreApplication.translate("MainWindow", u"\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u043e\u0442\u043a\u0440\u044b\u0442\u043e \u043b\u0438 \u043f\u043e\u043b\u043d\u043e\u044d\u043a\u0440\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435", None))
#if QT_CONFIG(tooltip)
self.createProfileButton.setToolTip(QCoreApplication.translate("MainWindow", u"\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c", None))
#endif // QT_CONFIG(tooltip)
self.createProfileButton.setText("")
#if QT_CONFIG(tooltip)
self.editProfileButton.setToolTip(QCoreApplication.translate("MainWindow", u"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c", None))
#endif // QT_CONFIG(tooltip)
self.editProfileButton.setText("")
#if QT_CONFIG(tooltip)
self.deleteProfileButton.setToolTip(QCoreApplication.translate("MainWindow", u"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c", None))
#endif // QT_CONFIG(tooltip)
self.deleteProfileButton.setText("")
self.profilesTitle.setText(QCoreApplication.translate("MainWindow", u"\u041f\u0440\u043e\u0444\u0438\u043b\u0438", None))
#if QT_CONFIG(tooltip)
self.listWidget.setToolTip(QCoreApplication.translate("MainWindow", u"\u0421\u043f\u0438\u0441\u043e\u043a \u0432\u0430\u0448\u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0444\u0438\u043b\u0435\u0439, \u043f\u0443\u0441\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0435\u0442\u0443 \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0444\u0438\u043b\u044f.", None))
#endif // QT_CONFIG(tooltip)
self.label.setText(QCoreApplication.translate("MainWindow", u"\u0412\u0430\u0448\u0438 \u043f\u0440\u043e\u0444\u0438\u043b\u0438:", None))
# retranslateUi

Loading

0 comments on commit 48e2332

Please sign in to comment.