Skip to content

Commit

Permalink
Fixing mngrp loader
Browse files Browse the repository at this point in the history
  • Loading branch information
HobbitDur committed Oct 30, 2024
1 parent b173499 commit 3ef4c7c
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 76 deletions.
71 changes: 21 additions & 50 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ on:
- "*"
pull_request:
branches: [ "master" ]
workflow_dispatch:

jobs:
create_assets:
release-version:
runs-on: windows-latest
steps:
- name: Checkout repository
Expand Down Expand Up @@ -47,57 +46,29 @@ jobs:
run: |
cd release/ShumiTranslator
7z a -tzip "../ShumiTranslator-continuous-${{ github.sha}}.zip" .
pwd
- name: zip name tag
shell: bash
if: startsWith(github.ref, 'refs/tags/')
run: |
cd release/ShumiTranslator
7z a -tzip "../ShumiTranslator-${{ github.ref_name }}.zip" .
- name: Upload artifact
uses: actions/upload-artifact@v4
7z a -tzip "../ShumiTranslator-${{ github.ref_name }}.zip" .
- name: Deploy Package
if: github.event.ref_type != 'tag' && github.ref == 'refs/heads/master'
uses: crowbarmaster/GH-Automatic-Releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "continuous"
prerelease: true
title: "Unstable Build"
files: |
release/ShumiTranslator-*.zip
- name: Deploy tag Package
if: startsWith(github.ref, 'refs/tags/')
uses: crowbarmaster/GH-Automatic-Releases@latest
with:
name: "artifact-${{ github.sha}}"
path: ${{ github.workspace }}/release/
release_assets:
name: Release
needs:
- create_assets
runs-on: windows-latest
concurrency: release-${{ github.ref }}
steps:
- name: Download Files
uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}/release/
- name: Test
shell: bash
run: |
ls -al
cd release
ls -al
echo ${{ github.event_name }}
echo ${{ github.event.ref_type }}
echo ${{ github.ref}}
echo ${{ github.ref_name}}
echo ${{ github.sha}} | cut -c1-7
- name: Deploy Package
if: github.event.ref_type != 'tag' && github.ref == 'refs/heads/master'
uses: crowbarmaster/GH-Automatic-Releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "continuous"
prerelease: true
title: "Unstable Build"
files: |
release/artifact-*/*
- name: Deploy tag Package
if: startsWith(github.ref, 'refs/tags/')
uses: crowbarmaster/GH-Automatic-Releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
automatic_release_tag: ${{ github.ref_name }}
title: "ShumiTranslator-${{ github.ref_name }}"
files: |
release/artifact-*/*
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
automatic_release_tag: ${{ github.ref_name }}
title: "ShumiTranslator-${{ github.ref_name }}"
files: |
release/ShumiTranslator-*.zip
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ This tool is a universal translator for FF8 that allow you to extract all text f
For the moment the following files are compatible:
- kernel.bin
- namedic.bin
- mngrp.bin
- FF8.exe for 2013/2000 version, off_cards_names_xx.dat for remaster
- c0m0xx.dat files

![image](https://github.com/user-attachments/assets/2b231b0a-7c8e-40df-8bd8-3e36190f5377)

3 changes: 0 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
pillow>=10.4.0
PyQt6>=6.7.1
PyQt6-Qt6>=6.7.3
PyQt6_sip>=13.8.0
setuptools>=75.1.0
46 changes: 23 additions & 23 deletions shumitranslator.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ def __load_file(self, file_to_load: str = ""):
# file_to_load = os.path.join("OriginalFiles", "mngrp_en - Copie.bin") # For developing faster
# file_to_load = os.path.join("OriginalFiles", "FF8_EN.exe") # For developing faster


if not file_to_load:
filter_file =self.FILE_MANAGED_REGEX[self.file_type_selection_widget.currentIndex()]
if self.file_type_selection_widget.currentIndex() == 4: # c0mxx.dat
Expand Down Expand Up @@ -407,28 +406,28 @@ def __load_file(self, file_to_load: str = ""):
elif "mngrp" in file_name and ".bin" in file_name:
self.file_loaded_type = FileType.MNGRP
# self.file_mngrphd_loaded = os.path.join("OriginalFiles", "mngrphd_en - Copie.bin") # For developing faster
if not self.file_mngrphd_loaded:
self.file_mngrphd_loaded = self.file_dialog.getOpenFileName(parent=self, caption="Find mngrphd", filter="*mngrphd*.bin",
directory=os.getcwd())[0]
self.mngrp_manager.load_file(self.file_mngrphd_loaded, self.file_loaded)
first_section_line_index = 2
for section in self.mngrp_manager.mngrp.get_section_list():
if section.type in (
SectionType.TKMNMES, SectionType.MNGRP_STRING, SectionType.FF8_TEXT, SectionType.MNGRP_TEXTBOX, SectionType.MNGRP_M00MSG):
if section.type == SectionType.MNGRP_STRING:
self.section_widget_list.append(SectionWidget(section.get_text_section(), first_section_line_index))
first_section_line_index += len(section.get_text_list())
elif section.type == SectionType.FF8_TEXT or section.type == SectionType.MNGRP_M00MSG:
self.section_widget_list.append(SectionWidget(section, first_section_line_index))
first_section_line_index += len(section.get_text_list())
elif section.type == SectionType.TKMNMES:
for i in range(section.get_nb_text_section()):
self.section_widget_list.append(SectionWidget(section.get_text_section_by_id(i), first_section_line_index))
first_section_line_index += len(section.get_text_section_by_id(i).get_text_list())
elif section.type == SectionType.MNGRP_TEXTBOX:
self.section_widget_list.append(SectionWidget(section, first_section_line_index))
first_section_line_index += len(section.get_text_list())
self.warning_mngrp_label_widget.show()
self.file_mngrphd_loaded = self.file_dialog.getOpenFileName(parent=self, caption="Find mngrphd", filter="*mngrphd*.bin",
directory=os.getcwd())[0]
if self.file_mngrphd_loaded:
self.mngrp_manager.load_file(self.file_mngrphd_loaded, self.file_loaded)
first_section_line_index = 2
for section in self.mngrp_manager.mngrp.get_section_list():
if section.type in (
SectionType.TKMNMES, SectionType.MNGRP_STRING, SectionType.FF8_TEXT, SectionType.MNGRP_TEXTBOX, SectionType.MNGRP_M00MSG):
if section.type == SectionType.MNGRP_STRING:
self.section_widget_list.append(SectionWidget(section.get_text_section(), first_section_line_index))
first_section_line_index += len(section.get_text_list())
elif section.type == SectionType.FF8_TEXT or section.type == SectionType.MNGRP_M00MSG:
self.section_widget_list.append(SectionWidget(section, first_section_line_index))
first_section_line_index += len(section.get_text_list())
elif section.type == SectionType.TKMNMES:
for i in range(section.get_nb_text_section()):
self.section_widget_list.append(SectionWidget(section.get_text_section_by_id(i), first_section_line_index))
first_section_line_index += len(section.get_text_section_by_id(i).get_text_list())
elif section.type == SectionType.MNGRP_TEXTBOX:
self.section_widget_list.append(SectionWidget(section, first_section_line_index))
first_section_line_index += len(section.get_text_list())
self.warning_mngrp_label_widget.show()

for section_widget in self.section_widget_list:
self._tab_widget.add_section(section_widget)
Expand Down Expand Up @@ -503,3 +502,4 @@ def __enable_all(self):
self.uncompress_button.setEnabled(True)
self.scroll_area.setEnabled(True)


0 comments on commit 3ef4c7c

Please sign in to comment.