A lot of work, beginning client UI, adding lesson and page handling, etc
This commit is contained in:
48
ADEPT-Godot/Client/Scripts/UI/ClientMain.cs
Normal file
48
ADEPT-Godot/Client/Scripts/UI/ClientMain.cs
Normal 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");
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
1
ADEPT-Godot/Client/Scripts/UI/ClientMain.cs.uid
Normal file
1
ADEPT-Godot/Client/Scripts/UI/ClientMain.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dta0h5g01sooo
|
||||
Reference in New Issue
Block a user