feat: Added Achievements (#1230)

This PR adds Achievements to ImHex that serve as both a guide and a fun
way to learn more about ImHex and reverse engineering
This commit is contained in:
Nik
2023-08-06 21:33:15 +02:00
committed by GitHub
parent 64a0c3f6e2
commit e77f138514
61 changed files with 1427 additions and 22 deletions

View File

@@ -1,4 +1,5 @@
#include <hex/api/content_registry.hpp>
#include <hex/api/achievement_manager.hpp>
#include <hex/providers/provider.hpp>
#include <hex/providers/buffered_reader.hpp>
@@ -48,6 +49,8 @@ namespace hex::plugin::builtin {
});
ContentRegistry::DataFormatter::add("hex.builtin.view.hex_editor.copy.cpp", [](prv::Provider *provider, u64 offset, size_t size) {
AchievementManager::unlockAchievement("hex.builtin.achievement.hex_editor", "hex.builtin.achievement.hex_editor.copy_as.name");
return formatLanguageArray(provider, offset, size, hex::format("constexpr std::array<uint8_t, {0}> data = {{", size), "0x{0:02X}, ", "};");
});