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
fe4994f8
Verified
Commit
fe4994f8
authored
7 months ago
by
Björn Eßwein
Browse files
Options
Downloads
Patches
Plain Diff
Fix old ScrollView description displaying html source code after a fact has been assigned
parent
3dfe74ef
No related branches found
No related tags found
No related merge requests found
Pipeline
#6346
passed
7 months ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Assets/Scripts/UI/InGame/ScrollDetails.cs
+12
-14
12 additions, 14 deletions
Assets/Scripts/UI/InGame/ScrollDetails.cs
Packages/bessw.unity.webview
+1
-1
1 addition, 1 deletion
Packages/bessw.unity.webview
with
13 additions
and
15 deletions
Assets/Scripts/UI/InGame/ScrollDetails.cs
+
12
−
14
View file @
fe4994f8
...
...
@@ -40,14 +40,14 @@ private void OnEnable()
{
SwitchScrollUI
.
activeScrollData
.
OnScrollChanged
.
AddListener
(
ShowScroll
);
SwitchScrollUI
.
activeScrollData
.
OnFactAssignmentUpdated
.
AddListener
(
OnFactAssignmentUpdated
);
SwitchScrollUI
.
activeScrollData
.
OnScrollDynamicInfoUpdated
.
AddListener
(
Update
ScrollDescription
);
SwitchScrollUI
.
activeScrollData
.
OnScrollDynamicInfoUpdated
.
AddListener
(
Display
ScrollDescription
);
}
private
void
OnDisable
()
{
SwitchScrollUI
.
activeScrollData
.
OnScrollChanged
.
RemoveListener
(
ShowScroll
);
SwitchScrollUI
.
activeScrollData
.
OnFactAssignmentUpdated
.
RemoveListener
(
OnFactAssignmentUpdated
);
SwitchScrollUI
.
activeScrollData
.
OnScrollDynamicInfoUpdated
.
RemoveListener
(
Update
ScrollDescription
);
SwitchScrollUI
.
activeScrollData
.
OnScrollDynamicInfoUpdated
.
RemoveListener
(
Display
ScrollDescription
);
}
private
void
OnDestroy
()
...
...
@@ -68,13 +68,7 @@ private void ShowScroll(Scroll newScroll)
//Clear all current ScrollFacts
originalViewport
.
GetChild
(
0
).
gameObject
.
DestroyAllChildren
();
var
description
=
newScroll
.
description
;
// if description is a html description, extract the alternative text representation
if
(
Regex
.
IsMatch
(
newScroll
.
description
,
".*<scroll-description.*"
))
{
description
=
Regex
.
Match
(
newScroll
.
description
,
"<scroll-description [^>]* alt=((?>\\\")|(?>\\'))([^>]*?)\\1[^>]*>"
).
Groups
[
2
].
Value
;
}
originalScroll
.
GetChild
(
0
).
GetComponent
<
TextMeshProUGUI
>().
text
=
description
;
DisplayScrollDescription
(
newScroll
);
//ParameterDisplays.ForEach(gameObj => Destroy(gameObj));
ParameterDisplays
=
new
();
...
...
@@ -94,13 +88,17 @@ private void ShowScroll(Scroll newScroll)
}
}
private
void
Update
ScrollDescription
(
Scroll
rendered
)
private
void
Display
ScrollDescription
(
Scroll
scroll
)
{
if
(
SwitchScrollUI
.
activeScrollData
.
DynamicScrollDescriptionsActive
)
{
// Update scroll-description
Transform
scroll
=
gameObject
.
transform
.
GetChild
(
1
).
transform
;
scroll
.
GetChild
(
0
).
GetComponent
<
TextMeshProUGUI
>().
text
=
rendered
.
description
;
var
description
=
scroll
.
description
;
// if description is a html description, extract the alternative text representation
if
(
Regex
.
IsMatch
(
scroll
.
description
,
".*<scroll-description.*"
))
{
description
=
Regex
.
Match
(
scroll
.
description
,
"<scroll-description [^>]* alt=((?>\\\")|(?>\\'))([^>]*?)\\1[^>]*>"
).
Groups
[
2
].
Value
;
}
Transform
scrollComponent
=
gameObject
.
transform
.
GetChild
(
1
).
transform
;
scrollComponent
.
GetChild
(
0
).
GetComponent
<
TextMeshProUGUI
>().
text
=
description
;
}
private
void
OnFactAssignmentUpdated
(
string
slotUri
,
ActiveScroll
.
SlotAssignment
slotAssignment
)
...
...
This diff is collapsed.
Click to expand it.
bessw.unity.webview
@
5004257d
Compare
923dcaa9
...
5004257d
Subproject commit
923dcaa913260cf737f908310cafcfccf78aef0d
Subproject commit
5004257d58f35d6c32eaf5a0a4afd7f42fc7d049
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