mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-23 06:02:08 -05:00
tweak on main logic
This commit is contained in:
parent
377c030469
commit
d4bc5875d7
@ -287,16 +287,17 @@ ItemTrackerNumbers GetItemCurrentAndMax(ItemTrackerItem item) {
|
|||||||
result.currentAmmo = gSaveContext.rupees;
|
result.currentAmmo = gSaveContext.rupees;
|
||||||
break;
|
break;
|
||||||
case ITEM_BOMBCHU:
|
case ITEM_BOMBCHU:
|
||||||
result.currentCapacity = 50;
|
result.currentCapacity = IsValidSaveFile() ? 50 : 0;
|
||||||
result.maxCapacity = 50;
|
result.maxCapacity = 50;
|
||||||
result.currentAmmo = AMMO(ITEM_BOMBCHU);
|
result.currentAmmo = AMMO(ITEM_BOMBCHU);
|
||||||
break;
|
break;
|
||||||
case ITEM_BEAN:
|
case ITEM_BEAN:
|
||||||
result.currentCapacity = 10;
|
result.currentCapacity = IsValidSaveFile() ? 10 : 0;
|
||||||
result.maxCapacity = 10;
|
result.maxCapacity = 10;
|
||||||
result.currentAmmo = AMMO(ITEM_BEAN);
|
result.currentAmmo = AMMO(ITEM_BEAN);
|
||||||
break;
|
break;
|
||||||
case QUEST_SKULL_TOKEN:
|
case QUEST_SKULL_TOKEN:
|
||||||
|
result.currentCapacity = IsValidSaveFile() ? 100 : 0;
|
||||||
result.maxCapacity = 100;
|
result.maxCapacity = 100;
|
||||||
result.currentAmmo = gSaveContext.inventory.gsTokens;
|
result.currentAmmo = gSaveContext.inventory.gsTokens;
|
||||||
break;
|
break;
|
||||||
@ -349,7 +350,7 @@ void DrawItemCount(ItemTrackerItem item) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (currentAndMax.currentCapacity > 0) {
|
if (currentAndMax.currentCapacity > 0) {
|
||||||
if (currentAndMax.currentCapacity >= currentAndMax.maxCapacity) {
|
/*if (currentAndMax.currentCapacity >= currentAndMax.maxCapacity) {
|
||||||
std::string currentString = std::to_string((int)currentAndMax.currentCapacity);
|
std::string currentString = std::to_string((int)currentAndMax.currentCapacity);
|
||||||
float x = CVar_GetS32("gItemTrackerCurrentOnLeft", 0) ? p.x : p.x + (iconSize / 2) - (ImGui::CalcTextSize(currentString.c_str()).x / 2);
|
float x = CVar_GetS32("gItemTrackerCurrentOnLeft", 0) ? p.x : p.x + (iconSize / 2) - (ImGui::CalcTextSize(currentString.c_str()).x / 2);
|
||||||
|
|
||||||
@ -358,6 +359,20 @@ void DrawItemCount(ItemTrackerItem item) {
|
|||||||
ImGui::Text("%d", (int)currentAndMax.currentCapacity);
|
ImGui::Text("%d", (int)currentAndMax.currentCapacity);
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
} else {
|
} else {
|
||||||
|
if (item.id == QUEST_SKULL_TOKEN) {
|
||||||
|
switch (CVar_GetS32("gItemTrackerCapacityTrack", 0)) {
|
||||||
|
case ITEM_TRACKER_NUMBER_NONE:
|
||||||
|
case ITEM_TRACKER_NUMBER_CURRENT_CAPACITY_ONLY:
|
||||||
|
case ITEM_TRACKER_NUMBER_CURRENT_AMMO_ONLY:
|
||||||
|
std::string currentString = std::to_string((int)currentAndMax.currentAmmo);
|
||||||
|
float x = CVar_GetS32("gItemTrackerCurrentOnLeft", 0) ? p.x : p.x + (iconSize / 2) - (ImGui::CalcTextSize(currentString.c_str()).x / 2);
|
||||||
|
|
||||||
|
ImGui::SetCursorScreenPos(ImVec2(x, p.y - 14));
|
||||||
|
ImGui::Text("%d", (int)currentAndMax.currentAmmo);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
switch (CVar_GetS32("gItemTrackerCapacityTrack", 0)) {
|
switch (CVar_GetS32("gItemTrackerCapacityTrack", 0)) {
|
||||||
case ITEM_TRACKER_NUMBER_NONE:
|
case ITEM_TRACKER_NUMBER_NONE:
|
||||||
break;
|
break;
|
||||||
@ -381,12 +396,28 @@ void DrawItemCount(ItemTrackerItem item) {
|
|||||||
break;
|
break;
|
||||||
case ITEM_TRACKER_NUMBER_CAPACITY:
|
case ITEM_TRACKER_NUMBER_CAPACITY:
|
||||||
{
|
{
|
||||||
|
std::string currentAndMaxString="0";
|
||||||
|
if (item.id == QUEST_SKULL_TOKEN) {
|
||||||
|
std::string currentAndMaxString = std::to_string((int)currentAndMax.currentAmmo) + "/" + std::to_string((int)currentAndMax.maxCapacity);
|
||||||
|
} else {
|
||||||
std::string currentAndMaxString = std::to_string((int)currentAndMax.currentCapacity) + "/" + std::to_string((int)currentAndMax.maxCapacity);
|
std::string currentAndMaxString = std::to_string((int)currentAndMax.currentCapacity) + "/" + std::to_string((int)currentAndMax.maxCapacity);
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::SetCursorScreenPos(ImVec2(p.x + (iconSize / 2) - (ImGui::CalcTextSize(currentAndMaxString.c_str()).x / 2), p.y - 14));
|
ImGui::SetCursorScreenPos(ImVec2(p.x + (iconSize / 2) - (ImGui::CalcTextSize(currentAndMaxString.c_str()).x / 2), p.y - 14));
|
||||||
|
|
||||||
|
|
||||||
|
if (item.id == QUEST_SKULL_TOKEN) {
|
||||||
|
ImGui::Text("%d/", (int)currentAndMax.currentAmmo);
|
||||||
|
} else {
|
||||||
ImGui::Text("%d/", (int)currentAndMax.currentCapacity);
|
ImGui::Text("%d/", (int)currentAndMax.currentCapacity);
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::SameLine(0, 0.0f);
|
ImGui::SameLine(0, 0.0f);
|
||||||
|
if (item.id == QUEST_SKULL_TOKEN) {
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(255, 0, 0, 255));
|
||||||
|
} else {
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(0, 255, 0, 255));
|
ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(0, 255, 0, 255));
|
||||||
|
}
|
||||||
ImGui::Text("%d", (int)currentAndMax.maxCapacity);
|
ImGui::Text("%d", (int)currentAndMax.maxCapacity);
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
}
|
}
|
||||||
@ -406,7 +437,11 @@ void DrawItemCount(ItemTrackerItem item) {
|
|||||||
ImGui::Text("%d/", (int)currentAndMax.currentAmmo);
|
ImGui::Text("%d/", (int)currentAndMax.currentAmmo);
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
ImGui::SameLine(0, 0.0f);
|
ImGui::SameLine(0, 0.0f);
|
||||||
|
if (item.id == QUEST_SKULL_TOKEN) {
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(255, 0, 0, 255));
|
||||||
|
} else {
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(0, 255, 0, 255));
|
ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(0, 255, 0, 255));
|
||||||
|
}
|
||||||
ImGui::Text("%d", (int)currentAndMax.currentCapacity);
|
ImGui::Text("%d", (int)currentAndMax.currentCapacity);
|
||||||
ImGui::PopStyleColor();
|
ImGui::PopStyleColor();
|
||||||
}
|
}
|
||||||
@ -414,7 +449,6 @@ void DrawItemCount(ItemTrackerItem item) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void DrawEquip(ItemTrackerItem item) {
|
void DrawEquip(ItemTrackerItem item) {
|
||||||
bool hasEquip = (item.data & gSaveContext.inventory.equipment) != 0;
|
bool hasEquip = (item.data & gSaveContext.inventory.equipment) != 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user