Skip to content

Commit

Permalink
Switch to FontAwesome 6.6.0 for icons, Fix Fake latency timeouts
Browse files Browse the repository at this point in the history
Added issue template from Fedoraware

Made it so prioritized players use the priority color for their chams
  • Loading branch information
Viceroyy committed Jul 30, 2024
1 parent 9d0052c commit a547187
Show file tree
Hide file tree
Showing 14 changed files with 6,618 additions and 7,433 deletions.
36 changes: 30 additions & 6 deletions .github/ISSUE_TEMPLATE
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
<!--
If applicable, include the following:
Description of the issue
Config used
Steps to reproduce said issue
-->
---
name: Bug Report
about: Create a report and help us improve AmalgamEdits!
title: A quick Description of Bug
labels: bug
assignees: ''
---
<!-- The template provided below is specifically for bug reports, if you intend to ask a question or recommend a feature/improvement, please head to the discussions tab instead. -->
**AmalgamEdits Build Date:** <!-- Ex: Jul 30 2024 -->
**Windows Version:** <!-- Ex: Windows 11 Pro 23H2 See: https://learn.microsoft.com/en-us/windows/client-management/client-tools/windows-version-search -->

## Configs used:
<!-- Upload both your normal and visual configs found in Team Fortress 2/Amalgam and Team Fortress 2/Amalgam/Visuals respectively. You can upload the contents of these files to any text-based hosting server. -->

## Description:
<!-- Describe what the issue is. -->
<!-- If possible, also provide a video of the issue occurring. -->

## Steps to reproduce:
- [ ] With the steps below I can consistently reproduce this issue.
<!-- If you are unable to consistently reproduce this issue, you must provide all other info in this template or your report will be removed. -->

Steps to reproduce the behavior:
<!-- Example only, please delete these steps and enter your own. -->
1. Enable X
2. Do Y
3. Notice Z

## Additional info:
<!-- Please provide any info relating to this issue that has not been declared previously in your report. -->
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -361,5 +361,6 @@ MigrationBackup/

# Fody - auto-generated XML schema
FodyWeavers.xsd

/build
/output
4 changes: 2 additions & 2 deletions Amalgam/Amalgam.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@
<ClInclude Include="src\Features\CheaterDetection\CheaterDetection.h" />
<ClInclude Include="src\Features\CritHack\CritHack.h" />
<ClInclude Include="src\Features\EnginePrediction\EnginePrediction.h" />
<ClInclude Include="src\Features\ImGui\FontAwesome\FontAwesome.h" />
<ClInclude Include="src\Features\ImGui\FontAwesome\IconDefinitions.h" />
<ClInclude Include="src\Features\Killstreak\Killstreak.h" />
<ClInclude Include="src\Features\Misc\Misc.h" />
<ClInclude Include="src\Features\NetworkFix\NetworkFix.h" />
Expand Down Expand Up @@ -494,8 +496,6 @@
<ClInclude Include="src\Features\Conditions\Conditions.h" />
<ClInclude Include="src\Features\Configs\Configs.h" />
<ClInclude Include="src\Features\ImGui\Render.h" />
<ClInclude Include="src\Features\ImGui\MaterialDesign\IconDefinitions.h" />
<ClInclude Include="src\Features\ImGui\MaterialDesign\MaterialIcons.h" />
<ClInclude Include="src\Features\ImGui\Menu\Components.h" />
<ClInclude Include="src\Features\ImGui\Menu\Menu.h" />
<ClInclude Include="src\Features\Records\Records.h" />
Expand Down
4 changes: 2 additions & 2 deletions Amalgam/Amalgam.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@
<ClInclude Include="src\Features\CameraWindow\CameraWindow.h" />
<ClInclude Include="src\Features\Conditions\Conditions.h" />
<ClInclude Include="src\Features\Configs\Configs.h" />
<ClInclude Include="src\Features\ImGui\MaterialDesign\IconDefinitions.h" />
<ClInclude Include="src\Features\ImGui\MaterialDesign\MaterialIcons.h" />
<ClInclude Include="src\Features\ImGui\Menu\Components.h" />
<ClInclude Include="src\Features\ImGui\Menu\Menu.h" />
<ClInclude Include="src\Features\Records\Records.h" />
Expand Down Expand Up @@ -424,6 +422,8 @@
<ClInclude Include="src\Features\Killstreak\Killstreak.h" />
<ClInclude Include="src\SDK\Definitions\Main\CCaptureFlag.h" />
<ClInclude Include="src\Utils\EventListener\EventListener.h" />
<ClInclude Include="src\Features\ImGui\FontAwesome\FontAwesome.h" />
<ClInclude Include="src\Features\ImGui\FontAwesome\IconDefinitions.h" />
</ItemGroup>
<ItemGroup>
<None Include="cpp.hint" />
Expand Down
5,122 changes: 5,122 additions & 0 deletions Amalgam/src/Features/ImGui/FontAwesome/FontAwesome.h

Large diffs are not rendered by default.

1,409 changes: 1,409 additions & 0 deletions Amalgam/src/Features/ImGui/FontAwesome/IconDefinitions.h

Large diffs are not rendered by default.

2,244 changes: 0 additions & 2,244 deletions Amalgam/src/Features/ImGui/MaterialDesign/IconDefinitions.h

This file was deleted.

5,137 changes: 0 additions & 5,137 deletions Amalgam/src/Features/ImGui/MaterialDesign/MaterialIcons.h

This file was deleted.

12 changes: 6 additions & 6 deletions Amalgam/src/Features/ImGui/Menu/Components.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include "../Render.h"
#include "Menu.h"
#include "../MaterialDesign/IconDefinitions.h"
#include "../FontAwesome/IconDefinitions.h"
#include "../../Conditions/Conditions.h"
#include "../../Visuals/Materials/Materials.h"
#include <ImGui/imgui_internal.h>
Expand Down Expand Up @@ -472,7 +472,7 @@ namespace ImGui
SetMouseCursor(ImGuiMouseCursor_Hand);

SetCursorPos({ restorePos.x + 4, restorePos.y + 3 });
IconImage(*var ? ICON_MD_CHECK_BOX : ICON_MD_CHECK_BOX_OUTLINE_BLANK, true, *var ? (flags & FToggle_PlainColor ? F::Render.Active.Value : F::Render.Accent.Value) : F::Render.Inactive.Value);
IconImage(*var ? ICON_FA_CIRCLE_CHECK : ICON_FA_CIRCLE, true, *var ? (flags & FToggle_PlainColor ? F::Render.Active.Value : F::Render.Accent.Value) : F::Render.Inactive.Value);

SetCursorPos({ restorePos.x + 24, restorePos.y + 5 });
if (*var)
Expand Down Expand Up @@ -842,7 +842,7 @@ namespace ImGui
PopStyleColor();

SetCursorPos({ originalPos.x + 16, originalPos.y - 33 });
IconImage(flagActive ? ICON_MD_CHECK_BOX : ICON_MD_CHECK_BOX_OUTLINE_BLANK, true, flagActive ? F::Render.Accent.Value : F::Render.Inactive.Value);
IconImage(flagActive ? ICON_FA_CIRCLE_CHECK : ICON_FA_CIRCLE, true, flagActive ? F::Render.Accent.Value : F::Render.Inactive.Value);
SetCursorPos(originalPos);
}
else
Expand Down Expand Up @@ -882,7 +882,7 @@ namespace ImGui
TextUnformatted(TruncateText(preview.c_str(), sizex - 55).c_str());

SetCursorPos({ originalPos.x + sizex - 25, originalPos.y - 2 });
IconImage(active ? ICON_MD_ARROW_DROP_UP : ICON_MD_ARROW_DROP_DOWN, true);
IconImage(active ? ICON_FA_CARET_UP : ICON_FA_CARET_DOWN, true);

EndComboPreview();
}
Expand Down Expand Up @@ -1049,7 +1049,7 @@ namespace ImGui
if (entries.size())
{
SetCursorPos({ originalPos.x + sizex - 25, originalPos.y - 2 });
IconImage(mActives[label] ? ICON_MD_ARROW_DROP_UP : ICON_MD_ARROW_DROP_DOWN, true);
IconImage(mActives[label] ? ICON_FA_CARET_UP : ICON_FA_CARET_DOWN, true);
}

if (mActives[label] || flags & FSDropdown_Custom || !entries.size())
Expand Down Expand Up @@ -1178,7 +1178,7 @@ namespace ImGui
TextUnformatted(TruncateText(preview.c_str(), sizex - 55).c_str());

SetCursorPos({ originalPos.x + sizex - 25, originalPos.y - 2 });
IconImage(active ? ICON_MD_ARROW_DROP_UP : ICON_MD_ARROW_DROP_DOWN, true);
IconImage(active ? ICON_FA_CARET_UP : ICON_FA_CARET_DOWN, true);

EndComboPreview();
}
Expand Down
50 changes: 25 additions & 25 deletions Amalgam/src/Features/ImGui/Menu/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void CMenu::DrawMenu()
const auto windowSize = mainWindowSize = GetWindowSize();

