added better credit system

This commit is contained in:
Ryzerth 2020-12-22 18:42:30 +01:00
parent 98b6e580b4
commit 4a86d6073c
5 changed files with 70 additions and 35 deletions

View File

@ -118,7 +118,7 @@ int sdrpp_main(int argc, char *argv[]) {
defConfig["windowSize"]["w"] = 1280; defConfig["windowSize"]["w"] = 1280;
// Load config // Load config
spdlog::info("Loading config {0}"); spdlog::info("Loading config");
core::configManager.setPath(options::opts.root + "/config.json"); core::configManager.setPath(options::opts.root + "/config.json");
core::configManager.load(defConfig); core::configManager.load(defConfig);
core::configManager.enableAutoSave(); core::configManager.enableAutoSave();

30
core/src/credits.cpp Normal file
View File

@ -0,0 +1,30 @@
#include <credits.h>
namespace sdrpp_credits {
const char* contributors[] = {
"Ryzerth (Author)",
"aosync",
"Alexsey Shestacov",
"Benjamin Kyd",
"Tobias Mädel",
"Raov",
"Howard0su"
};
const char* libraries[] = {
"Dear ImGui (ocornut)",
"json (nlohmann)",
"portaudio (P.A. comm.)",
"SoapySDR (PothosWare)",
"spdlog (gabime)",
};
const char* patrons[] = {
"SignalsEverywhere",
"Lee Donaghy"
};
const int contributorCount = sizeof(contributors) / sizeof(char*);
const int libraryCount = sizeof(libraries) / sizeof(char*);
const int patronCount = sizeof(patrons) / sizeof(char*);
}

11
core/src/credits.h Normal file
View File

@ -0,0 +1,11 @@
#pragma once
#include <new_module.h>
namespace sdrpp_credits {
SDRPP_EXPORT const char* contributors[];
SDRPP_EXPORT const char* libraries[];
SDRPP_EXPORT const char* patrons[];
SDRPP_EXPORT const int contributorCount;
SDRPP_EXPORT const int libraryCount;
SDRPP_EXPORT const int patronCount;
}

View File

@ -3,6 +3,8 @@
#include <gui/icons.h> #include <gui/icons.h>
#include <gui/style.h> #include <gui/style.h>
#include <config.h> #include <config.h>
#include <credits.h>
#include <version.h>
namespace credits { namespace credits {
ImFont* bigFont; ImFont* bigFont;
@ -29,30 +31,29 @@ namespace credits {
ImGui::Columns(3, "CreditColumns", true); ImGui::Columns(3, "CreditColumns", true);
// Contributors
ImGui::Text("Contributors"); ImGui::Text("Contributors");
ImGui::BulletText("Ryzerth (Creator)"); for (int i = 0; i < sdrpp_credits::contributorCount; i++) {
ImGui::BulletText("Alexsey Shestacov"); ImGui::BulletText(sdrpp_credits::contributors[i]);
ImGui::BulletText("aosync"); }
ImGui::BulletText("Benjamin Kyd");
ImGui::BulletText("Tobias Mädel");
ImGui::BulletText("Raov");
ImGui::BulletText("Howard0su");
// Libraries
ImGui::NextColumn(); ImGui::NextColumn();
ImGui::Text("Libraries"); ImGui::Text("Libraries");
ImGui::BulletText("SoapySDR (PothosWare)"); for (int i = 0; i < sdrpp_credits::libraryCount; i++) {
ImGui::BulletText("Dear ImGui (ocornut)"); ImGui::BulletText(sdrpp_credits::libraries[i]);
ImGui::BulletText("spdlog (gabime)"); }
ImGui::BulletText("json (nlohmann)");
ImGui::BulletText("portaudio (PA Comm.)");
// Patrons
ImGui::NextColumn(); ImGui::NextColumn();
ImGui::Text("Patrons"); ImGui::Text("Patrons");
ImGui::BulletText("SignalsEverywhere"); for (int i = 0; i < sdrpp_credits::patronCount; i++) {
ImGui::BulletText("Lee Donaghy"); ImGui::BulletText(sdrpp_credits::patrons[i]);
}
ImGui::Columns(1, "CreditColumnsEnd", true);
ImGui::Spacing();
ImGui::Spacing();
ImGui::Spacing();
ImGui::Text("SDR++ v" VERSION_STR);
ImGui::EndPopup(); ImGui::EndPopup();
ImGui::PopStyleVar(1); ImGui::PopStyleVar(1);

View File

@ -6,6 +6,7 @@
#include "imgui_impl_opengl3.h" #include "imgui_impl_opengl3.h"
#include <gui/icons.h> #include <gui/icons.h>
#include <gui/style.h> #include <gui/style.h>
#include <credits.h>
namespace LoadingScreen { namespace LoadingScreen {
GLFWwindow* _win; GLFWwindow* _win;
@ -41,30 +42,22 @@ namespace LoadingScreen {
ImGui::Columns(3, "CreditColumns", true); ImGui::Columns(3, "CreditColumns", true);
// Contributors
ImGui::Text("Contributors"); ImGui::Text("Contributors");
ImGui::BulletText("Ryzerth (Creator)"); for (int i = 0; i < sdrpp_credits::contributorCount; i++) {
ImGui::BulletText("Alexsey Shestacov"); ImGui::BulletText(sdrpp_credits::contributors[i]);
ImGui::BulletText("aosync"); }
ImGui::BulletText("Benjamin Kyd");
ImGui::BulletText("Tobias Mädel");
ImGui::BulletText("Raov");
ImGui::BulletText("Howard0su");
// Libraries
ImGui::NextColumn(); ImGui::NextColumn();
ImGui::Text("Libraries"); ImGui::Text("Libraries");
ImGui::BulletText("SoapySDR (PothosWare)"); for (int i = 0; i < sdrpp_credits::libraryCount; i++) {
ImGui::BulletText("Dear ImGui (ocornut)"); ImGui::BulletText(sdrpp_credits::libraries[i]);
ImGui::BulletText("spdlog (gabime)"); }
ImGui::BulletText("json (nlohmann)");
ImGui::BulletText("portaudio (PA Comm.)");
// Patrons
ImGui::NextColumn(); ImGui::NextColumn();
ImGui::Text("Patrons"); ImGui::Text("Patrons");
ImGui::BulletText("SignalsEverywhere"); for (int i = 0; i < sdrpp_credits::patronCount; i++) {
ImGui::BulletText("Lee Donaghy"); ImGui::BulletText(sdrpp_credits::patrons[i]);
}
ImGui::Columns(1, "CreditColumnsEnd", true); ImGui::Columns(1, "CreditColumnsEnd", true);