Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
UFrameIT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FrameIT
UFrameIT
Commits
72c6c77d
Commit
72c6c77d
authored
4 years ago
by
John Schihada
Browse files
Options
Downloads
Patches
Plain Diff
Fixed Scroll-Selection-Bug
parent
5a783cf4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Assets/Scripts/InventoryStuff/Scroll.cs
+0
-78
0 additions, 78 deletions
Assets/Scripts/InventoryStuff/Scroll.cs
Assets/Scripts/InventoryStuff/ScrollDetails.cs
+7
-6
7 additions, 6 deletions
Assets/Scripts/InventoryStuff/ScrollDetails.cs
with
7 additions
and
84 deletions
Assets/Scripts/InventoryStuff/Scroll.cs
+
0
−
78
View file @
72c6c77d
...
@@ -7,38 +7,6 @@
...
@@ -7,38 +7,6 @@
using
JsonSubTypes
;
using
JsonSubTypes
;
using
Newtonsoft.Json
;
using
Newtonsoft.Json
;
/*
[Serializable]
public class Declaration
{
public string name;
public string isProof;
public string value;
public string identifier;
public string description;
}
[Serializable]
public class Scroll
{
public string problemTheory;
public string solutionTheory;
public string label;
public string description;
public Declaration[] declarations;
//public string output;
public static Scroll generateFromJson(string json) {
return JsonUtility.FromJson<Scroll>(json);
}
public string toJson() {
return JsonUtility.ToJson(this);
}
}
*/
public
class
Scroll
:
LightScroll
public
class
Scroll
:
LightScroll
{
{
public
string
label
;
public
string
label
;
...
@@ -65,52 +33,6 @@ public static void InitDynamicScroll(int n)
...
@@ -65,52 +33,6 @@ public static void InitDynamicScroll(int n)
FactOccurences
=
new
List
<
KeyValuePair
<
int
,
int
>>[
n
];
FactOccurences
=
new
List
<
KeyValuePair
<
int
,
int
>>[
n
];
}
}
//also collects occurences to be changed later
public
static
string
ParseString
(
int
stringId
,
string
raw
,
List
<
ScrollFact
>
scrollFacts
)
{
int
i
=
0
;
while
(
true
)
{
char
[]
rawChars
=
raw
.
ToCharArray
();
i
=
Array
.
FindIndex
(
rawChars
,
i
,
c
=>
c
==
'$'
);
if
(
i
==
-
1
)
break
;
// Debug.Log(i);
//id of Fact, specified after the $
int
toChange
=
(
int
)
Char
.
GetNumericValue
(
raw
[
i
+
1
]);
//label of this Fact
string
label
=
scrollFacts
[
toChange
].
label
;
raw
=
raw
.
Remove
(
i
,
2
);
raw
=
raw
.
Insert
(
i
,
label
);
if
(
FactOccurences
[
toChange
]
==
null
)
{
FactOccurences
[
toChange
]
=
new
List
<
KeyValuePair
<
int
,
int
>>();
}
//if (toChange >= 0) Debug.Log(stringId);
FactOccurences
[
toChange
].
Add
(
new
KeyValuePair
<
int
,
int
>(
stringId
,
i
));
}
return
raw
;
}
/*
public class ScrollList
{
public List<Scroll> scrolls;
}*/
public
class
ScrollAssignment
public
class
ScrollAssignment
{
{
public
KeyValuePair
<
string
,
JSONManager
.
MMTTerm
>
assignment
;
public
KeyValuePair
<
string
,
JSONManager
.
MMTTerm
>
assignment
;
...
...
This diff is collapsed.
Click to expand it.
Assets/Scripts/InventoryStuff/ScrollDetails.cs
+
7
−
6
View file @
72c6c77d
...
@@ -56,7 +56,11 @@ public void setScroll(Scroll s)
...
@@ -56,7 +56,11 @@ public void setScroll(Scroll s)
Transform
scrollView
=
gameObject
.
transform
.
GetChild
(
2
);
Transform
scrollView
=
gameObject
.
transform
.
GetChild
(
2
);
Transform
viewport
=
scrollView
.
GetChild
(
0
);
Transform
viewport
=
scrollView
.
GetChild
(
0
);
this
.
scroll
=
s
;
this
.
scroll
=
s
;
//Clear all current ScrollFacts
foreach
(
Transform
child
in
viewport
.
GetChild
(
0
).
transform
)
GameObject
.
Destroy
(
child
.
gameObject
);
ParameterDisplays
=
new
List
<
GameObject
>();
ParameterDisplays
=
new
List
<
GameObject
>();
Scroll
.
InitDynamicScroll
(
s
.
requiredFacts
.
Count
);
Scroll
.
InitDynamicScroll
(
s
.
requiredFacts
.
Count
);
for
(
int
i
=
0
;
i
<
s
.
requiredFacts
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
s
.
requiredFacts
.
Count
;
i
++)
...
@@ -67,15 +71,12 @@ public void setScroll(Scroll s)
...
@@ -67,15 +71,12 @@ public void setScroll(Scroll s)
scrollFact
.
ID
=
i
;
scrollFact
.
ID
=
i
;
//obj.GetComponent<RectTransform>().localPosition = GetPosition(i);
//obj.GetComponent<RectTransform>().localPosition = GetPosition(i);
scrollFact
.
Label
=
Scroll
.
ParseString
(
i
,
s
.
requiredFacts
[
i
].
label
,
s
.
requiredFacts
)
;
scrollFact
.
Label
=
s
.
requiredFacts
[
i
].
label
;
obj
.
transform
.
SetParent
(
viewport
.
GetChild
(
0
));
obj
.
transform
.
SetParent
(
viewport
.
GetChild
(
0
));
//this is from benni, I dont know if the hack is the commented line below or the line above....
//TODO: Remvoe this reaaaaly bad hack
//obj.transform.localScale = Vector3.one;
ParameterDisplays
.
Add
(
obj
);
ParameterDisplays
.
Add
(
obj
);
}
}
//scroll description
//scroll description
ScrollDescription
=
Scroll
.
ParseString
(-
1
,
s
.
description
,
s
.
requiredFacts
)
;
ScrollDescription
=
s
.
description
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment