A lot of work, beginning client UI, adding lesson and page handling, etc

This commit is contained in:
2025-02-16 00:57:45 -06:00
parent 119609f38c
commit 4d0e64ed87
22 changed files with 444 additions and 35 deletions

View File

@@ -0,0 +1,48 @@
using Godot;
using System;
using ADEPT.Core;
using Cogwheel;
public partial class ClientMain : Control
{
[Export] private Label _lessonTitleLabel;
[Export] private Label _pageTitleLabel;
[Export] private Button _backNavButton;
[Export] private Button _nextNavButton;
[Export] private Button _menuNavButton;
public override void _Ready()
{
GetTree().CreateTimer(1).Timeout += () => { COGWHEEL.RegisterObject(this); Init(); };
}
[Command(Name = "client.init", Description = "Initialize the client")]
private void Init()
{
Adept.LessonHandler.LessonLoaded += (s, o) =>
{
_lessonTitleLabel.Text = Adept.LessonHandler.CurrentLesson.Title;
_pageTitleLabel.Text = Adept.LessonHandler.CurrentPage.Title;
};
Adept.LessonHandler.PageChanged += (s, o) =>
{
_pageTitleLabel.Text = Adept.LessonHandler.CurrentPage.Title;
};
_backNavButton.Pressed += () =>
{
// Adept.LessonHandler.LoadPreviousPage();
COGWHEEL.RunCommand("lesson.previous");
};
_nextNavButton.Pressed += () =>
{
// Adept.LessonHandler.LoadNextPage();
COGWHEEL.RunCommand("lesson.next");
};
}
}

View File

@@ -0,0 +1 @@
uid://dta0h5g01sooo