Skip to content

Commit

Permalink
Fixed various mouse cursor issues.
Browse files Browse the repository at this point in the history
* Fixed missing mouse cursor handling for buttons.
* Fixed default cursor not applying in menu on WebGL builds.
* Lazily fixed situations where wrong cursor was retained.
  • Loading branch information
PathogenDavid committed Sep 23, 2024
1 parent 11c60b7 commit 5dc92f2
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Assets/HandMadeGame/Code/DialogueController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ private void Start()
YesButton.onClick.AddListener(() =>
{
SoundEffectsController.Instance.PlayUiSound(ButtonClickSound);
CursorController.Instance.SetCursor(CursorKind.Default);
HandleAction(YesAction);
});

NoButton.onClick.AddListener(() =>
{
SoundEffectsController.Instance.PlayUiSound(ButtonClickSound);
CursorController.Instance.SetCursor(CursorKind.Default);
HandleAction(NoAction);
});
}
Expand Down
1 change: 1 addition & 0 deletions Assets/HandMadeGame/Code/GameFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public void EndArrangementMode(Quest quest)
throw new InvalidOperationException("Arrangement mode should not be ended with a quest that isn't the current quest!");

BackgroundMusicController.Instance.TransitionToCharacterMusic();
CursorController.Instance.SetCursor(CursorKind.Default);

PuzzleOutcome outcome = quest.Validator.CheckPuzzle(quest);
switch (outcome)
Expand Down
1 change: 1 addition & 0 deletions Assets/HandMadeGame/Code/MainMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ private void Awake()

StartButton.onClick.AddListener(() =>
{
CursorController.Instance.SetCursor(CursorKind.Default);
SoundEffectsController.Instance.PlayUiSound(ButtonClickSound);

CanvasGroup.interactable = false;
Expand Down
52 changes: 52 additions & 0 deletions Assets/HandMadeGame/Maps/Main.unity
Original file line number Diff line number Diff line change
Expand Up @@ -11929,6 +11929,7 @@ GameObject:
- component: {fileID: 473317550}
- component: {fileID: 473317549}
- component: {fileID: 473317548}
- component: {fileID: 473317551}
m_Layer: 5
m_Name: StartButton
m_TagString: Untagged
Expand Down Expand Up @@ -12038,6 +12039,18 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 473317546}
m_CullTransparentMesh: 1
--- !u!114 &473317551
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 473317546}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 27243cb7dee347744ab5b457343ddcf2, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &475276776
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -36189,6 +36202,7 @@ GameObject:
- component: {fileID: 1412623275}
- component: {fileID: 1412623274}
- component: {fileID: 1412623273}
- component: {fileID: 1412623276}
m_Layer: 5
m_Name: OptionsButton
m_TagString: Untagged
Expand Down Expand Up @@ -36298,6 +36312,18 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1412623271}
m_CullTransparentMesh: 1
--- !u!114 &1412623276
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1412623271}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 27243cb7dee347744ab5b457343ddcf2, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1412991123 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7156350169396152092, guid: 6e3b176020cc7904f9c7afa29fdc429f,
Expand Down Expand Up @@ -44875,6 +44901,7 @@ GameObject:
- component: {fileID: 1759138006}
- component: {fileID: 1759138005}
- component: {fileID: 1759138004}
- component: {fileID: 1759138007}
m_Layer: 5
m_Name: YesButton
m_TagString: Untagged
Expand Down Expand Up @@ -44984,6 +45011,18 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1759138002}
m_CullTransparentMesh: 1
--- !u!114 &1759138007
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1759138002}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 27243cb7dee347744ab5b457343ddcf2, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &1761891330
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -46196,6 +46235,7 @@ GameObject:
- component: {fileID: 1815159082}
- component: {fileID: 1815159081}
- component: {fileID: 1815159080}
- component: {fileID: 1815159083}
m_Layer: 5
m_Name: NoButton
m_TagString: Untagged
Expand Down Expand Up @@ -46305,6 +46345,18 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1815159078}
m_CullTransparentMesh: 1
--- !u!114 &1815159083
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1815159078}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 27243cb7dee347744ab5b457343ddcf2, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &1815746919
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
4 changes: 2 additions & 2 deletions ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ PlayerSettings:
accelerometerFrequency: 60
companyName: Unnamed Wholesome Games Jam Team
productName: Interior Birdecorator
defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0}
defaultCursor: {fileID: 2800000, guid: 0b3af7198ee45254ba7acd84c44cbe63, type: 3}
cursorHotspot: {x: 18, y: 10}
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
m_ShowUnitySplashScreen: 1
m_ShowUnitySplashLogo: 1
Expand Down

0 comments on commit 5dc92f2

Please sign in to comment.