diff --git a/api/news/BAU-v1.3.0-H1.yaml b/api/news/BAU-v1.3.0-H1.yaml index c6b8f5e..68163d0 100644 --- a/api/news/BAU-v1.3.0-H1.yaml +++ b/api/news/BAU-v1.3.0-H1.yaml @@ -1,6 +1,5 @@ ^show: true ^type: 1 -^id: 110003 ^title: Hotfix Patch Notes ^subtitle: Just a quick hotfix! ^listtitle: BAU v1.3.0 H1 diff --git a/api/news/BAU-v1.3.0-H2.yaml b/api/news/BAU-v1.3.0-H2.yaml index 9893c63..9416ebf 100644 --- a/api/news/BAU-v1.3.0-H2.yaml +++ b/api/news/BAU-v1.3.0-H2.yaml @@ -1,6 +1,5 @@ ^show: true ^type: 1 -^id: 110004 ^title: Hotfix Patch Notes ^subtitle: Just a quick hotfix! ^listtitle: BAU v1.3.0 H2 diff --git a/api/news/BAU-v1.3.0-H3.yaml b/api/news/BAU-v1.3.0-H3.yaml index 9a466a6..ea371bc 100644 --- a/api/news/BAU-v1.3.0-H3.yaml +++ b/api/news/BAU-v1.3.0-H3.yaml @@ -1,6 +1,5 @@ ^show: true ^type: 1 -^id: 110005 ^title: Hotfix Patch Notes ^subtitle: Just a quick hotfix! ^listtitle: BAU v1.3.0 H3 diff --git a/api/news/BAU-v1.3.0.yaml b/api/news/BAU-v1.3.0.yaml index 58703d5..b1cac77 100644 --- a/api/news/BAU-v1.3.0.yaml +++ b/api/news/BAU-v1.3.0.yaml @@ -1,6 +1,5 @@ ^show: true ^type: 1 -^id: 110002 ^title: Long time no see :) ^subtitle: We are back! ^listtitle: BAU v1.3.0 diff --git a/api/news/Template.yaml b/api/news/Template.yaml index 4227f6a..67ff0dc 100644 --- a/api/news/Template.yaml +++ b/api/news/Template.yaml @@ -1,6 +1,5 @@ ^show: false ^type: 1 -^id: 110001 ^title: Main Header ^subtitle: Main Header SubText ^listtitle: List Name diff --git a/src/Modules/ModNews.cs b/src/Modules/ModNews.cs index 4fb7dbc..78a4638 100644 --- a/src/Modules/ModNews.cs +++ b/src/Modules/ModNews.cs @@ -17,8 +17,8 @@ internal sealed class ModNews public Dictionary Contents { get; set; } = []; internal string Date { get; } - internal static List NewsDataToProcess { get; } = new(); - internal static List AllModNews { get; } = new(); + internal static List NewsDataToProcess { get; } = []; + internal static List AllModNews { get; } = []; internal ModNews(NewsTypes type, int number, string title, string subTitle, string shortTitle, Dictionary contents, string date) { @@ -59,21 +59,22 @@ internal sealed class ModNews return announcement; } + private static int _nextAnnouncementNumber; internal static void ProcessModNewsFiles() { AllModNews.Clear(); + _nextAnnouncementNumber = 110000; foreach (var config in NewsDataToProcess) { - ParseModNewsContent(config); + ParseModNewsContent(config, _nextAnnouncementNumber); + _nextAnnouncementNumber++; } } - private static void ParseModNewsContent(NewsData config) + private static void ParseModNewsContent(NewsData config, int nextAnnouncementNumber) { - if (config.Id == 0) return; - var type = (NewsTypes)config.Type; - _ = new ModNews(type, (int)config.Id, config.Title, config.SubTitle, config.ListTitle, config.Contents, config.Date); + _ = new ModNews(type, nextAnnouncementNumber, config.Title, config.SubTitle, config.ListTitle, config.Contents, config.Date); } } \ No newline at end of file diff --git a/src/Network/Configs/NewsData.cs b/src/Network/Configs/NewsData.cs index 6b54ff1..71bb129 100644 --- a/src/Network/Configs/NewsData.cs +++ b/src/Network/Configs/NewsData.cs @@ -19,11 +19,6 @@ internal sealed class NewsData() /// public int Type { get; set; } - /// - /// Unique identifier for the news item. - /// - public uint Id { get; set; } - /// /// The main title of the news item. /// @@ -61,8 +56,6 @@ internal sealed class NewsData() newsData.Show = bool.Parse(show); if (data.TryGetValue("type", out var type)) newsData.Type = int.Parse(type); - if (data.TryGetValue("id", out var id)) - newsData.Id = uint.Parse(id); if (data.TryGetValue("title", out var title)) newsData.Title = title; if (data.TryGetValue("subtitle", out var subtitle)) diff --git a/src/Resources/NewsTest b/src/Resources/NewsTest index 21d8d3e..9303436 100644 --- a/src/Resources/NewsTest +++ b/src/Resources/NewsTest @@ -1,6 +1,5 @@ ^show: false ^type: 1 -^id: 110000 ^title: Header ^subtitle: Text Under Header ^listtitle: List Name