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 &&
|
||||
(gi.getItemId == RG_ARCHIPELAGO_ITEM_PROGRESSIVE || gi.getItemId == RG_ARCHIPELAGO_ITEM_USEFUL ||
|
||||
gi.getItemId == RG_ARCHIPELAGO_ITEM_JUNK)) {
|
||||
Notification::Emit({
|
||||
|
||||
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({
|
||||
.itemIcon = itemIcon,
|
||||
.prefix = std::string(gSaveContext.ship.quest.data.archipelago.locations[rc].itemName),
|
||||
.message = " for ",
|
||||
.suffix = std::string(gSaveContext.ship.quest.data.archipelago.locations[rc].playerName)
|
||||
|
||||
@@ -16,12 +16,12 @@ void ArchipelagoSettingsWindow::DrawElement() {
|
||||
|
||||
ImGui::Text("Server Address");
|
||||
UIWidgets::CVarInputString("##ArchipelagoServerAddress", CVAR_REMOTE_ARCHIPELAGO("ServerAddress"),
|
||||
UIWidgets::InputOptions()
|
||||
.Color(THEME_COLOR)
|
||||
.PlaceholderText("archipelago.gg:38281")
|
||||
.DefaultValue("archipelago.gg:38281")
|
||||
.Size(ImVec2(ImGui::GetFontSize() * 15, 0))
|
||||
.LabelPosition(UIWidgets::LabelPositions::None));
|
||||
UIWidgets::InputOptions()
|
||||
.Color(THEME_COLOR)
|
||||
.PlaceholderText("archipelago.gg:38281")
|
||||
.DefaultValue("archipelago.gg:38281")
|
||||
.Size(ImVec2(ImGui::GetFontSize() * 15, 0))
|
||||
.LabelPosition(UIWidgets::LabelPositions::None));
|
||||
ImGui::Text("Slot Name");
|
||||
UIWidgets::CVarInputString("##ArchipelagoSlotName", CVAR_REMOTE_ARCHIPELAGO("SlotName"),
|
||||
UIWidgets::InputOptions()
|
||||
@@ -66,6 +66,18 @@ void ArchipelagoSettingsWindow::DrawElement() {
|
||||
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() {
|
||||
|
||||
@@ -89,7 +89,7 @@ void Window::Draw() {
|
||||
|
||||
if (notification.itemIcon != nullptr) {
|
||||
ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(notification.itemIcon),
|
||||
ImVec2(24, 24));
|
||||
ImVec2(32, 32));
|
||||
ImGui::SameLine();
|
||||
}
|
||||
if (!notification.prefix.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user