Metadata-Version: 2.1
Name: gui-converter
Version: 1.0.0
Summary: GUI Converter Tool for KotOR - converts GUI files between games
Author: NickHugi
Maintainer-email: th3w1zard1 <halomastar@gmail.com>
License: LGPL-3.0-or-later
Project-URL: Homepage, https://github.com/th3w1zard1/PyKotor
Project-URL: Documentation, https://github.com/th3w1zard1/PyKotor/wiki
Project-URL: Repository, https://github.com/th3w1zard1/PyKotor.git
Project-URL: Issues, https://github.com/th3w1zard1/PyKotor/issues
Project-URL: Changelog, https://github.com/th3w1zard1/PyKotor/releases
Keywords: kotor,kotor1,kotor2,tsl,gui,converter,interface,pykotor,modding
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Utilities
Classifier: Environment :: Console
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pykotor>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"

# 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**:
   ```bash
   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.

   ```bash
   pip install -r requirements.txt
   ```

## Usage

### Basic Command

To run the tool, use the following command:

```bash
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:

```bash
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.
