Skip to content

Commit 9bb054a

Browse files
author
yapetrichka
committed
UI Toolkit migration
1 parent d3d8f23 commit 9bb054a

12 files changed

+177
-62
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## [1.0.12] - 2022-09-01
4+
- UI Toolkit migration
5+
36
## [1.0.11] - 2022-08-24
47
- Added README.md
58

Editor/KeystorePreprocess.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@ namespace Packages.DreamCode.AutoKeystore.Editor
66
{
77
public class KeystorePreprocess : IPreprocessBuildWithReport
88
{
9-
private const string _keystoreExt = ".keystore";
10-
9+
#region PUBLIC_VARIABLES
10+
1111
public int callbackOrder => 0;
12-
12+
13+
#endregion
14+
15+
#region PRIVATE_VARIABLES
16+
17+
private const string _keystoreExt = ".keystore";
18+
19+
#endregion
20+
1321
public void OnPreprocessBuild(BuildReport report)
1422
{
1523
Autocomplete();
@@ -21,7 +29,6 @@ private static void Autocomplete()
2129
var keystorePass = EditorPrefs.GetString(PlayerSettings.applicationIdentifier + "dcKeystorePass");
2230
var keyaliasName = EditorPrefs.GetString(PlayerSettings.applicationIdentifier + "dcKeyaliasName");
2331
var keyaliasPass = EditorPrefs.GetString(PlayerSettings.applicationIdentifier + "dcKeyaliasPass");
24-
2532
//Project Keystore
2633
PlayerSettings.Android.keystoreName = keystoreName + _keystoreExt;
2734
PlayerSettings.Android.keystorePass = keystorePass;

Editor/Menu/KeystoreMenuItem.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
using Packages.DreamCode.AutoKeystore.Editor.Windows;
22
using UnityEditor;
3+
using UnityEngine;
34

45
namespace Packages.DreamCode.AutoKeystore.Editor.Menu
56
{
67
public class KeystoreMenuItem : UnityEditor.Editor
78
{
8-
9-
#region PUBLIC_VARIABLES
9+
#region PRIVATE_VARIABLES
1010

1111
private static KeystoreEditorWindow _keystoreWindow;
12-
private const string _winTitle = "Android AutoKeystore";
12+
private const string _winTitle = "AutoKeystore";
13+
private static readonly Vector2 _windowMinSize = new Vector2(200, 380);
1314

1415
#endregion
1516

@@ -18,6 +19,7 @@ private static void Init()
1819
{
1920
_keystoreWindow = EditorWindow.GetWindow<KeystoreEditorWindow>();
2021
_keystoreWindow.titleContent.text = _winTitle;
22+
_keystoreWindow.minSize = _windowMinSize;
2123
}
2224
}
2325
}

Editor/UI.meta

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

Editor/UI/Stylesheets.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
.save-button {
2+
background-color: rgb(26, 115, 232);
3+
color: rgb(255, 255, 255);
4+
margin-right: 20%;
5+
margin-left: 20%;
6+
margin-bottom: 0;
7+
margin-top: 4%;
8+
height: 12%;
9+
border-top-left-radius: 16px;
10+
border-bottom-left-radius: 16px;
11+
border-top-right-radius: 16px;
12+
border-bottom-right-radius: 16px;
13+
font-size: 18px;
14+
}
15+
16+
.save-button:hover {
17+
background-color: rgb(73, 153, 231);
18+
}
19+
20+
.keystore-text-field {
21+
flex-direction: column;
22+
flex-wrap: nowrap;
23+
justify-content: flex-start;
24+
font-size: 14px;
25+
color: rgb(255, 255, 255);
26+
background-color: rgb(255, 255, 255);
27+
-unity-font-style: bold;
28+
-unity-text-align: upper-left;
29+
width: auto;
30+
padding-left: 10%;
31+
padding-right: 10%;
32+
padding-top: 20px;
33+
}
34+
35+
.keystore-text-field > .unity-base-field__label {
36+
color: rgb(118, 118, 118);
37+
}
38+
39+
.keystore-text-field > .unity-base-field__input {
40+
background-color: rgb(232, 232, 232);
41+
color: rgb(32, 33, 36);
42+
border-left-color: rgb(204, 204, 204);
43+
border-right-color: rgb(204, 204, 204);
44+
border-top-color: rgb(204, 204, 204);
45+
border-bottom-color: rgb(204, 204, 204);
46+
}

Editor/UI/Stylesheets/KeystoreWindow.uss.meta

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

Editor/UI/Templates.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" xsi="http://www.w3.org/2001/XMLSchema-instance" engine="UnityEngine.UIElements" editor="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
2+
<Style src="project://database/Packages/com.dreamcode.mobile.android-keystore/Editor/UI/Stylesheets/KeystoreWindow.uss?fileID=7433441132597879392&amp;guid=4c0697299499c2746bd838d8d7bc9c29&amp;type=3#KeystoreWindow" />
3+
<ui:VisualElement name="Container" style="height: 100%; color: rgb(255, 255, 255); background-color: rgb(255, 255, 255); justify-content: space-around; flex-grow: 0; align-items: stretch;">
4+
<ui:Label text="Project Keystore" display-tooltip-when-elided="true" name="KeystoreLabel" style="color: rgb(118, 118, 118); -unity-font-style: bold; -unity-text-align: upper-center; font-size: 24px; padding-right: 0; padding-left: 0; padding-top: 0; width: auto; white-space: normal;" />
5+
<ui:TextField picking-mode="Ignore" label="Path .keystore" text="path.keystore" multiline="false" name="KeystorePath" class="keystore-text-field" style="padding-top: 0; font-size: 18px;" />
6+
<ui:TextField picking-mode="Ignore" label="Password" text="password" multiline="false" name="KeystorePass" class="keystore-text-field" style="flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; font-size: 18px; color: rgb(255, 255, 255); background-color: rgb(255, 255, 255); -unity-font-style: bold; -unity-text-align: upper-left; width: auto; padding-left: 10%; padding-right: 10%; padding-top: 0;" />
7+
<ui:Label text="Project Key" display-tooltip-when-elided="true" name="KeyLabel" style="color: rgb(118, 118, 118); -unity-font-style: bold; -unity-text-align: upper-center; font-size: 24px; padding-right: 0; padding-left: 0; padding-top: 0; white-space: normal;" />
8+
<ui:TextField picking-mode="Ignore" label="Alias" text="alias" multiline="false" name="KeyaliasName" class="keystore-text-field" style="flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; font-size: 18px; color: rgb(255, 255, 255); background-color: rgb(255, 255, 255); -unity-font-style: bold; -unity-text-align: upper-left; width: auto; padding-left: 10%; padding-right: 10%; padding-top: 0;" />
9+
<ui:TextField picking-mode="Ignore" label="Password" text="password" multiline="false" name="KeyaliasPass" class="keystore-text-field" style="flex-direction: column; flex-wrap: nowrap; justify-content: flex-start; font-size: 18px; color: rgb(255, 255, 255); background-color: rgb(255, 255, 255); -unity-font-style: bold; -unity-text-align: upper-left; width: auto; padding-left: 10%; padding-right: 10%; padding-top: 0;" />
10+
<ui:Button text="Save" display-tooltip-when-elided="true" name="SaveBtn" class="save save-button" style="border-left-width: 0; border-right-width: 0; border-top-width: 0; border-bottom-width: 0; margin-top: 0; margin-bottom: 0; -unity-font-style: bold; bottom: auto; top: auto; flex-shrink: 0; flex-grow: 0;" />
11+
</ui:VisualElement>
12+
</ui:UXML>

Editor/UI/Templates/KeystoreWindow.uxml.meta

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

0 commit comments

Comments
 (0)