rs-client: refactoring (#1344)

* Rename some things to be more consistent everywhere

* rs-client: refactoring

* MenuAction -> MenuOpcode merge
This commit is contained in:
Lucwousin
2019-08-20 22:24:51 +02:00
committed by GitHub
parent 0f46656e9d
commit db705f5dd5
297 changed files with 13734 additions and 14043 deletions

View File

@@ -1685,7 +1685,7 @@ public interface Client extends GameShell
*
* @param param0 This is SceneX for gameObject, index for items, and 0 for npc.
* @param param1 This is SceneY for gameObject, static for items, and 0 for npc.
* @param type Menu entry Action type.
* @param type Menu entry Action opcode.
* @param id Targets ID
* @param menuEntry Do these actually matter?
* @param targetString Do these actually matter?

View File

@@ -40,8 +40,8 @@ public interface DecorativeObject extends TileObject
Polygon getConvexHull();
Polygon getConvexHull2();
Entity getRenderable();
Entity getRenderable2();
Entity getEntity1();
Entity getEntity2();
Model getModel1();

View File

@@ -68,7 +68,7 @@ public interface GameObject extends TileObject
*/
Angle getOrientation();
Entity getRenderable();
Entity getEntity();
int getRsOrientation();

View File

@@ -29,7 +29,7 @@ package net.runelite.api;
*/
public interface GroundObject extends TileObject
{
Entity getRenderable();
Entity getEntity();
Model getModel();
}

View File

@@ -57,7 +57,7 @@ public class MenuEntry
/**
* The action the entry will trigger.
*/
private int type;
private int opcode;
/**
* An additional parameter for the action.
*/
@@ -80,7 +80,7 @@ public class MenuEntry
src.getOption(),
src.getTarget(),
src.getIdentifier(),
src.getType(),
src.getOpcode(),
src.getParam0(),
src.getParam1(),
src.isForceLeftClick()

View File

@@ -30,7 +30,7 @@ import java.util.Map;
/**
* An enumeration of right-click menu actions.
*/
public enum MenuAction
public enum MenuOpcode
{
/**
* Menu action for using an item in your inventory on a tile object (GameObject or GroundObject).
@@ -281,19 +281,19 @@ public enum MenuAction
public static final int MENU_ACTION_DEPRIORITIZE_OFFSET = 2000;
private static final Map<Integer, MenuAction> map = new HashMap<>();
private static final Map<Integer, MenuOpcode> map = new HashMap<>();
static
{
for (MenuAction menuAction : values())
for (MenuOpcode menuOpcode : values())
{
map.put(menuAction.getId(), menuAction);
map.put(menuOpcode.getId(), menuOpcode);
}
}
private final int id;
MenuAction(int id)
MenuOpcode(int id)
{
this.id = id;
}
@@ -303,7 +303,7 @@ public enum MenuAction
return id;
}
public static MenuAction of(int id)
public static MenuOpcode of(int id)
{
return map.getOrDefault(id, UNKNOWN);
}

View File

@@ -73,14 +73,14 @@ public interface Tile
*
* @return the paint
*/
TilePaint getSceneTilePaint();
TilePaint getTilePaint();
/**
* Gets the model of the tile in the scene.
*
* @return the tile model
*/
TileModel getSceneTileModel();
TileModel getTileModel();
/**
* Gets the location coordinate of the tile in the world.

View File

@@ -50,8 +50,8 @@ public interface WallObject extends TileObject
*/
int getConfig();
Entity getRenderable1();
Entity getRenderable2();
Entity getEntity1();
Entity getEntity2();
Model getModelA();
Model getModelB();

View File

@@ -52,7 +52,7 @@ public class MenuEntryAdded implements Event
public int getType()
{
return menuEntry.getType();
return menuEntry.getOpcode();
}
public int getIdentifier()

View File

@@ -27,7 +27,7 @@ package net.runelite.api.events;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Setter;
import net.runelite.api.MenuAction;
import net.runelite.api.MenuOpcode;
import net.runelite.api.MenuEntry;
/**
@@ -79,11 +79,11 @@ public class MenuOptionClicked implements Event
}
/**
* MenuAction but int-ish
* MenuOpcode but int-ish
*/
public int getType()
public int getOpcode()
{
return menuEntry.getType();
return menuEntry.getOpcode();
}
/**
@@ -118,9 +118,9 @@ public class MenuOptionClicked implements Event
/**
* The action performed.
*/
public MenuAction getMenuAction()
public MenuOpcode getMenuOpcode()
{
return MenuAction.of(getType());
return MenuOpcode.of(getOpcode());
}
/**

View File

@@ -91,7 +91,7 @@ public class WidgetConfig
/**
* Add a USE option
*
* @see// MenuAction#ITEM_USE
* @see// MenuOpcode#ITEM_USE
*/
public static final int ITEM_USE_OP = 1 << 31;
}