Skip to content

Commit 4a86d60

Browse files
author
Ryzerth
committed
added better credit system
1 parent 98b6e58 commit 4a86d60

File tree

5 files changed

+72
-37
lines changed

5 files changed

+72
-37
lines changed

core/src/core.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ int sdrpp_main(int argc, char *argv[]) {
118118
defConfig["windowSize"]["w"] = 1280;
119119

120120
// Load config
121-
spdlog::info("Loading config {0}");
121+
spdlog::info("Loading config");
122122
core::configManager.setPath(options::opts.root + "/config.json");
123123
core::configManager.load(defConfig);
124124
core::configManager.enableAutoSave();

core/src/credits.cpp

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#include <credits.h>
2+
3+
namespace sdrpp_credits {
4+
const char* contributors[] = {
5+
"Ryzerth (Author)",
6+
"aosync",
7+
"Alexsey Shestacov",
8+
"Benjamin Kyd",
9+
"Tobias Mädel",
10+
"Raov",
11+
"Howard0su"
12+
};
13+
14+
const char* libraries[] = {
15+
"Dear ImGui (ocornut)",
16+
"json (nlohmann)",
17+
"portaudio (P.A. comm.)",
18+
"SoapySDR (PothosWare)",
19+
"spdlog (gabime)",
20+
};
21+
22+
const char* patrons[] = {
23+
"SignalsEverywhere",
24+
"Lee Donaghy"
25+
};
26+
27+
const int contributorCount = sizeof(contributors) / sizeof(char*);
28+
const int libraryCount = sizeof(libraries) / sizeof(char*);
29+
const int patronCount = sizeof(patrons) / sizeof(char*);
30+
}

core/src/credits.h

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#pragma once
2+
#include <new_module.h>
3+
4+
namespace sdrpp_credits {
5+
SDRPP_EXPORT const char* contributors[];
6+
SDRPP_EXPORT const char* libraries[];
7+
SDRPP_EXPORT const char* patrons[];
8+
SDRPP_EXPORT const int contributorCount;
9+
SDRPP_EXPORT const int libraryCount;
10+
SDRPP_EXPORT const int patronCount;
11+
}

core/src/gui/dialogs/credits.cpp

+19-18
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include <gui/icons.h>
44
#include <gui/style.h>
55
#include <config.h>
6+
#include <credits.h>
7+
#include <version.h>
68

79
namespace credits {
810
ImFont* bigFont;
@@ -29,30 +31,29 @@ namespace credits {
2931

3032
ImGui::Columns(3, "CreditColumns", true);
3133

32-
// Contributors
3334
ImGui::Text("Contributors");
34-
ImGui::BulletText("Ryzerth (Creator)");
35-
ImGui::BulletText("Alexsey Shestacov");
36-
ImGui::BulletText("aosync");
37-
ImGui::BulletText("Benjamin Kyd");
38-
ImGui::BulletText("Tobias Mädel");
39-
ImGui::BulletText("Raov");
40-
ImGui::BulletText("Howard0su");
41-
42-
// Libraries
35+
for (int i = 0; i < sdrpp_credits::contributorCount; i++) {
36+
ImGui::BulletText(sdrpp_credits::contributors[i]);
37+
}
38+
4339
ImGui::NextColumn();
4440
ImGui::Text("Libraries");
45-
ImGui::BulletText("SoapySDR (PothosWare)");
46-
ImGui::BulletText("Dear ImGui (ocornut)");
47-
ImGui::BulletText("spdlog (gabime)");
48-
ImGui::BulletText("json (nlohmann)");
49-
ImGui::BulletText("portaudio (PA Comm.)");
41+
for (int i = 0; i < sdrpp_credits::libraryCount; i++) {
42+
ImGui::BulletText(sdrpp_credits::libraries[i]);
43+
}
5044

51-
// Patrons
5245
ImGui::NextColumn();
5346
ImGui::Text("Patrons");
54-
ImGui::BulletText("SignalsEverywhere");
55-
ImGui::BulletText("Lee Donaghy");
47+
for (int i = 0; i < sdrpp_credits::patronCount; i++) {
48+
ImGui::BulletText(sdrpp_credits::patrons[i]);
49+
}
50+
51+
ImGui::Columns(1, "CreditColumnsEnd", true);
52+
53+
ImGui::Spacing();
54+
ImGui::Spacing();
55+
ImGui::Spacing();
56+
ImGui::Text("SDR++ v" VERSION_STR);
5657

5758
ImGui::EndPopup();
5859
ImGui::PopStyleVar(1);

core/src/gui/dialogs/loading_screen.cpp

+11-18
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "imgui_impl_opengl3.h"
77
#include <gui/icons.h>
88
#include <gui/style.h>
9+
#include <credits.h>
910

1011
namespace LoadingScreen {
1112
GLFWwindow* _win;
@@ -41,30 +42,22 @@ namespace LoadingScreen {
4142

4243
ImGui::Columns(3, "CreditColumns", true);
4344

44-
// Contributors
4545
ImGui::Text("Contributors");
46-
ImGui::BulletText("Ryzerth (Creator)");
47-
ImGui::BulletText("Alexsey Shestacov");
48-
ImGui::BulletText("aosync");
49-
ImGui::BulletText("Benjamin Kyd");
50-
ImGui::BulletText("Tobias Mädel");
51-
ImGui::BulletText("Raov");
52-
ImGui::BulletText("Howard0su");
53-
54-
// Libraries
46+
for (int i = 0; i < sdrpp_credits::contributorCount; i++) {
47+
ImGui::BulletText(sdrpp_credits::contributors[i]);
48+
}
49+
5550
ImGui::NextColumn();
5651
ImGui::Text("Libraries");
57-
ImGui::BulletText("SoapySDR (PothosWare)");
58-
ImGui::BulletText("Dear ImGui (ocornut)");
59-
ImGui::BulletText("spdlog (gabime)");
60-
ImGui::BulletText("json (nlohmann)");
61-
ImGui::BulletText("portaudio (PA Comm.)");
52+
for (int i = 0; i < sdrpp_credits::libraryCount; i++) {
53+
ImGui::BulletText(sdrpp_credits::libraries[i]);
54+
}
6255

63-
// Patrons
6456
ImGui::NextColumn();
6557
ImGui::Text("Patrons");
66-
ImGui::BulletText("SignalsEverywhere");
67-
ImGui::BulletText("Lee Donaghy");
58+
for (int i = 0; i < sdrpp_credits::patronCount; i++) {
59+
ImGui::BulletText(sdrpp_credits::patrons[i]);
60+
}
6861

6962
ImGui::Columns(1, "CreditColumnsEnd", true);
7063

0 commit comments

Comments
 (0)