Admin menu appearance changes.

This commit is contained in:
MobiusDevelopment
2020-02-04 15:52:59 +00:00
parent 4dd37dd106
commit 6d6030f9d3
33 changed files with 250 additions and 371 deletions

View File

@ -117,7 +117,6 @@ public class Config
public static boolean GM_SPECIAL_EFFECT;
public static boolean GM_STARTUP_SILENCE;
public static boolean GM_STARTUP_AUTO_LIST;
public static String GM_ADMIN_MENU_STYLE;
public static boolean GM_HERO_AURA;
public static boolean GM_STARTUP_BUILDER_HIDE;
public static boolean GM_STARTUP_INVULNERABLE;
@ -1167,7 +1166,6 @@ public class Config
EVERYBODY_HAS_ADMIN_RIGHTS = Boolean.parseBoolean(accessSettings.getProperty("EverybodyHasAdminRights", "false"));
GM_STARTUP_AUTO_LIST = Boolean.parseBoolean(accessSettings.getProperty("GMStartupAutoList", "true"));
GM_ADMIN_MENU_STYLE = accessSettings.getProperty("GMAdminMenuStyle", "modern");
GM_HERO_AURA = Boolean.parseBoolean(accessSettings.getProperty("GMHeroAura", "false"));
GM_STARTUP_BUILDER_HIDE = Boolean.parseBoolean(accessSettings.getProperty("GMStartupBuilderHide", "true"));
GM_STARTUP_INVULNERABLE = Boolean.parseBoolean(accessSettings.getProperty("GMStartupInvulnerable", "true"));

View File

@ -43,7 +43,6 @@ public class AdminAdmin implements IAdminCommandHandler
"admin_admin2",
"admin_admin3",
"admin_admin4",
"admin_admin5",
"admin_gmliston",
"admin_gmlistoff",
"admin_silence",
@ -62,7 +61,6 @@ public class AdminAdmin implements IAdminCommandHandler
admin_admin2,
admin_admin3,
admin_admin4,
admin_admin5,
admin_gmliston,
admin_gmlistoff,
admin_silence,
@ -93,7 +91,6 @@ public class AdminAdmin implements IAdminCommandHandler
case admin_admin2:
case admin_admin3:
case admin_admin4:
case admin_admin5:
{
showMainPage(activeChar, command);
return true;
@ -302,21 +299,9 @@ public class AdminAdmin implements IAdminCommandHandler
filename = "server";
break;
}
case 5:
{
filename = "mods";
break;
}
default:
{
if (Config.GM_ADMIN_MENU_STYLE.equals("modern"))
{
filename = "main";
}
else
{
filename = "classic";
}
filename = "main";
break;
}
}

View File

