Skip to content

Commit

Permalink
v0.6.1 Release
Browse files Browse the repository at this point in the history
Updated various scripts in the Handburger Modkit, including AudioCalculator, FolderMaker, MCAConverter, MCA_Forge, NSOpusConverter, OpusMetadataExtractor, and STQ_Merge, with changes to version numbers, themes, etc.

Made much cleaner and cohesive system-wide.

Revised locales, added Cantonese (yue) locale.
  • Loading branch information
RTHKKona committed Sep 8, 2024
1 parent 7c5af37 commit aaa21dc
Show file tree
Hide file tree
Showing 21 changed files with 302 additions and 87 deletions.
4 changes: 2 additions & 2 deletions Hb_Modkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def add_tabs(self):
"Audio Calculator": AudioCalculator.AudioCalculator,
"FolderMaker": FolderMaker.FolderMaker,
"Hex Enc/Decoder": HexConverterEncoder.HexConverterEncoder,
"NSOpus Converter": NSOpusConverter.NSOpusConverter,
"NS Opus Converter": NSOpusConverter.NSOpusConverter,
"Opus Metadata Extractor": OpusMetadataExtractor.OpusMetadataExtractor,
"STQ Merge Tool": STQ_Merge.STQMergeTool,
"MCA Converter" : MCAConverter.WavToMcaConverter,
Expand Down Expand Up @@ -555,7 +555,7 @@ def update_translations(self, translations):
"MCA Converter": translations.get('mcaconvert_desc', "Converts audio files into .MCA format. For use with the MCA Header Injector for modding."),
"MCA Forger": translations.get('mcaforge_desc', "Allows users to import two .MCA files—an original and a replacement—and merge key elements to create a new custom header with a preset structure."),
"Hex Enc/Decoder": translations.get('hex_enc_decoder_desc', "Encodes or decodes hexadecimal data, useful for file conversions and analysis."),
"NSOpus Converter": translations.get('nsopus_converter_desc',"Converts audio files to and from the Opus format, with support for Nintendo Switch Opus MHGU-specific formats."),
"NS Opus Converter": translations.get('nsopus_converter_desc',"Converts audio files to and from the Opus format, with support for Nintendo Switch Opus MHGU-specific formats."),
"Opus Metadata Extractor": translations.get('opus_metadata_extractor_desc', "Extracts metadata from Opus files for easier management and editing.")
}

Expand Down
16 changes: 9 additions & 7 deletions locales/eng.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
{
"settings_label": "Settings",
"language_label": "Language",
"handburger_modkit_title": "Handburger Modkit",
"about_content": "This multi-use tool is developed to help with various modding tasks for Monster Hunter Generations Ultimate.",
"version": "This is version {version}.",
"tutorial": "Click on any tab to use it. Right-click a tab to pop-out or create a new instance.",
"about_content": "This multi-use tool was developed to assist with and automate various modding tasks for Monster Hunter Generations Ultimate.",
"tutorial": "Click on any tab to use it. Right-click a tab to pop-out or create a new instance of a particular tab.",
"plug": "Find more about the developer (me!) and support them below.",
"thanks": "Thanks to ffmpeg for the conversion functions, masagrator for the NXAenc variation for MHGU, and vgmstream for their audio software and dependencies.",
"thanks": "Massive thanks to my translators, ffmpeg & Dasding for their conversion functions, masagrator for the NXAenc variation for MHGU, and vgmstream for their audio software and dependencies.",
"tool_descriptions_title": "Tool Descriptions",
"stq_editor_tool_desc": "A tool for editing and viewing STQ/STQR files, including hex pattern analysis.",
"stq_merge_tool_desc": "Merging and managing STQR file conflicts between multiple mods.",
"opus_header_injector_desc": "Allows users to inject or modify Opus headers within audio files.",
"opus_header_injector_desc": "Allows users to inject or modify .Opus headers within .Opus files.",
"audio_calculator_desc": "A utility for calculating audio properties such as bitrate, file size, and duration.",
"foldermaker_desc": "Helps in organizing and creating folders necessary for modding projects.",
"mcaconvert_desc": "Converts audio files into .MCA format. For use with the MCA Header Injector for modding.",
"mcaforge_desc": "Allows users to import two .MCA files—an original and a replacement—and merge key elements to create a new custom header with a preset structure.",
"hex_enc_decoder_desc": "Encodes or decodes hexadecimal data, useful for file conversions and analysis.",
"nsopus_converter_desc": "Converts audio files to and from the Opus format, with support for Nintendo Switch Opus MHGU-specific formats.",
"opus_metadata_extractor_desc": "Extracts metadata from Opus files for easier management and editing.",
"settings_label": "Settings",
"language_label": "Language",
"github_link": "GitHub - RTHKKona",
"kofi_link": "Ko-fi - Handburger"
}
}
23 changes: 23 additions & 0 deletions locales/yue.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"handburger_modkit_title": "漢堡包工具包",
"version": "呢個係版本 {version}。",
"about_content": "呢個多功能工具係專門用嚟協助同自動化《怪物獵人XX》嘅各種modding任務。",
"tutorial": "點擊任意標籤頁使用,右擊標籤頁彈出或創建新實例。",
"plug": "了解更多開發者嘅資訊(我!)同埋支持佢哋。",
"thanks": "特別感謝我嘅翻譯者,ffmpeg和Dasding嘅轉換功能,masagrator為MHGU製作嘅NXAenc變體,以及vgmstream嘅音頻軟件同依賴。",
"tool_descriptions_title": "工具說明",
"stq_editor_tool_desc": "一個用嚟編輯同查看STQ/STQR文件嘅工具,包括十六進制模式分析。",
"stq_merge_tool_desc": "合併同管理多個mod之間嘅STQR文件衝突。",
"opus_header_injector_desc": "容許用戶注入或修改Opus文件內嘅.Opus頭部。",
"audio_calculator_desc": "計算音頻屬性嘅工具,例如比特率、文件大小同時長。",
"foldermaker_desc": "協助組織同創建modding項目所需嘅文件夾。",
"mcaconvert_desc": "將音頻文件轉換為MCA格式,用於MCA頭部注入。",
"mcaforge_desc": "容許用戶導入兩個.MCA文件(一個原始文件同一個替換文件),並合併關鍵元素以創建具有預設結構嘅新自訂頭部。",
"hex_enc_decoder_desc": "編碼或解碼十六進制數據,適用於文件轉換同分析。",
"nsopus_converter_desc": "將音頻文件轉換為Opus格式,並支持Nintendo Switch Opus MHGU特定格式。",
"opus_metadata_extractor_desc": "提取Opus文件嘅元數據,方便管理同編輯。",
"settings_label": "設定",
"language_label": "語言",
"github_link": "GitHub - RTHKKona",
"kofi_link": "Ko-fi - 漢堡包"
}
36 changes: 19 additions & 17 deletions locales/zho.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
{
"handburger_modkit_title": "汉堡包工具包",
"version": "这是版本 {version}。",
"about_content": "此多功能工具旨在协助和自动化《怪物猎人XX》中的各种modding任务。",
"tutorial": "点击任何标签页即可使用它。右键单击标签页可弹出或创建该工具的新实例。",
"plug": "了解更多关于开发者(我!)的信息,并在下方支持他们。",
"thanks": "特别感谢我的翻译者,ffmpeg和Dasding的转换功能,masagrator为MHGU制作的NXAenc变体,以及vgmstream的音频软件和依赖项。",
"tool_descriptions_title": "工具说明",
"stq_editor_tool_desc": "用于编辑和查看STQ/STQR文件的工具,包括十六进制模式分析。",
"stq_merge_tool_desc": "合并和管理多个mod之间的STQR文件冲突。",
"opus_header_injector_desc": "允许用户在Opus文件中注入或修改.Opus头部。",
"audio_calculator_desc": "计算音频属性的工具,例如比特率、文件大小和时长。",
"foldermaker_desc": "帮助组织和创建modding项目所需的文件夹。",
"mcaconvert_desc": "将音频文件转换为MCA格式,用于MCA头部注入。",
"mcaforge_desc": "允许用户导入两个.MCA文件(一个原始文件和一个替换文件),并合并关键元素以创建具有预设结构的新自定义头部。",
"hex_enc_decoder_desc": "编码或解码十六进制数据,适用于文件转换和分析。",
"nsopus_converter_desc": "将音频文件转换为Opus格式,并支持Nintendo Switch Opus MHGU特定格式。",
"opus_metadata_extractor_desc": "提取Opus文件的元数据,便于管理和编辑。",
"settings_label": "设置",
"language_label": "语言",
"handburger_modkit_title": "汉堡模组工具包",
"about_content": "这个多功能工具旨在帮助处理《怪物猎人XX》的各种模组任务。",
"version": "这是 {version} 版本。",
"tutorial": "点击任意标签页使用它。右键点击标签页以弹出或创建新实例。",
"plug": "了解更多关于开发者(我!)的信息,并在下方支持他们。",
"thanks": "感谢 ffmpeg 提供转换功能,感谢 masagrator 为 MHGU 提供的 NXAenc 变体,以及感谢 vgmstream 提供他们的音频软件和依赖项。",
"tool_descriptions_title": "工具描述",
"stq_editor_tool_desc": "一个用于编辑和查看 STQ/STQR 文件的工具,包括十六进制模式分析。",
"stq_merge_tool_desc": "合并和管理多个模组之间的 STQR 文件冲突。",
"opus_header_injector_desc": "允许用户在音频文件中注入或修改 Opus 头信息。",
"audio_calculator_desc": "一个用于计算音频属性(如比特率、文件大小和时长)的实用程序。",
"foldermaker_desc": "帮助组织和创建模组项目所需的文件夹。",
"hex_enc_decoder_desc": "对十六进制数据进行编码或解码,用于文件转换和分析。",
"nsopus_converter_desc": "将音频文件与 Nintendo Switch Opus MHGU 特定格式之间进行转换。",
"opus_metadata_extractor_desc": "从 Opus 文件中提取元数据,便于管理和编辑。",
"github_link": "GitHub - RTHKKona",
"kofi_link": "Ko-fi - Handburger"
}
"kofi_link": "Ko-fi - 汉堡包"
}
37 changes: 30 additions & 7 deletions scripts/AudioCalculator.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Audio Calculator module
# Version management
VERSION = "1.0.1"
VERSION = "1.0.2"

