Commit eab2e229 authored by radow's avatar radow
Browse files

helpsystem changes

parent 6c40df09
......@@ -2403,7 +2403,7 @@ MonoBehaviour:
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Transition: 0
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.18823531, g: 0.19215688, b: 0.15294118, a: 1}
......@@ -6868,7 +6868,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: v1.0
m_text: v1.1
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: a8fe1bc46038f2647b8c3b4d7485d7b2, type: 2}
m_sharedMaterial: {fileID: 4506315107996966872, guid: a8fe1bc46038f2647b8c3b4d7485d7b2, type: 2}
......@@ -7196,7 +7196,7 @@ MonoBehaviour:
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Transition: 0
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.18823531, g: 0.19215688, b: 0.15294118, a: 1}
......@@ -8624,7 +8624,7 @@ MonoBehaviour:
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Transition: 0
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.18823531, g: 0.19215688, b: 0.15294118, a: 1}
......@@ -9175,6 +9175,7 @@ RectTransform:
- {fileID: 793119572}
- {fileID: 815730611165886017}
- {fileID: 1541493731789459640}
- {fileID: 2733461690521916184}
m_Father: {fileID: 643539944}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -9256,6 +9257,7 @@ MonoBehaviour:
noButton: {fileID: 1678646552}
ease: 4
duration: 1
helpTextDisplay: {fileID: 7361459869877620017}
--- !u!1 &1027814838
GameObject:
m_ObjectHideFlags: 0
......@@ -16749,7 +16751,7 @@ MonoBehaviour:
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Transition: 0
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.18823531, g: 0.19215688, b: 0.15294118, a: 1}
......@@ -20807,7 +20809,7 @@ MonoBehaviour:
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4281479730
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
......@@ -21309,6 +21311,141 @@ MonoBehaviour:
swapSprites: 0
highlightsprite: {fileID: 0}
regularSprite: {fileID: 0}
--- !u!1 &3221002174241065376
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2733461690521916184}
- component: {fileID: 8706688034772169552}
- component: {fileID: 7361459869877620017}
m_Layer: 5
m_Name: Helpinfo
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &2733461690521916184
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3221002174241065376}
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: 1015994506}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -858, y: 371}
m_SizeDelta: {x: 200, y: 50}
m_Pivot: {x: 1, y: 0}
--- !u!222 &8706688034772169552
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3221002174241065376}
m_CullTransparentMesh: 1
--- !u!114 &7361459869877620017
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3221002174241065376}
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: No help available in this section!
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: a8fe1bc46038f2647b8c3b4d7485d7b2, type: 2}
m_sharedMaterial: {fileID: 4506315107996966872, guid: a8fe1bc46038f2647b8c3b4d7485d7b2, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, 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: 23
m_fontSizeBase: 23
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 1
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_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 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: -662.66284, 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!1 &4354649136666777738
GameObject:
m_ObjectHideFlags: 0
......
......@@ -9305,6 +9305,11 @@ MeshFilter:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 896042366}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &897546845 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2419820664655915638, guid: 6cbd62c30b39a9545a47f56696b6522b, type: 3}
m_PrefabInstance: {fileID: 7309086472921592635}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &901173700
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -17473,7 +17478,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_FirstSelected: {fileID: 897546845}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!4 &1713794830
......@@ -25232,6 +25237,14 @@ PrefabInstance:
propertyPath: m_Name
value: UI
objectReference: {fileID: 0}
- target: {fileID: 7515028771046351607, guid: 6cbd62c30b39a9545a47f56696b6522b, type: 3}
propertyPath: m_Transition
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9221352886730524022, guid: 6cbd62c30b39a9545a47f56696b6522b, type: 3}
propertyPath: m_Transition
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6cbd62c30b39a9545a47f56696b6522b, type: 3}
--- !u!4 &7556906438312485286
......
......@@ -15,9 +15,10 @@ public class ActivateShortcut : MonoBehaviour
}
}
public void Activate()
public string Activate()
{
activated = true;
shortcutGO.SetActive(true);
return "Shortcut activated";
}
}
......@@ -13,16 +13,19 @@ public class Helproom : MonoBehaviour
currentRoom = this;
}
public static void GetHelp()
public static string GetHelp()
{
if (currentRoom == null) return;
if (currentRoom == null) return"No help available in this section.";
var reply = "No more help available in this section.";
foreach(ActivateShortcut s in currentRoom.shortcuts)
{
if (!s.activated)
{
s.Activate();
reply = s.Activate();
break;
}
}
return reply;
}
}
......@@ -5,12 +5,14 @@ using DG.Tweening;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using TMPro;
public class Menu : MonoBehaviour
{
public static Menu instance;
private void Awake()
{
instance = this;
UISensivitySettings.LoadSoundSettingsLocally();
UISoundSettings.LoadSoundSettingsLocally();
UIToggleButton.LoadDataLocally();
......@@ -149,11 +151,13 @@ public class Menu : MonoBehaviour
InputMode.SetInputMode(on ? InputMode.Mode.MENU : InputMode.Mode.PLAYMODE);
if (on)
{
helpTextDisplay.gameObject.SetActive(false);
GoToSubMenu(Sub.MAIN);
playButton.SetActive(false);
creditButton.SetActive(false);
continueButton.SetActive(true);
helpButton.SetActive(true);
continueButton.GetComponent<Button>().Select();
m_DepthOfField = ScriptableObject.CreateInstance<DepthOfField>();
m_DepthOfField.enabled.Override(true);
......@@ -190,8 +194,15 @@ public class Menu : MonoBehaviour
public void GetHelp()
{
Helproom.GetHelp();
SetPausemenu(false);
DisplayHelpInfo(Helproom.GetHelp());
//SetPausemenu(false);
}
public TextMeshProUGUI helpTextDisplay;
public void DisplayHelpInfo(string helpinfo)
{
helpTextDisplay.gameObject.SetActive(true);
helpTextDisplay.text = helpinfo;
}
}
......@@ -5,7 +5,7 @@ using UnityEngine.EventSystems;
using UnityEngine.UI;
using TMPro;
public class OwnButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, ISelectHandler, IDeselectHandler
public class OwnButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, ISelectHandler, IDeselectHandler, IPointerClickHandler
{
bool selected;
bool isHovering;
......@@ -57,14 +57,15 @@ public class OwnButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandle
doAudio = true;
}
private void Update()
{
if (dirty)
if (dirty||true)
{
outline.enabled = selected||isHovering;
outline.effectDistance = selected ? new Vector2(4,-4) : new Vector2(2,-2);
buttonImage.color = (isHovering||selected) ? highlightColor : regularColor;
text.fontStyle = isHovering ? FontStyles.Bold : FontStyles.Normal;
//text.fontStyle = isHovering ? FontStyles.Bold : FontStyles.Normal;
if (isHovering || selected) textSwap.Select();
else textSwap.DeSelect();
if (doAudio) auds.Play();
......@@ -73,4 +74,9 @@ public class OwnButton : MonoBehaviour, IPointerEnterHandler, IPointerExitHandle
doAudio = false;
}
}
public void OnPointerClick(PointerEventData eventData)
{
selected = false;
}
}
......@@ -10,8 +10,8 @@ public class UISoundSettings : MonoBehaviour
public static float vaVolume;
public static float musicVolumeDefault = 1;
public static float effectsVolumeDefault = 1;
public static float vaVolumeDefault = 1;
public static float effectsVolumeDefault = .3f;
public static float vaVolumeDefault = .7f;
public Slider musicVolumeSlider;
public Slider effectsVolumeSlider;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment