Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
- Added Task Event/Icon to Replay
Browse files Browse the repository at this point in the history
  • Loading branch information
v0idp committed Feb 11, 2022
1 parent 1ed79c4 commit 09291d8
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 2 deletions.
1 change: 1 addition & 0 deletions AmongUsMenu.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@
<Image Include="resources\polus.png" />
<Image Include="resources\report.png" />
<Image Include="resources\the_skald.png" />
<Image Include="resources\tick.png" />
<Image Include="resources\vent_in.png" />
<Image Include="resources\vent_out.png" />
</ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions AmongUsMenu.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,9 @@
<Image Include="resources\report.png">
<Filter>resources</Filter>
</Image>
<Image Include="resources\tick.png">
<Filter>resources</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<None Include="framework\version.def">
Expand Down
16 changes: 16 additions & 0 deletions gui/replay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,22 @@ namespace Replay
ImVec2(0.0f, 1.0f),
ImVec2(1.0f, 0.0f));
}
else if (e->getType() == EVENT_TYPES::EVENT_TASK)
{
auto task_event = dynamic_cast<TaskCompletedEvent*>(e);
auto position = task_event->GetPosition();
IconTexture icon = icons.at(ICON_TYPES::TASK);
float mapX = maps[MapType].x_offset + (position.x - (icon.iconImage.imageWidth * icon.scale * 0.5f)) * maps[MapType].scale + winpos.x;
float mapY = maps[MapType].y_offset - (position.y - (icon.iconImage.imageHeight * icon.scale * 0.5f)) * maps[MapType].scale + winpos.y;
float mapXMax = maps[MapType].x_offset + (position.x + (icon.iconImage.imageWidth * icon.scale * 0.5f)) * maps[MapType].scale + winpos.x;
float mapYMax = maps[MapType].y_offset - (position.y + (icon.iconImage.imageHeight * icon.scale * 0.5f)) * maps[MapType].scale + winpos.y;

drawList->AddImage((void*)icon.iconImage.shaderResourceView,
ImVec2(mapX, mapY),
ImVec2(mapXMax, mapYMax),
ImVec2(0.0f, 1.0f),
ImVec2(1.0f, 0.0f));
}
else if (e->getType() == EVENT_TYPES::EVENT_REPORT || e->getType() == EVENT_TYPES::EVENT_MEETING)
{
auto report_event = dynamic_cast<ReportDeadBodyEvent*>(e);
Expand Down
1 change: 1 addition & 0 deletions hooks/DirectX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ bool ImGuiInitialization(IDXGISwapChain* pSwapChain) {
icons.insert({ ICON_TYPES::VENT_OUT, { D3D11Image(Resource(IDB_PNG6), pDevice), 0.02f }});
icons.insert({ ICON_TYPES::KILL, { D3D11Image(Resource(IDB_PNG7), pDevice), 0.02f } });
icons.insert({ ICON_TYPES::REPORT, { D3D11Image(Resource(IDB_PNG8), pDevice), 0.02f } });
icons.insert({ ICON_TYPES::TASK, { D3D11Image(Resource(IDB_PNG9), pDevice), 0.02f } });

DirectX::hRenderSemaphore = CreateSemaphore(
NULL, // default security attributes
Expand Down
3 changes: 2 additions & 1 deletion hooks/DirectX.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ enum ICON_TYPES {
VENT_IN,
VENT_OUT,
KILL,
REPORT
REPORT,
TASK
};

struct MapTexture {
Expand Down
3 changes: 2 additions & 1 deletion resources/resource_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
#define IDB_PNG6 106
#define IDB_PNG7 107
#define IDB_PNG8 108
#define IDB_PNG9 109

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 109
#define _APS_NEXT_RESOURCE_VALUE 110
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
Expand Down
2 changes: 2 additions & 0 deletions resources/resource_data.rc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ IDB_PNG7 PNG "kill.png"

IDB_PNG8 PNG "report.png"

IDB_PNG9 PNG "tick.png"

#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////

Expand Down
Binary file added resources/tick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 09291d8

Please sign in to comment.