Java 类net.minecraftforge.client.event.GuiScreenEvent.BackgroundDrawnEvent 实例源码

项目:NotEnoughItems    文件:ContainerEventHandler.java   
@SubscribeEvent (priority = EventPriority.LOWEST)//We need to be called after JEI as this is is a render overlay.
public void onDrawBackgroundEventPost(BackgroundDrawnEvent event) {
    GuiTextFieldFilter fieldFilter = JEIIntegrationManager.getTextFieldFilter();
    if (!ClientUtils.inWorld() || !isNEIInWorld() || fieldFilter == null || !SearchField.searchInventories() || JEIIntegrationManager.searchBoxOwner != EnumItemBrowser.JEI || JEIIntegrationManager.itemPanelOwner == EnumItemBrowser.NEI) {
        return;
    }

    int x = fieldFilter.x;
    int y = fieldFilter.y;
    int h = fieldFilter.height;
    int w = fieldFilter.width;

    GuiDraw.drawGradientRect(x - 1, y - 1, 1, h + 2, 0xFFFFFF00, 0xFFC0B000);//Left
    GuiDraw.drawGradientRect(x - 1, y - 1, w + 2, 1, 0xFFFFFF00, 0xFFC0B000);//Top
    GuiDraw.drawGradientRect(x + w, y - 1, 1, h + 2, 0xFFFFFF00, 0xFFC0B000);//Left
    GuiDraw.drawGradientRect(x - 1, y + h, w + 2, 1, 0xFFFFFF00, 0xFFC0B000);//Bottom

}
项目:VisibleArmorSlots    文件:EventDelegatorGuiOverlay.java   
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onBackgroundDrawEvent(BackgroundDrawnEvent event)
{
    if (!this.shouldDisplayGuiOverlay(event.getGui())) { return; }

    this.getGuiOverlay().drawBackground();
    this.getGuiOverlay().drawScreen(event.getMouseX(), event.getMouseY());
}
项目:Dailies    文件:GuiDailyProgressIndicators.java   
@SubscribeEvent
public void drawProgressIndicatorsInInventory(BackgroundDrawnEvent event) {
    if (ConfigurationHandler.showQuestsInPlayerInventory && mc.currentScreen instanceof GuiInventory) {
        buildQuestInventoryGui(event);
    } else if (mc.currentScreen instanceof DailiesGuiContainer) {
        buildAvailableQuestGui(event.getMouseX(), event.getMouseY());
        buildQuestInventoryGui(event);
    }
}
项目:Dailies    文件:GuiDailyProgressIndicators.java   
public void buildQuestInventoryGui(BackgroundDrawnEvent event) {

    if (!isSet(DailiesPacketHandler.acceptedQuests)) {
        DailiesPacketHandler.INSTANCE.sendToServer(new RequestAcceptedQuests());
        return;
    }

    ScaledResolution viewport = new ScaledResolution(mc);

    int xPos = viewport.getScaledWidth() - 122 - 22;
    int yPos = (viewport.getScaledHeight() / 2) - (inventoryHeight / 2);

    adjustGlStateManager();
    acceptedBadgeList.clear();
    abandonButtonMap.clear();

    for (int i = 0; i < questsPerPage; i++) {
        if (DailiesPacketHandler.acceptedQuests.size() < i + offsetAccepted + 1) {
            break;
        }
        DailyQuest quest = (DailyQuest) DailiesPacketHandler.acceptedQuests.toArray()[i + offsetAccepted];
        acceptedBadgeList.add(new GuiDailyBadge(quest, mc, xPos, yPos));
        abandonButtonMap.put(quest.id, new GuiButton(i + 10, xPos + 122, yPos+4, 20, 20, "X"));
        yPos += 30;
    }
    offsetAccepted = drawPagerButtons(viewport, xPos, event.getMouseX(), event.getMouseY(), offsetAccepted, DailiesPacketHandler.acceptedQuests.size());
    drawQuestAbandonButtons(event.getMouseX(), event.getMouseY());
}