Skip to content

Commit

Permalink
Back button works
Browse files Browse the repository at this point in the history
  • Loading branch information
TimAidley committed Mar 20, 2023
1 parent 41b39df commit a8614e1
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
35 changes: 35 additions & 0 deletions Assets/Prefabs/Panels/SketchbookPanel.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -15210,6 +15210,41 @@ PrefabInstance:
propertyPath: m_DescriptionText
value: Back
objectReference: {fileID: 0}
- target: {fileID: 7879899076693153277, guid: 0963942396a615f4fb1b390436e881b8,
type: 3}
propertyPath: m_Action.m_PersistentCalls.m_Calls.Array.size
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7879899076693153277, guid: 0963942396a615f4fb1b390436e881b8,
type: 3}
propertyPath: m_Action.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7879899076693153277, guid: 0963942396a615f4fb1b390436e881b8,
type: 3}
propertyPath: m_Action.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 2478559423573741591}
- target: {fileID: 7879899076693153277, guid: 0963942396a615f4fb1b390436e881b8,
type: 3}
propertyPath: m_Action.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 7879899076693153277, guid: 0963942396a615f4fb1b390436e881b8,
type: 3}
propertyPath: m_Action.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: BackButtonPressed
objectReference: {fileID: 0}
- target: {fileID: 7879899076693153277, guid: 0963942396a615f4fb1b390436e881b8,
type: 3}
propertyPath: m_Action.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
value: TiltBrush.SketchbookPanel, Assembly-CSharp
objectReference: {fileID: 0}
- target: {fileID: 7879899076693153277, guid: 0963942396a615f4fb1b390436e881b8,
type: 3}
propertyPath: m_Action.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0963942396a615f4fb1b390436e881b8, type: 3}
--- !u!4 &5835854812254485208 stripped
Expand Down
1 change: 1 addition & 0 deletions Assets/Scripts/GUI/LoadSketchButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ override protected void OnButtonPressed()
{
var sketchSet = new ResourceCollectionSketchSet(collection);
SketchbookPanel.Instance.PushSketchSet(SketchbookPanel.Instance.SelectedSketchStack, sketchSet);
return;
}
}

Expand Down
14 changes: 14 additions & 0 deletions Assets/Scripts/GUI/SketchbookPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,15 @@ public void PushSketchSet(int stack, ISketchSet sketchSet)
}
}

public void PopSketchSet(int stack)
{
m_SetStacks[stack].Pop();
if (stack == m_SelectedStack)
{
SetVisibleSketchSet((RootSet)m_SelectedStack);
}
}

void SetVisibleSketchSet(RootSet stack)
{
int stackIndex = (int)stack;
Expand Down Expand Up @@ -824,6 +833,11 @@ public void ButtonPressed(GalleryButton.Type rType, BaseButton button = null)
}
}

public void BackButtonPressed()
{
PopSketchSet(m_SelectedStack);
}

private void OnSketchSetDirty()
{
ComputeNumPages();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public bool GetSketchIcon(int index, out Texture2D icon, out string[] authors, o
var sketch = m_Sketches[index];
icon = sketch.Icon;
authors = sketch.Authors;
description = "DESCRIPTION NOT IMPLEMENTED";
description = sketch.ResourceFileInfo.Resource.Description ?? "";
return icon != null;
}

Expand Down

0 comments on commit a8614e1

Please sign in to comment.