mirror of
https://github.com/refactorinqq/SLC-1.8.9.git
synced 2024-11-13 02:41:31 +01:00
Fixed Friends Overlay Scroll
This commit is contained in:
parent
89d0d94416
commit
43df4014a3
@ -7,17 +7,16 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.silentclient.client.Client;
|
import net.silentclient.client.Client;
|
||||||
import net.silentclient.client.gui.animation.SimpleAnimation;
|
import net.silentclient.client.gui.animation.SimpleAnimation;
|
||||||
import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils;
|
|
||||||
import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils;
|
|
||||||
import net.silentclient.client.gui.elements.Button;
|
import net.silentclient.client.gui.elements.Button;
|
||||||
import net.silentclient.client.gui.elements.IconButton;
|
import net.silentclient.client.gui.elements.IconButton;
|
||||||
import net.silentclient.client.gui.font.SilentFontRenderer;
|
import net.silentclient.client.gui.font.SilentFontRenderer;
|
||||||
import net.silentclient.client.gui.notification.NotificationManager;
|
import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils;
|
||||||
|
import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils;
|
||||||
import net.silentclient.client.gui.theme.Theme;
|
import net.silentclient.client.gui.theme.Theme;
|
||||||
import net.silentclient.client.gui.util.RenderUtil;
|
|
||||||
import net.silentclient.client.mods.settings.GeneralMod;
|
|
||||||
import net.silentclient.client.gui.theme.button.DefaultButtonTheme;
|
import net.silentclient.client.gui.theme.button.DefaultButtonTheme;
|
||||||
import net.silentclient.client.gui.theme.button.SelectedButtonTheme;
|
import net.silentclient.client.gui.theme.button.SelectedButtonTheme;
|
||||||
|
import net.silentclient.client.gui.util.RenderUtil;
|
||||||
|
import net.silentclient.client.mods.settings.GeneralMod;
|
||||||
import net.silentclient.client.utils.ColorUtils;
|
import net.silentclient.client.utils.ColorUtils;
|
||||||
import net.silentclient.client.utils.MenuBlurUtils;
|
import net.silentclient.client.utils.MenuBlurUtils;
|
||||||
import net.silentclient.client.utils.types.FriendsResponse;
|
import net.silentclient.client.utils.types.FriendsResponse;
|
||||||
@ -104,15 +103,14 @@ public class FriendsListOverlay extends GuiScreen {
|
|||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
|
|
||||||
if(scrollY > height) {
|
scrollAnimation.setAnimation((float) scrollY, 16);
|
||||||
scrollAnimation.setAnimation((float) scrollY, 16);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleMouseInput() throws IOException {
|
public void handleMouseInput() throws IOException {
|
||||||
super.handleMouseInput();
|
super.handleMouseInput();
|
||||||
int dw = Mouse.getEventDWheel();
|
int dw = Mouse.getEventDWheel();
|
||||||
|
double newScrollY = this.scrollY;
|
||||||
if(dw != 0) {
|
if(dw != 0) {
|
||||||
if (dw > 0) {
|
if (dw > 0) {
|
||||||
dw = -1;
|
dw = -1;
|
||||||
@ -120,10 +118,19 @@ public class FriendsListOverlay extends GuiScreen {
|
|||||||
dw = 1;
|
dw = 1;
|
||||||
}
|
}
|
||||||
float amountScrolled = (float) (dw * 10);
|
float amountScrolled = (float) (dw * 10);
|
||||||
if (scrollY + amountScrolled > 0)
|
int friendsHeight = (showRequests ? Client.getInstance().getFriends().getRequests().size() : Client.getInstance().getFriends().getFriends().size()) * 25;
|
||||||
scrollY += amountScrolled;
|
|
||||||
|
if (newScrollY + amountScrolled > 0)
|
||||||
|
newScrollY += amountScrolled;
|
||||||
else
|
else
|
||||||
scrollY = 0;
|
newScrollY = 0;
|
||||||
|
|
||||||
|
if((newScrollY < friendsHeight && friendsHeight > height - 46) || amountScrolled < 0) {
|
||||||
|
this.scrollY = (float) newScrollY;
|
||||||
|
if(this.scrollY < 0) {
|
||||||
|
this.scrollY = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user