Metadata-Version: 2.4
Name: mobile-textdb
Version: 0.4.0
Summary: Read/write GTA San Andreas & Vice City mobile texture databases (textdb)
Author: GTA Mobile modding
License: MIT
Keywords: gta,san-andreas,textdb,textures,dxt
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Games/Entertainment
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: Pillow>=11.2.1
Requires-Dist: texture2ddecoder>=1.0.0
Requires-Dist: texfury>=0.1.0; sys_platform == "win32"
Requires-Dist: rwfury>=0.4.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"

# mobile-textdb

Python-библиотека для **GTA San Andreas / Vice City Mobile** — чтение и запись `textdb` (`.txt`, `.dat`, `.toc`).

Режимы импорта (TXD Tool) + prompt для AI: **[docs/AI_TEXTURE_IMPORT_GUIDE.md](docs/AI_TEXTURE_IMPORT_GUIDE.md)**

## Установка

```bash
pip install -e .
```

## Минимальный пример

```python
from pathlib import Path
from PIL import Image
from mobile_textdb import TextureDatabase

db = TextureDatabase.open(Path("texdb/gta3"))
db.replace("radar00", Image.open("radar00.png").convert("RGBA"))
db.save()
```

## TXD (через rwfury)

```python
from mobile_textdb import TextureDatabase, load_txd

db = TextureDatabase.open("texdb/gta3")
for tex in load_txd("grenade.txd", max_size=512):
    (db.replace if db.get(tex.name) else db.add)(tex.name, tex.image)
db.save()
```

## CLI

```bash
python example_import_examples.py
mobile-textdb --folder texdb/gta3 --png-dir examples/ --replace
```

## Файлы

| Пишем | Не трогаем |
|-------|------------|
| `.txt`, `.dat`, `.toc` | `.tmb` (не нужен игре) |

## Платформы

Windows, **Linux (Ubuntu)**, macOS — только Python 3.10+ и pip.

## Зависимости

Pillow (≥ 11.2.1), texfury (только Windows), texture2ddecoder, **rwfury** (импорт TXD)