@ -40,11 +40,10 @@ public class AdminCreateItem implements IAdminCommandHandler
private static final Logger LOGGER = Logger.getLogger(AdminCreateItem.class.getName());
private static final String[] ADMIN_COMMANDS =
{
"admin_l2jmobius",
"admin_itemcreate",
"admin_create_item",
"admin_mass_create",
"admin_clear_inventory"
"admin_create_coin"
};
private enum CommandEnum
@ -52,7 +51,7 @@ public class AdminCreateItem implements IAdminCommandHandler
admin_itemcreate,
admin_create_item,
admin_mass_create,
admin_clear_inventory
admin_create_coin
}
@Override
@ -61,7 +60,6 @@ public class AdminCreateItem implements IAdminCommandHandler
final StringTokenizer st = new StringTokenizer(command);
final CommandEnum comm = CommandEnum.valueOf(st.nextToken());
if (comm == null)
{
return false;
@ -183,9 +181,23 @@ public class AdminCreateItem implements IAdminCommandHandler
}
return false;
}
case admin_clear_inventory:
case admin_create_coin:
{
removeAllItems(activeChar);
try
{
final int id = getCoinId(st.nextToken());
if (id <= 0)
{
activeChar.sendMessage("Usage: //create_coin <name> [amount]");
return false;
}
createItem(activeChar, id, (st.hasMoreTokens()) ? Integer.parseInt(st.nextToken()) : 1);
}
catch (Exception e)
{
activeChar.sendMessage("Usage: //create_coin <name> [amount]");
}
return true;
}
default:
@ -195,10 +207,24 @@ public class AdminCreateItem implements IAdminCommandHandler
}
}
@Override
public String[] getAdminCommandList()
private static int getCoinId(String name)
{
return ADMIN_COMMANDS;
if (name.equalsIgnoreCase("adena"))
{
return 57;
}
if (name.equalsIgnoreCase("ancientadena"))
{
return 5575;
}
if (name.equalsIgnoreCase("festivaladena"))
{
return 6673;
}
return 0;
}
private void createItem(PlayerInstance activeChar, int id, int num)
@ -215,7 +241,6 @@ public class AdminCreateItem implements IAdminCommandHandler
}
PlayerInstance player = null;
if (activeChar.getTarget() != null)
{
if (activeChar.getTarget() instanceof PlayerInstance)
@ -243,29 +268,26 @@ public class AdminCreateItem implements IAdminCommandHandler
player = activeChar;
}
player.getInventory().addItem("Admin", id, num, player, null);
final ItemInstance newItem = player.getInventory().addItem("Admin", id, num, player, null);
player.sendPacket(new ItemList(player, true));
if (activeChar.getName().equalsIgnoreCase(player.getName()))
{
BuilderUtil.sendSysMessage(activeChar, "You have spawned " + num + " item(s) number " + id + " in your inventory.");
BuilderUtil.sendSysMessage(activeChar, "You have spawned " + num + " " + newItem.getItemName() + " (" + id + ") in your inventory.");
}
else
{
BuilderUtil.sendSysMessage(activeChar, "You have spawned " + num + " item(s) number " + id + " in " + player.getName() + "'s inventory.");
player.sendMessage("Admin has spawned " + num + " item(s) number " + id + " in your inventory.");
BuilderUtil.sendSysMessage(activeChar, "You have spawned " + num + " " + newItem.getItemName() + " (" + id + ") in " + player.getName() + "'s inventory.");
player.sendMessage("Admin has spawned " + num + " " + newItem.getItemName() + " (" + id + ") in your inventory.");
}
}
private void massCreateItem(PlayerInstance activeChar, int id, int num)
{
if (num > 20)
final Item template = ItemTable.getInstance().getTemplate(id);
if ((template != null) && !template.isStackable())
{
final Item template = ItemTable.getInstance().getTemplate(id);
if ((template != null) && !template.isStackable())
{
BuilderUtil.sendSysMessage(activeChar, "This item does not stack - Creation aborted.");
return;
}
BuilderUtil.sendSysMessage(activeChar, "This item does not stack - Creation aborted.");
return;
}
int i = 0;
@ -287,16 +309,9 @@ public class AdminCreateItem implements IAdminCommandHandler
LOGGER.info("GM " + activeChar.getName() + " mass_created item Id: " + id + " (" + num + ")");
}
private void removeAllItems(PlayerInstance activeChar)
@Override
public String[] getAdminCommandList()
{
for (ItemInstance item : activeChar.getInventory().getItems())
{
if (item.getItemLocation() == ItemInstance.ItemLocation.INVENTORY)
{
activeChar.getInventory().destroyItem("Destroy", item.getObjectId(), item.getCount(), activeChar, null);
}
}
activeChar.sendPacket(new ItemList(activeChar, false));
BuilderUtil.sendSysMessage(activeChar, "Your inventory has been cleared.");
return ADMIN_COMMANDS;
}
}

View File

@ -136,7 +136,7 @@ public class AdminShutdown implements IAdminCommandHandler
final int h = t / 60;
final int m = t % 60;
final SimpleDateFormat format = new SimpleDateFormat("h:mm a");
final SimpleDateFormat format = new SimpleDateFormat("h:mm");
final Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, h);
cal.set(Calendar.MINUTE, m);

View File

