Initial commit xd
This commit is contained in:
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
10
.idea/HOI4Launcher.iml
generated
Normal file
10
.idea/HOI4Launcher.iml
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Python 3.14 (HOI4Launcher)" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
55
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
55
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,55 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="myValues">
|
||||
<value>
|
||||
<list size="1">
|
||||
<item index="0" class="java.lang.String" itemvalue="," />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
<option name="myCustomValuesEnabled" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="myValues">
|
||||
<value>
|
||||
<list size="10">
|
||||
<item index="0" class="java.lang.String" itemvalue="nobr" />
|
||||
<item index="1" class="java.lang.String" itemvalue="noembed" />
|
||||
<item index="2" class="java.lang.String" itemvalue="comment" />
|
||||
<item index="3" class="java.lang.String" itemvalue="noscript" />
|
||||
<item index="4" class="java.lang.String" itemvalue="embed" />
|
||||
<item index="5" class="java.lang.String" itemvalue="script" />
|
||||
<item index="6" class="java.lang.String" itemvalue="div" />
|
||||
<item index="7" class="java.lang.String" itemvalue="upper-panel" />
|
||||
<item index="8" class="java.lang.String" itemvalue="link-container" />
|
||||
<item index="9" class="java.lang.String" itemvalue="auth" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
<option name="myCustomValuesEnabled" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PyPep8Inspection" enabled="true" level="INFORMATION" enabled_by_default="true">
|
||||
<option name="ignoredErrors">
|
||||
<list>
|
||||
<option value="E302" />
|
||||
</list>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
||||
<option name="ignoredErrors">
|
||||
<list>
|
||||
<option value="N806" />
|
||||
<option value="N811" />
|
||||
</list>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||
<option name="processCode" value="true" />
|
||||
<option name="processLiterals" value="true" />
|
||||
<option name="processComments" value="false" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="SqlNoDataSourceInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
||||
6
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
6
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
7
.idea/misc.xml
generated
Normal file
7
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.13 (HOI4Launcher)" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.14 (HOI4Launcher)" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/HOI4Launcher.iml" filepath="$PROJECT_DIR$/.idea/HOI4Launcher.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
101
Layout/ui/card.ui
Normal file
101
Layout/ui/card.ui
Normal file
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainCard</class>
|
||||
<widget class="QWidget" name="MainCard">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>144</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="horizontalWidget" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>144</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="card_thumbnail">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="card_title_check">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="card_descr">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
253
Layout/ui/main.ui
Normal file
253
Layout/ui/main.ui
Normal file
@@ -0,0 +1,253 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::ContextMenuPolicy::NoContextMenu</enum>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::ContextMenuPolicy::NoContextMenu</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="gridWidget" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>8</x>
|
||||
<y>8</y>
|
||||
<width>784</width>
|
||||
<height>584</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="mods_tab">
|
||||
<attribute name="title">
|
||||
<string>Mods</string>
|
||||
</attribute>
|
||||
<widget class="QWidget" name="mods_main_container" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>778</width>
|
||||
<height>467</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarPolicy::ScrollBarAsNeeded</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="verticalWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>766</width>
|
||||
<height>455</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="mods_container">
|
||||
<property name="spacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QWidget" name="dlc_tab">
|
||||
<attribute name="title">
|
||||
<string>DLCs</string>
|
||||
</attribute>
|
||||
<widget class="QWidget" name="dlcs_main_container" native="true">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>778</width>
|
||||
<height>467</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarPolicy::ScrollBarAsNeeded</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="verticalWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>766</width>
|
||||
<height>455</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="dlcs_container">
|
||||
<property name="spacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="apply_button">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Apply</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="QIcon::ThemeIcon::ListAdd"/>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="play_button">
|
||||
<property name="text">
|
||||
<string>Play</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="QIcon::ThemeIcon::GoNext"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
81
Layout/ui_card.py
Normal file
81
Layout/ui_card.py
Normal file
@@ -0,0 +1,81 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file 'card.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.10.1
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QCheckBox, QHBoxLayout, QLabel,
|
||||
QSizePolicy, QVBoxLayout, QWidget)
|
||||
|
||||
class Ui_MainCard(object):
|
||||
def setupUi(self, MainCard):
|
||||
if not MainCard.objectName():
|
||||
MainCard.setObjectName(u"MainCard")
|
||||
MainCard.resize(600, 144)
|
||||
sizePolicy = QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(MainCard.sizePolicy().hasHeightForWidth())
|
||||
MainCard.setSizePolicy(sizePolicy)
|
||||
self.horizontalWidget = QWidget(MainCard)
|
||||
self.horizontalWidget.setObjectName(u"horizontalWidget")
|
||||
self.horizontalWidget.setGeometry(QRect(0, 0, 600, 144))
|
||||
sizePolicy.setHeightForWidth(self.horizontalWidget.sizePolicy().hasHeightForWidth())
|
||||
self.horizontalWidget.setSizePolicy(sizePolicy)
|
||||
self.horizontalLayout = QHBoxLayout(self.horizontalWidget)
|
||||
self.horizontalLayout.setSpacing(8)
|
||||
self.horizontalLayout.setObjectName(u"horizontalLayout")
|
||||
self.horizontalLayout.setContentsMargins(8, 8, 8, 8)
|
||||
self.card_thumbnail = QLabel(self.horizontalWidget)
|
||||
self.card_thumbnail.setObjectName(u"card_thumbnail")
|
||||
sizePolicy.setHeightForWidth(self.card_thumbnail.sizePolicy().hasHeightForWidth())
|
||||
self.card_thumbnail.setSizePolicy(sizePolicy)
|
||||
|
||||
self.horizontalLayout.addWidget(self.card_thumbnail)
|
||||
|
||||
self.verticalLayout = QVBoxLayout()
|
||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||
self.card_title_check = QCheckBox(self.horizontalWidget)
|
||||
self.card_title_check.setObjectName(u"card_title_check")
|
||||
sizePolicy1 = QSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Fixed)
|
||||
sizePolicy1.setHorizontalStretch(0)
|
||||
sizePolicy1.setVerticalStretch(0)
|
||||
sizePolicy1.setHeightForWidth(self.card_title_check.sizePolicy().hasHeightForWidth())
|
||||
self.card_title_check.setSizePolicy(sizePolicy1)
|
||||
|
||||
self.verticalLayout.addWidget(self.card_title_check)
|
||||
|
||||
self.card_descr = QLabel(self.horizontalWidget)
|
||||
self.card_descr.setObjectName(u"card_descr")
|
||||
self.card_descr.setAlignment(Qt.AlignmentFlag.AlignLeading|Qt.AlignmentFlag.AlignLeft|Qt.AlignmentFlag.AlignTop)
|
||||
self.card_descr.setWordWrap(True)
|
||||
|
||||
self.verticalLayout.addWidget(self.card_descr)
|
||||
|
||||
|
||||
self.horizontalLayout.addLayout(self.verticalLayout)
|
||||
|
||||
|
||||
self.retranslateUi(MainCard)
|
||||
|
||||
QMetaObject.connectSlotsByName(MainCard)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, MainCard):
|
||||
MainCard.setWindowTitle(QCoreApplication.translate("MainCard", u"Form", None))
|
||||
self.card_thumbnail.setText(QCoreApplication.translate("MainCard", u"TextLabel", None))
|
||||
self.card_title_check.setText(QCoreApplication.translate("MainCard", u"CheckBox", None))
|
||||
self.card_descr.setText(QCoreApplication.translate("MainCard", u"TextLabel", None))
|
||||
# retranslateUi
|
||||
|
||||
157
Layout/ui_main.py
Normal file
157
Layout/ui_main.py
Normal file
@@ -0,0 +1,157 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
################################################################################
|
||||
## Form generated from reading UI file 'main.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.10.1
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
|
||||
from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
|
||||
QMetaObject, QObject, QPoint, QRect,
|
||||
QSize, QTime, QUrl, Qt)
|
||||
from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
||||
QFont, QFontDatabase, QGradient, QIcon,
|
||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||
from PySide6.QtWidgets import (QApplication, QGridLayout, QMainWindow, QPushButton,
|
||||
QScrollArea, QSizePolicy, QTabWidget, QVBoxLayout,
|
||||
QWidget)
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
if not MainWindow.objectName():
|
||||
MainWindow.setObjectName(u"MainWindow")
|
||||
MainWindow.resize(800, 600)
|
||||
sizePolicy = QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
|
||||
MainWindow.setSizePolicy(sizePolicy)
|
||||
MainWindow.setContextMenuPolicy(Qt.ContextMenuPolicy.NoContextMenu)
|
||||
self.centralwidget = QWidget(MainWindow)
|
||||
self.centralwidget.setObjectName(u"centralwidget")
|
||||
sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
|
||||
self.centralwidget.setSizePolicy(sizePolicy)
|
||||
self.centralwidget.setContextMenuPolicy(Qt.ContextMenuPolicy.NoContextMenu)
|
||||
self.gridWidget = QWidget(self.centralwidget)
|
||||
self.gridWidget.setObjectName(u"gridWidget")
|
||||
self.gridWidget.setGeometry(QRect(8, 8, 784, 584))
|
||||
self.gridLayout = QGridLayout(self.gridWidget)
|
||||
self.gridLayout.setSpacing(8)
|
||||
self.gridLayout.setObjectName(u"gridLayout")
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.verticalLayout = QVBoxLayout()
|
||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||
self.tabWidget = QTabWidget(self.gridWidget)
|
||||
self.tabWidget.setObjectName(u"tabWidget")
|
||||
self.mods_tab = QWidget()
|
||||
self.mods_tab.setObjectName(u"mods_tab")
|
||||
self.mods_main_container = QWidget(self.mods_tab)
|
||||
self.mods_main_container.setObjectName(u"mods_main_container")
|
||||
self.mods_main_container.setGeometry(QRect(0, 0, 778, 467))
|
||||
sizePolicy1 = QSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum)
|
||||
sizePolicy1.setHorizontalStretch(0)
|
||||
sizePolicy1.setVerticalStretch(0)
|
||||
sizePolicy1.setHeightForWidth(self.mods_main_container.sizePolicy().hasHeightForWidth())
|
||||
self.mods_main_container.setSizePolicy(sizePolicy1)
|
||||
self.verticalLayout1 = QVBoxLayout(self.mods_main_container)
|
||||
self.verticalLayout1.setObjectName(u"verticalLayout1")
|
||||
self.scrollArea = QScrollArea(self.mods_main_container)
|
||||
self.scrollArea.setObjectName(u"scrollArea")
|
||||
sizePolicy2 = QSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Minimum)
|
||||
sizePolicy2.setHorizontalStretch(0)
|
||||
sizePolicy2.setVerticalStretch(0)
|
||||
sizePolicy2.setHeightForWidth(self.scrollArea.sizePolicy().hasHeightForWidth())
|
||||
self.scrollArea.setSizePolicy(sizePolicy2)
|
||||
self.scrollArea.setVerticalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAsNeeded)
|
||||
self.scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
|
||||
self.scrollArea.setWidgetResizable(True)
|
||||
self.verticalWidget = QWidget()
|
||||
self.verticalWidget.setObjectName(u"verticalWidget")
|
||||
self.verticalWidget.setGeometry(QRect(0, 0, 766, 455))
|
||||
sizePolicy2.setHeightForWidth(self.verticalWidget.sizePolicy().hasHeightForWidth())
|
||||
self.verticalWidget.setSizePolicy(sizePolicy2)
|
||||
self.mods_container = QVBoxLayout(self.verticalWidget)
|
||||
self.mods_container.setSpacing(8)
|
||||
self.mods_container.setObjectName(u"mods_container")
|
||||
self.mods_container.setContentsMargins(8, 8, 8, 8)
|
||||
self.scrollArea.setWidget(self.verticalWidget)
|
||||
|
||||
self.verticalLayout1.addWidget(self.scrollArea)
|
||||
|
||||
self.tabWidget.addTab(self.mods_tab, "")
|
||||
self.dlc_tab = QWidget()
|
||||
self.dlc_tab.setObjectName(u"dlc_tab")
|
||||
self.dlcs_main_container = QWidget(self.dlc_tab)
|
||||
self.dlcs_main_container.setObjectName(u"dlcs_main_container")
|
||||
self.dlcs_main_container.setGeometry(QRect(0, 0, 778, 467))
|
||||
sizePolicy3 = QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Expanding)
|
||||
sizePolicy3.setHorizontalStretch(0)
|
||||
sizePolicy3.setVerticalStretch(0)
|
||||
sizePolicy3.setHeightForWidth(self.dlcs_main_container.sizePolicy().hasHeightForWidth())
|
||||
self.dlcs_main_container.setSizePolicy(sizePolicy3)
|
||||
self.verticalLayout_2 = QVBoxLayout(self.dlcs_main_container)
|
||||
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
|
||||
self.scrollArea_2 = QScrollArea(self.dlcs_main_container)
|
||||
self.scrollArea_2.setObjectName(u"scrollArea_2")
|
||||
sizePolicy2.setHeightForWidth(self.scrollArea_2.sizePolicy().hasHeightForWidth())
|
||||
self.scrollArea_2.setSizePolicy(sizePolicy2)
|
||||
self.scrollArea_2.setVerticalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAsNeeded)
|
||||
self.scrollArea_2.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
|
||||
self.scrollArea_2.setWidgetResizable(True)
|
||||
self.verticalWidget_2 = QWidget()
|
||||
self.verticalWidget_2.setObjectName(u"verticalWidget_2")
|
||||
self.verticalWidget_2.setGeometry(QRect(0, 0, 766, 455))
|
||||
sizePolicy2.setHeightForWidth(self.verticalWidget_2.sizePolicy().hasHeightForWidth())
|
||||
self.verticalWidget_2.setSizePolicy(sizePolicy2)
|
||||
self.dlcs_container = QVBoxLayout(self.verticalWidget_2)
|
||||
self.dlcs_container.setSpacing(8)
|
||||
self.dlcs_container.setObjectName(u"dlcs_container")
|
||||
self.dlcs_container.setContentsMargins(8, 8, 8, 8)
|
||||
self.scrollArea_2.setWidget(self.verticalWidget_2)
|
||||
|
||||
self.verticalLayout_2.addWidget(self.scrollArea_2)
|
||||
|
||||
self.tabWidget.addTab(self.dlc_tab, "")
|
||||
|
||||
self.verticalLayout.addWidget(self.tabWidget)
|
||||
|
||||
self.apply_button = QPushButton(self.gridWidget)
|
||||
self.apply_button.setObjectName(u"apply_button")
|
||||
self.apply_button.setEnabled(False)
|
||||
icon = QIcon(QIcon.fromTheme(QIcon.ThemeIcon.ListAdd))
|
||||
self.apply_button.setIcon(icon)
|
||||
self.apply_button.setCheckable(False)
|
||||
|
||||
self.verticalLayout.addWidget(self.apply_button)
|
||||
|
||||
self.play_button = QPushButton(self.gridWidget)
|
||||
self.play_button.setObjectName(u"play_button")
|
||||
icon1 = QIcon(QIcon.fromTheme(QIcon.ThemeIcon.GoNext))
|
||||
self.play_button.setIcon(icon1)
|
||||
|
||||
self.verticalLayout.addWidget(self.play_button)
|
||||
|
||||
|
||||
self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)
|
||||
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
|
||||
self.tabWidget.setCurrentIndex(0)
|
||||
|
||||
|
||||
QMetaObject.connectSlotsByName(MainWindow)
|
||||
# setupUi
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.mods_tab), QCoreApplication.translate("MainWindow", u"Mods", None))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.dlc_tab), QCoreApplication.translate("MainWindow", u"DLCs", None))
|
||||
self.apply_button.setText(QCoreApplication.translate("MainWindow", u"Apply", None))
|
||||
self.play_button.setText(QCoreApplication.translate("MainWindow", u"Play", None))
|
||||
# retranslateUi
|
||||
|
||||
6
build.sh
Normal file
6
build.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
for i in ./Layout/ui/*.ui; do
|
||||
./.venv/bin/pyside6-uic "$i" -o ./Layout/ui_"$(basename "$i" | sed -e 's/.ui/.py/g')"
|
||||
done
|
||||
python main.py
|
||||
165
main.py
Normal file
165
main.py
Normal file
@@ -0,0 +1,165 @@
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import zipfile
|
||||
from functools import partial
|
||||
from json import JSONDecodeError
|
||||
|
||||
from PySide6 import QtWidgets
|
||||
from PySide6.QtCore import QProcess
|
||||
from PySide6.QtGui import QPixmap
|
||||
from PySide6.QtWidgets import QMainWindow, QWidget
|
||||
|
||||
from Layout.ui_card import Ui_MainCard
|
||||
from Layout.ui_main import Ui_MainWindow
|
||||
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super(MainWindow, self).__init__()
|
||||
self.ui = Ui_MainWindow()
|
||||
self.ui.setupUi(self)
|
||||
self.setFixedSize(800, 600)
|
||||
|
||||
class MainCard(QWidget):
|
||||
def __init__(self):
|
||||
super(MainCard, self).__init__()
|
||||
self.ui = Ui_MainCard()
|
||||
self.ui.setupUi(self)
|
||||
self.setFixedSize(762, 144)
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QtWidgets.QApplication([])
|
||||
|
||||
mainWindow = MainWindow()
|
||||
|
||||
def update_apply_button_state():
|
||||
old_mods = enabled_mods
|
||||
old_mods.sort()
|
||||
new_mods = new_enabled_mods
|
||||
new_mods.sort()
|
||||
old_dlcs = disabled_dlcs
|
||||
old_dlcs.sort()
|
||||
new_dlcs = new_disabled_dlcs
|
||||
new_dlcs.sort()
|
||||
|
||||
if new_mods == old_mods and old_dlcs == new_dlcs:
|
||||
mainWindow.ui.apply_button.setEnabled(False)
|
||||
else:
|
||||
mainWindow.ui.apply_button.setEnabled(True)
|
||||
|
||||
def add_remove_mods(modf: str):
|
||||
if modf in new_enabled_mods:
|
||||
new_enabled_mods.remove(modf)
|
||||
else:
|
||||
new_enabled_mods.append(modf)
|
||||
update_apply_button_state()
|
||||
|
||||
def add_remove_dlcs(dlcf: str):
|
||||
if dlcf in new_disabled_dlcs:
|
||||
new_disabled_dlcs.remove(dlcf)
|
||||
else:
|
||||
new_disabled_dlcs.append(dlcf)
|
||||
update_apply_button_state()
|
||||
|
||||
def on_process_finished():
|
||||
app.quit()
|
||||
|
||||
def play_game():
|
||||
if mainWindow.ui.apply_button.isEnabled():
|
||||
apply_mods_and_dlcs()
|
||||
mainWindow.hide()
|
||||
process = QProcess(mainWindow)
|
||||
process.finished.connect(on_process_finished)
|
||||
process.start("/bin/bash", ["-c", f"xdg-open steam://rungameid/394360"])
|
||||
|
||||
dlc_mod_file = f"{os.getenv('HOME')}/.local/share/Paradox Interactive/Hearts of Iron IV/dlc_load.json"
|
||||
with open(dlc_mod_file, "r") as dlc_f:
|
||||
dlc_obj = json.load(dlc_f)
|
||||
enabled_mods = [i.replace("mod/ugc_", "").replace(".mod", "") for i in dlc_obj["enabled_mods"]]
|
||||
disabled_dlcs = [i.split("/")[1] for i in dlc_obj["disabled_dlcs"]]
|
||||
|
||||
new_enabled_mods = enabled_mods.copy()
|
||||
new_disabled_dlcs = disabled_dlcs.copy()
|
||||
|
||||
def apply_mods_and_dlcs():
|
||||
global enabled_mods
|
||||
enabled_mods = new_enabled_mods.copy()
|
||||
global disabled_dlcs
|
||||
disabled_dlcs = new_disabled_dlcs.copy()
|
||||
new_dlc_obj = dlc_obj.copy()
|
||||
|
||||
new_dlc_obj["enabled_mods"] = [f"mod/ugc_{mod}.mod" for mod in new_enabled_mods]
|
||||
new_dlc_obj["disabled_dlcs"] = [f"dlc/{dlc}/{dlc.split("_")[0]}.dlc" for dlc in new_disabled_dlcs]
|
||||
|
||||
with open(dlc_mod_file, "w") as mf:
|
||||
mf.write(json.dumps(new_dlc_obj))
|
||||
|
||||
update_apply_button_state()
|
||||
|
||||
mainWindow.ui.apply_button.clicked.connect(apply_mods_and_dlcs)
|
||||
mainWindow.ui.play_button.clicked.connect(play_game)
|
||||
|
||||
mod_dir = f"{os.getenv('HOME')}/.local/share/Steam/steamapps/workshop/content/394360"
|
||||
dlc_dir = f"{os.getenv('HOME')}/.local/share/Steam/steamapps/common/Hearts of Iron IV/dlc"
|
||||
temp_thumb = "placeholder_unknown.jpg"
|
||||
|
||||
for f in os.listdir(mod_dir):
|
||||
try:
|
||||
with open(f"{mod_dir}/{f}/descriptor.mod", "r", encoding="utf-8") as fl:
|
||||
text = fl.read()
|
||||
except FileNotFoundError:
|
||||
files = os.listdir(f"{mod_dir}/{f}")
|
||||
if ".zip" == [a[-4:] for a in files][0]:
|
||||
with zipfile.ZipFile(f"{mod_dir}/{f}/{files[0]}") as zf:
|
||||
with zf.open("descriptor.mod") as flz:
|
||||
text = flz.read().decode("utf-8")
|
||||
|
||||
mod_name = re.findall('name="(.*)"', text)[0]
|
||||
thumb_name = re.findall('picture="(.*)"', text)
|
||||
if len(thumb_name) != 0:
|
||||
mod_thumbnail = f"{mod_dir}/{f}/{thumb_name[0]}"
|
||||
elif "thumbnail.png" in os.listdir(f"{mod_dir}/{f}"):
|
||||
mod_thumbnail = f"{mod_dir}/{f}/thumbnail.png"
|
||||
else:
|
||||
mod_thumbnail = temp_thumb
|
||||
|
||||
item = MainCard()
|
||||
item.ui.card_thumbnail.setFixedSize(128, 128)
|
||||
pixmap = QPixmap(mod_thumbnail).scaled(item.ui.card_thumbnail.size())
|
||||
item.ui.card_thumbnail.setPixmap(pixmap)
|
||||
item.ui.card_title_check.setText(mod_name)
|
||||
item.ui.card_descr.setText(f"{mod_dir}/{f}")
|
||||
if f in enabled_mods:
|
||||
item.ui.card_title_check.setChecked(True)
|
||||
item.ui.card_title_check.clicked.connect(partial(add_remove_mods, f))
|
||||
mainWindow.ui.mods_container.layout().addWidget(item)
|
||||
|
||||
for d in os.listdir(dlc_dir):
|
||||
dlc_p = f"{dlc_dir}/{d}"
|
||||
dlc_info = f"{dlc_p}/{d.split("_")[0]}.dlc"
|
||||
dlc_name = ""
|
||||
dlc_thumbnail = ""
|
||||
try:
|
||||
with open(dlc_info, "r") as df:
|
||||
text = df.read()
|
||||
dlc_name = re.findall('^name = "(.*)"', text)[0]
|
||||
dlc_thumbnail = f"{dlc_p}/thumbnail.png"
|
||||
except FileNotFoundError:
|
||||
dlc_name = d
|
||||
dlc_thumbnail = temp_thumb
|
||||
|
||||
item = MainCard()
|
||||
item.ui.card_thumbnail.setFixedSize(224, 128)
|
||||
pixmap = QPixmap(dlc_thumbnail).scaled(item.ui.card_thumbnail.size())
|
||||
item.ui.card_thumbnail.setPixmap(pixmap)
|
||||
item.ui.card_title_check.setText(dlc_name)
|
||||
if d not in disabled_dlcs:
|
||||
item.ui.card_title_check.setChecked(True)
|
||||
item.ui.card_title_check.clicked.connect(partial(add_remove_dlcs, d))
|
||||
mainWindow.ui.dlcs_container.layout().addWidget(item)
|
||||
|
||||
mainWindow.show()
|
||||
|
||||
sys.exit(app.exec())
|
||||
BIN
placeholder_unknown.jpg
Normal file
BIN
placeholder_unknown.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 107 KiB |
1
settings.json
Normal file
1
settings.json
Normal file
@@ -0,0 +1 @@
|
||||
{"cmdline_args": "./cream.sh %command%"}
|
||||
Reference in New Issue
Block a user