PO/Library/Artifacts/5b/5ba316dc88efd1ca36e7871998c...

172 lines
9.8 KiB
Plaintext
Raw Normal View History

2022-01-12 10:06:03 +03:00
<0F>'<2019.4.19f1<00><><EFBFBD><EFBFBD> <00><>f<EFBFBD><66>!<21>5<>9<EFBFBD>4Q<0E><>B<00>7<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><><00> E<00> <00><00>#<00>.<00>,<00>5a<00> <00><00>#<00>.<00>,<00><00><00>r<00> <00><00># <00>.<00>,
<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD> <01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00> Q<00>j<00><00><00>J<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><00><00>j<00><><EFBFBD><EFBFBD><EFBFBD><00>\<00><00><><EFBFBD><EFBFBD><EFBFBD><00>H<00>r<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>H<00>w<00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>H<00><><00><><EFBFBD><EFBFBD><00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>y<00>
<00> <00><00>#!<00>.<00>,"<00><00><><00><><EFBFBD><EFBFBD>#@1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>$<00><00><00>%.<00>j<00>&<00><00><><00><><EFBFBD><EFBFBD>'<00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>(<00><00><00><00>)<00>j<00><><EFBFBD><EFBFBD><EFBFBD>*<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD>+<00>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>,@<00><00><00>-Q<00>j<00>.y<00>
<00> /<00><00>#0<00>.<00>,1<00> <00><>2@<00><00><> 3@<00><00>#4<00>.<00>,5<00>H<00><><00><><EFBFBD><EFBFBD>6<01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>7@<00><00><00>8Q<00>j<00>9H<00><><00><><EFBFBD><EFBFBD>:<01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>;@<00><00><00><Q<00>j<00>=H<00><><00><><EFBFBD><EFBFBD>><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>?@<00><00><00>@Q<00>j<00>AMonoImporterPPtr<EditorExtension>m_FileIDm_PathIDPPtr<PrefabInstance>m_ExternalObjectsSourceAssetIdentifiertypeassemblynamem_UsedFileIDsm_DefaultReferencesexecutionOrdericonm_UserDatam_AssetBundleNamem_AssetBundleVariants<00><><EFBFBD>G<EFBFBD><47>܏Z56<35>:!@i<>J*<00><00>7<00><><EFBFBD><EFBFBD><EFBFBD><00><00><00><><00>E<00> <00><00><00>.<00><00>(a<00> <00><00><00>.<00><00><00><00>r<00> <00><00> <00>.<00>
<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD> <01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD> @<00><00><00> Q<00>j<00>H<00><><00><><EFBFBD><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00><00><00>=<00><><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD><01><00><00><00><00>j<00><><EFBFBD><EFBFBD><EFBFBD><01>H<00><><00><><EFBFBD><EFBFBD><EFBFBD><01>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>@<00><00><00>Q<00>j<00>y<00>
<00> <00><00><00>.<00><00>y<00>Q <00><00><00>.<00> <00><00><00>X!H<00>i<00><><EFBFBD><EFBFBD>"<10>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>#@<00><00><00>$Q<00>j<00>%H<00>u<00><><EFBFBD><EFBFBD>&<10>1<00>1<00><><EFBFBD><EFBFBD><EFBFBD>'@<00><00><00>(Q<00>j<00>)PPtr<EditorExtension>m_FileIDm_PathIDPPtr<PrefabInstance>m_DefaultReferencesm_Iconm_ExecutionOrderm_ClassNamem_Namespace\<00>y<EFBFBD>`<00><00>y<EFBFBD>PlasticSCMWindowWusing PlasticGui;
using System.Collections;
using System.Collections.Generic;
using Unity.PlasticSCM.Editor.UI;
using Unity.PlasticSCM.Editor.UI.UIElements;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
namespace Unity.PlasticSCM.Editor
{
internal class PlasticSCMWindow : EditorWindow
{
internal static void ShowWindow()
{
PlasticSCMWindow window = GetWindow<PlasticSCMWindow>();
window.titleContent = new GUIContent(
UnityConstants.PLASTIC_WINDOW_TITLE,
Images.GetImage(Images.Name.IconPlasticView));
window.minSize= new Vector2(750, 260);
window.Show();
}
void OnEnable()
{
BuildComponents();
}
void OnDestroy()
{
Dispose();
}
void Dispose()
{
mRefreshButton.clicked -= RefreshButton_Clicked;
mSettingsButton.clicked -= SettingsButton_Clicked;
}
void BuildComponents()
{
VisualElement root = rootVisualElement;
root.Clear();
root.LoadStyle("PlasticWindow/PlasticWindow");
BuildTabview(root);
BuildStatusBar(root);
}
/*** Tabview ***/
void BuildTabview(VisualElement root)
{
mTabView = new TabView();
mTabView.LoadStyle("PlasticWindow/PlasticWindow");
mTabView.AddTab(
PlasticLocalization.GetString(PlasticLocalization.Name.PendingChangesViewTitle),
new VisualElement()).clicked += () =>
{
// TODO: Add view switch to Pending Changes here
};
mTabView.AddTab(
PlasticLocalization.GetString(PlasticLocalization.Name.ChangesetsViewTitle),
new VisualElement()).clicked += () =>
{
// TODO: Add view switch to Changesets here
};
mTabView.AddTab(
PlasticLocalization.GetString(PlasticLocalization.Name.IncomingChangesViewTitle),
new VisualElement()).clicked += () =>
{
// TODO: Add view switch to Incoming Changes here
};
VisualElement controlsContainer = new VisualElement() { name = "ControlsContainer" };
controlsContainer.AddToClassList("row");
mRefreshButton = new Button() { name = "RefreshButton" };
mRefreshButton.Add(new Image() { image = EditorGUIUtility.IconContent("refresh").image });
mRefreshButton.clicked += RefreshButton_Clicked;
controlsContainer.Add(mRefreshButton);
mSettingsButton = new Button() { name = "SettingsButton" };
mSettingsButton.Add(new Image() { image = EditorGUIUtility.IconContent("settings").image });
mSettingsButton.clicked += SettingsButton_Clicked;
controlsContainer.Add(mSettingsButton);
var tabArea = mTabView.Q<VisualElement>("TabArea");
tabArea.Add(controlsContainer);
root.Add(mTabView);
}
void RefreshButton_Clicked()
{
// TODO
}
void SettingsButton_Clicked()
{
GenericMenu menu = new GenericMenu();
menu.AddItem(new GUIContent("Invite Members to Workspace"),
false,
InviteMemberButton_clicked,
null);
menu.ShowAsContext();
}
static void InviteMemberButton_clicked(object obj)
{
Application.OpenURL("https://www.plasticscm.com/dashboard/cloud/unity_cloud/users-and-groups");
}
/*** Update Bar ***/
void BuildStatusBar(VisualElement root)
{
VisualElement StatusBar = new VisualElement() { name = "StatusBar" };
StatusBar.AddToClassList("row");
StatusBar.LoadLayout("PlasticWindow/StatusBar");
mUpdateNotification = StatusBar.Q<VisualElement>("UpdateNotificationContainer");
mUpdateNotificaionImage = StatusBar.Q<Image>("UpdateNotificationImage");
mUpdateNotificationLabel = StatusBar.Q<Label>("UpdateNotificationLabel");
mUpdateButton = StatusBar.Q<Button>("UpdateButton");
mUpdateButton.text = PlasticLocalization.GetString(PlasticLocalization.Name.UpdateButton);
mBranchLabel = StatusBar.Q<Label>("BranchLabel");
mBranchLabel.text = "Branch main @ codice @ codice@cloud";
ShowUpdateNotification(false);
root.Add(StatusBar);
}
// For the icon string, the name of unity icons can be found at
// https://unitylist.com/p/5c3/Unity-editor-icons
internal void ShowUpdateNotification(bool show, string icon = "", string notification = "")
{
if (!string.IsNullOrEmpty(icon))
mUpdateNotificaionImage.image = EditorGUIUtility.IconContent(icon).image;
if (!string.IsNullOrEmpty(notification))
mUpdateNotificationLabel.text = notification;
if (show)
mUpdateNotification.RemoveFromClassList("display-none");
else
mUpdateNotification.AddToClassList("display-none");
}
// Tabview variables
internal TabView mTabView;
Button mRefreshButton;
Button mSettingsButton;
// Update bar variables
VisualElement mUpdateNotification;
Image mUpdateNotificaionImage;
Label mUpdateNotificationLabel;
Button mUpdateButton;
Label mBranchLabel;
}
}
PlasticSCMWindowUnity.PlasticSCM.Editor