mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-07-05 20:41:29 -07:00
Tracker circle (#5632)
* Fix item tracker circle display. * Add .o2r to .gitignore. * clang
This commit is contained in:
parent
112fbc5a4b
commit
16c3cb1adf
2 changed files with 5 additions and 4 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -457,3 +457,4 @@ soh/properties.h
|
||||||
# Tools
|
# Tools
|
||||||
/clang-format
|
/clang-format
|
||||||
/clang-format.exe
|
/clang-format.exe
|
||||||
|
*.o2r
|
||||||
|
|
|
@ -696,9 +696,9 @@ void DrawQuest(ItemTrackerItem item) {
|
||||||
bool hasQuestItem = HasQuestItem(item);
|
bool hasQuestItem = HasQuestItem(item);
|
||||||
float iconSize = static_cast<float>(CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36));
|
float iconSize = static_cast<float>(CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36));
|
||||||
ImGui::BeginGroup();
|
ImGui::BeginGroup();
|
||||||
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
|
ImGui::ImageWithBg(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(
|
||||||
hasQuestItem && IsValidSaveFile() ? item.name : item.nameFaded),
|
hasQuestItem && IsValidSaveFile() ? item.name : item.nameFaded),
|
||||||
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
|
ImVec2(iconSize, iconSize), ImVec2(0, 0), ImVec2(1, 1));
|
||||||
|
|
||||||
if (item.id == QUEST_SKULL_TOKEN) {
|
if (item.id == QUEST_SKULL_TOKEN) {
|
||||||
DrawItemCount(item, false);
|
DrawItemCount(item, false);
|
||||||
|
@ -1231,7 +1231,7 @@ void DrawItemsInACircle(std::vector<ItemTrackerItem> items) {
|
||||||
float radius = (iconSize + iconSpacing) * 2.0f;
|
float radius = (iconSize + iconSpacing) * 2.0f;
|
||||||
|
|
||||||
for (int i = 0; i < items.size(); i++) {
|
for (int i = 0; i < items.size(); i++) {
|
||||||
float angle = static_cast<float>(i / items.size() * 2.0f * M_PI);
|
float angle = static_cast<float>(i) / items.size() * 2.0f * M_PIf;
|
||||||
float x = (radius / 2.0f) * cos(angle) + max.x / 2.0f;
|
float x = (radius / 2.0f) * cos(angle) + max.x / 2.0f;
|
||||||
float y = (radius / 2.0f) * sin(angle) + max.y / 2.0f;
|
float y = (radius / 2.0f) * sin(angle) + max.y / 2.0f;
|
||||||
ImGui::SetCursorPos(ImVec2(x - (CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36) - 8) / 2.0f, y + 4));
|
ImGui::SetCursorPos(ImVec2(x - (CVarGetInteger(CVAR_TRACKER_ITEM("IconSize"), 36) - 8) / 2.0f, y + 4));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue