Refactor AIImages mod to streamline API loading functionality, consolidating model, sampler, and scheduler loading into a single method. Update localized strings in English and Russian for improved clarity and consistency. Enhance UI with scrollable prompt display for better user experience. Update AIImages.dll to reflect these changes.
This commit is contained in:
@@ -49,6 +49,7 @@ namespace AIImages
|
||||
public override Vector2 InitialSize => new Vector2(900f, 800f);
|
||||
|
||||
private Vector2 scrollPosition = Vector2.zero;
|
||||
private Vector2 promptScrollPosition = Vector2.zero;
|
||||
private float copiedMessageTime = 0f;
|
||||
|
||||
/// <summary>
|
||||
@@ -337,13 +338,29 @@ namespace AIImages
|
||||
generationSettings
|
||||
);
|
||||
|
||||
float promptHeight = Mathf.Min(Text.CalcHeight(promptText, rect.width), 150f);
|
||||
Rect promptRect = new Rect(rect.x, rect.y + curY, rect.width, promptHeight);
|
||||
// Фиксированная высота для области промпта
|
||||
float promptBoxHeight = 150f;
|
||||
float actualPromptHeight = Text.CalcHeight(promptText, rect.width - 20f);
|
||||
|
||||
// Рисуем промпт в скроллируемой области если он длинный
|
||||
Widgets.DrawBoxSolid(promptRect, new Color(0.1f, 0.1f, 0.1f, 0.5f));
|
||||
Widgets.Label(promptRect.ContractedBy(5f), promptText);
|
||||
curY += promptHeight + 10f;
|
||||
Rect promptOuterRect = new Rect(rect.x, rect.y + curY, rect.width, promptBoxHeight);
|
||||
Rect promptViewRect = new Rect(0f, 0f, rect.width - 20f, actualPromptHeight);
|
||||
|
||||
// Рисуем фон
|
||||
Widgets.DrawBoxSolid(promptOuterRect, new Color(0.1f, 0.1f, 0.1f, 0.5f));
|
||||
|
||||
// Рисуем промпт с прокруткой
|
||||
Widgets.BeginScrollView(
|
||||
promptOuterRect.ContractedBy(5f),
|
||||
ref promptScrollPosition,
|
||||
promptViewRect
|
||||
);
|
||||
Widgets.Label(
|
||||
new Rect(0f, 0f, promptViewRect.width, promptViewRect.height),
|
||||
promptText
|
||||
);
|
||||
Widgets.EndScrollView();
|
||||
|
||||
curY += promptBoxHeight + 10f;
|
||||
|
||||
// Кнопка копирования промпта
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user