Implement AI Images gallery feature in RimWorld mod, allowing users to view, delete, and manage generated images. Update UI components to include a gallery button and enhance image management functionality. Add localization strings for gallery features in English and Russian. Update AIImages.dll to reflect these changes.
This commit is contained in:
@@ -1293,8 +1293,8 @@ namespace AIImages
|
||||
? "AIImages.Generation.Cancel".Translate()
|
||||
: "AIImages.Generation.Generate".Translate();
|
||||
|
||||
// Основная кнопка генерации (занимает 70% ширины)
|
||||
float buttonWidth = rect.width * 0.7f;
|
||||
// Основная кнопка генерации (занимает 40% ширины)
|
||||
float buttonWidth = rect.width * 0.4f;
|
||||
if (Widgets.ButtonText(new Rect(rect.x, curY, buttonWidth, 35f), buttonLabel))
|
||||
{
|
||||
if (isGenerating)
|
||||
@@ -1303,9 +1303,25 @@ namespace AIImages
|
||||
StartGeneration();
|
||||
}
|
||||
|
||||
// Отладочная кнопка (занимает 25% ширины)
|
||||
float debugButtonWidth = rect.width * 0.25f;
|
||||
float debugButtonX = rect.x + buttonWidth + 10f;
|
||||
// Кнопка галереи
|
||||
float galleryButtonWidth = rect.width * 0.35f;
|
||||
float galleryButtonX = rect.x + buttonWidth + 10f;
|
||||
int imageCount = PawnPortraitHelper.GetPortraitCount(pawn);
|
||||
string galleryLabel = "AIImages.Gallery.OpenGallery".Translate();
|
||||
if (imageCount > 0)
|
||||
{
|
||||
galleryLabel += " " + "AIImages.Gallery.ImagesCount".Translate(imageCount);
|
||||
}
|
||||
|
||||
if (Widgets.ButtonText(new Rect(galleryButtonX, curY, galleryButtonWidth, 35f), galleryLabel))
|
||||
{
|
||||
var galleryWindow = new Window_AIGallery(pawn);
|
||||
Find.WindowStack.Add(galleryWindow);
|
||||
}
|
||||
|
||||
// Отладочная кнопка (занимает 20% ширины)
|
||||
float debugButtonWidth = rect.width * 0.2f;
|
||||
float debugButtonX = galleryButtonX + galleryButtonWidth + 10f;
|
||||
if (Widgets.ButtonText(new Rect(debugButtonX, curY, debugButtonWidth, 35f), "Debug"))
|
||||
{
|
||||
DebugAllPawns();
|
||||
|
||||
Reference in New Issue
Block a user