added discord server information (#2471)

This commit is contained in:
gullradriel 2025-01-07 14:56:08 +01:00 committed by GitHub
parent 0124051c4f
commit dfa35b4290
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 20 deletions

View File

@ -7,30 +7,33 @@
namespace ui { namespace ui {
// Information: a line starting with a '#' will be yellow coloured // Information: a line starting with a '#' will be yellow coloured
constexpr std::string_view authors_list[] = { constexpr std::string_view mayhem_information_list[] = {
"# * List of contributors * ", "#****** Mayhem Community ******",
" ",
" https://discord.mayhem.app",
" ",
"#**** List of contributors ****",
" ", " ",
"#Mayhem-Firmware:", "#Mayhem-Firmware:",
"jboone,eried,furrtek,", "jboone,eried,furrtek,",
"NotherNgineer,gullradriel,", "NotherNgineer,gullradriel,",
"jLynx,kallanreed,Brumi-2021,", "jLynx,kallanreed,Brumi-2021,",
"htotoo,bernd-herzog,zxkmm,", "htotoo,zxkmm,bernd-herzog,",
"ArjanOnwezen,euquiq,u-foka,", "ArjanOnwezen,euquiq,u-foka,",
"iNetro,heurist1,dqs105,", "iNetro,heurist1,dqs105,",
"teixeluis,jwetzell,", "teixeluis,jwetzell,",
"jimilinuxguy,gregoryfenton,", "jimilinuxguy,gregoryfenton,",
"notpike,strijar,BehleZebub,", "notpike,strijar,BehleZebub,",
"arneluehrs,rascafr,joyel24,", "arneluehrs,mcules,rascafr,",
"ImDroided,zigad,johnelder,", "joyel24,ImDroided,zigad,",
"klockee,nnesetto,LupusE,", "johnelder,klockee,nnesetto,",
"argilo,dc2dc,formtapez,", "LupusE,argilo,dc2dc,formtapez,",
"RocketGod-git,mrmookie,", "RocketGod-git,mrmookie,",
"ITAxReal,F33RNI,F4GEV,", "ITAxReal,F33RNI,F4GEV,",
"rusty-labs,mjwaxios,andrej-mk,", "rusty-labs,mjwaxios,andrej-mk,",
"RedFox-Fr,nemanjan00,", "RedFox-Fr,nemanjan00,",
"MichalLeonBorsuk,", "MichalLeonBorsuk,",
"MatiasFernandez,Giorgiofox,", "MatiasFernandez,Giorgiofox",
"ckuethe",
" ", " ",
"#Havoc:", "#Havoc:",
"jboone,furrtek,eried,argilo,", "jboone,furrtek,eried,argilo,",
@ -72,7 +75,7 @@ AboutView::AboutView(NavigationView& nav) {
button_ok.focus(); button_ok.focus();
}; };
for (auto& authors_line : authors_list) { for (auto& authors_line : mayhem_information_list) {
// if it's starting with #, it's a title and we have to substract the '#' and paint yellow // if it's starting with #, it's a title and we have to substract the '#' and paint yellow
if (authors_line.size() > 0) { if (authors_line.size() > 0) {
if (authors_line[0] == '#') { if (authors_line[0] == '#') {
@ -103,15 +106,13 @@ void AboutView::on_frame_sync() {
menu_view.set_highlighted(current + 1); menu_view.set_highlighted(current + 1);
} else { } else {
menu_view.set_highlighted(0); menu_view.set_highlighted(0);
// ^ to go back to the REAL top instead of make the 2 at the top to make the title disappeares
menu_view.set_highlighted(2); // the first line that has human name
} }
} }
} }
void AboutView::focus() { void AboutView::focus() {
button_ok.focus(); button_ok.focus();
menu_view.set_highlighted(2); // the first line that has human name menu_view.set_highlighted(3); // contributors block starting line
} }
bool AboutView::on_touch(const TouchEvent) { bool AboutView::on_touch(const TouchEvent) {

View File

@ -53,7 +53,7 @@ AboutView::AboutView(NavigationView& nav) {
button_ok.focus(); button_ok.focus();
}; };
for (auto& authors_line : authors_list) { for (auto& authors_line : mayhem_information_list) {
// if it's starting with #, it's a title and we have to substract the '#' and paint yellow // if it's starting with #, it's a title and we have to substract the '#' and paint yellow
if (authors_line.size() > 0) { if (authors_line.size() > 0) {
if (authors_line[0] == '#') { if (authors_line[0] == '#') {
@ -84,15 +84,13 @@ void AboutView::on_frame_sync() {
menu_view.set_highlighted(current + 1); menu_view.set_highlighted(current + 1);
} else { } else {
menu_view.set_highlighted(0); menu_view.set_highlighted(0);
// ^ to go back to the REAL top instead of make the 2 at the top to make the title disappeares
menu_view.set_highlighted(2); // the first line that has human name
} }
} }
} }
void AboutView::focus() { void AboutView::focus() {
button_ok.focus(); button_ok.focus();
menu_view.set_highlighted(2); // the first line that has human name menu_view.set_highlighted(3); // contributors block starting line
} }
bool AboutView::on_touch(const TouchEvent) { bool AboutView::on_touch(const TouchEvent) {
@ -141,8 +139,12 @@ def get_contributors(url):
def generate_content(projects): def generate_content(projects):
project_contrib = [] project_contrib = []
project_contrib.append("string_view authors_list[] = {\n") project_contrib.append("string_view mayhem_information_list[] = {\n")
project_contrib.append(" \"# * List of contributors * \",\n") project_contrib.append(" \"#****** Mayhem Community ******\",\n")
project_contrib.append(" \" \",\n")
project_contrib.append(" \" https://discord.mayhem.app\",\n")
project_contrib.append(" \" \",\n")
project_contrib.append(" \"#**** List of contributors ****\",\n")
for project in projects: for project in projects:
project_contrib.append(" \" \",\n") project_contrib.append(" \" \",\n")
project_contrib.append(f" \"#{project[0]}:\",\n") project_contrib.append(f" \"#{project[0]}:\",\n")
@ -170,7 +172,7 @@ def pp_create_ui_about_simple_cpp(cpp_file, cppheader, cppcontent, cppfooter):
def pp_change_ui_about_simple_cpp(cpp_file, cppcontent): def pp_change_ui_about_simple_cpp(cpp_file, cppcontent):
content = [] content = []
content_pattern = re.compile(r"string_view authors_list\[\] = {\n(?:\s+(?:.*,\n)+\s+.*};\n)", re.MULTILINE) content_pattern = re.compile(r"string_view mayhem_information_list\[\] = {\n(?:\s+(?:.*,\n)+\s+.*};\n)", re.MULTILINE)
# Read original file # Read original file
with open(cpp_file, 'r') as file: with open(cpp_file, 'r') as file: