添加更新日志及游戏内界面

master
lightyears 2 years ago
parent 9c7fc660cc
commit 57a139cf95
Signed by: lightyears
GPG Key ID: 98D80DDF26D4F2F9

@ -0,0 +1,7 @@
# 更新日志
## [未发布]
## [1.0.0] - 2023-06-03
- 第一个测试场景

@ -0,0 +1,87 @@
using System.Text;
namespace CMSGame.Models
{
internal record class Changelog
{
public DateOnly Date { set; get; }
public string Title { set; get; }
public string Description { set; get; }
public Changelog(DateOnly date, string title, string description)
{
Date = date;
Title = title;
Description = description;
}
}
internal sealed class ChangelogList : List<Changelog>
{
public ChangelogList()
{
try
{
ParseChangelogFile();
}
catch (Exception ex)
{
GD.PushError(ex);
}
}
private void ParseChangelogFile()
{
var file = FileAccess.Open(new GodotPath("res://CHANGELOG.md"), FileAccess.ModeFlags.Read);
var fileContent = file.GetAsText();
if (fileContent == null) return;
Changelog? changelog = null;
StringBuilder contentBuilder = new StringBuilder();
foreach (var line in fileContent.Split("\n"))
{
if (line.Trim() == "")
{
continue;
}
if (line.StartsWith("#"))
{
if (line.StartsWith("# ")) // 一号标题
{
continue;
}
if (line.StartsWith("## ")) // 二号标题,格式为 [未发布] 或 [1.0.0] - 2023-06-03
{
string title = line.TrimStart(new char[] { '#', ' ' });
string[] parts = title.Split('-').Select(str => str.Trim()).ToArray();
string versionString = parts[0];
string dateString = "";
if (parts.Length >= 2)
{
dateString = parts[1];
}
if (changelog != null)
{
changelog.Description = contentBuilder.ToString();
contentBuilder.Clear();
this.Add(changelog);
}
changelog = new Changelog(DateOnly.Parse(dateString), versionString, "");
continue;
}
}
contentBuilder.AppendLine(line.Trim());
}
}
}
}

@ -10,4 +10,5 @@ Godot 4.0 with Mono (.NET 7.0)
## 许可
代码采用 MIT 协议许可;素材使用 CC-BY-4.0 协议授权。
这是一个使用 Godot 引擎制作的开源游戏,项目中原创的代码采用 MIT 协议许可;原创素材使用 CC-BY-4.0 协议授权。
项目中还使用了来自其他开源项目的代码和素材。这些资产的许可文件已在项目的源码树中列出。

@ -55,6 +55,39 @@ title = "游戏设置"
visible = false
borderless = false
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -450.0
offset_top = -338.0
offset_right = -60.0
offset_bottom = 374.0
grow_horizontal = 0
grow_vertical = 2
[node name="Label" type="Label" parent="VBoxContainer"]
layout_mode = 2
theme = ExtResource("1_y72s3")
text = "更新日志"
horizontal_alignment = 1
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
[node name="ChanglogLabel" type="RichTextLabel" parent="VBoxContainer/ScrollContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
bbcode_enabled = true
text = "[b]标题[/b]
- 更新内容"
[connection signal="pressed" from="StartMenu/StartButton" to="." method="On_BattleDemo1Button_Pressed"]
[connection signal="pressed" from="StartMenu/SettingsButton" to="." method="On_SettingsPopupButton_Pressed"]
[connection signal="pressed" from="StartMenu/QuitButton" to="." method="On_QuitButton_Pressed"]

@ -8,7 +8,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="Temp/Exports/CMSGame.exe"
export_path="Temp/Exports/windows-64/CMSGame.exe"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
@ -45,7 +45,7 @@ application/company_name="CMSGame Developers"
application/product_name="CMSGame"
application/file_description="The Country of Mountains and Seas"
application/copyright="CMSGame Developers"
application/trademarks="CMSGame"
application/trademarks=""
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"

Loading…
Cancel
Save