Skip to content

Commit 7f7e0e5

Browse files
committed
feat(draims): swipe active & standby frequency
1 parent 28b2c23 commit 7f7e0e5

File tree

4 files changed

+217
-1
lines changed

4 files changed

+217
-1
lines changed

src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/RadioComponent.prefab

+137
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ RectTransform:
243243
m_Children:
244244
- {fileID: 8830349552323726862}
245245
- {fileID: 5831318964179428642}
246+
- {fileID: 1672302704265545114}
246247
m_Father: {fileID: 6553454962824877765}
247248
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
248249
m_AnchorMin: {x: 0.5, y: 0.5}
@@ -288,6 +289,141 @@ MonoBehaviour:
288289
m_FillOrigin: 0
289290
m_UseSpriteMesh: 0
290291
m_PixelsPerUnitMultiplier: 1
292+
--- !u!1 &3169894272624406815
293+
GameObject:
294+
m_ObjectHideFlags: 0
295+
m_CorrespondingSourceObject: {fileID: 0}
296+
m_PrefabInstance: {fileID: 0}
297+
m_PrefabAsset: {fileID: 0}
298+
serializedVersion: 6
299+
m_Component:
300+
- component: {fileID: 1672302704265545114}
301+
- component: {fileID: 4775938652859990520}
302+
- component: {fileID: 2773999932382198781}
303+
m_Layer: 17
304+
m_Name: EditUnderline
305+
m_TagString: Untagged
306+
m_Icon: {fileID: 0}
307+
m_NavMeshLayer: 0
308+
m_StaticEditorFlags: 0
309+
m_IsActive: 1
310+
--- !u!224 &1672302704265545114
311+
RectTransform:
312+
m_ObjectHideFlags: 0
313+
m_CorrespondingSourceObject: {fileID: 0}
314+
m_PrefabInstance: {fileID: 0}
315+
m_PrefabAsset: {fileID: 0}
316+
m_GameObject: {fileID: 3169894272624406815}
317+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
318+
m_LocalPosition: {x: 0, y: 0, z: 0}
319+
m_LocalScale: {x: 1, y: 1, z: 1}
320+
m_ConstrainProportionsScale: 0
321+
m_Children: []
322+
m_Father: {fileID: 7165789494254489964}
323+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
324+
m_AnchorMin: {x: 0.5, y: 0.5}
325+
m_AnchorMax: {x: 0.5, y: 0.5}
326+
m_AnchoredPosition: {x: 1.5, y: 8.1}
327+
m_SizeDelta: {x: 200, y: 50}
328+
m_Pivot: {x: 0.5, y: 0.5}
329+
--- !u!222 &4775938652859990520
330+
CanvasRenderer:
331+
m_ObjectHideFlags: 0
332+
m_CorrespondingSourceObject: {fileID: 0}
333+
m_PrefabInstance: {fileID: 0}
334+
m_PrefabAsset: {fileID: 0}
335+
m_GameObject: {fileID: 3169894272624406815}
336+
m_CullTransparentMesh: 1
337+
--- !u!114 &2773999932382198781
338+
MonoBehaviour:
339+
m_ObjectHideFlags: 0
340+
m_CorrespondingSourceObject: {fileID: 0}
341+
m_PrefabInstance: {fileID: 0}
342+
m_PrefabAsset: {fileID: 0}
343+
m_GameObject: {fileID: 3169894272624406815}
344+
m_Enabled: 1
345+
m_EditorHideFlags: 0
346+
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
347+
m_Name:
348+
m_EditorClassIdentifier:
349+
m_Material: {fileID: 0}
350+
m_Color: {r: 1, g: 1, b: 1, a: 1}
351+
m_RaycastTarget: 1
352+
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
353+
m_Maskable: 1
354+
m_OnCullStateChanged:
355+
m_PersistentCalls:
356+
m_Calls: []
357+
m_text: ___.___
358+
m_isRightToLeft: 0
359+
m_fontAsset: {fileID: 11400000, guid: 4b68adbcc8fecb04899ef4099b51d83d, type: 2}
360+
m_sharedMaterial: {fileID: 1138958138483197462, guid: 4b68adbcc8fecb04899ef4099b51d83d,
361+
type: 2}
362+
m_fontSharedMaterials: []
363+
m_fontMaterial: {fileID: 0}
364+
m_fontMaterials: []
365+
m_fontColor32:
366+
serializedVersion: 2
367+
rgba: 4291948924
368+
m_fontColor: {r: 0.4862745, g: 0.94509804, b: 0.81960785, a: 1}
369+
m_enableVertexGradient: 0
370+
m_colorMode: 3
371+
m_fontColorGradient:
372+
topLeft: {r: 1, g: 1, b: 1, a: 1}
373+
topRight: {r: 1, g: 1, b: 1, a: 1}
374+
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
375+
bottomRight: {r: 1, g: 1, b: 1, a: 1}
376+
m_fontColorGradientPreset: {fileID: 0}
377+
m_spriteAsset: {fileID: 0}
378+
m_tintAllSprites: 0
379+
m_StyleSheet: {fileID: 0}
380+
m_TextStyleHashCode: -1183493901
381+
m_overrideHtmlColors: 0
382+
m_faceColor:
383+
serializedVersion: 2
384+
rgba: 4294967295
385+
m_fontSize: 30
386+
m_fontSizeBase: 30
387+
m_fontWeight: 400
388+
m_enableAutoSizing: 0
389+
m_fontSizeMin: 18
390+
m_fontSizeMax: 72
391+
m_fontStyle: 0
392+
m_HorizontalAlignment: 2
393+
m_VerticalAlignment: 512
394+
m_textAlignment: 65535
395+
m_characterSpacing: -6
396+
m_wordSpacing: 0
397+
m_lineSpacing: 0
398+
m_lineSpacingMax: 0
399+
m_paragraphSpacing: 0
400+
m_charWidthMaxAdj: 0
401+
m_enableWordWrapping: 1
402+
m_wordWrappingRatios: 0.4
403+
m_overflowMode: 0
404+
m_linkedTextComponent: {fileID: 0}
405+
parentLinkedComponent: {fileID: 0}
406+
m_enableKerning: 1
407+
m_enableExtraPadding: 0
408+
checkPaddingRequired: 0
409+
m_isRichText: 1
410+
m_parseCtrlCharacters: 1
411+
m_isOrthographic: 1
412+
m_isCullingEnabled: 0
413+
m_horizontalMapping: 0
414+
m_verticalMapping: 0
415+
m_uvLineOffset: 0
416+
m_geometrySortingOrder: 0
417+
m_IsTextObjectScaleStatic: 0
418+
m_VertexBufferAutoSizeReduction: 0
419+
m_useMaxVisibleDescender: 1
420+
m_pageToDisplay: 1
421+
m_margin: {x: 0, y: 0, z: 0, w: 0}
422+
m_isUsingLegacyAnimationComponent: 0
423+
m_isVolumetricText: 0
424+
m_hasFontAssetChanged: 0
425+
m_baseMaterial: {fileID: 0}
426+
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
291427
--- !u!1 &3400891327296201365
292428
GameObject:
293429
m_ObjectHideFlags: 0
@@ -988,6 +1124,7 @@ MonoBehaviour:
9881124
_frequencyText: {fileID: 1745892785861053448}
9891125
_standByFrequencyText: {fileID: 8151093581666850098}
9901126
_isSelectedIcon: {fileID: 2970647689031799624}
1127+
_editingUnderline: {fileID: 3169894272624406815}
9911128
--- !u!114 &2333064660428131205
9921129
MonoBehaviour:
9931130
m_ObjectHideFlags: 0

