Skip to content

Commit ce3ac77

Browse files
committed
feat: graphics settings
1 parent b3333e7 commit ce3ac77

File tree

15 files changed

+528
-200
lines changed

15 files changed

+528
-200
lines changed

Assets/Materials/SurfacePointMaterial.mat

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ Material:
9898
m_Offset: {x: 0, y: 0}
9999
m_Ints: []
100100
m_Floats:
101+
- _AddPrecomputedVelocity: 0
101102
- _AlphaClip: 0
102103
- _AlphaToMask: 0
103104
- _Blend: 0
@@ -127,10 +128,11 @@ Material:
127128
- _SrcBlendAlpha: 1
128129
- _Surface: 0
129130
- _WorkflowMode: 1
131+
- _XRMotionVectorsPass: 1
130132
- _ZWrite: 1
131133
m_Colors:
132-
- _BaseColor: {r: 0.2, g: 0.8509804, b: 0.69803923, a: 1}
133-
- _Color: {r: 0.2, g: 0.8509804, b: 0.69803923, a: 1}
134+
- _BaseColor: {r: 1, g: 0.5235849, b: 0.9873817, a: 1}
135+
- _Color: {r: 1, g: 0.5235849, b: 0.9873817, a: 1}
134136
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
135137
- _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1}
136138
m_BuildTextureStacks: []

Assets/Scenes/TrajectoryPlanner.unity

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2480,6 +2480,18 @@ GameObject:
24802480
m_CorrespondingSourceObject: {fileID: 6193778552061300709, guid: b578609b502e9c74286332dd7db2cfc8, type: 3}
24812481
m_PrefabInstance: {fileID: 6193778551148742955}
24822482
m_PrefabAsset: {fileID: 0}
2483+
--- !u!114 &1537967827
2484+
MonoBehaviour:
2485+
m_ObjectHideFlags: 0
2486+
m_CorrespondingSourceObject: {fileID: 0}
2487+
m_PrefabInstance: {fileID: 0}
2488+
m_PrefabAsset: {fileID: 0}
2489+
m_GameObject: {fileID: 1537967822}
2490+
m_Enabled: 1
2491+
m_EditorHideFlags: 0
2492+
m_Script: {fileID: 11500000, guid: e4e262c39dcb70445923b9f3d697fa72, type: 3}
2493+
m_Name:
2494+
m_EditorClassIdentifier: Assembly-CSharp::SurfaceCoordinate
24832495
--- !u!114 &1550119012 stripped
24842496
MonoBehaviour:
24852497
m_CorrespondingSourceObject: {fileID: 341190944882926336, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3}
@@ -9496,6 +9508,14 @@ PrefabInstance:
94969508
propertyPath: m_Name
94979509
value: Debug
94989510
objectReference: {fileID: 0}
9511+
- target: {fileID: 6193778552061300709, guid: b578609b502e9c74286332dd7db2cfc8, type: 3}
9512+
propertyPath: m_IsActive
9513+
value: 1
9514+
objectReference: {fileID: 0}
9515+
- target: {fileID: 6193778552061300731, guid: b578609b502e9c74286332dd7db2cfc8, type: 3}
9516+
propertyPath: m_Enabled
9517+
value: 0
9518+
objectReference: {fileID: 0}
94999519
- target: {fileID: 6193778552155365640, guid: b578609b502e9c74286332dd7db2cfc8, type: 3}
95009520
propertyPath: m_LocalScale.x
95019521
value: 0.2
@@ -9519,7 +9539,10 @@ PrefabInstance:
95199539
m_RemovedComponents: []
95209540
m_RemovedGameObjects: []
95219541
m_AddedGameObjects: []
9522-
m_AddedComponents: []
9542+
m_AddedComponents:
9543+
- targetCorrespondingSourceObject: {fileID: 6193778552061300709, guid: b578609b502e9c74286332dd7db2cfc8, type: 3}
9544+
insertIndex: -1
9545+
addedObject: {fileID: 1537967827}
95239546
m_SourcePrefab: {fileID: 100100000, guid: b578609b502e9c74286332dd7db2cfc8, type: 3}
95249547
--- !u!1001 &8016510559444948309
95259548
PrefabInstance:
@@ -11229,6 +11252,10 @@ PrefabInstance:
1122911252
propertyPath: _probePrefabs.Array.size
1123011253
value: 10
1123111254
objectReference: {fileID: 0}
11255+
- target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3}
11256+
propertyPath: _referenceCoordBehaviorGO
11257+
value:
11258+
objectReference: {fileID: 2018799750}
1123211259
- target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3}
1123311260
propertyPath: probePrefabIDs.Array.size
1123411261
value: 4
Lines changed: 96 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,119 @@
11
using Unity.AppUI.Redux;
2+
using UnityEngine;
23
using Utils.Types;
34

45
namespace Models.Settings
56
{
67
public static class SettingsReducers
78
{
89
public static SettingsState SetTabIndexReducer(SettingsState state, IAction<int> action)
9-
{
10-
// Ignore if the payload is negative (invalid tab index).
11-
if (action.payload < 0)
12-
return state;
10+
{
11+
// Ignore if the payload is negative (invalid tab index).
12+
if (action.payload < 0)
13+
return state;
1314
return state with { TabIndex = action.payload };
1415
}
1516

1617
public static SettingsState SetInPlaneZoomReducer(SettingsState state, IAction<int> action)
1718
{
18-
return state with { inPlaneZoom = action.payload };
19-
}
19+
return state with { inPlaneZoom = action.payload };
20+
}
2021

2122
#region Probe Settings
2223

2324
public static SettingsState SetDetectCollisionsReducer(
24-
SettingsState state,
25-
IAction<bool> action
25+
SettingsState state,
26+
IAction<bool> action
2627
)
2728
{
28-
return state with { DetectCollisions = action.payload };
29+
return state with { DetectCollisions = action.payload };
30+
}
31+
32+
public static SettingsState SetConvertAPML2ProbeReducer(
33+
SettingsState state,
34+
IAction<bool> action
35+
)
36+
{
37+
return state with { ConvertAPML2Probe = action.payload };
2938
}
3039

31-
public static SettingsState SetConvertAPML2ProbeReducer(
40+
#endregion
41+
42+
#region Graphics Settings
43+
44+
public static SettingsState SetBackgroundReducer(
45+
SettingsState state,
46+
IAction<Color> action
47+
)
48+
{
49+
return state with { Background = action.payload };
50+
}
51+
52+
public static SettingsState SetShowSurfaceCoordinateReducer(
53+
SettingsState state,
54+
IAction<bool> action
55+
)
56+
{
57+
return state with { ShowSurfaceCoordinate = action.payload };
58+
}
59+
60+
public static SettingsState SetShowBregmaAxisReducer(
3261
SettingsState state,
33-
IAction<bool> action
62+
IAction<bool> action
3463
)
3564
{
36-
return state with { ConvertAPML2Probe = action.payload };
65+
return state with { ShowBregmaAxis = action.payload };
66+
}
67+
68+
public static SettingsState SetGhostInactiveProbesReducer(
69+
SettingsState state,
70+
IAction<bool> action
71+
)
72+
{
73+
return state with { GhostInactiveProbes = action.payload };
3774
}
3875

3976
#endregion
4077

4178
#region Ephys Link
4279

4380
public static SettingsState SetSelectedEphysLinkPlatformTypeReducer(
44-
SettingsState state,
81+
SettingsState state,
4582
IAction<EphysLinkPlatformType> action
4683
)
4784
{
48-
return state with { SelectedEphysLinkPlatformType = action.payload };
85+
return state with { SelectedEphysLinkPlatformType = action.payload };
4986
}
5087

5188
public static SettingsState SetNewScalePathfinderMpmPortReducer(
5289
SettingsState state,
5390
IAction<int> action
54-
)
55-
{
56-
return state with { NewScalePathfinderMpmPort = action.payload };
57-
}
91+
)
92+
{
93+
return state with { NewScalePathfinderMpmPort = action.payload };
94+
}
5895

59-
public static SettingsState SetCustomServerIpAddressReducer(
96+
public static SettingsState SetCustomServerIpAddressReducer(
6097
SettingsState state,
61-
IAction<string> action
62-
)
98+
IAction<string> action
99+
)
63100
{
64101
return state with { CustomServerIpAddress = action.payload };
65-
}
102+
}
66103

67104
public static SettingsState SetCustomServerPortReducer(
68-
SettingsState state,
69-
IAction<int> action
70-
)
71-
{
105+
SettingsState state,
106+
IAction<int> action
107+
)
108+
{
72109
return state with { CustomServerPort = action.payload };
73110
}
74111

75112
public static SettingsState SetEphysLinkConnectionStateReducer(
76-
SettingsState state,
113+
SettingsState state,
77114
IAction<(EphysLinkConnectionState ConnectionState, string ConnectionSocketId)> action
78115
)
79-
{
116+
{
80117
return state with { EphysLinkConnectionState = action.payload.ConnectionState };
81118
}
82119

@@ -89,37 +126,53 @@ public static class SettingsActions
89126
$"{SliceNames.SETTINGS_SLICE}/SetTabIndex";
90127

91128
public static readonly ActionCreator<int> SET_IN_PLANE_ZOOM =
92-
$"{SliceNames.SETTINGS_SLICE}/SetInPlaneZoom";
129+
$"{SliceNames.SETTINGS_SLICE}/SetInPlaneZoom";
93130

94-
#region Probe Settings
131+
#region Probe Settings
95132

96-
public static readonly ActionCreator<bool> SET_DETECT_COLLISIONS =
133+
public static readonly ActionCreator<bool> SET_DETECT_COLLISIONS =
97134
$"{SliceNames.SETTINGS_SLICE}/SetDetectCollisions";
98135

99136
public static readonly ActionCreator<bool> SET_CONVERT_APML2PROBE =
100-
$"{SliceNames.SETTINGS_SLICE}/SetConvertAPML2Probe";
137+
$"{SliceNames.SETTINGS_SLICE}/SetConvertAPML2Probe";
138+
139+
#endregion
140+
141+
#region Graphics Settings
142+
143+
public static readonly ActionCreator<Color> SET_BACKGROUND =
144+
$"{SliceNames.SETTINGS_SLICE}/SetBackground";
145+
146+
public static readonly ActionCreator<bool> SET_SHOW_SURFACE_COORDINATE =
147+
$"{SliceNames.SETTINGS_SLICE}/SetShowSurfaceCoordinate";
148+
149+
public static readonly ActionCreator<bool> SET_SHOW_BREGMA_AXIS =
150+
$"{SliceNames.SETTINGS_SLICE}/SetShowBregmaAxis";
151+
152+
public static readonly ActionCreator<bool> SET_GHOST_INACTIVE_PROBES =
153+
$"{SliceNames.SETTINGS_SLICE}/SetGhostInactiveProbes";
101154

102155
#endregion
103156

104157
#region Ephys Link
105158

106-
public static readonly ActionCreator<EphysLinkPlatformType> SET_SELECTED_EPHYS_LINK_PLATFORM_TYPE =
107-
$"{SliceNames.SETTINGS_SLICE}/SetSelectedEphysLinkPlatformType";
159+
public static readonly ActionCreator<EphysLinkPlatformType> SET_SELECTED_EPHYS_LINK_PLATFORM_TYPE =
160+
$"{SliceNames.SETTINGS_SLICE}/SetSelectedEphysLinkPlatformType";
108161

109-
public static readonly ActionCreator<int> SET_NEW_SCALE_PATHFINDER_MPM_PORT =
110-
$"{SliceNames.SETTINGS_SLICE}/SetNewScalePathfinderMpmPort";
162+
public static readonly ActionCreator<int> SET_NEW_SCALE_PATHFINDER_MPM_PORT =
163+
$"{SliceNames.SETTINGS_SLICE}/SetNewScalePathfinderMpmPort";
111164

112-
public static readonly ActionCreator<string> SET_CUSTOM_SERVER_IP_ADDRESS =
165+
public static readonly ActionCreator<string> SET_CUSTOM_SERVER_IP_ADDRESS =
113166
$"{SliceNames.SETTINGS_SLICE}/SetCustomServerIpAddress";
114167

115-
public static readonly ActionCreator<int> SET_CUSTOM_SERVER_PORT =
116-
$"{SliceNames.SETTINGS_SLICE}/SetCustomServerPort";
168+
public static readonly ActionCreator<int> SET_CUSTOM_SERVER_PORT =
169+
$"{SliceNames.SETTINGS_SLICE}/SetCustomServerPort";
117170

118-
public static readonly ActionCreator<(
119-
EphysLinkConnectionState ConnectionState,
120-
string ConnectionSocketId
171+
public static readonly ActionCreator<(
172+
EphysLinkConnectionState ConnectionState,
173+
string ConnectionSocketId
121174
)> SET_EPHYS_LINK_CONNECTION_STATE = $"{SliceNames.SETTINGS_SLICE}/SetEphysLinkConnectionState";
122175

123-
#endregion
176+
#endregion
124177
}
125178
}

Assets/Scripts/Models/Settings/SettingsState.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public record SettingsState
3636

3737
#region Graphics Settings
3838

39+
public Color Background = Color.black;
40+
3941
public bool ShowSurfaceCoordinate = true;
4042

4143
public bool ShowBregmaAxis = true;

0 commit comments

Comments
 (0)