Skip to content

Commit

Permalink
navigateable ui work
Browse files Browse the repository at this point in the history
  • Loading branch information
callistoAshley committed Oct 27, 2021
1 parent 5c74e55 commit 0ef3d6c
Show file tree
Hide file tree
Showing 88 changed files with 627 additions and 56 deletions.
Binary file modified .vs/space!!!!/v16/.suo
Binary file not shown.
1 change: 1 addition & 0 deletions Assembly-CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<Compile Include="Assets\scripts\SpaceshipDoor.cs" />
<Compile Include="Assets\scripts\UI.cs" />
<Compile Include="Assets\scripts\UIManager.cs" />
<Compile Include="Assets\scripts\UINavigateable.cs" />
<Compile Include="Assets\sprites\idk\Something.cs" />
<Reference Include="Unity.Timeline.Editor">
<HintPath>C:/Users/maste/Desktop/Unity Projects/space!!!!/Library/ScriptAssemblies/Unity.Timeline.Editor.dll</HintPath>
Expand Down
Binary file added Assets/ProggyClean.ttf
Binary file not shown.
22 changes: 22 additions & 0 deletions Assets/ProggyClean.ttf.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions Assets/alisonscript/Functions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,20 @@ public IEnumerator Goto(FunctionArgs args)
yield break;
}

[Function("choice", 2)]
public IEnumerator DialogueChoice(FunctionArgs args)
{
UINavigateable ui = UIManager.instance.NewNavigateable(new Vector2(200, 0), new Vector2(400, 50));
ui.SetOptions(args.args.Skip(1).ToArray(), // first element of the array is the string that the navigateable ui is hovering over
new Action(() =>
{
Interpreter.runningScript.AddObject(args.args[0], ui.selectedOption);
Debug.Log("hello!!!!");
args.callback.Invoke();
})) ;
yield break;
}

public struct FunctionArgs
{
public Action callback;
Expand Down
9 changes: 3 additions & 6 deletions Assets/alisonscript/Line.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,11 @@ public void Process(RunningScript runningScript)
if (args.Length == 0)
throw new AlisonscriptSyntaxError(Interpreter.runningScript.GetCurrentLine(), "value assignment expected");

// get the value being assigned to the object
string objectValue = args[0];

if (Interpreter.runningScript.objects.ContainsKey(objectName))
// if the script already has an object with the name objectName, set its value
Interpreter.runningScript.objects[objectName].value = objectValue;
else
// otherwise, create it and add it
Interpreter.runningScript.objects.Add(objectName, new Object(objectValue));
// add the object
Interpreter.runningScript.AddObject(objectName, objectValue);

Interpreter.runningScript.IncrementIndex();
}
Expand Down
11 changes: 11 additions & 0 deletions Assets/alisonscript/RunningScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,16 @@ public void JumpToNextOccurence(int start, string input)
}
throw new Exception($"couldn't find an occurence of {input} from {start}");
}

public void AddObject(string objectName, string objectValue)
{
Debug.Log($"adding object: {objectName} with value: {objectValue}");
if (Interpreter.runningScript.objects.ContainsKey(objectName))
// if the script already has an object with the name objectName, set its value
Interpreter.runningScript.objects[objectName].value = objectValue;
else
// otherwise, create it and add it
Interpreter.runningScript.objects.Add(objectName, new Object(objectValue));
}
}
}
1 change: 0 additions & 1 deletion Assets/lang/en/debug/test2.alisonscript
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
;spk "|alison the robot| now i have a speaker"
;spk "|alison the robot| woah!"
;spk "fkalsdkfl kjalhsdufylias hajdfhbasgb"
;can_move "true"
4 changes: 4 additions & 0 deletions Assets/lang/en/debug/test3.alisonscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
;spk "|alison the robot| this is another test of the dialogue engine"
;spk "|alison the robot| i am going to mispell my name"
;spk "|ailson the robot| hello"
;spk "|alison the robot| cool video game"
7 changes: 7 additions & 0 deletions Assets/lang/en/debug/test3.alisonscript.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Assets/lang/en/debug/test_bigtext.alisonscript
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
;spk "|the debug guy| asgdflbayusjidufiozuic;z/dmc,.znidfya98s6d7oiyoi18644u1yh2k3.a,zbcjalsh duuas diansupdioyuoiu2p1io478iwudjakls.d,nmxzbc.jvzxcv;iz;xjckvnzm,xbciofuapoidsufi;kdfkhi347ou1i2634jlhamndfds hi"
7 changes: 7 additions & 0 deletions Assets/lang/en/debug/test_bigtext.alisonscript.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Assets/lang/en/debug/test_choice.alisonscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
;spk "|the debug guy| i am going to ask you a question"
;choice "@ch" "yes" "no"

cond "@ch"
when "yes"
;spk "|the debug guy| you selected 'yes'"
when "no"
;spk "|the debug guy| you selected 'no'"
end

;spk "|the debug guy| cool choice"
7 changes: 7 additions & 0 deletions Assets/lang/en/debug/test_choice.alisonscript.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Assets/prefabs/GLOBAL.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ MonoBehaviour:
- {fileID: 1514882982938558864, guid: 012e497b4c5be5142815e2a446d0f733, type: 3}
- {fileID: 7499685204744656029, guid: 12f41df85d5312847a5af014d27f4f7d, type: 3}
- {fileID: 1645538143918434251, guid: 7573680d0c780c3499186c70e24247b8, type: 3}
- {fileID: 607486584548431623, guid: 11b2d91ba4950bc4bb4fcde2f01ff21c, type: 3}
- {fileID: 4783293141925882966, guid: fcfd0f181067adb42b777ef486ded1a9, type: 3}
--- !u!114 &1068492277122502070
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down
75 changes: 75 additions & 0 deletions Assets/prefabs/arrow.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &607486584548431623
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8474826642165904809}
- component: {fileID: 723270357771343847}
- component: {fileID: 9188627688612405143}
m_Layer: 5
m_Name: arrow
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8474826642165904809
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 607486584548431623}
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_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
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: 0}
m_SizeDelta: {x: 50, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &723270357771343847
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 607486584548431623}
m_CullTransparentMesh: 0
--- !u!114 &9188627688612405143
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 607486584548431623}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 3157a87178795ed44ba928f1cef78499, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
7 changes: 7 additions & 0 deletions Assets/prefabs/arrow.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0ef3d6c

Please sign in to comment.