src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/Scripts/Components/RadioComponent.asset

+55-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/Scripts/Components/RadioComponent.cs

+10
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public class RadioComponent : UdonSharpBehaviour {
2525

2626
[SerializeField] private GameObject _isSelectedIcon;
2727

28+
[SerializeField] private GameObject _editingUnderline;
29+
2830

2931
[PublicAPI]
3032
public void _InitComponent(FDMiFloat frequency, FDMiFloat standByFrequency, FDMiBool isReceive, FDMiBool isTransmit, DRAIMS draims) {
@@ -56,5 +58,13 @@ public void _OnTransmitChange()
5658
{
5759
_transmitIcon.SetActive(_isTransmit.Data);
5860
}
61+
62+
public void _SwipeFrequency() {
63+
// ReSharper disable once SwapViaDeconstruction
64+
var newStandByFrequency = _frequency.Data;
65+
66+
_frequency.Data = _standByFrequency.Data;
67+
_standByFrequency.Data = newStandByFrequency;
68+
}
5969
}
6070
}

src/Packages/com.yuxiaviation.v320neo.fdmi/Runtime/Avionics/Instruments/DRAIMS/Scripts/Pages/DraimsVHFPage.cs

+15
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,22 @@ public override void _FirstInitPage(DRAIMS draims) {
4848
_vhf1Component._InitComponent(_vhf1Frequency, _vhf1StandByFrequency, _isVHF1Receive, _isVHF1Transmit, draims);
4949
_vhf2Component._InitComponent(_vhf2Frequency, _vhf2StandByFrequency, _isVHF2Receive, _isVHF2Transmit, draims);
5050
_vhf3Component._InitComponent(_vhf3Frequency, _vhf3StandByFrequency, _isVHF3Receive, _isVHF3Transmit, draims);
51+
}
52+
53+
public override void _OnKeyPressed(DRAIMSKeyType keyType) {
54+
base._OnKeyPressed(keyType);
5155

56+
switch (keyType) {
57+
case DRAIMSKeyType.SelectionLeft1:
58+
_vhf1Component._SwipeFrequency();
59+
break;
60+
case DRAIMSKeyType.SelectionLeft2:
61+
_vhf2Component._SwipeFrequency();
62+
break;
63+
case DRAIMSKeyType.SelectionLeft3:
64+
_vhf3Component._SwipeFrequency();
65+
break;
66+
}
5267
}
5368
}
5469
}

0 commit comments

Comments
 (0)