Add icons to ap item notifications
This commit is contained in:
BIN
soh/assets/custom/textures/parameter_static/gArchipelagoJunk.png
Normal file
BIN
soh/assets/custom/textures/parameter_static/gArchipelagoJunk.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
@@ -362,7 +362,22 @@ void RegisterArchipelago() {
|
|||||||
if (isGiSkipped && gi.modIndex == MOD_RANDOMIZER &&
|
if (isGiSkipped && gi.modIndex == MOD_RANDOMIZER &&
|
||||||
(gi.getItemId == RG_ARCHIPELAGO_ITEM_PROGRESSIVE || gi.getItemId == RG_ARCHIPELAGO_ITEM_USEFUL ||
|
(gi.getItemId == RG_ARCHIPELAGO_ITEM_PROGRESSIVE || gi.getItemId == RG_ARCHIPELAGO_ITEM_USEFUL ||
|
||||||
gi.getItemId == RG_ARCHIPELAGO_ITEM_JUNK)) {
|
gi.getItemId == RG_ARCHIPELAGO_ITEM_JUNK)) {
|
||||||
|
|
||||||
|
const char* itemIcon = "";
|
||||||
|
switch (gi.getItemId) {
|
||||||
|
case RG_ARCHIPELAGO_ITEM_PROGRESSIVE:
|
||||||
|
itemIcon = "Archipelago Progressive Icon";
|
||||||
|
break;
|
||||||
|
case RG_ARCHIPELAGO_ITEM_USEFUL:
|
||||||
|
itemIcon = "Archipelago Useful Icon";
|
||||||
|
break;
|
||||||
|
case RG_ARCHIPELAGO_ITEM_JUNK:
|
||||||
|
itemIcon = "Archipelago Junk Icon";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
Notification::Emit({
|
Notification::Emit({
|
||||||
|
.itemIcon = itemIcon,
|
||||||
.prefix = std::string(gSaveContext.ship.quest.data.archipelago.locations[rc].itemName),
|
.prefix = std::string(gSaveContext.ship.quest.data.archipelago.locations[rc].itemName),
|
||||||
.message = " for ",
|
.message = " for ",
|
||||||
.suffix = std::string(gSaveContext.ship.quest.data.archipelago.locations[rc].playerName)
|
.suffix = std::string(gSaveContext.ship.quest.data.archipelago.locations[rc].playerName)
|
||||||
|
|||||||
@@ -66,6 +66,18 @@ void ArchipelagoSettingsWindow::DrawElement() {
|
|||||||
ArchipelagoClient::GetInstance().OnItemReceived(16711816, true);
|
ArchipelagoClient::GetInstance().OnItemReceived(16711816, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool sArchipelagoTexturesLoaded = false;
|
||||||
|
if (!sArchipelagoTexturesLoaded) {
|
||||||
|
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
|
||||||
|
"Archipelago Progressive Icon", "textures/parameter_static/gArchipelagoProgressive.png");
|
||||||
|
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
|
||||||
|
"Archipelago Useful Icon", "textures/parameter_static/gArchipelagoUseful.png");
|
||||||
|
Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadTextureFromRawImage(
|
||||||
|
"Archipelago Junk Icon", "textures/parameter_static/gArchipelagoJunk.png");
|
||||||
|
|
||||||
|
sArchipelagoTexturesLoaded = true;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void ArchipelagoSettingsWindow::InitElement() {
|
void ArchipelagoSettingsWindow::InitElement() {
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ void Window::Draw() {
|
|||||||
|
|
||||||
if (notification.itemIcon != nullptr) {
|
if (notification.itemIcon != nullptr) {
|
||||||
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(notification.itemIcon),
|
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(notification.itemIcon),
|
||||||
ImVec2(24, 24));
|
ImVec2(32, 32));
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
}
|
}
|
||||||
if (!notification.prefix.empty()) {
|
if (!notification.prefix.empty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user