Fixed preview and clothes bug

This commit is contained in:
Jerome Coudron
2023-05-14 12:37:36 +00:00
committed by Dries Van Schuylenbergh
parent 1e09f09dae
commit 7df6ea1ecd
5 changed files with 47 additions and 28 deletions

View File

@@ -253,12 +253,7 @@ public class CoursesController : AbstractFeedback
{
PersistentDataController.SavedLearnableProgress learnable = progress.GetRandomLearnable();
int panelChosen;
if (course.theme.modelIndex == ModelIndex.NONE)
{
// only multiple choice works in preview mode
panelChosen = 1;
}
else if (learnable.progress > 2.0f)
if (learnable.progress > 2.0f)
{
panelChosen = 2;
}
@@ -285,6 +280,14 @@ public class CoursesController : AbstractFeedback
//if (isNextSignInTransit || maxWords < progress.completedLearnables)
if (isNextSignInTransit) return;
// Code for preview-progress, skipping should give progress unless it is multipleChoice
if (course.theme.modelIndex == ModelIndex.NONE)
{
string currentName = course.theme.learnables[currentWordIndex].name;
// This works both to allow panel 0 to allow progress via skipping and also to allow panel 2 to be skipped.
if (progress.FindLearnable(currentName).progress <= 1f || progress.FindLearnable(currentName).progress >= 2f) progress.UpdateLearnable(currentName, 1.5f);
}
progress.progress = (float)progress.completedLearnables / (float)maxWords;
progressBar.fillAmount = progress.progress;