Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Commit

Permalink
update inspector window
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiebrynes7 committed Jun 3, 2020
1 parent 685c808 commit a2a8d38
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.columns {
#entities {
flex-direction: row;
flex-grow: 1;
flex-grow: 14;
}

#entity-list-view {
Expand All @@ -9,7 +9,7 @@
--unity-item-height: 24;
}

.unity-list-view__item {
#entity-list-view .unity-list-view__item {
padding-left: 8px;
-unity-text-align: middle-left;
}
Expand Down Expand Up @@ -74,6 +74,58 @@
padding-bottom: 4px;
}

.is-auth-toggle .unity-label:disabled {
color: white;
#worker-details {
padding: 8px 4px;
border-top-color: rgba(0, 0, 0, 0.20);
border-top-width: 1px;
max-height: 15%;
flex-shrink: 1;
flex-grow: 1;
}

#worker-details-label {
-unity-font-style: bold;
font-size: 18px;
margin-bottom: 8px;
}

#worker-info {
max-width: 40%;
flex-grow: 1;
padding-left: 4px;
}

#worker-type .unity-label {
min-width: 100px;
}

#worker-id .unity-label {
min-width: 100px;
}

#worker-flags {
max-width: 60%;
flex-grow: 2;
padding-left: 20px;
}

#worker-flags-list {
margin-top: 6px;
flex-grow: 1;
flex-direction: column;
--unity-item-height: 24;
-unity-text-align: middle-left;
}

#worker-flags-list .unity-list-view__item {
padding-left: 2px;
}

.flag-element-container {
flex-direction: row;
}

.flag-element {
flex-grow: 1;
max-width: 50%;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
xmlns:wi="Improbable.Gdk.Debug.WorkerInspector"
>
<gdk:WorldSelector />
<VisualElement class="columns">
<wi:WorkerDetail name="worker-details"/>
<VisualElement name="entities">
<wi:EntityList name="entity-panel"/>
<wi:EntityDetail name="entity-detail" />
</VisualElement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ internal class WorkerInspectorWindow : EditorWindow
private WorldSelector worldSelector;
private EntityList entityList;
private EntityDetail entityDetail;
private WorkerDetail workerDetail;

[MenuItem("SpatialOS/Window/Worker Inspector", false)]
public static void ShowWindow()
Expand All @@ -30,6 +31,7 @@ private void OnInspectorUpdate()
worldSelector.UpdateWorldSelection();
entityList.Update();
entityDetail.Update();
workerDetail.Update();
}

private void SetupUI()
Expand All @@ -50,12 +52,15 @@ private void SetupUI()
entityList.OnEntitySelected += OnEntitySelected;

entityDetail = rootVisualElement.Q<EntityDetail>();

workerDetail = rootVisualElement.Q<WorkerDetail>();
}

private void OnWorldChanged(World world)
{
entityList.SetWorld(world);
entityDetail.SetWorld(world);
workerDetail.SetWorld(world);
}

private void OnEntitySelected(EntityData entityData)
Expand Down

0 comments on commit a2a8d38

Please sign in to comment.