import sys
from PyQt5.QtWidgets import (
QApplication, QMainWindow, QVBoxLayout, QHBoxLayout, QLabel, QMessageBox,
QPushButton, QWidget, QRadioButton, QFrame, QTextEdit, QAction, QMenuBar
)
from PyQt5.QtGui import QFont

from decimal import Decimal, getcontext, InvalidOperation

# Set precision high enough to handle all operations accurately
Expand Down Expand Up @@ -134,8 +133,7 @@ def clear_inputs(self):
self.result_output.clear()

def update_font_size(self):
font = QFont()
font.setPointSize(11) # Increased font size by 1 point
font = QFont("Consolas", 11)
widgets = [
self.input_label, self.audio_input, self.settings_label,
self.mode_samples_to_duration, self.mode_duration_to_samples,
Expand All @@ -154,15 +152,40 @@ def apply_initial_theme(self):

def apply_theme(self):
"""Apply the appropriate stylesheet based on the current theme."""
stylesheet = """
common_styles = """
QPushButton {
font-family: Consolas;
font-size: 12pt;
padding: 6px;
}
"""

dark_mode_styles = """
QMainWindow { background-color: #2b2b2b; color: #ffebcd; }
QTextEdit { background-color: #4d4d4d; color: #ffebcd; }
QLabel { color: #ffebcd; }
QRadioButton { color: #ffebcd; }
QPushButton { background-color: #4d4d4d; color: #ffebcd; }
QFrame { background-color: #2b2b2b; color: #ffebcd; }
""" if self.dark_mode else ""
self.setStyleSheet(stylesheet)
"""

light_mode_styles = """
QMainWindow { background-color: white; color: black; }
QTextEdit { background-color: white; color: black; }
QLabel { color: black; }
QRadioButton { color: black; }
QPushButton { background-color: #f0f0f0; color: black; }
QFrame { background-color: white; color: black; }
"""

# Apply common styles plus mode-specific styles
if self.dark_mode:
full_stylesheet = common_styles + dark_mode_styles
else:
full_stylesheet = common_styles + light_mode_styles

# Apply the combined stylesheet
self.setStyleSheet(full_stylesheet)

if __name__ == "__main__":
app = QApplication(sys.argv)
Expand Down
44 changes: 34 additions & 10 deletions scripts/FolderMaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ def initUI(self):
main_layout.addWidget(self.cmd_output)

self.folder_input = QLineEdit(self)
self.folder_input.setPlaceholderText("Click 'Browse' to select a directory you'd like to analyze... (likely nativeNX)")
self.folder_input.setPlaceholderText("Click 'Browse' to select a directory you'd like to analyse. (likely nativeNX)")
bottom_layout.addWidget(self.folder_input)

browse_button = QPushButton("Browse", self)
browse_button.clicked.connect(self.browse_folder)
bottom_layout.addWidget(browse_button)

self.file_input = QLineEdit(self)
self.file_input.setPlaceholderText("Input exact name of file that you want to replace (i.e bgm_v03.opus)")
self.file_input.setPlaceholderText("Input exact file you want to replace. (i.e bgm_v03.opus)")
bottom_layout.addWidget(self.file_input)

create_button = QPushButton("Create Directory/Folders", self)
Expand All @@ -63,13 +63,12 @@ def initUI(self):
main_layout.addLayout(bottom_layout)

self.setWindowTitle('FolderMaker')
self.setGeometry(100, 100, 1600, 900) # Set the window size to 1600x800, positioned at 100,100
self.setGeometry(100, 70, 1600, 1000) # Set the window size to 1600x800, positioned at 100,100

self.update_font_size() # Increase the font size

def update_font_size(self):
font = QFont()
font.setPointSize(11) # Increased font size by 1 point
font = QFont("Consolas", 11) # Increased font size by 1 point
widgets = [
self.folder_input, self.file_input, self.cmd_output,
self.toggle_theme_btn
Expand Down Expand Up @@ -149,19 +148,44 @@ def toggle_theme(self):
self.apply_theme()

def apply_initial_theme(self):
"""Apply the theme once during initialization."""
# Apply the theme once during initialization.
self.apply_theme()

def apply_theme(self):
"""Apply the appropriate stylesheet based on the current theme."""
stylesheet = """
# Apply the appropriate stylesheet based on the current theme.
common_styles = """
QPushButton {
font-family: Consolas;
font-size: 12pt;
padding: 6px;
}
"""

dark_mode_styles = """
QWidget { background-color: #2b2b2b; color: #ffebcd; }
QTextEdit { background-color: #4d4d4d; color: #ffebcd; }
QLabel { color: #ffebcd; }
QLineEdit { background-color: #4d4d4d; color: #ffebcd; border: 1px solid #ffebcd; }
QPushButton { background-color: #4d4d4d; color: #ffebcd; }
""" if self.dark_mode else ""
self.setStyleSheet(stylesheet)
"""

light_mode_styles = """
QWidget { background-color: white; color: black; }
QTextEdit { background-color: white; color: black; }
QLabel { color: black; }
QLineEdit { background-color: white; color: black; border: 1px solid black; }
QPushButton { background-color: #f0f0f0; color: black; }
"""

# Combine common styles with the mode-specific styles
if self.dark_mode:
full_stylesheet = common_styles + dark_mode_styles
else:
full_stylesheet = common_styles + light_mode_styles

# Apply the combined stylesheet
self.setStyleSheet(full_stylesheet)


def display_welcome_message(self):
#Display ASCII art and welcome message when the app launches.
Expand Down
55 changes: 43 additions & 12 deletions scripts/MCAConverter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MCA Converter
# Version management
VERSION = "1.0.6"
VERSION = "1.0.7"

import os, sys,subprocess
from concurrent.futures import ThreadPoolExecutor
Expand Down Expand Up @@ -153,19 +153,50 @@ def apply_initial_theme(self):
self.apply_theme()

def apply_theme(self):
stylesheet = (
"QMainWindow { background-color: #2b2b2b; color: #ffebcd; }"
"QTextEdit { background-color: #4d4d4d; color: #ffebcd; }"
"QPushButton { background-color: #4d4d4d; color: #ffebcd; }"
) if self.dark_mode else (
"QMainWindow { background-color: #f0f0f0; color: #000000; }"
"QTextEdit { background-color: #ffffff; color: #000000; }"
"QPushButton { background-color: #ffffff; color: #000000; }"
)
self.setStyleSheet(stylesheet)
common_styles = """
QPushButton {
font-family: Consolas;
font-size: 12pt;
padding: 6px;
}
QMessageBox QLabel{
font-weight: bold;
font-size: 12pt;
font-family: Consolas;
padding: 10px;
}
"""

dark_mode_styles = """
QMainWindow { background-color: #2b2b2b; color: #ffebcd; }
QTextEdit { background-color: #4d4d4d; color: #ffebcd; }
QPushButton { background-color: #4d4d4d; color: #ffebcd; }
QMessageBox QLabel { color: #ffebcd; } /* Ensure QLabel inside QMessageBox is styled */
QMessageBox QPushButton { background-color: #4d4d4d; color: #ffebcd; } /* Button styling inside QMessageBox */
QMessageBox { background-color: #4d4d4d; } /* Background styling for QMessageBox */
"""

light_mode_styles = """
QMainWindow { background-color: #f0f0f0; color: #000000; }
QTextEdit { background-color: #ffffff; color: #000000; }
QPushButton { background-color: #ffffff; color: #000000; }
QMessageBox QLabel { color: #000000; } /* Ensure QLabel inside QMessageBox is styled */
QMessageBox QPushButton { background-color: #ffffff; color: #000000; } /* Button styling inside QMessageBox */
QMessageBox { background-color: #ffffff; } /* Background styling for QMessageBox */
"""

# Apply common styles plus mode-specific styles
if self.dark_mode:
full_stylesheet = common_styles + dark_mode_styles
else:
full_stylesheet = common_styles + light_mode_styles

# Apply the combined stylesheet
self.setStyleSheet(full_stylesheet)


def show_about_dialog(self):
about_text = f"Audio to MCA Converter\nVersion {VERSION}\nConverts supported audio files to MCA format."
about_text = f"Audio to MCA Converter Version {VERSION}\nConverts supported audio files to MCA format."
QMessageBox.about(self, "About", about_text)

def show_help(self):
Expand Down
Loading

0 comments on commit aaa21dc

Please sign in to comment.