-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from Lefraudeur/dev
added backtrack
- Loading branch information
Showing
4 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include "Modules.h" | ||
#include "../Cache/Cache.h" | ||
|
||
void Ripterms::Modules::BackTrack::renderGUI() | ||
{ | ||
static bool display_options = false; | ||
ImGui::PushStyleVar(ImGuiStyleVar_ItemInnerSpacing, ImVec2(20.0f, 0.0f)); | ||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(250.0f, ImGui::GetStyle().FramePadding.y)); | ||
ImGui::Checkbox("BackTrack", &enabled); | ||
ImGui::PopStyleVar(); | ||
ImGui::PopStyleVar(); | ||
if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) | ||
display_options = !display_options; | ||
ImGui::SameLine(); | ||
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - 30.0f); | ||
if (ImGui::ArrowButton("BackTrackopt", ImGuiDir_Down)) | ||
display_options = !display_options; | ||
if (display_options) | ||
{ | ||
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 10.0f); | ||
ImGui::BeginGroup(); | ||
ImGui::SliderFloat("PartialTicks in advance", &partialTicks, 0.01f, 2.0f, "%.2f"); | ||
ImGui::EndGroup(); | ||
} | ||
} | ||
|
||
void Ripterms::Modules::BackTrack::run() | ||
{ | ||
if (!enabled) return; | ||
static Ripterms::CTimer timer = std::chrono::milliseconds(10); | ||
if (!timer.isElapsed()) | ||
return; | ||
|
||
for (EntityPlayer& player : Ripterms::cache->playerEntities.toVector<EntityPlayer>()) | ||
{ | ||
if (player.isEqualTo(Ripterms::cache->thePlayer)) continue; | ||
Ripterms::Maths::Vector3d vector = player.getMovementVector(partialTicks); | ||
AxisAlignedBB bb = player.getBoundingBox(); | ||
Ripterms::Maths::Vector3d minbb(bb.getMinX(), bb.getMinY(), bb.getMinZ()); | ||
Ripterms::Maths::Vector3d maxbb(bb.getMaxX(), bb.getMaxY(), bb.getMaxZ()); | ||
minbb = minbb - vector; | ||
maxbb = maxbb - vector; | ||
bb.setMinX(minbb.x); bb.setMinY(minbb.y); bb.setMinZ(minbb.z); | ||
bb.setMaxX(maxbb.x); bb.setMaxY(maxbb.y); bb.setMaxZ(maxbb.z); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters