Skip to content

Commit c2d1f5f

Browse files
author
Michael Hillcox
committed
Refactors
1 parent da90204 commit c2d1f5f

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

src/main/java/com/fgtxray/client/gui/GuiSettings.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@
2424

2525
public class GuiSettings extends GuiScreen
2626
{
27-
private Map<String, OreButtons> buttons = new HashMap<String, OreButtons>();
28-
private List<GuiPage> pageIndex = new ArrayList<GuiPage>();
27+
private Map<String, OreButtons> buttons = new HashMap<>();
28+
private List<GuiPage> pageIndex = new ArrayList<>();
2929

30-
private int pageCurrent = 0;
31-
private int pageMax = 0;
30+
private int pageCurrent, pageMax = 0;
3231

3332
@Override
3433
public void initGui()
@@ -50,12 +49,9 @@ public void initGui()
5049
this.buttonList.add( aNextButton );
5150
this.buttonList.add( aPrevButton );
5251

53-
int x = width / 2 - 100;
54-
int y = height / 2 - 100;
52+
int x = width / 2 - 100, y = height / 2 - 100;
53+
int Count = 0, Page = 0, CountPerPage = 0;
5554

56-
int Count = 0;
57-
int Page = 0;
58-
int CountPerPage = 0;
5955
for( OreInfo ore : OresSearch.searchList )
6056
{
6157
if( buttons.get( ore.oreName ) != null )
@@ -72,9 +68,7 @@ public void initGui()
7268
{
7369
Page++;
7470
if( Page > pageMax )
75-
{
7671
pageMax++;
77-
}
7872

7973
x = width / 2 - 100;
8074
y = height / 2 - 100;
@@ -83,7 +77,7 @@ public void initGui()
8377
pageIndex.add(new GuiPage(Page, new GuiButton(id, x, y, 100, 20, ore.oreName + ": " + (ore.draw ? "On" : "Off")))); // create new button and set the text to Name: On||Off
8478
buttons.put( ore.oreName, new OreButtons( ore.oreName, id, ore ) ); // Add this new button to the buttons hashmap.
8579
y += 21.8; // Next button should be placed down from this one.
86-
80+
8781
// this should reset each page to split the list :)
8882
if( CountPerPage == 6 )
8983
{

0 commit comments

Comments
 (0)