Description:
Add NewsItem struct.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
|
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
@@ -1,15 +1,14 | |||||
|
1 | { |
|
1 | { |
|
2 | "format": 1, |
|
2 | "format": 1, |
|
3 | "restore": { |
|
3 | "restore": { |
|
4 |
"/ |
|
4 | "/home/alys/repos/isometric-park-fna/SpriteFontPlus/src/SpriteFontPlus.FNA.csproj": {} |
|
5 | }, |
|
5 | }, |
|
6 | "projects": { |
|
6 | "projects": { |
|
7 |
"/ |
|
7 | "/home/alys/repos/isometric-park-fna/FNA/FNA.csproj": { |
|
8 | "version": "1.0.0", |
|
||
|
9 | "restore": { |
|
8 | "restore": { |
|
10 |
"projectUniqueName": "/ |
|
9 | "projectUniqueName": "/home/alys/repos/isometric-park-fna/FNA/FNA.csproj", |
|
11 | "projectName": "FNA", |
|
10 | "projectName": "FNA", |
|
12 |
"projectPath": "/ |
|
11 | "projectPath": "/home/alys/repos/isometric-park-fna/FNA/FNA.csproj", |
|
13 | "frameworks": { |
|
12 | "frameworks": { |
|
14 | "net48": { |
|
13 | "net48": { |
|
15 | "projectReferences": {} |
|
14 | "projectReferences": {} |
@@ -20,17 +19,20 | |||||
|
20 | "net48": {} |
|
19 | "net48": {} |
|
21 | } |
|
20 | } |
|
22 | }, |
|
21 | }, |
|
23 |
"/ |
|
22 | "/home/alys/repos/isometric-park-fna/SpriteFontPlus/src/SpriteFontPlus.FNA.csproj": { |
|
24 | "version": "1.0.0", |
|
23 | "version": "1.0.0", |
|
25 | "restore": { |
|
24 | "restore": { |
|
26 |
"projectUniqueName": "/ |
|
25 | "projectUniqueName": "/home/alys/repos/isometric-park-fna/SpriteFontPlus/src/SpriteFontPlus.FNA.csproj", |
|
27 | "projectName": "SpriteFontPlus", |
|
26 | "projectName": "SpriteFontPlus", |
|
28 |
"projectPath": "/ |
|
27 | "projectPath": "/home/alys/repos/isometric-park-fna/SpriteFontPlus/src/SpriteFontPlus.FNA.csproj", |
|
29 |
"packagesPath": "/ |
|
28 | "packagesPath": "/home/alys/.nuget/packages/", |
|
30 |
"outputPath": "/ |
|
29 | "outputPath": "/home/alys/repos/isometric-park-fna/SpriteFontPlus/src/obj/", |
|
31 | "projectStyle": "PackageReference", |
|
30 | "projectStyle": "PackageReference", |
|
|
31 | "fallbackFolders": [ | ||
|
|
32 | "/usr/share/dotnet/sdk/NuGetFallbackFolder" | ||
|
|
33 | ], | ||
|
32 | "configFilePaths": [ |
|
34 | "configFilePaths": [ |
|
33 |
"/ |
|
35 | "/home/alys/.config/NuGet/NuGet.Config" |
|
34 | ], |
|
36 | ], |
|
35 | "originalTargetFrameworks": [ |
|
37 | "originalTargetFrameworks": [ |
|
36 | "net45" |
|
38 | "net45" |
@@ -41,8 +43,8 | |||||
|
41 | "frameworks": { |
|
43 | "frameworks": { |
|
42 | "net45": { |
|
44 | "net45": { |
|
43 | "projectReferences": { |
|
45 | "projectReferences": { |
|
44 |
"/ |
|
46 | "/home/alys/repos/isometric-park-fna/FNA/FNA.csproj": { |
|
45 |
"projectPath": "/ |
|
47 | "projectPath": "/home/alys/repos/isometric-park-fna/FNA/FNA.csproj" |
|
46 | } |
|
48 | } |
|
47 | } |
|
49 | } |
|
48 | } |
|
50 | } |
@@ -4,10 +4,10 | |||||
|
4 | <RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess> |
|
4 | <RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess> |
|
5 | <RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool> |
|
5 | <RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool> |
|
6 | <ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile> |
|
6 | <ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile> |
|
7 |
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/ |
|
7 | <NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/home/alys/.nuget/packages/</NuGetPackageRoot> |
|
8 |
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/ |
|
8 | <NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/home/alys/.nuget/packages/;/usr/share/dotnet/sdk/NuGetFallbackFolder</NuGetPackageFolders> |
|
9 | <NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle> |
|
9 | <NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle> |
|
10 |
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5. |
|
10 | <NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">5.6.0</NuGetToolVersion> |
|
11 | </PropertyGroup> |
|
11 | </PropertyGroup> |
|
12 | <PropertyGroup> |
|
12 | <PropertyGroup> |
|
13 | <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> |
|
13 | <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> |
@@ -26,19 +26,23 | |||||
|
26 | ] |
|
26 | ] |
|
27 | }, |
|
27 | }, |
|
28 | "packageFolders": { |
|
28 | "packageFolders": { |
|
29 |
"/ |
|
29 | "/home/alys/.nuget/packages/": {}, |
|
|
30 | "/usr/share/dotnet/sdk/NuGetFallbackFolder": {} | ||
|
30 | }, |
|
31 | }, |
|
31 | "project": { |
|
32 | "project": { |
|
32 | "version": "1.0.0", |
|
33 | "version": "1.0.0", |
|
33 | "restore": { |
|
34 | "restore": { |
|
34 |
"projectUniqueName": "/ |
|
35 | "projectUniqueName": "/home/alys/repos/isometric-park-fna/SpriteFontPlus/src/SpriteFontPlus.FNA.csproj", |
|
35 | "projectName": "SpriteFontPlus", |
|
36 | "projectName": "SpriteFontPlus", |
|
36 |
"projectPath": "/ |
|
37 | "projectPath": "/home/alys/repos/isometric-park-fna/SpriteFontPlus/src/SpriteFontPlus.FNA.csproj", |
|
37 |
"packagesPath": "/ |
|
38 | "packagesPath": "/home/alys/.nuget/packages/", |
|
38 |
"outputPath": "/ |
|
39 | "outputPath": "/home/alys/repos/isometric-park-fna/SpriteFontPlus/src/obj/", |
|
39 | "projectStyle": "PackageReference", |
|
40 | "projectStyle": "PackageReference", |
|
|
41 | "fallbackFolders": [ | ||
|
|
42 | "/usr/share/dotnet/sdk/NuGetFallbackFolder" | ||
|
|
43 | ], | ||
|
40 | "configFilePaths": [ |
|
44 | "configFilePaths": [ |
|
41 |
"/ |
|
45 | "/home/alys/.config/NuGet/NuGet.Config" |
|
42 | ], |
|
46 | ], |
|
43 | "originalTargetFrameworks": [ |
|
47 | "originalTargetFrameworks": [ |
|
44 | "net45" |
|
48 | "net45" |
@@ -49,8 +53,8 | |||||
|
49 | "frameworks": { |
|
53 | "frameworks": { |
|
50 | "net45": { |
|
54 | "net45": { |
|
51 | "projectReferences": { |
|
55 | "projectReferences": { |
|
52 |
"/ |
|
56 | "/home/alys/repos/isometric-park-fna/FNA/FNA.csproj": { |
|
53 |
"projectPath": "/ |
|
57 | "projectPath": "/home/alys/repos/isometric-park-fna/FNA/FNA.csproj" |
|
54 | } |
|
58 | } |
|
55 | } |
|
59 | } |
|
56 | } |
|
60 | } |
@@ -1,13 +1,8 | |||||
|
1 | { |
|
1 | { |
|
2 | "version": 2, |
|
2 | "version": 2, |
|
3 | "dgSpecHash": "Jvo88cLyNvFTWWYROD/x2aycV9834tUcxzVkPfCY2PJ4jsQJZaa+i/VrEjCdsSictNeWCYKaMokGY5EFY72cqg==", |
|
3 | "dgSpecHash": "3AWDv+MZriwMxBTBDorp8FiSvyrXQqppePDYsTfATqNGlipF/pJObt6DcBo8NzTLP21oSN3cyqBrcDukFLx64w==", |
|
4 | "success": true, |
|
4 | "success": true, |
|
5 |
"projectFilePath": "/ |
|
5 | "projectFilePath": "/home/alys/repos/isometric-park-fna/SpriteFontPlus/src/SpriteFontPlus.FNA.csproj", |
|
6 | "expectedPackageFiles": [ |
|
6 | "expectedPackageFiles": [], |
|
7 | "/Users/alys/.nuget/packages/microsoft.netcore.platforms/1.1.0/microsoft.netcore.platforms.1.1.0.nupkg.sha512", |
|
||
|
8 | "/Users/alys/.nuget/packages/microsoft.netframework.referenceassemblies/1.0.0/microsoft.netframework.referenceassemblies.1.0.0.nupkg.sha512", |
|
||
|
9 | "/Users/alys/.nuget/packages/microsoft.netframework.referenceassemblies.net45/1.0.0/microsoft.netframework.referenceassemblies.net45.1.0.0.nupkg.sha512", |
|
||
|
10 | "/Users/alys/.nuget/packages/netstandard.library/2.0.3/netstandard.library.2.0.3.nupkg.sha512" |
|
||
|
11 | ], |
|
||
|
12 | "logs": [] |
|
7 | "logs": [] |
|
13 | } No newline at end of file |
|
8 | } |
@@ -881,7 +881,9 | |||||
|
881 |
|
881 | ||
|
882 | if (this.showNews) |
|
882 | if (this.showNews) |
|
883 | { |
|
883 | { |
|
884 |
NewsWindow.Render(ref this.showNews, debugWindow.monoFont, this.simulation |
|
884 | NewsWindow.Render(ref this.showNews, debugWindow.monoFont, this.simulation, |
|
|
885 | new[] {new NewsItem{hed="test", contents="MILWAUKEE - This is where the lede would go."}, | ||
|
|
886 | new NewsItem{hed="Politicians Debate Stimulus Package", contents="WASHINGTON - Politicians debate the latest stimulus package, which opponents argue might help some people who don't deserve it. So it's impossible to say whether it's good or bad."}}); | ||
|
885 | } |
|
887 | } |
|
886 |
|
888 | ||
|
887 | bool quit = false; |
|
889 | bool quit = false; |
@@ -11,13 +11,13 | |||||
|
11 | private static bool activeButton(string label, bool active, Num.Vector4 activeColor) { |
|
11 | private static bool activeButton(string label, bool active, Num.Vector4 activeColor) { |
|
12 |
|
12 | ||
|
13 | if (active) { |
|
13 | if (active) { |
|
14 |
|
|
14 | ImGui.PushStyleColor(ImGuiCol.Button, activeColor); |
|
15 | } |
|
15 | } |
|
16 |
|
16 | ||
|
17 | var result = ImGui.Button(label); |
|
17 | var result = ImGui.Button(label); |
|
18 |
|
18 | ||
|
19 | if (active) { |
|
19 | if (active) { |
|
20 |
|
|
20 | ImGui.PopStyleColor(); |
|
21 | } |
|
21 | } |
|
22 |
|
22 | ||
|
23 | return result; |
|
23 | return result; |
@@ -52,7 +52,7 | |||||
|
52 |
|
52 | ||
|
53 | ImGui.Text(header); |
|
53 | ImGui.Text(header); |
|
54 |
|
54 | ||
|
55 |
ImGui.SetCursorPosX(width - |
|
55 | ImGui.SetCursorPosX(width - 425); |
|
56 |
|
56 | ||
|
57 | if (Menu.activeButton("$ Budget", show_budget, new Num.Vector4(0.060f, 0.590f, 0.980f, 1f))) |
|
57 | if (Menu.activeButton("$ Budget", show_budget, new Num.Vector4(0.060f, 0.590f, 0.980f, 1f))) |
|
58 | { |
|
58 | { |
@@ -61,12 +61,12 | |||||
|
61 | } |
|
61 | } |
|
62 | if (Menu.activeButton("\ue124 Forest", show_forest, new Num.Vector4(0.060f, 0.590f, 0.980f, 1f))) |
|
62 | if (Menu.activeButton("\ue124 Forest", show_forest, new Num.Vector4(0.060f, 0.590f, 0.980f, 1f))) |
|
63 | { |
|
63 | { |
|
64 |
show_ |
|
64 | show_forest = !show_forest; |
|
65 |
|
65 | ||
|
66 | } |
|
66 | } |
|
67 |
if (Menu.activeButton("! News", show_ |
|
67 | if (Menu.activeButton("! News", show_news, new Num.Vector4(0.060f, 0.590f, 0.980f, 1f))) |
|
68 | { |
|
68 | { |
|
69 |
show_ |
|
69 | show_news = !show_news; |
|
70 |
|
70 | ||
|
71 | } |
|
71 | } |
|
72 |
|
72 |
@@ -6,9 +6,14 | |||||
|
6 | namespace isometricparkfna.UI |
|
6 | namespace isometricparkfna.UI |
|
7 | { |
|
7 | { |
|
8 |
|
8 | ||
|
9 | public static class NewsWindow |
|
9 | public struct NewsItem { |
|
|
10 | public string hed; | ||
|
|
11 | public string contents; | ||
|
|
12 | } | ||
|
|
13 | |||
|
|
14 | public static class NewsWindow | ||
|
10 | { |
|
15 | { |
|
11 | public static void Render(ref bool show, ImFontPtr font, Simulation sim) |
|
16 | public static void Render(ref bool show, ImFontPtr font, Simulation sim, NewsItem[] content) |
|
12 | { |
|
17 | { |
|
13 | if (show) |
|
18 | if (show) |
|
14 | { |
|
19 | { |
@@ -35,10 +40,13 | |||||
|
35 | ImGui.PushStyleColor(ImGuiCol.Text, new Num.Vector4(0f, 0f, 0f, 1f)); |
|
40 | ImGui.PushStyleColor(ImGuiCol.Text, new Num.Vector4(0f, 0f, 0f, 1f)); |
|
36 | ImGui.Begin("NEWS", ref show, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoSavedSettings); |
|
41 | ImGui.Begin("NEWS", ref show, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoSavedSettings); |
|
37 |
|
42 | ||
|
38 |
if (ImGui.BeginTabBar(" |
|
43 | if (ImGui.BeginTabBar("Sources", 0)) { |
|
39 | if (ImGui.BeginTabItem("Wire")) { |
|
44 | if (ImGui.BeginTabItem("Wire")) { |
|
40 | if (ImGui.CollapsingHeader("Headline")) { |
|
45 | |
|
41 |
|
|
46 | foreach (NewsItem story in content) { |
|
|
47 | if (ImGui.CollapsingHeader(story.hed, ImGuiTreeNodeFlags.DefaultOpen)) { | ||
|
|
48 | ImGui.TextWrapped(story.contents); | ||
|
|
49 | } | ||
|
42 | } |
|
50 | } |
|
43 | } |
|
51 | } |
|
44 | } |
|
52 | } |
You need to be logged in to leave comments.
Login now