Skip to content

Commit 4c53578

Browse files
committed
Fixed blurry promo text.
1 parent 63863cc commit 4c53578

File tree

6 files changed

+69
-25
lines changed

6 files changed

+69
-25
lines changed
0 Bytes
Binary file not shown.

AdvancedInstanceManager/Promotion/Resources/InstanceManager/Promotion/background.bmp.meta

Lines changed: 16 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AdvancedInstanceManager/Promotion/Resources/InstanceManager/Promotion/swap/pawujl9s.bmp.meta

Lines changed: 15 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AdvancedInstanceManager/Promotion/Resources/InstanceManager/Promotion/swap/ppfkkbih.bmp.meta

Lines changed: 15 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AdvancedInstanceManager/System/Editor/InstanceManagerWindow.cs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static void Initialize()
4747
{
4848

4949
if (margin is null) margin = new GUIStyle() { margin = new RectOffset(12, 12, 12, 12) };
50-
if (createButton is null) createButton = new GUIStyle(GUI.skin.button) { padding = new RectOffset(12, 12, 6, 6) };
50+
if (createButton is null) createButton = new GUIStyle(GUI.skin.button) { margin = new RectOffset(0, 0, 8, 0), padding = new RectOffset(12, 12, 6, 6) };
5151
if (row is null) row = new GUIStyle(EditorStyles.toolbar) { padding = new RectOffset(12, 12, 12, 6), fixedHeight = 42 };
5252
if (noItemsText is null) noItemsText = new GUIStyle(GUI.skin.label) { alignment = TextAnchor.MiddleCenter, normal = new GUIStyleState() { textColor = new Color(1, 1, 1, 0.75f) } };
5353
if (removeButton is null) removeButton = new GUIStyle(GUI.skin.button) { margin = new RectOffset(12, 0, 0, 0) };
@@ -258,10 +258,18 @@ void ReloadInstances() =>
258258
abstract class View
259259
{
260260

261-
public virtual void OnGUI() { }
262-
public virtual void OnFocus() { }
263-
public virtual void OnEnable() { }
264-
public virtual void OnDisable() { }
261+
public virtual void OnGUI()
262+
{
263+
}
264+
public virtual void OnFocus()
265+
{
266+
}
267+
public virtual void OnEnable()
268+
{
269+
}
270+
public virtual void OnDisable()
271+
{
272+
}
265273
public virtual Vector2? minSize { get; }
266274
public Rect position => window.position;
267275

@@ -299,7 +307,7 @@ static void SetInstance(string id)
299307

300308
}
301309

302-
#endregion
310+
#endregion View
303311
#region Check resize
304312

305313
internal bool hasResized { get; private set; }
@@ -315,7 +323,7 @@ protected void BeginCheckResize()
315323
protected void EndCheckResize() =>
316324
prevPos = position;
317325

318-
#endregion
326+
#endregion Check resize
319327

320328
}
321329

AdvancedInstanceManager/System/Editor/MainView.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ void ContextMenu_Item(UnityInstance instance)
196196

197197
}
198198

199+
const float footerHeight = 42;
199200
void DrawFooter()
200201
{
201202

@@ -209,22 +210,21 @@ void DrawFooter()
209210
GUI.DrawTexture(r, EditorGUIUtility.whiteTexture);
210211
GUIExt.EndColorScope();
211212

212-
EditorGUILayout.BeginHorizontal(Style.margin);
213+
EditorGUILayout.BeginHorizontal(Style.margin, GUILayout.Height(footerHeight));
213214

214215
GUILayout.FlexibleSpace();
216+
215217
var promoPos = GUILayoutUtility.GetLastRect();
218+
promoPos.height = footerHeight;
216219

217-
//if (GUILayout.Button(Content.settings, GUILayout.Height(27)))
218-
// OpenSettings();
220+
DrawPromo(promoPos);
219221

220222
if (GUILayout.Button(Content.createNewInstance, Style.createButton))
221223
{
222224
InstanceUtility.Create();
223225
GUIUtility.ExitGUI();
224226
}
225227

226-
DrawPromo(promoPos, GUILayoutUtility.GetLastRect().height);
227-
228228
EditorGUILayout.EndHorizontal();
229229

230230
}
@@ -255,7 +255,7 @@ void UpdatePromo()
255255
}
256256

257257
bool isMouseDownPromo;
258-
void DrawPromo(Rect position, float height)
258+
void DrawPromo(Rect position)
259259
{
260260

261261
if (!promoBackground)
@@ -265,10 +265,10 @@ void DrawPromo(Rect position, float height)
265265
promoSwaps = Resources.LoadAll<Texture2D>("InstanceManager/Promotion/swap");
266266

267267
var r3 = new Rect(position);
268-
r3.yMin -= 6;
268+
r3.yMin += (position.height / 2) - (promoBackground.height / 2);
269269
r3.xMin -= 6;
270270
r3.width = promoBackground.width;
271-
r3.height = promoBackground.height - 22;
271+
r3.height = promoBackground.height;
272272
GUI.DrawTexture(r3, promoBackground);
273273
GUI.DrawTexture(r3, promoSwaps[promoSwap]);
274274

0 commit comments

Comments
 (0)