// Main tabs
FTabs({ "AIMBOT", "VISUALS", "MISC", "LOGS", "SETTINGS" }, &CurrentTab, TabSize, { 0, SubTabSize.y }, true, { ICON_MD_ADS_CLICK, ICON_MD_VISIBILITY, ICON_MD_PUBLIC, ICON_MD_MENU_BOOK, ICON_MD_SETTINGS });
FTabs({ "AIMBOT", "VISUALS", "MISC", "LOGS", "SETTINGS" }, &CurrentTab, TabSize, { 0, SubTabSize.y }, true, { ICON_FA_BULLSEYE, ICON_FA_PERSON_RAYS, ICON_FA_EARTH_AMERICAS, ICON_FA_BOOK, ICON_FA_GEAR });

// Sub tabs
switch (CurrentTab)
Expand Down Expand Up @@ -101,7 +101,7 @@ void CMenu::DrawMenu()
GetWindowDrawList()->AddText(F::Render.FontRegular, F::Render.FontRegular->FontSize, { windowPos.x + 16.f + preSize.x, windowPos.y + 13.f }, F::Render.Accent, sCondition.c_str());

SetCursorPos({ textSize.x + 28, 11 });
if (IconButton(ICON_MD_CANCEL))
if (IconButton(ICON_FA_CIRCLE_XMARK))
sCondition = "default";

End();
Expand Down Expand Up @@ -1105,12 +1105,12 @@ void CMenu::MenuSettings()
int o = 26;

SetCursorPos({ GetWindowSize().x - o, current + 9 });
if (IconButton(ICON_MD_DELETE))
if (IconButton(ICON_FA_TRASH))
OpenPopup(std::format("Confirmation## DeleteConfig{}", configName).c_str());
o += 25;

