Skip to main content

GUI Converter Tool for KotOR - converts GUI files between games

Project description

GUI Resizer CLI Tool

Overview

This is a simple command-line interface (CLI) tool designed to adjust and scale GUI (Graphical User Interface) files based on different screen resolutions. The tool reads .gui files from the popular game Star Wars: Knights of the Old Republic and adjusts the layout to fit various resolutions and aspect ratios. It supports multiple resolutions and can handle batch processing of files.

Features

  • Multi-Resolution Support: The tool can adjust GUI files to fit several resolutions across different aspect ratios, such as 16:9, 16:10, 4:3, 5:4, 21:9, 3:2, and 1:1.
  • Batch Processing: You can process multiple GUI files at once, making it easy to adjust a whole directory of files.
  • Logging: Outputs logs to track the processing of files, including which resolutions were processed and where the output files are saved.
  • Cross-Platform: Works on Windows, Linux, and macOS with Python 3.8+.

Installation

To use this tool, you'll need to have Python 3.8 or higher installed on your system.

  1. Clone the Repository:

    git clone <repository-url>
    cd <repository-directory>
    
  2. Install Dependencies: Ensure you have the necessary Python packages installed. You may need to install pykotor, a package that handles .gff files, as well as any other dependencies.

    pip install -r requirements.txt
    

Usage

Basic Command

To run the tool, use the following command:

python3 gui_resizer.py --input <input-path> --output <output-path> --resolution <resolution>

Parameters

  • --input: The path to the .gui file(s) you want to process. You can specify a single file or a directory containing multiple .gui files.
  • --output: The directory where the processed files will be saved.
  • --resolution: The target resolution(s). Use the format WIDTHxHEIGHT (e.g., 1920x1080). You can also specify ALL to process all common resolutions.

Example

To convert all .gui files in the directory input_files/ to fit a 1920x1080 resolution and save them to the output_files/ directory, run:

python3 gui_resizer.py --input input_files/ --output output_files/ --resolution 1920x1080

Logging

If logging is enabled, a log file named output.log will be created in the specified output directory. This file will contain details of the processing operations performed.

How It Works

  1. Input Handling: The tool takes in .gui files or directories containing these files and reads them using the pykotor library.

  2. Resolution Scaling: The tool scales the GUI elements based on the specified target resolution(s). It calculates scale factors based on the original dimensions of the GUI and applies these factors to resize elements accordingly.

  3. Output Generation: The processed GUI files are then saved to the specified output directory, organized by resolution.

Requirements

  • Python: 3.8 or higher
  • OS: Windows, Linux, or macOS
  • Dependencies: Listed in requirements.txt (to be created based on the imports)

Notes

  • Ensure that your .gui files are compatible with the Star Wars: Knights of the Old Republic game or any other project you're working on.
  • The tool supports adding more aspect ratios and resolutions by modifying the ASPECT_RATIO_TO_RESOLUTION dictionary in the script.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gui_converter-1.0.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gui_converter-1.0.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file gui_converter-1.0.0.tar.gz.

File metadata

  • Download URL: gui_converter-1.0.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gui_converter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 929ad59f2a1a847cb6a70ce6c30c071bb0124f589ae8ab2c3f918d458f097cf3
MD5 f54d06e7679504c032f61be18d17fbe4
BLAKE2b-256 11a8058267561dd5150ae0865d52f79d716eb592fbf28ac6496afa296e21f930

See more details on using hashes here.

File details

Details for the file gui_converter-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: gui_converter-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for gui_converter-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e3c4b36663c56a3caa9ab94c7aca3891578331bf9aa73b2f10e4db63e8cc0b9
MD5 cd29f23ec36850e2848ce6eb646c9cd1
BLAKE2b-256 9ada455802d17dc7901fe8adee7d321cefffe24023bb99594b4453281292ab4d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page