Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
73822ebb94
|
|||
|
7b7890aa8c
|
|||
|
24f983ecb1
|
|||
|
d3ae8e56a5
|
|||
|
a968d6c28b
|
|||
|
a5d37fdaf5
|
|||
|
c13dd8439d
|
|||
|
b657415e9a
|
|||
|
7ef6d153e1
|
|||
|
06e367966a
|
|||
|
a8088d0964
|
|||
|
d548663222
|
|||
|
3056e38cf2
|
|||
|
bcc8a91015
|
|||
|
3a80abd28c
|
|||
|
261d4a8985
|
|||
|
d5e2601cb9
|
|||
|
96090090fa
|
|||
|
79a4a5e07b
|
|||
|
1abe2ac064
|
|||
|
b37db5231e
|
|||
|
09b18a07bf
|
|||
|
ec797297e0
|
|||
|
b48a826052
|
|||
|
845e58f98f
|
BIN
Assets/Resources/Sounds/MenuMusic.mp3
Normal file
BIN
Assets/Resources/Sounds/MenuMusic.mp3
Normal file
Binary file not shown.
23
Assets/Resources/Sounds/MenuMusic.mp3.meta
Normal file
23
Assets/Resources/Sounds/MenuMusic.mp3.meta
Normal file
@@ -0,0 +1,23 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f59ed3599d5096e2a37719634154c5a
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 8
|
||||
defaultSettings:
|
||||
serializedVersion: 2
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
preloadAudioData: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -6287,6 +6287,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
loggedInText: {fileID: 1811333580}
|
||||
accountLoggedOut: {fileID: 983419245}
|
||||
loggedInChangeUsernameButton: {fileID: 1572018539}
|
||||
loggedInChangePasswordButton: {fileID: 501899887}
|
||||
loggedInSaveButton: {fileID: 1394498766}
|
||||
@@ -6590,6 +6591,7 @@ MonoBehaviour:
|
||||
loggedOutLoginButton: {fileID: 1842378620}
|
||||
loggedOutRegisterButton: {fileID: 1888048651}
|
||||
loggedOutBackButton: {fileID: 1848992338}
|
||||
clearValues: 0
|
||||
--- !u!1 &989136372
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
2945
Assets/Scenes/ChatroomMenu.unity
Normal file
2945
Assets/Scenes/ChatroomMenu.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Scenes/ChatroomMenu.unity.meta
Normal file
7
Assets/Scenes/ChatroomMenu.unity.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6d51f8ef1f7d4f01a8416e468a7ed278
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -2057,142 +2057,6 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1097153681}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1221390703
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1221390704}
|
||||
- component: {fileID: 1221390706}
|
||||
- component: {fileID: 1221390705}
|
||||
m_Layer: 5
|
||||
m_Name: Text (TMP)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1221390704
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1221390703}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2038556860}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: -21.5}
|
||||
m_SizeDelta: {x: 200, y: 50}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1221390705
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1221390703}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: Coming 1.5.1
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 4fd546dd0900395408d2de20f5025882, type: 2}
|
||||
m_sharedMaterial: {fileID: -1476194838487357290, guid: 4fd546dd0900395408d2de20f5025882, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4278255615
|
||||
m_fontColor: {r: 1, g: 1, b: 0, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
m_StyleSheet: {fileID: 0}
|
||||
m_TextStyleHashCode: -1183493901
|
||||
m_overrideHtmlColors: 0
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 16
|
||||
m_fontSizeBase: 16
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
m_lineSpacing: 0
|
||||
m_lineSpacingMax: 0
|
||||
m_paragraphSpacing: 0
|
||||
m_charWidthMaxAdj: 0
|
||||
m_TextWrappingMode: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 0
|
||||
m_ActiveFontFeatures: 6e72656b
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_EmojiFallbackSupport: 1
|
||||
m_parseCtrlCharacters: 1
|
||||
m_isOrthographic: 1
|
||||
m_isCullingEnabled: 0
|
||||
m_horizontalMapping: 0
|
||||
m_verticalMapping: 0
|
||||
m_uvLineOffset: 0
|
||||
m_geometrySortingOrder: 0
|
||||
m_IsTextObjectScaleStatic: 0
|
||||
m_VertexBufferAutoSizeReduction: 0
|
||||
m_useMaxVisibleDescender: 1
|
||||
m_pageToDisplay: 1
|
||||
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_isUsingLegacyAnimationComponent: 0
|
||||
m_isVolumetricText: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_baseMaterial: {fileID: 0}
|
||||
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||
--- !u!222 &1221390706
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1221390703}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1263503579
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -4327,6 +4191,148 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
sceneName: IconsMenu
|
||||
--- !u!1 &2001843690
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2001843693}
|
||||
- component: {fileID: 2001843692}
|
||||
- component: {fileID: 2001843691}
|
||||
m_Layer: 0
|
||||
m_Name: MenuMusic
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &2001843691
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2001843690}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 8febb42bbb9b4988498aad078a2a35a0, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!82 &2001843692
|
||||
AudioSource:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2001843690}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 4
|
||||
OutputAudioMixerGroup: {fileID: 0}
|
||||
m_audioClip: {fileID: 8300000, guid: 5f59ed3599d5096e2a37719634154c5a, type: 3}
|
||||
m_Resource: {fileID: 8300000, guid: 5f59ed3599d5096e2a37719634154c5a, type: 3}
|
||||
m_PlayOnAwake: 1
|
||||
m_Volume: 1
|
||||
m_Pitch: 1
|
||||
Loop: 1
|
||||
Mute: 0
|
||||
Spatialize: 0
|
||||
SpatializePostEffects: 0
|
||||
Priority: 0
|
||||
DopplerLevel: 1
|
||||
MinDistance: 1
|
||||
MaxDistance: 500
|
||||
Pan2D: 0
|
||||
rolloffMode: 0
|
||||
BypassEffects: 0
|
||||
BypassListenerEffects: 0
|
||||
BypassReverbZones: 0
|
||||
rolloffCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
panLevelCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
spreadCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
reverbZoneMixCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!4 &2001843693
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2001843690}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &2038556859
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -4360,7 +4366,6 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 1657120008}
|
||||
- {fileID: 1221390704}
|
||||
m_Father: {fileID: 1266243668}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
@@ -4420,7 +4425,7 @@ MonoBehaviour:
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 0
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 2038556863}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
@@ -4470,5 +4475,6 @@ SceneRoots:
|
||||
- {fileID: 519420032}
|
||||
- {fileID: 101625093}
|
||||
- {fileID: 583716567}
|
||||
- {fileID: 2001843693}
|
||||
- {fileID: 1263503583}
|
||||
- {fileID: 1513462405}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -7,6 +7,7 @@ using UnityEngine.UI;
|
||||
public class AccountLoggedIn : MonoBehaviour
|
||||
{
|
||||
public TMP_Text loggedInText;
|
||||
public AccountLoggedOut accountLoggedOut;
|
||||
public Button loggedInChangeUsernameButton;
|
||||
public Button loggedInChangePasswordButton;
|
||||
public Button loggedInSaveButton;
|
||||
@@ -22,7 +23,10 @@ public class AccountLoggedIn : MonoBehaviour
|
||||
loggedInSaveButton.onClick.AddListener(() => SaveAccount());
|
||||
loggedInLoadButton.onClick.AddListener(() => LoadAccount());
|
||||
loggedInRefreshLoginButton.onClick.AddListener(() => AccountHandler.instance.SwitchPanel(6));
|
||||
loggedInLogoutButton.onClick.AddListener(() => AccountHandler.instance.SwitchPanel(1));
|
||||
loggedInLogoutButton.onClick.AddListener(() => {
|
||||
accountLoggedOut.clearValues = true;
|
||||
AccountHandler.instance.SwitchPanel(1);
|
||||
});
|
||||
loggedInBackButton.onClick.AddListener(async () => await SceneManager.LoadSceneAsync("MainMenu"));
|
||||
}
|
||||
|
||||
@@ -49,6 +53,12 @@ public class AccountLoggedIn : MonoBehaviour
|
||||
dataForm.AddField("totalUltraBerries", PlayerPrefs.GetString("TotalUltraBerries", "0"));
|
||||
dataForm.AddField("totalSpeedyBerries", PlayerPrefs.GetString("TotalSpeedyBerries", "0"));
|
||||
dataForm.AddField("totalAttempts", PlayerPrefs.GetString("TotalAttempts", "0"));
|
||||
dataForm.AddField("birdR", PlayerPrefs.GetString("BirdColor", "255;255;255").Split(';')[0]);
|
||||
dataForm.AddField("birdG", PlayerPrefs.GetString("BirdColor", "255;255;255").Split(';')[1]);
|
||||
dataForm.AddField("birdB", PlayerPrefs.GetString("BirdColor", "255;255;255").Split(';')[2]);
|
||||
dataForm.AddField("overlayR", PlayerPrefs.GetString("OverlayColor", "255;255;255").Split(';')[0]);
|
||||
dataForm.AddField("overlayG", PlayerPrefs.GetString("OverlayColor", "255;255;255").Split(';')[1]);
|
||||
dataForm.AddField("overlayB", PlayerPrefs.GetString("OverlayColor", "255;255;255").Split(';')[2]);
|
||||
using UnityWebRequest request = UnityWebRequest.Post(SensitiveInfo.SERVER_DATABASE_PREFIX + "saveAccount.php", dataForm.GetWWWForm());
|
||||
request.SetRequestHeader("Requester", "BerryDashClient");
|
||||
request.SetRequestHeader("ClientVersion", Application.version);
|
||||
@@ -130,6 +140,8 @@ public class AccountLoggedIn : MonoBehaviour
|
||||
PlayerPrefs.SetString("TotalUltraBerries", split[7]);
|
||||
PlayerPrefs.SetString("TotalSpeedyBerries", split[8]);
|
||||
PlayerPrefs.SetString("TotalAttempts", split[9]);
|
||||
PlayerPrefs.SetString("BirdColor", $"{split[10]};{split[11]};{split[12]}");
|
||||
PlayerPrefs.SetString("OverlayColor", $"{split[13]};{split[14]};{split[15]}");
|
||||
AccountHandler.UpdateStatusText(loggedInText, "Loaded account data", Color.green);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -7,6 +7,7 @@ public class AccountLoggedOut : MonoBehaviour
|
||||
public Button loggedOutLoginButton;
|
||||
public Button loggedOutRegisterButton;
|
||||
public Button loggedOutBackButton;
|
||||
public bool clearValues = false;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
@@ -17,11 +18,23 @@ public class AccountLoggedOut : MonoBehaviour
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
PlayerPrefs.DeleteKey("gameSession");
|
||||
PlayerPrefs.DeleteKey("userName");
|
||||
PlayerPrefs.DeleteKey("userId");
|
||||
PlayerPrefs.SetString("HighScoreV2", "0");
|
||||
PlayerPrefs.SetInt("icon", 1);
|
||||
PlayerPrefs.SetInt("overlay", 0);
|
||||
if (clearValues)
|
||||
{
|
||||
PlayerPrefs.DeleteKey("gameSession");
|
||||
PlayerPrefs.DeleteKey("userName");
|
||||
PlayerPrefs.DeleteKey("userId");
|
||||
PlayerPrefs.SetString("HighScoreV2", "0");
|
||||
PlayerPrefs.SetInt("icon", 1);
|
||||
PlayerPrefs.SetInt("overlay", 0);
|
||||
PlayerPrefs.DeleteKey("TotalNormalBerries");
|
||||
PlayerPrefs.DeleteKey("TotalPoisonBerries");
|
||||
PlayerPrefs.DeleteKey("TotalSlowBerries");
|
||||
PlayerPrefs.DeleteKey("TotalUltraBerries");
|
||||
PlayerPrefs.DeleteKey("TotalSpeedyBerries");
|
||||
PlayerPrefs.DeleteKey("TotalAttempts");
|
||||
PlayerPrefs.DeleteKey("BirdColor");
|
||||
PlayerPrefs.DeleteKey("OverlayColor");
|
||||
clearValues = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,6 +83,8 @@ public class AccountLogin : MonoBehaviour
|
||||
PlayerPrefs.SetString("TotalUltraBerries", array[10]);
|
||||
PlayerPrefs.SetString("TotalSpeedyBerries", array[11]);
|
||||
PlayerPrefs.SetString("TotalAttempts", array[12]);
|
||||
PlayerPrefs.SetString("BirdColor", $"{array[13]};{array[14]};{array[15]}");
|
||||
PlayerPrefs.SetString("OverlayColor", $"{array[16]};{array[17]};{array[18]}");
|
||||
AccountHandler.instance.SwitchPanel(0);
|
||||
AccountHandler.UpdateStatusText(loginPanelStatusText, "", Color.red);
|
||||
}
|
||||
|
||||
@@ -59,9 +59,17 @@ public class AccountRefreshLogin : MonoBehaviour
|
||||
{
|
||||
AccountHandler.UpdateStatusText(refreshLoginStatusText, "Incorrect username or password", Color.red);
|
||||
}
|
||||
else if (response == "1")
|
||||
else if (response.Split(":")[0] == "1")
|
||||
{
|
||||
string[] array = response.Split(':');
|
||||
string session = array[1];
|
||||
string userName = array[2];
|
||||
int userId = int.Parse(array[3]);
|
||||
PlayerPrefs.SetString("gameSession", session);
|
||||
PlayerPrefs.SetString("userName", userName);
|
||||
PlayerPrefs.SetInt("userId", userId);
|
||||
AccountHandler.instance.SwitchPanel(0);
|
||||
AccountHandler.UpdateStatusText(refreshLoginStatusText, "", Color.red);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
244
Assets/Scripts/ChatroomMenu.cs
Normal file
244
Assets/Scripts/ChatroomMenu.cs
Normal file
@@ -0,0 +1,244 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ChatroomMenu : MonoBehaviour
|
||||
{
|
||||
public TMP_Text statusText;
|
||||
public Button backButton;
|
||||
public Button sendButton;
|
||||
public TMP_InputField messageInputField;
|
||||
public GameObject content;
|
||||
public GameObject sampleObject;
|
||||
private string statusMessage;
|
||||
private Coroutine statusRoutine;
|
||||
private Coroutine refreshLoopRoutine;
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (!PlayerPrefs.HasKey("gameSession") || !PlayerPrefs.HasKey("userName") || !PlayerPrefs.HasKey("userId"))
|
||||
{
|
||||
sendButton.interactable = false;
|
||||
messageInputField.interactable = false;
|
||||
ShowStatus("Warning: You are not logged in. Please log in to send messages.");
|
||||
}
|
||||
backButton.onClick.AddListener(async () => await SceneManager.LoadSceneAsync("MainMenu"));
|
||||
sendButton.onClick.AddListener(async () => await HandleMessageSubmit());
|
||||
messageInputField.textComponent.textWrappingMode = TextWrappingModes.Normal;
|
||||
messageInputField.onSubmit.AddListener(async (_) => await HandleMessageSubmit());
|
||||
refreshLoopRoutine = StartCoroutine(Loop());
|
||||
}
|
||||
|
||||
IEnumerator Loop() {
|
||||
while (true) {
|
||||
Refresh();
|
||||
yield return new WaitForSeconds(3f);
|
||||
}
|
||||
}
|
||||
|
||||
async Task HandleMessageSubmit()
|
||||
{
|
||||
if (!sendButton.interactable) return;
|
||||
var text = messageInputField.text.Clone() as string;
|
||||
messageInputField.text = string.Empty;
|
||||
if (string.IsNullOrEmpty(text))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EncryptedWWWForm dataForm = new();
|
||||
dataForm.AddField("content", text);
|
||||
dataForm.AddField("gameSession", PlayerPrefs.GetString("gameSession", ""));
|
||||
using UnityWebRequest request = UnityWebRequest.Post(SensitiveInfo.SERVER_DATABASE_PREFIX + "sendChatroomMessage.php", dataForm.GetWWWForm());
|
||||
request.SetRequestHeader("Requester", "BerryDashClient");
|
||||
request.SetRequestHeader("ClientVersion", Application.version);
|
||||
request.SetRequestHeader("ClientPlatform", Application.platform.ToString());
|
||||
await request.SendWebRequest();
|
||||
if (request.result != UnityWebRequest.Result.Success)
|
||||
{
|
||||
return;
|
||||
}
|
||||
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
||||
switch (response)
|
||||
{
|
||||
case "-999":
|
||||
ShowStatus("Server error while fetching data");
|
||||
break;
|
||||
case "-998":
|
||||
ShowStatus("Client version too outdated to access servers");
|
||||
break;
|
||||
case "-997":
|
||||
ShowStatus("Encryption/decryption issues");
|
||||
break;
|
||||
case "-1":
|
||||
ShowStatus("Authentication error");
|
||||
break;
|
||||
case "1":
|
||||
StopCoroutine(refreshLoopRoutine);
|
||||
refreshLoopRoutine = StartCoroutine(Loop());
|
||||
content.transform.localPosition = new Vector2(0f, 0f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ShowStatus(string content)
|
||||
{
|
||||
statusMessage = content;
|
||||
if (statusRoutine != null) StopCoroutine(statusRoutine);
|
||||
statusRoutine = StartCoroutine(StatusRoutine());
|
||||
}
|
||||
|
||||
IEnumerator StatusRoutine()
|
||||
{
|
||||
statusText.gameObject.SetActive(true);
|
||||
statusText.text = statusMessage;
|
||||
statusText.color = new Color(statusText.color.r, statusText.color.g, statusText.color.b, 0f);
|
||||
|
||||
float t = 0f;
|
||||
while (t < 0.5f)
|
||||
{
|
||||
t += Time.deltaTime;
|
||||
float a = t / 0.5f;
|
||||
statusText.color = new Color(statusText.color.r, statusText.color.g, statusText.color.b, a);
|
||||
yield return null;
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds(2f);
|
||||
|
||||
t = 0f;
|
||||
while (t < 0.5f)
|
||||
{
|
||||
t += Time.deltaTime;
|
||||
float a = 1f - (t / 0.5f);
|
||||
statusText.color = new Color(statusText.color.r, statusText.color.g, statusText.color.b, a);
|
||||
yield return null;
|
||||
}
|
||||
|
||||
statusText.gameObject.SetActive(false);
|
||||
statusText.text = "";
|
||||
statusRoutine = null;
|
||||
}
|
||||
|
||||
async void Refresh()
|
||||
{
|
||||
using UnityWebRequest request = UnityWebRequest.Get(SensitiveInfo.SERVER_DATABASE_PREFIX + "getChatroomMessages.php");
|
||||
request.SetRequestHeader("Requester", "BerryDashClient");
|
||||
request.SetRequestHeader("ClientVersion", Application.version);
|
||||
request.SetRequestHeader("ClientPlatform", Application.platform.ToString());
|
||||
await request.SendWebRequest();
|
||||
if (request.result != UnityWebRequest.Result.Success)
|
||||
{
|
||||
Debug.LogError("Failed to fetch chatroom messages: " + request.error);
|
||||
return;
|
||||
}
|
||||
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
||||
var shouldClear = true;
|
||||
switch (response)
|
||||
{
|
||||
case "-999":
|
||||
ShowStatus("Server error while fetching data");
|
||||
break;
|
||||
case "-998":
|
||||
ShowStatus("Client version too outdated to access servers");
|
||||
break;
|
||||
case "-997":
|
||||
ShowStatus("Encryption/decryption issues");
|
||||
break;
|
||||
default:
|
||||
var split = response.Split(':');
|
||||
if (split[0] == "1")
|
||||
{
|
||||
shouldClear = false;
|
||||
foreach (var row in split[1].Split("|"))
|
||||
{
|
||||
var rowSplit = row.Split(';');
|
||||
var id = rowSplit[0];
|
||||
var username = Encoding.UTF8.GetString(Convert.FromBase64String(rowSplit[1]));
|
||||
var chatContent = Encoding.UTF8.GetString(Convert.FromBase64String(rowSplit[2]));
|
||||
var icon = rowSplit[3];
|
||||
var overlay = rowSplit[4];
|
||||
var uid = rowSplit[5];
|
||||
var birdR = rowSplit[6];
|
||||
var birdG = rowSplit[7];
|
||||
var birdB = rowSplit[8];
|
||||
var overlayR = rowSplit[9];
|
||||
var overlayG = rowSplit[10];
|
||||
var overlayB = rowSplit[11];
|
||||
|
||||
if (content.transform.Find("ChatroomRow_" + id) != null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (content.transform.childCount > 50)
|
||||
{
|
||||
var firstChild = content.transform.GetChild(0);
|
||||
Destroy(firstChild.gameObject);
|
||||
}
|
||||
|
||||
var rowInfo = Instantiate(sampleObject, content.transform);
|
||||
var usernameText = rowInfo.transform.GetChild(0).GetComponent<TMP_Text>();
|
||||
var playerIcon = usernameText.transform.GetChild(0).GetComponent<Image>();
|
||||
var playerOverlayIcon = playerIcon.transform.GetChild(0).GetComponent<Image>();
|
||||
var messageText = rowInfo.transform.GetChild(1).GetComponent<TMP_Text>();
|
||||
|
||||
usernameText.text = username;
|
||||
messageText.text = chatContent;
|
||||
playerIcon.sprite = Resources.Load<Sprite>("Icons/Icons/bird_" + icon);
|
||||
if (icon == "1")
|
||||
{
|
||||
playerIcon.sprite = Tools.GetIconForUser(int.Parse(uid));
|
||||
}
|
||||
playerOverlayIcon.sprite = Resources.Load<Sprite>("Icons/Overlays/overlay_" + overlay);
|
||||
if (overlay == "0")
|
||||
{
|
||||
playerOverlayIcon.gameObject.SetActive(false);
|
||||
}
|
||||
else if (overlay == "8")
|
||||
{
|
||||
playerOverlayIcon.transform.localPosition = new Vector2(-16.56f, 14.81f);
|
||||
}
|
||||
else if (overlay == "11")
|
||||
{
|
||||
playerOverlayIcon.transform.localPosition = new Vector2(-14.74451f, 20.39122f);
|
||||
}
|
||||
else if (overlay == "13")
|
||||
{
|
||||
playerOverlayIcon.transform.localPosition = new Vector2(-16.54019f, 14.70365f);
|
||||
}
|
||||
try
|
||||
{
|
||||
playerIcon.color = new Color32(byte.Parse(birdR), byte.Parse(birdG), byte.Parse(birdB), 255);
|
||||
playerOverlayIcon.color = new Color32(byte.Parse(overlayR), byte.Parse(overlayG), byte.Parse(overlayB), 255);
|
||||
} catch (Exception)
|
||||
{
|
||||
playerIcon.color = Color.white;
|
||||
playerOverlayIcon.color = Color.white;
|
||||
}
|
||||
rowInfo.name = "ChatroomRow_" + id;
|
||||
rowInfo.SetActive(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowStatus("Error fetching messages.");
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (shouldClear)
|
||||
{
|
||||
foreach (Transform item in content.transform)
|
||||
{
|
||||
if (item.gameObject.activeSelf)
|
||||
{
|
||||
Destroy(item.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/ChatroomMenu.cs.meta
Normal file
2
Assets/Scripts/ChatroomMenu.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0dbd2b8269756e018b7c71d0e878242c
|
||||
@@ -6,7 +6,7 @@ public class EncryptedWWWForm
|
||||
|
||||
public void AddField(string key, string value)
|
||||
{
|
||||
form.AddField(key, SensitiveInfo.Encrypt(value, SensitiveInfo.SERVER_SEND_TRANSFER_KEY));
|
||||
form.AddField(SensitiveInfo.Encrypt(key, SensitiveInfo.SERVER_SEND_TRANSFER_KEY), SensitiveInfo.Encrypt(value, SensitiveInfo.SERVER_SEND_TRANSFER_KEY));
|
||||
}
|
||||
|
||||
public WWWForm GetWWWForm() => form;
|
||||
|
||||
@@ -42,6 +42,32 @@ public class GamePlayer : MonoBehaviour
|
||||
|
||||
void Awake()
|
||||
{
|
||||
var backgroundColor = PlayerPrefs.GetString("BackgroundColor", "58;58;58").Split(";");
|
||||
var birdColor = PlayerPrefs.GetString("BirdColor", "255;255;255").Split(";");
|
||||
var overlayColor = PlayerPrefs.GetString("OverlayColor", "255;255;255").Split(";");
|
||||
try
|
||||
{
|
||||
Camera.main.backgroundColor = new Color(
|
||||
int.Parse(backgroundColor[0])/255f,
|
||||
int.Parse(backgroundColor[1])/255f,
|
||||
int.Parse(backgroundColor[2])/255f
|
||||
);
|
||||
bird.GetComponent<SpriteRenderer>().color = new Color(
|
||||
int.Parse(birdColor[0])/255f,
|
||||
int.Parse(birdColor[1])/255f,
|
||||
int.Parse(birdColor[2])/255f
|
||||
);
|
||||
bird.transform.GetChild(0).GetComponent<SpriteRenderer>().color = new Color(
|
||||
int.Parse(overlayColor[0])/255f,
|
||||
int.Parse(overlayColor[1])/255f,
|
||||
int.Parse(overlayColor[2])/255f
|
||||
);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Debug.LogError("Invalid BackgroundColor format");
|
||||
}
|
||||
|
||||
lastMoveTime = Time.time;
|
||||
UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.Enable();
|
||||
instance = this;
|
||||
|
||||
62
Assets/Scripts/IconsMenuBirdColorPanel.cs
Normal file
62
Assets/Scripts/IconsMenuBirdColorPanel.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class IconsMenuBirdColorPanel : MonoBehaviour
|
||||
{
|
||||
public Slider rSlider;
|
||||
public Slider gSlider;
|
||||
public Slider bSlider;
|
||||
public TMP_InputField hexValue;
|
||||
public Image previewImage;
|
||||
public Button resetButton;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
var birdColor = PlayerPrefs.GetString("BirdColor", "255;255;255").Split(";");
|
||||
try
|
||||
{
|
||||
rSlider.value = int.Parse(birdColor[0]);
|
||||
gSlider.value = int.Parse(birdColor[1]);
|
||||
bSlider.value = int.Parse(birdColor[2]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Debug.LogError("Invalid BirdColor format");
|
||||
rSlider.value = 255; gSlider.value = 255; bSlider.value = 255;
|
||||
}
|
||||
SlidersChanged();
|
||||
|
||||
rSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
||||
gSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
||||
bSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
||||
|
||||
hexValue.onValueChanged.AddListener(value =>
|
||||
{
|
||||
var v = value.StartsWith("#") ? value[1..] : value;
|
||||
if (v.Length == 6 && ColorUtility.TryParseHtmlString("#" + v, out var col))
|
||||
{
|
||||
rSlider.SetValueWithoutNotify(col.r * 255f);
|
||||
gSlider.SetValueWithoutNotify(col.g * 255f);
|
||||
bSlider.SetValueWithoutNotify(col.b * 255f);
|
||||
previewImage.color = col;
|
||||
PlayerPrefs.SetString("BirdColor", $"{(int)(col.r * 255)};{(int)(col.g * 255)};{(int)(col.b * 255)}");
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
});
|
||||
|
||||
resetButton.onClick.AddListener(() =>
|
||||
{
|
||||
hexValue.text = "#FFFFFF";
|
||||
});
|
||||
}
|
||||
|
||||
void SlidersChanged()
|
||||
{
|
||||
var col = new Color(rSlider.value/255f, gSlider.value/255f, bSlider.value/255f);
|
||||
previewImage.color = col;
|
||||
hexValue.SetTextWithoutNotify($"#{ColorUtility.ToHtmlStringRGB(col)}");
|
||||
PlayerPrefs.SetString("BirdColor", $"{(int)rSlider.value};{(int)gSlider.value};{(int)bSlider.value}");
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/IconsMenuBirdColorPanel.cs.meta
Normal file
2
Assets/Scripts/IconsMenuBirdColorPanel.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b2570aea461bc94f28157a7cc7d381ef
|
||||
62
Assets/Scripts/IconsMenuOverlayColorPanel.cs
Normal file
62
Assets/Scripts/IconsMenuOverlayColorPanel.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class IconsMenuOverlayColorPanel : MonoBehaviour
|
||||
{
|
||||
public Slider rSlider;
|
||||
public Slider gSlider;
|
||||
public Slider bSlider;
|
||||
public TMP_InputField hexValue;
|
||||
public Image previewImage;
|
||||
public Button resetButton;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
var overlayColor = PlayerPrefs.GetString("OverlayColor", "255;255;255").Split(";");
|
||||
try
|
||||
{
|
||||
rSlider.value = int.Parse(overlayColor[0]);
|
||||
gSlider.value = int.Parse(overlayColor[1]);
|
||||
bSlider.value = int.Parse(overlayColor[2]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Debug.LogError("Invalid OverlayColor format");
|
||||
rSlider.value = 255; gSlider.value = 255; bSlider.value = 255;
|
||||
}
|
||||
SlidersChanged();
|
||||
|
||||
rSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
||||
gSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
||||
bSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
||||
|
||||
hexValue.onValueChanged.AddListener(value =>
|
||||
{
|
||||
var v = value.StartsWith("#") ? value[1..] : value;
|
||||
if (v.Length == 6 && ColorUtility.TryParseHtmlString("#" + v, out var col))
|
||||
{
|
||||
rSlider.SetValueWithoutNotify(col.r * 255f);
|
||||
gSlider.SetValueWithoutNotify(col.g * 255f);
|
||||
bSlider.SetValueWithoutNotify(col.b * 255f);
|
||||
previewImage.color = col;
|
||||
PlayerPrefs.SetString("OverlayColor", $"{(int)(col.r * 255)};{(int)(col.g * 255)};{(int)(col.b * 255)}");
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
});
|
||||
|
||||
resetButton.onClick.AddListener(() =>
|
||||
{
|
||||
hexValue.text = "#FFFFFF";
|
||||
});
|
||||
}
|
||||
|
||||
void SlidersChanged()
|
||||
{
|
||||
var col = new Color(rSlider.value/255f, gSlider.value/255f, bSlider.value/255f);
|
||||
previewImage.color = col;
|
||||
hexValue.SetTextWithoutNotify($"#{ColorUtility.ToHtmlStringRGB(col)}");
|
||||
PlayerPrefs.SetString("OverlayColor", $"{(int)rSlider.value};{(int)gSlider.value};{(int)bSlider.value}");
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/IconsMenuOverlayColorPanel.cs.meta
Normal file
2
Assets/Scripts/IconsMenuOverlayColorPanel.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65f6bd5c95bc89f17b1446eb992dc697
|
||||
@@ -9,37 +9,40 @@ using UnityEngine.UI;
|
||||
public class LeaderboardsMenu : MonoBehaviour
|
||||
{
|
||||
public TMP_Text statusText;
|
||||
public Button backButton;
|
||||
public Button refreshButton;
|
||||
|
||||
public GameObject selectionPanel;
|
||||
public Button selectionScoreButton;
|
||||
public Button selectionBerryButton;
|
||||
public Button selectionBackButton;
|
||||
|
||||
public GameObject scorePanel;
|
||||
public GameObject scoreContent;
|
||||
public Button scoreBackButton;
|
||||
public Button scoreRefreshButton;
|
||||
public GameObject scoreSampleObject;
|
||||
|
||||
public GameObject berryPanel;
|
||||
public GameObject berryContent;
|
||||
public TMP_Dropdown berryShowTypeDropdown;
|
||||
public Button berryBackButton;
|
||||
public Button berryRefreshButton;
|
||||
public GameObject berrySampleObject;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
selectionScoreButton.onClick.AddListener(() => SwitchMenu(1));
|
||||
selectionBerryButton.onClick.AddListener(() => SwitchMenu(2));
|
||||
selectionBackButton.onClick.AddListener(async () => await SceneManager.LoadSceneAsync("MainMenu"));
|
||||
|
||||
scoreBackButton.onClick.AddListener(() => SwitchMenu(0));
|
||||
scoreRefreshButton.onClick.AddListener(() => GetTopPlayersScore());
|
||||
|
||||
berryShowTypeDropdown.onValueChanged.AddListener(value => GetTopPlayersBerry(value));
|
||||
berryBackButton.onClick.AddListener(() => SwitchMenu(0));
|
||||
berryRefreshButton.onClick.AddListener(() => GetTopPlayersBerry(berryShowTypeDropdown.value));
|
||||
|
||||
|
||||
backButton.onClick.AddListener(async () =>
|
||||
{
|
||||
if (selectionPanel.activeSelf) await SceneManager.LoadSceneAsync("MainMenu");
|
||||
else if (scorePanel.activeSelf || berryPanel.activeSelf) SwitchMenu(0);
|
||||
});
|
||||
refreshButton.onClick.AddListener(() =>
|
||||
{
|
||||
if (scorePanel.activeSelf) GetTopPlayersScore();
|
||||
else if (berryPanel.activeSelf) GetTopPlayersBerry(berryShowTypeDropdown.value);
|
||||
});
|
||||
}
|
||||
|
||||
void SwitchMenu(int menu) {
|
||||
@@ -62,17 +65,22 @@ public class LeaderboardsMenu : MonoBehaviour
|
||||
switch (menu)
|
||||
{
|
||||
case 0:
|
||||
refreshButton.gameObject.SetActive(false);
|
||||
selectionPanel.SetActive(true);
|
||||
scorePanel.SetActive(false);
|
||||
berryPanel.SetActive(false);
|
||||
break;
|
||||
case 1:
|
||||
refreshButton.transform.localPosition = new Vector2(-402.5f, -282.33f);
|
||||
refreshButton.gameObject.SetActive(true);
|
||||
GetTopPlayersScore();
|
||||
selectionPanel.SetActive(false);
|
||||
scorePanel.SetActive(true);
|
||||
berryPanel.SetActive(false);
|
||||
break;
|
||||
case 2:
|
||||
refreshButton.transform.localPosition = new Vector2(402.5f, 282.33f);
|
||||
refreshButton.gameObject.SetActive(true);
|
||||
berryShowTypeDropdown.value = 0;
|
||||
GetTopPlayersBerry(0);
|
||||
selectionPanel.SetActive(false);
|
||||
@@ -84,8 +92,8 @@ public class LeaderboardsMenu : MonoBehaviour
|
||||
|
||||
async void GetTopPlayersScore()
|
||||
{
|
||||
scoreBackButton.interactable = false;
|
||||
scoreRefreshButton.interactable = false;
|
||||
backButton.interactable = false;
|
||||
refreshButton.interactable = false;
|
||||
foreach (Transform item in scoreContent.transform)
|
||||
{
|
||||
if (item.gameObject.activeSelf)
|
||||
@@ -133,6 +141,12 @@ public class LeaderboardsMenu : MonoBehaviour
|
||||
var icon = split[2];
|
||||
var overlay = split[3];
|
||||
var uid = split[4];
|
||||
var birdR = split[5];
|
||||
var birdG = split[6];
|
||||
var birdB = split[7];
|
||||
var overlayR = split[8];
|
||||
var overlayG = split[9];
|
||||
var overlayB = split[10];
|
||||
|
||||
var entryInfo = Instantiate(scoreSampleObject, scoreContent.transform);
|
||||
var usernameText = entryInfo.transform.GetChild(0).GetComponent<TMP_Text>();
|
||||
@@ -164,6 +178,15 @@ public class LeaderboardsMenu : MonoBehaviour
|
||||
{
|
||||
playerOverlayIcon.transform.localPosition = new Vector2(-16.54019f, 14.70365f);
|
||||
}
|
||||
try
|
||||
{
|
||||
playerIcon.color = new Color32(byte.Parse(birdR), byte.Parse(birdG), byte.Parse(birdB), 255);
|
||||
playerOverlayIcon.color = new Color32(byte.Parse(overlayR), byte.Parse(overlayG), byte.Parse(overlayB), 255);
|
||||
} catch (Exception)
|
||||
{
|
||||
playerIcon.color = Color.white;
|
||||
playerOverlayIcon.color = Color.white;
|
||||
}
|
||||
entryInfo.SetActive(true);
|
||||
}
|
||||
}
|
||||
@@ -172,15 +195,15 @@ public class LeaderboardsMenu : MonoBehaviour
|
||||
{
|
||||
UpdateStatus(true, "Failed to fetch leaderboard stats");
|
||||
}
|
||||
scoreBackButton.interactable = true;
|
||||
scoreRefreshButton.interactable = true;
|
||||
backButton.interactable = true;
|
||||
refreshButton.interactable = true;
|
||||
}
|
||||
|
||||
async void GetTopPlayersBerry(int showAmount)
|
||||
{
|
||||
berryShowTypeDropdown.interactable = false;
|
||||
berryBackButton.interactable = false;
|
||||
berryRefreshButton.interactable = false;
|
||||
backButton.interactable = false;
|
||||
refreshButton.interactable = false;
|
||||
foreach (Transform item in berryContent.transform)
|
||||
{
|
||||
if (item.gameObject.activeSelf)
|
||||
@@ -229,6 +252,12 @@ public class LeaderboardsMenu : MonoBehaviour
|
||||
var icon = split[2];
|
||||
var overlay = split[3];
|
||||
var uid = split[4];
|
||||
var birdR = split[5];
|
||||
var birdG = split[6];
|
||||
var birdB = split[7];
|
||||
var overlayR = split[8];
|
||||
var overlayG = split[9];
|
||||
var overlayB = split[10];
|
||||
|
||||
var entryInfo = Instantiate(berrySampleObject, berryContent.transform);
|
||||
var usernameText = entryInfo.transform.GetChild(0).GetComponent<TMP_Text>();
|
||||
@@ -260,6 +289,15 @@ public class LeaderboardsMenu : MonoBehaviour
|
||||
{
|
||||
playerOverlayIcon.transform.localPosition = new Vector2(-16.54019f, 14.70365f);
|
||||
}
|
||||
try
|
||||
{
|
||||
playerIcon.color = new Color32(byte.Parse(birdR), byte.Parse(birdG), byte.Parse(birdB), 255);
|
||||
playerOverlayIcon.color = new Color32(byte.Parse(overlayR), byte.Parse(overlayG), byte.Parse(overlayB), 255);
|
||||
} catch (Exception)
|
||||
{
|
||||
playerIcon.color = Color.white;
|
||||
playerOverlayIcon.color = Color.white;
|
||||
}
|
||||
entryInfo.SetActive(true);
|
||||
}
|
||||
}
|
||||
@@ -269,8 +307,8 @@ public class LeaderboardsMenu : MonoBehaviour
|
||||
UpdateStatus(true, "Failed to fetch leaderboard stats");
|
||||
}
|
||||
berryShowTypeDropdown.interactable = true;
|
||||
berryBackButton.interactable = true;
|
||||
berryRefreshButton.interactable = true;
|
||||
backButton.interactable = true;
|
||||
refreshButton.interactable = true;
|
||||
}
|
||||
|
||||
private void UpdateStatus(bool enabled, string message = "")
|
||||
|
||||
@@ -89,6 +89,17 @@ public class LoadingMenu : MonoBehaviour
|
||||
await SceneManager.LoadSceneAsync("MainMenu");
|
||||
}
|
||||
else if (response == "2")
|
||||
{
|
||||
text.text = "Outdated client! You can still play the game and access the servers, but it isn't recommended.";
|
||||
|
||||
var updateButtonPos = updateButton.transform.localPosition;
|
||||
updateButtonPos.x = -135;
|
||||
updateButton.transform.localPosition = updateButtonPos;
|
||||
|
||||
updateButton.gameObject.SetActive(true);
|
||||
continueButton.gameObject.SetActive(true);
|
||||
}
|
||||
else if (response == "3")
|
||||
{
|
||||
text.text = "Outdated client! You can still load into the game, but online features may not be available.";
|
||||
|
||||
|
||||
31
Assets/Scripts/MenuMusic.cs
Normal file
31
Assets/Scripts/MenuMusic.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class MenuMusic : MonoBehaviour
|
||||
{
|
||||
public static MenuMusic Instance;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (Instance == null)
|
||||
{
|
||||
Instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
SceneManager.sceneLoaded += OnSceneLoaded;
|
||||
GetComponent<AudioSource>().volume = PlayerPrefs.GetFloat("musicVolume", 1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
||||
{
|
||||
if (scene.name == "GamePlayer")
|
||||
{
|
||||
SceneManager.sceneLoaded -= OnSceneLoaded;
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/MenuMusic.cs.meta
Normal file
2
Assets/Scripts/MenuMusic.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8febb42bbb9b4988498aad078a2a35a0
|
||||
@@ -54,6 +54,7 @@ public class SettingsMenu : MonoBehaviour
|
||||
{
|
||||
PlayerPrefs.SetFloat("musicVolume", value);
|
||||
PlayerPrefs.Save();
|
||||
MenuMusic.Instance.GetComponent<AudioSource>().volume = value;
|
||||
});
|
||||
sfxSlider.onValueChanged.AddListener(value =>
|
||||
{
|
||||
|
||||
62
Assets/Scripts/SettingsMenuBgColorPanel.cs
Normal file
62
Assets/Scripts/SettingsMenuBgColorPanel.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class SettingsMenuBgColorPanel : MonoBehaviour
|
||||
{
|
||||
public Slider rSlider;
|
||||
public Slider gSlider;
|
||||
public Slider bSlider;
|
||||
public TMP_InputField hexValue;
|
||||
public Image previewImage;
|
||||
public Button resetButton;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
var backgroundColor = PlayerPrefs.GetString("BackgroundColor", "58;58;58").Split(";");
|
||||
try
|
||||
{
|
||||
rSlider.value = int.Parse(backgroundColor[0]);
|
||||
gSlider.value = int.Parse(backgroundColor[1]);
|
||||
bSlider.value = int.Parse(backgroundColor[2]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Debug.LogError("Invalid BackgroundColor format");
|
||||
rSlider.value = 58; gSlider.value = 58; bSlider.value = 58;
|
||||
}
|
||||
SlidersChanged();
|
||||
|
||||
rSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
||||
gSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
||||
bSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
||||
|
||||
hexValue.onValueChanged.AddListener(value =>
|
||||
{
|
||||
var v = value.StartsWith("#") ? value[1..] : value;
|
||||
if (v.Length == 6 && ColorUtility.TryParseHtmlString("#" + v, out var col))
|
||||
{
|
||||
rSlider.SetValueWithoutNotify(col.r * 255f);
|
||||
gSlider.SetValueWithoutNotify(col.g * 255f);
|
||||
bSlider.SetValueWithoutNotify(col.b * 255f);
|
||||
previewImage.color = col;
|
||||
PlayerPrefs.SetString("BackgroundColor", $"{(int)(col.r * 255)};{(int)(col.g * 255)};{(int)(col.b * 255)}");
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
});
|
||||
|
||||
resetButton.onClick.AddListener(() =>
|
||||
{
|
||||
hexValue.text = "#3A3A3A";
|
||||
});
|
||||
}
|
||||
|
||||
void SlidersChanged()
|
||||
{
|
||||
var col = new Color(rSlider.value/255f, gSlider.value/255f, bSlider.value/255f);
|
||||
previewImage.color = col;
|
||||
hexValue.SetTextWithoutNotify($"#{ColorUtility.ToHtmlStringRGB(col)}");
|
||||
PlayerPrefs.SetString("BackgroundColor", $"{(int)rSlider.value};{(int)gSlider.value};{(int)bSlider.value}");
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/SettingsMenuBgColorPanel.cs.meta
Normal file
2
Assets/Scripts/SettingsMenuBgColorPanel.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 851d6819986698659a53cdf0cb057649
|
||||
@@ -14,6 +14,9 @@ EditorBuildSettings:
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/AccountMenu.unity
|
||||
guid: 61d560f45a39646489a33d9e871b5336
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/ChatroomMenu.unity
|
||||
guid: 6d51f8ef1f7d4f01a8416e468a7ed278
|
||||
- enabled: 1
|
||||
path: Assets/Scenes/GamePlayer.unity
|
||||
guid: 8d9f90781cae8d24c8560dbca7ed6f42
|
||||
|
||||
@@ -140,7 +140,7 @@ PlayerSettings:
|
||||
loadStoreDebugModeEnabled: 0
|
||||
visionOSBundleVersion: 1.0
|
||||
tvOSBundleVersion: 1.0
|
||||
bundleVersion: 1.5.0
|
||||
bundleVersion: 1.5.2
|
||||
preloadedAssets:
|
||||
- {fileID: -944628639613478452, guid: 2bcd2660ca9b64942af0de543d8d7100, type: 3}
|
||||
metroInputSource: 0
|
||||
|
||||
Reference in New Issue
Block a user