@ -599,10 +599,10 @@ public class DoorInstance extends Creature
html1.append("<tr><td><br></td></tr>");
html1.append("</table>");
html1.append("<table><tr>");
html1.append("<td><button value=\"Open\" action=\"bypass -h admin_open " + _doorId + "\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
html1.append("<td><button value=\"Close\" action=\"bypass -h admin_close " + _doorId + "\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
html1.append("<td><button value=\"Kill\" action=\"bypass -h admin_kill\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
html1.append("<td><button value=\"Delete\" action=\"bypass -h admin_delete\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
html1.append("<td><button value=\"Open\" action=\"bypass -h admin_open " + _doorId + "\" width=65 height=19 back=\"L2UI_ch3.smallbutton2_over\" fore=\"L2UI_ch3.smallbutton2\"></td>");
html1.append("<td><button value=\"Close\" action=\"bypass -h admin_close " + _doorId + "\" width=65 height=19 back=\"L2UI_ch3.smallbutton2_over\" fore=\"L2UI_ch3.smallbutton2\"></td>");
html1.append("<td><button value=\"Kill\" action=\"bypass -h admin_kill\" width=65 height=19 back=\"L2UI_ch3.smallbutton2_over\" fore=\"L2UI_ch3.smallbutton2\"></td>");
html1.append("<td><button value=\"Delete\" action=\"bypass -h admin_delete\" width=65 height=19 back=\"L2UI_ch3.smallbutton2_over\" fore=\"L2UI_ch3.smallbutton2\"></td>");
html1.append("</tr></table></body></html>");
html.setHtml(html1.toString());

View File

@ -852,7 +852,14 @@ public class NpcInstance extends Creature
final NpcHtmlMessage html = new NpcHtmlMessage(0);
final StringBuilder html1 = new StringBuilder("<html><body><center><font color=\"LEVEL\">NPC Information</font></center>");
final String className = getClass().getSimpleName();
html1.append("<br>");
html1.append("<br><center><table><tr>");
html1.append("<td><button value=\"Kill\" action=\"bypass -h admin_kill\" width=65 height=19 back=\"L2UI_ch3.smallbutton2_over\" fore=\"L2UI_ch3.smallbutton2\"></td>");
html1.append("<td><button value=\"Delete\" action=\"bypass -h admin_delete\" width=65 height=19 back=\"L2UI_ch3.smallbutton2_over\" fore=\"L2UI_ch3.smallbutton2\"></td></tr>");
html1.append("<td><button value=\"Skills\" action=\"bypass -h admin_show_skilllist_npc " + getTemplate().getNpcId() + "\" width=65 height=19 back=\"L2UI_ch3.smallbutton2_over\" fore=\"L2UI_ch3.smallbutton2\"></td>");
html1.append("<td><button value=\"Droplist\" action=\"bypass -h admin_show_droplist " + getTemplate().getNpcId() + "\" width=65 height=19 back=\"L2UI_ch3.smallbutton2_over\" fore=\"L2UI_ch3.smallbutton2\"></td>");
html1.append("<tr><td><button value=\"Edit NPC\" action=\"bypass -h admin_edit_npc " + getTemplate().getNpcId() + "\" width=65 height=19 back=\"L2UI_ch3.smallbutton2_over\" fore=\"L2UI_ch3.smallbutton2\"><br1></td></tr>");
html1.append("</table></center><br>");
html1.append("Instance Type: " + className + "<br1>Faction: " + getTemplate().getFactionId() + "<br1>Location ID: " + (_spawn != null ? _spawn.getLocation() : 0) + "<br1>");
@ -886,14 +893,8 @@ public class NpcInstance extends Creature
html1.append("<table border=\"0\" width=\"100%\">");
html1.append("<tr><td>STR</td><td>" + getSTR() + "</td><td>DEX</td><td>" + getDEX() + "</td><td>CON</td><td>" + getCON() + "</td></tr>");
html1.append("<tr><td>INT</td><td>" + getINT() + "</td><td>WIT</td><td>" + getWIT() + "</td><td>MEN</td><td>" + getMEN() + "</td></tr>");
html1.append("</table>");
html1.append("</table><br>");
html1.append("<br><center><table><tr><td><button value=\"Edit NPC\" action=\"bypass -h admin_edit_npc " + getTemplate().getNpcId() + "\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"><br1></td>");
html1.append("<td><button value=\"Kill\" action=\"bypass -h admin_kill\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><br1></tr>");
html1.append("<tr><td><button value=\"Show DropList\" action=\"bypass -h admin_show_droplist " + getTemplate().getNpcId() + "\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td></tr>");
html1.append("<td><button value=\"Delete\" action=\"bypass -h admin_delete\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td></tr>");
html1.append("<tr><td><button value=\"Show Skillist\" action=\"bypass -h admin_show_skilllist_npc " + getTemplate().getNpcId() + "\" width=100 height=20 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td><td></td></tr>");
html1.append("</table></center><br>");
html1.append("</body></html>");
html.setHtml(html1.toString());
@ -938,7 +939,7 @@ public class NpcInstance extends Creature
html1.append("<tr><td>INT</td><td>" + getINT() + "</td><td>WIT</td><td>" + getWIT() + "</td><td>MEN</td><td>" + getMEN() + "</td></tr>");
html1.append("</table>");
html1.append("<br><center><font color=\"LEVEL\">[Drop Info]</font></center>");
html1.append("<br><center><font color=\"LEVEL\">[Drop Info]</font><br>");
html1.append("Rates legend: <font color=\"ff0000\">50%+</font> <font color=\"00ff00\">30%+</font> <font color=\"0000ff\">less than 30%</font>");
html1.append("<table border=0 width=\"100%\">");