www
www
This commit is contained in:
1 parent
3933cd1901
commit
0aa65c433d
98 files changed
+56670
No files matched your search
@@ -0,0 +1,56 @@
|
||||
#include "PlayerProfile.h"
|
||||
|
||||
#include "helpers.h"
|
||||
|
||||
namespace {
|
||||
constexpr const char* kUidPath = "/UINode/UIRoot/UIDPanelPanel/Main/TextNode/Text";
|
||||
constexpr const char* kManagerNamePath =
|
||||
"/UINode/WorldUIRoot/WatchPanel/Content/WatchNode/canvas_watch/"
|
||||
"LeftBottomNode/PlayInfoPosNode/PlayInfoLifengCell(Clone)/PlayerInfo/ManagerName";
|
||||
}
|
||||
|
||||
PlayerProfileModule::PlayerProfileModule()
|
||||
: BaseModule("PlayerProfile", "PlayerProfile", ModuleCategory::Visual) {}
|
||||
|
||||
void PlayerProfileModule::RegisterTab() {
|
||||
uid_text_.clear();
|
||||
name_text_.clear();
|
||||
uid_input_.fill('\0');
|
||||
name_input_.fill('\0');
|
||||
}
|
||||
|
||||
void PlayerProfileModule::Render() {
|
||||
if (!ImGui::CollapsingHeader(Tr("PlayerProfile"), ImGuiTreeNodeFlags_DefaultOpen)) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool enabled = Enabled();
|
||||
if (ImGui::Checkbox(Tr("ON / OFF"), &enabled)) {
|
||||
SetEnabled(enabled);
|
||||
}
|
||||
|
||||
if (ImGui::InputText(Tr("UID text"), uid_input_.data(), uid_input_.size())) {
|
||||
uid_text_ = Utf8ToWide(uid_input_.data());
|
||||
}
|
||||
if (ImGui::InputText(Tr("Name text"), name_input_.data(), name_input_.size())) {
|
||||
name_text_ = Utf8ToWide(name_input_.data());
|
||||
}
|
||||
ImGui::Checkbox(Tr("Name changer"), &name_changer_enabled_);
|
||||
}
|
||||
|
||||
void PlayerProfileModule::Update() {
|
||||
if (!Enabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
using FnSetText = void (*)(void*, int, void*);
|
||||
auto set_tmp_text = GetIl2cppFn<FnSetText>(IL2CPP::TMPro_set_text);
|
||||
auto set_ui_text = GetIl2cppFn<FnSetText>(IL2CPP::UnityUI_Text_set_text);
|
||||
if (!set_tmp_text || !set_ui_text) {
|
||||
return;
|
||||
}
|
||||
|
||||
(void)kUidPath;
|
||||
(void)kManagerNamePath;
|
||||
(void)name_changer_enabled_;
|
||||
}
|
||||
Reference in new issue
Block a user