SetCursorPos({ GetWindowSize().x - o, current + 9 });
if (IconButton(ICON_MD_SAVE))
if (IconButton(ICON_FA_FLOPPY_DISK))
{
if (configName != F::Configs.sCurrentConfig || F::Configs.sCurrentVisuals.length())
OpenPopup(std::format("Confirmation## SaveConfig{}", configName).c_str());
Expand All @@ -1120,7 +1120,7 @@ void CMenu::MenuSettings()
o += 25;

SetCursorPos({ GetWindowSize().x - o, current + 9 });
if (IconButton(ICON_MD_DOWNLOAD))
if (IconButton(ICON_FA_DOWNLOAD))
F::Configs.LoadConfig(configName);

// Dialogs
Expand Down Expand Up @@ -1190,12 +1190,12 @@ void CMenu::MenuSettings()
int o = 26;

SetCursorPos({ GetWindowSize().x - o, current + 9 });
if (IconButton(ICON_MD_DELETE))
if (IconButton(ICON_FA_TRASH))
OpenPopup(std::format("Confirmation## DeleteVisual{}", configName).c_str());
o += 25;

SetCursorPos({ GetWindowSize().x - o, current + 9 });
if (IconButton(ICON_MD_SAVE))
if (IconButton(ICON_FA_FLOPPY_DISK))
{
if (configName != F::Configs.sCurrentVisuals)
OpenPopup(std::format("Confirmation## SaveVisual{}", configName).c_str());
Expand All @@ -1205,7 +1205,7 @@ void CMenu::MenuSettings()
o += 25;

SetCursorPos({ GetWindowSize().x - o, current + 9 });
if (IconButton(ICON_MD_DOWNLOAD))
if (IconButton(ICON_FA_DOWNLOAD))
F::Configs.LoadVisual(configName);

// Dialogs
Expand Down Expand Up @@ -1390,12 +1390,12 @@ void CMenu::MenuSettings()
if (sName.length() && FNV1A::Hash(sName.c_str()) != FNV1A::HashConst("default") && bParent && (!tCond.Type ? tCond.Key : true))
{
bMatch = F::Conditions.mConditions.contains(sName);
IconImage(bMatch ? ICON_MD_SETTINGS : ICON_MD_ADD);
IconImage(bMatch ? ICON_FA_GEAR : ICON_FA_CIRCLE_PLUS);
}
else
{
bTransparent = true;
IconImage(ICON_MD_ADD);
IconImage(ICON_FA_CIRCLE_PLUS);
bTransparent = false;
}

Expand All @@ -1407,7 +1407,7 @@ void CMenu::MenuSettings()
bClear = Button("##ClearButton", { 40, 40 });
PopStyleColor(3);
SetCursorPos({ GetWindowSize().x - 35, 76 });
IconImage(ICON_MD_CLEAR);
IconImage(ICON_FA_CIRCLE_XMARK);

if (bCreate)
F::Conditions.AddCondition(sName, tCond);
Expand Down Expand Up @@ -1496,10 +1496,10 @@ void CMenu::MenuSettings()

// buttons
SetCursorPos({ restorePos.x + width - 22, restorePos.y + 5 });
bDelete = IconButton(ICON_MD_DELETE);
bDelete = IconButton(ICON_FA_TRASH);

SetCursorPos({ restorePos.x + width - 47, restorePos.y + 5 });
bEdit = IconButton(ICON_MD_EDIT);
bEdit = IconButton(ICON_FA_PEN);

SetCursorPos(restorePos);
bClicked = Button(std::format("##{}", sCond).c_str(), { width, 28 });
Expand Down Expand Up @@ -1577,12 +1577,12 @@ void CMenu::MenuSettings()
if (player.Local)
{
SetCursorPos({ restorePos.x + 7, restorePos.y + 5 });
IconImage(ICON_MD_PERSON);
IconImage(ICON_FA_USER);
}
else if (player.Friend)
{
SetCursorPos({ restorePos.x + 7, restorePos.y + 5 });
IconImage(ICON_MD_GROUP);
IconImage(ICON_FA_USER_GROUP);
}
int lOffset = player.Local || player.Friend ? 29 : 10;
SetCursorPos({ restorePos.x + lOffset, restorePos.y + 7 });
Expand All @@ -1594,14 +1594,14 @@ void CMenu::MenuSettings()
{
// right
SetCursorPos({ restorePos.x + width - 22, restorePos.y + 5 });
bAdd = IconButton(ICON_MD_ADD);
bAdd = IconButton(ICON_FA_CIRCLE_PLUS);
if (Vars::AntiHack::Resolver::Resolver.Value && !player.Local)
{
SetCursorPos({ restorePos.x + width - 42, restorePos.y + 5 });
bYaw = IconButton(ICON_MD_ARROW_FORWARD);
bYaw = IconButton(ICON_FA_ARROW_RIGHT_LONG);

SetCursorPos({ restorePos.x + width - 62, restorePos.y + 5 });
bPitch = IconButton(ICON_MD_ARROW_UPWARD);
bPitch = IconButton(ICON_FA_ARROW_UP_LONG);
}

// tag bar
Expand All @@ -1628,7 +1628,7 @@ void CMenu::MenuSettings()
SetCursorPos({ tagPos.x + 5, tagPos.y + 4 });
TextUnformatted(sTag.c_str());
SetCursorPos({ tagPos.x + tagWidth - 18, tagPos.y + 2 });
if (IconButton(ICON_MD_CANCEL))
if (IconButton(ICON_FA_CIRCLE_XMARK))
F::PlayerUtils.RemoveTag(player.FriendsID, sTag, true, player.Name);

PopStyleColor();
Expand Down Expand Up @@ -1794,12 +1794,12 @@ void CMenu::MenuSettings()
if (sName.length())
{
bool bMatch = F::PlayerUtils.mTags.contains(sName);
IconImage(bMatch ? ICON_MD_SETTINGS : ICON_MD_ADD);
IconImage(bMatch ? ICON_FA_GEAR : ICON_FA_CIRCLE_PLUS);
}
else
{
bTransparent = true;
IconImage(ICON_MD_ADD);
IconImage(ICON_FA_CIRCLE_PLUS);
bTransparent = false;
}

Expand All @@ -1811,7 +1811,7 @@ void CMenu::MenuSettings()
bClear = Button("##ClearButton", { 40, 40 });
PopStyleColor(3);
SetCursorPos({ GetWindowSize().x - 35, 28 });
IconImage(ICON_MD_CLEAR);
IconImage(ICON_FA_CIRCLE_XMARK);

if (bCreate)
{
Expand Down Expand Up @@ -1857,7 +1857,7 @@ void CMenu::MenuSettings()
if (!plTag.Locked)
{
SetCursorPos({ restorePos.x + width - 22, restorePos.y + 5 });
bDelete = IconButton(ICON_MD_DELETE);
bDelete = IconButton(ICON_FA_TRASH);
}

SetCursorPos(restorePos);
Expand Down Expand Up @@ -1986,7 +1986,7 @@ void CMenu::MenuSettings()
if (!pair.second.bLocked)
{
SetCursorPos({ GetWindowSize().x - o, current + 9 });
if (IconButton(ICON_MD_DELETE))
if (IconButton(ICON_FA_TRASH))
OpenPopup(std::format("Confirmation## DeleteMat{}", pair.first).c_str());
if (BeginPopupModal(std::format("Confirmation## DeleteMat{}", pair.first).c_str(), nullptr, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_AlwaysUseWindowPadding))
{
Expand All @@ -2006,7 +2006,7 @@ void CMenu::MenuSettings()
}

SetCursorPos({ GetWindowSize().x - o, current + 9 });
if (IconButton(ICON_MD_EDIT))
if (IconButton(ICON_FA_PEN))
{
CurrentMaterial = pair.first;
LockedMaterial = pair.second.bLocked;
Expand Down
10 changes: 5 additions & 5 deletions Amalgam/src/Features/ImGui/Render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include "../../Hooks/Direct3DDevice9_EndScene.h"
#include <ImGui/imgui_impl_win32.h>
#include "MaterialDesign/MaterialIcons.h"
#include "MaterialDesign/IconDefinitions.h"
#include "FontAwesome/FontAwesome.h"
#include "FontAwesome/IconDefinitions.h"
#include "Menu/Menu.h"
#include "../Visuals/Visuals.h"

Expand Down Expand Up @@ -131,10 +131,10 @@ void CRender::Initialize(IDirect3DDevice9* pDevice)

ImFontConfig iconConfig;
iconConfig.PixelSnapH = true;
constexpr ImWchar iconRange[]{ short(ICON_MIN_MD), short(ICON_MAX_MD), 0 };
constexpr ImWchar iconRange[]{ short(ICON_MIN_FA), short(ICON_MAX_FA), 0 };

IconFontRegular = io.Fonts->AddFontFromMemoryCompressedTTF(MaterialIcons_compressed_data, MaterialIcons_compressed_size, 15.f, &iconConfig, iconRange);
IconFontLarge = io.Fonts->AddFontFromMemoryCompressedTTF(MaterialIcons_compressed_data, MaterialIcons_compressed_size, 16.f, &iconConfig, iconRange);
IconFontRegular = io.Fonts->AddFontFromMemoryCompressedTTF(FontAwesome_compressed_data, FontAwesome_compressed_size, 15.f, &iconConfig, iconRange);
IconFontLarge = io.Fonts->AddFontFromMemoryCompressedTTF(FontAwesome_compressed_data, FontAwesome_compressed_size, 16.f, &iconConfig, iconRange);

io.Fonts->Build();
}
Expand Down
16 changes: 14 additions & 2 deletions Amalgam/src/Features/Visuals/Chams/Chams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,6 @@ void CChams::DrawModel(CBaseEntity* pEntity, Chams_t chams, IMatRenderContext* p
bRendering = false;
}



void CChams::RenderMain(CTFPlayer* pLocal)
{
const auto pRenderContext = I::MaterialSystem->GetRenderContext();
Expand All @@ -324,6 +322,20 @@ void CChams::RenderMain(CTFPlayer* pLocal)
chams.OccludedColor = { 0, 255, 0, 255 };
DrawModel(pEntity, chams, pRenderContext);
}
else if (Vars::Chams::Player::Priority.Value && F::PlayerUtils.GetPriority(pEntity->entindex()) > F::PlayerUtils.mTags["Default"].Priority)
{
PlayerInfo_t pi{};
if (I::EngineClient->GetPlayerInfo(pEntity->entindex(), &pi))
{
std::string sTag; PriorityLabel_t plTag;
if (F::PlayerUtils.GetSignificantTag(pi.friendsID, &sTag, &plTag, 1))
{
chams.OccludedColor = plTag.Color;
chams.VisibleColor = plTag.Color;
DrawModel(pEntity, chams, pRenderContext);
}
}
}
else
DrawModel(pEntity, chams, pRenderContext);
}
Expand Down
2 changes: 1 addition & 1 deletion Amalgam/src/Hooks/NetChannel_SendDatagram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MAKE_SIGNATURE(NetChannel_SendDatagram, "engine.dll", "40 55 57 41 56 48 8D AC 2
MAKE_HOOK(NetChannel_SendDatagram, S::NetChannel_SendDatagram(), int, __fastcall,
CNetChannel* netChannel, bf_write* datagram)
{
if (!netChannel || datagram)
if (!netChannel || datagram || netChannel->GetTimeSinceLastReceived() > TICK_INTERVAL * 2 || netChannel->IsTimingOut())
return CALL_ORIGINAL(netChannel, datagram);

F::Backtrack.bFakeLatency = H::Entities.GetLocal() && Vars::Backtrack::Enabled.Value && Vars::Backtrack::LatencyMode.Value == 1 || Vars::Backtrack::LatencyMode.Value == 2 && Vars::Backtrack::Latency.Value;
Expand Down
Loading

0 comments on commit a547187

Please sign in to comment.