Delete shortcuts should consider type for auto use.
This commit is contained in:
@ -57,34 +57,47 @@ public class RequestShortCutDel implements IClientIncomingPacket
|
|||||||
// Delete the shortcut.
|
// Delete the shortcut.
|
||||||
final Shortcut oldShortcut = player.getShortCut(_slot, _page);
|
final Shortcut oldShortcut = player.getShortCut(_slot, _page);
|
||||||
player.deleteShortCut(_slot, _page);
|
player.deleteShortCut(_slot, _page);
|
||||||
boolean removed = true;
|
|
||||||
|
|
||||||
// Keep other similar shortcuts activated.
|
if (oldShortcut != null)
|
||||||
if ((oldShortcut != null) && oldShortcut.isAutoUse())
|
|
||||||
{
|
{
|
||||||
player.removeAutoShortcut(_slot, _page);
|
boolean removed = true;
|
||||||
for (Shortcut shortcut : player.getAllShortCuts())
|
|
||||||
|
// Keep other similar shortcuts activated.
|
||||||
|
if (oldShortcut.isAutoUse())
|
||||||
{
|
{
|
||||||
if (oldShortcut.getId() == shortcut.getId())
|
player.removeAutoShortcut(_slot, _page);
|
||||||
|
for (Shortcut shortcut : player.getAllShortCuts())
|
||||||
{
|
{
|
||||||
player.addAutoShortcut(shortcut.getSlot(), shortcut.getPage());
|
if ((oldShortcut.getId() == shortcut.getId()) && (oldShortcut.getType() == shortcut.getType()))
|
||||||
removed = false;
|
{
|
||||||
|
player.addAutoShortcut(shortcut.getSlot(), shortcut.getPage());
|
||||||
|
removed = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Remove auto used ids.
|
||||||
// Remove auto used ids.
|
if (removed)
|
||||||
if (removed)
|
|
||||||
{
|
|
||||||
final int id = oldShortcut == null ? -1 : oldShortcut.getId();
|
|
||||||
if (_slot > 263)
|
|
||||||
{
|
{
|
||||||
AutoUseTaskManager.getInstance().removeAutoSupplyItem(player, id);
|
switch (oldShortcut.getType())
|
||||||
}
|
{
|
||||||
else
|
case SKILL:
|
||||||
{
|
{
|
||||||
AutoUseTaskManager.getInstance().removeAutoBuff(player, id);
|
AutoUseTaskManager.getInstance().removeAutoBuff(player, oldShortcut.getId());
|
||||||
AutoUseTaskManager.getInstance().removeAutoSkill(player, id);
|
AutoUseTaskManager.getInstance().removeAutoSkill(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ITEM:
|
||||||
|
{
|
||||||
|
AutoUseTaskManager.getInstance().removeAutoSupplyItem(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ACTION:
|
||||||
|
{
|
||||||
|
AutoUseTaskManager.getInstance().removeAutoAction(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,16 +93,13 @@ public class RequestShortCutReg implements IClientIncomingPacket
|
|||||||
// Activate if any other similar shortcut is activated.
|
// Activate if any other similar shortcut is activated.
|
||||||
for (Shortcut shortcut : player.getAllShortCuts())
|
for (Shortcut shortcut : player.getAllShortCuts())
|
||||||
{
|
{
|
||||||
if (!shortcut.isAutoUse() || (shortcut.getType() != _type))
|
if (!shortcut.isAutoUse() || (shortcut.getId() != _id) || (shortcut.getType() != _type))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_id == shortcut.getId())
|
player.addAutoShortcut(_slot, _page);
|
||||||
{
|
break;
|
||||||
player.addAutoShortcut(_slot, _page);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,34 +57,47 @@ public class RequestShortCutDel implements IClientIncomingPacket
|
|||||||
// Delete the shortcut.
|
// Delete the shortcut.
|
||||||
final Shortcut oldShortcut = player.getShortCut(_slot, _page);
|
final Shortcut oldShortcut = player.getShortCut(_slot, _page);
|
||||||
player.deleteShortCut(_slot, _page);
|
player.deleteShortCut(_slot, _page);
|
||||||
boolean removed = true;
|
|
||||||
|
|
||||||
// Keep other similar shortcuts activated.
|
if (oldShortcut != null)
|
||||||
if ((oldShortcut != null) && oldShortcut.isAutoUse())
|
|
||||||
{
|
{
|
||||||
player.removeAutoShortcut(_slot, _page);
|
boolean removed = true;
|
||||||
for (Shortcut shortcut : player.getAllShortCuts())
|
|
||||||
|
// Keep other similar shortcuts activated.
|
||||||
|
if (oldShortcut.isAutoUse())
|
||||||
{
|
{
|
||||||
if (oldShortcut.getId() == shortcut.getId())
|
player.removeAutoShortcut(_slot, _page);
|
||||||
|
for (Shortcut shortcut : player.getAllShortCuts())
|
||||||
{
|
{
|
||||||
player.addAutoShortcut(shortcut.getSlot(), shortcut.getPage());
|
if ((oldShortcut.getId() == shortcut.getId()) && (oldShortcut.getType() == shortcut.getType()))
|
||||||
removed = false;
|
{
|
||||||
|
player.addAutoShortcut(shortcut.getSlot(), shortcut.getPage());
|
||||||
|
removed = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Remove auto used ids.
|
||||||
// Remove auto used ids.
|
if (removed)
|
||||||
if (removed)
|
|
||||||
{
|
|
||||||
final int id = oldShortcut == null ? -1 : oldShortcut.getId();
|
|
||||||
if (_slot > 263)
|
|
||||||
{
|
{
|
||||||
AutoUseTaskManager.getInstance().removeAutoSupplyItem(player, id);
|
switch (oldShortcut.getType())
|
||||||
}
|
{
|
||||||
else
|
case SKILL:
|
||||||
{
|
{
|
||||||
AutoUseTaskManager.getInstance().removeAutoBuff(player, id);
|
AutoUseTaskManager.getInstance().removeAutoBuff(player, oldShortcut.getId());
|
||||||
AutoUseTaskManager.getInstance().removeAutoSkill(player, id);
|
AutoUseTaskManager.getInstance().removeAutoSkill(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ITEM:
|
||||||
|
{
|
||||||
|
AutoUseTaskManager.getInstance().removeAutoSupplyItem(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ACTION:
|
||||||
|
{
|
||||||
|
AutoUseTaskManager.getInstance().removeAutoAction(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,16 +93,13 @@ public class RequestShortCutReg implements IClientIncomingPacket
|
|||||||
// Activate if any other similar shortcut is activated.
|
// Activate if any other similar shortcut is activated.
|
||||||
for (Shortcut shortcut : player.getAllShortCuts())
|
for (Shortcut shortcut : player.getAllShortCuts())
|
||||||
{
|
{
|
||||||
if (!shortcut.isAutoUse() || (shortcut.getType() != _type))
|
if (!shortcut.isAutoUse() || (shortcut.getId() != _id) || (shortcut.getType() != _type))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_id == shortcut.getId())
|
player.addAutoShortcut(_slot, _page);
|
||||||
{
|
break;
|
||||||
player.addAutoShortcut(_slot, _page);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,34 +57,47 @@ public class RequestShortCutDel implements IClientIncomingPacket
|
|||||||
// Delete the shortcut.
|
// Delete the shortcut.
|
||||||
final Shortcut oldShortcut = player.getShortCut(_slot, _page);
|
final Shortcut oldShortcut = player.getShortCut(_slot, _page);
|
||||||
player.deleteShortCut(_slot, _page);
|
player.deleteShortCut(_slot, _page);
|
||||||
boolean removed = true;
|
|
||||||
|
|
||||||
// Keep other similar shortcuts activated.
|
if (oldShortcut != null)
|
||||||
if ((oldShortcut != null) && oldShortcut.isAutoUse())
|
|
||||||
{
|
{
|
||||||
player.removeAutoShortcut(_slot, _page);
|
boolean removed = true;
|
||||||
for (Shortcut shortcut : player.getAllShortCuts())
|
|
||||||
|
// Keep other similar shortcuts activated.
|
||||||
|
if (oldShortcut.isAutoUse())
|
||||||
{
|
{
|
||||||
if (oldShortcut.getId() == shortcut.getId())
|
player.removeAutoShortcut(_slot, _page);
|
||||||
|
for (Shortcut shortcut : player.getAllShortCuts())
|
||||||
{
|
{
|
||||||
player.addAutoShortcut(shortcut.getSlot(), shortcut.getPage());
|
if ((oldShortcut.getId() == shortcut.getId()) && (oldShortcut.getType() == shortcut.getType()))
|
||||||
removed = false;
|
{
|
||||||
|
player.addAutoShortcut(shortcut.getSlot(), shortcut.getPage());
|
||||||
|
removed = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Remove auto used ids.
|
||||||
// Remove auto used ids.
|
if (removed)
|
||||||
if (removed)
|
|
||||||
{
|
|
||||||
final int id = oldShortcut == null ? -1 : oldShortcut.getId();
|
|
||||||
if (_slot > 263)
|
|
||||||
{
|
{
|
||||||
AutoUseTaskManager.getInstance().removeAutoSupplyItem(player, id);
|
switch (oldShortcut.getType())
|
||||||
}
|
{
|
||||||
else
|
case SKILL:
|
||||||
{
|
{
|
||||||
AutoUseTaskManager.getInstance().removeAutoBuff(player, id);
|
AutoUseTaskManager.getInstance().removeAutoBuff(player, oldShortcut.getId());
|
||||||
AutoUseTaskManager.getInstance().removeAutoSkill(player, id);
|
AutoUseTaskManager.getInstance().removeAutoSkill(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ITEM:
|
||||||
|
{
|
||||||
|
AutoUseTaskManager.getInstance().removeAutoSupplyItem(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ACTION:
|
||||||
|
{
|
||||||
|
AutoUseTaskManager.getInstance().removeAutoAction(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,16 +93,13 @@ public class RequestShortCutReg implements IClientIncomingPacket
|
|||||||
// Activate if any other similar shortcut is activated.
|
// Activate if any other similar shortcut is activated.
|
||||||
for (Shortcut shortcut : player.getAllShortCuts())
|
for (Shortcut shortcut : player.getAllShortCuts())
|
||||||
{
|
{
|
||||||
if (!shortcut.isAutoUse() || (shortcut.getType() != _type))
|
if (!shortcut.isAutoUse() || (shortcut.getId() != _id) || (shortcut.getType() != _type))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_id == shortcut.getId())
|
player.addAutoShortcut(_slot, _page);
|
||||||
{
|
break;
|
||||||
player.addAutoShortcut(_slot, _page);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,34 +57,47 @@ public class RequestShortCutDel implements IClientIncomingPacket
|
|||||||
// Delete the shortcut.
|
// Delete the shortcut.
|
||||||
final Shortcut oldShortcut = player.getShortCut(_slot, _page);
|
final Shortcut oldShortcut = player.getShortCut(_slot, _page);
|
||||||
player.deleteShortCut(_slot, _page);
|
player.deleteShortCut(_slot, _page);
|
||||||
boolean removed = true;
|
|
||||||
|
|
||||||
// Keep other similar shortcuts activated.
|
if (oldShortcut != null)
|
||||||
if ((oldShortcut != null) && oldShortcut.isAutoUse())
|
|
||||||
{
|
{
|
||||||
player.removeAutoShortcut(_slot, _page);
|
boolean removed = true;
|
||||||
for (Shortcut shortcut : player.getAllShortCuts())
|
|
||||||
|
// Keep other similar shortcuts activated.
|
||||||
|
if (oldShortcut.isAutoUse())
|
||||||
{
|
{
|
||||||
if (oldShortcut.getId() == shortcut.getId())
|
player.removeAutoShortcut(_slot, _page);
|
||||||
|
for (Shortcut shortcut : player.getAllShortCuts())
|
||||||
{
|
{
|
||||||
player.addAutoShortcut(shortcut.getSlot(), shortcut.getPage());
|
if ((oldShortcut.getId() == shortcut.getId()) && (oldShortcut.getType() == shortcut.getType()))
|
||||||
removed = false;
|
{
|
||||||
|
player.addAutoShortcut(shortcut.getSlot(), shortcut.getPage());
|
||||||
|
removed = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Remove auto used ids.
|
||||||
// Remove auto used ids.
|
if (removed)
|
||||||
if (removed)
|
|
||||||
{
|
|
||||||
final int id = oldShortcut == null ? -1 : oldShortcut.getId();
|
|
||||||
if (_slot > 263)
|
|
||||||
{
|
{
|
||||||
AutoUseTaskManager.getInstance().removeAutoSupplyItem(player, id);
|
switch (oldShortcut.getType())
|
||||||
}
|
{
|
||||||
else
|
case SKILL:
|
||||||
{
|
{
|
||||||
AutoUseTaskManager.getInstance().removeAutoBuff(player, id);
|
AutoUseTaskManager.getInstance().removeAutoBuff(player, oldShortcut.getId());
|
||||||
AutoUseTaskManager.getInstance().removeAutoSkill(player, id);
|
AutoUseTaskManager.getInstance().removeAutoSkill(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ITEM:
|
||||||
|
{
|
||||||
|
AutoUseTaskManager.getInstance().removeAutoSupplyItem(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ACTION:
|
||||||
|
{
|
||||||
|
AutoUseTaskManager.getInstance().removeAutoAction(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,16 +93,13 @@ public class RequestShortCutReg implements IClientIncomingPacket
|
|||||||
// Activate if any other similar shortcut is activated.
|
// Activate if any other similar shortcut is activated.
|
||||||
for (Shortcut shortcut : player.getAllShortCuts())
|
for (Shortcut shortcut : player.getAllShortCuts())
|
||||||
{
|
{
|
||||||
if (!shortcut.isAutoUse() || (shortcut.getType() != _type))
|
if (!shortcut.isAutoUse() || (shortcut.getId() != _id) || (shortcut.getType() != _type))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_id == shortcut.getId())
|
player.addAutoShortcut(_slot, _page);
|
||||||
{
|
break;
|
||||||
player.addAutoShortcut(_slot, _page);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,34 +57,47 @@ public class RequestShortCutDel implements IClientIncomingPacket
|
|||||||
// Delete the shortcut.
|
// Delete the shortcut.
|
||||||
final Shortcut oldShortcut = player.getShortCut(_slot, _page);
|
final Shortcut oldShortcut = player.getShortCut(_slot, _page);
|
||||||
player.deleteShortCut(_slot, _page);
|
player.deleteShortCut(_slot, _page);
|
||||||
boolean removed = true;
|
|
||||||
|
|
||||||
// Keep other similar shortcuts activated.
|
if (oldShortcut != null)
|
||||||
if ((oldShortcut != null) && oldShortcut.isAutoUse())
|
|
||||||
{
|
{
|
||||||
player.removeAutoShortcut(_slot, _page);
|
boolean removed = true;
|
||||||
for (Shortcut shortcut : player.getAllShortCuts())
|
|
||||||
|
// Keep other similar shortcuts activated.
|
||||||
|
if (oldShortcut.isAutoUse())
|
||||||
{
|
{
|
||||||
if (oldShortcut.getId() == shortcut.getId())
|
player.removeAutoShortcut(_slot, _page);
|
||||||
|
for (Shortcut shortcut : player.getAllShortCuts())
|
||||||
{
|
{
|
||||||
player.addAutoShortcut(shortcut.getSlot(), shortcut.getPage());
|
if ((oldShortcut.getId() == shortcut.getId()) && (oldShortcut.getType() == shortcut.getType()))
|
||||||
removed = false;
|
{
|
||||||
|
player.addAutoShortcut(shortcut.getSlot(), shortcut.getPage());
|
||||||
|
removed = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Remove auto used ids.
|
||||||
// Remove auto used ids.
|
if (removed)
|
||||||
if (removed)
|
|
||||||
{
|
|
||||||
final int id = oldShortcut == null ? -1 : oldShortcut.getId();
|
|
||||||
if (_slot > 263)
|
|
||||||
{
|
{
|
||||||
AutoUseTaskManager.getInstance().removeAutoSupplyItem(player, id);
|
switch (oldShortcut.getType())
|
||||||
}
|
{
|
||||||
else
|
case SKILL:
|
||||||
{
|
{
|
||||||
AutoUseTaskManager.getInstance().removeAutoBuff(player, id);
|
AutoUseTaskManager.getInstance().removeAutoBuff(player, oldShortcut.getId());
|
||||||
AutoUseTaskManager.getInstance().removeAutoSkill(player, id);
|
AutoUseTaskManager.getInstance().removeAutoSkill(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ITEM:
|
||||||
|
{
|
||||||
|
AutoUseTaskManager.getInstance().removeAutoSupplyItem(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ACTION:
|
||||||
|
{
|
||||||
|
AutoUseTaskManager.getInstance().removeAutoAction(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,16 +93,13 @@ public class RequestShortCutReg implements IClientIncomingPacket
|
|||||||
// Activate if any other similar shortcut is activated.
|
// Activate if any other similar shortcut is activated.
|
||||||
for (Shortcut shortcut : player.getAllShortCuts())
|
for (Shortcut shortcut : player.getAllShortCuts())
|
||||||
{
|
{
|
||||||
if (!shortcut.isAutoUse() || (shortcut.getType() != _type))
|
if (!shortcut.isAutoUse() || (shortcut.getId() != _id) || (shortcut.getType() != _type))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_id == shortcut.getId())
|
player.addAutoShortcut(_slot, _page);
|
||||||
{
|
break;
|
||||||
player.addAutoShortcut(_slot, _page);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,34 +57,47 @@ public class RequestShortCutDel implements IClientIncomingPacket
|
|||||||
// Delete the shortcut.
|
// Delete the shortcut.
|
||||||
final Shortcut oldShortcut = player.getShortCut(_slot, _page);
|
final Shortcut oldShortcut = player.getShortCut(_slot, _page);
|
||||||
player.deleteShortCut(_slot, _page);
|
player.deleteShortCut(_slot, _page);
|
||||||
boolean removed = true;
|
|
||||||
|
|
||||||
// Keep other similar shortcuts activated.
|
if (oldShortcut != null)
|
||||||
if ((oldShortcut != null) && oldShortcut.isAutoUse())
|
|
||||||
{
|
{
|
||||||
player.removeAutoShortcut(_slot, _page);
|
boolean removed = true;
|
||||||
for (Shortcut shortcut : player.getAllShortCuts())
|
|
||||||
|
// Keep other similar shortcuts activated.
|
||||||
|
if (oldShortcut.isAutoUse())
|
||||||
{
|
{
|
||||||
if (oldShortcut.getId() == shortcut.getId())
|
player.removeAutoShortcut(_slot, _page);
|
||||||
|
for (Shortcut shortcut : player.getAllShortCuts())
|
||||||
{
|
{
|
||||||
player.addAutoShortcut(shortcut.getSlot(), shortcut.getPage());
|
if ((oldShortcut.getId() == shortcut.getId()) && (oldShortcut.getType() == shortcut.getType()))
|
||||||
removed = false;
|
{
|
||||||
|
player.addAutoShortcut(shortcut.getSlot(), shortcut.getPage());
|
||||||
|
removed = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Remove auto used ids.
|
||||||
// Remove auto used ids.
|
if (removed)
|
||||||
if (removed)
|
|
||||||
{
|
|
||||||
final int id = oldShortcut == null ? -1 : oldShortcut.getId();
|
|
||||||
if (_slot > 263)
|
|
||||||
{
|
{
|
||||||
AutoUseTaskManager.getInstance().removeAutoSupplyItem(player, id);
|
switch (oldShortcut.getType())
|
||||||
}
|
{
|
||||||
else
|
case SKILL:
|
||||||
{
|
{
|
||||||
AutoUseTaskManager.getInstance().removeAutoBuff(player, id);
|
AutoUseTaskManager.getInstance().removeAutoBuff(player, oldShortcut.getId());
|
||||||
AutoUseTaskManager.getInstance().removeAutoSkill(player, id);
|
AutoUseTaskManager.getInstance().removeAutoSkill(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ITEM:
|
||||||
|
{
|
||||||
|
AutoUseTaskManager.getInstance().removeAutoSupplyItem(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ACTION:
|
||||||
|
{
|
||||||
|
AutoUseTaskManager.getInstance().removeAutoAction(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,16 +93,13 @@ public class RequestShortCutReg implements IClientIncomingPacket
|
|||||||
// Activate if any other similar shortcut is activated.
|
// Activate if any other similar shortcut is activated.
|
||||||
for (Shortcut shortcut : player.getAllShortCuts())
|
for (Shortcut shortcut : player.getAllShortCuts())
|
||||||
{
|
{
|
||||||
if (!shortcut.isAutoUse() || (shortcut.getType() != _type))
|
if (!shortcut.isAutoUse() || (shortcut.getId() != _id) || (shortcut.getType() != _type))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_id == shortcut.getId())
|
player.addAutoShortcut(_slot, _page);
|
||||||
{
|
break;
|
||||||
player.addAutoShortcut(_slot, _page);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,34 +57,47 @@ public class RequestShortCutDel implements IClientIncomingPacket
|
|||||||
// Delete the shortcut.
|
// Delete the shortcut.
|
||||||
final Shortcut oldShortcut = player.getShortCut(_slot, _page);
|
final Shortcut oldShortcut = player.getShortCut(_slot, _page);
|
||||||
player.deleteShortCut(_slot, _page);
|
player.deleteShortCut(_slot, _page);
|
||||||
boolean removed = true;
|
|
||||||
|
|
||||||
// Keep other similar shortcuts activated.
|
if (oldShortcut != null)
|
||||||
if ((oldShortcut != null) && oldShortcut.isAutoUse())
|
|
||||||
{
|
{
|
||||||
player.removeAutoShortcut(_slot, _page);
|
boolean removed = true;
|
||||||
for (Shortcut shortcut : player.getAllShortCuts())
|
|
||||||
|
// Keep other similar shortcuts activated.
|
||||||
|
if (oldShortcut.isAutoUse())
|
||||||
{
|
{
|
||||||
if (oldShortcut.getId() == shortcut.getId())
|
player.removeAutoShortcut(_slot, _page);
|
||||||
|
for (Shortcut shortcut : player.getAllShortCuts())
|
||||||
{
|
{
|
||||||
player.addAutoShortcut(shortcut.getSlot(), shortcut.getPage());
|
if ((oldShortcut.getId() == shortcut.getId()) && (oldShortcut.getType() == shortcut.getType()))
|
||||||
removed = false;
|
{
|
||||||
|
player.addAutoShortcut(shortcut.getSlot(), shortcut.getPage());
|
||||||
|
removed = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Remove auto used ids.
|
||||||
// Remove auto used ids.
|
if (removed)
|
||||||
if (removed)
|
|
||||||
{
|
|
||||||
final int id = oldShortcut == null ? -1 : oldShortcut.getId();
|
|
||||||
if (_slot > 263)
|
|
||||||
{
|
{
|
||||||
AutoUseTaskManager.getInstance().removeAutoSupplyItem(player, id);
|
switch (oldShortcut.getType())
|
||||||
}
|
{
|
||||||
else
|
case SKILL:
|
||||||
{
|
{
|
||||||
AutoUseTaskManager.getInstance().removeAutoBuff(player, id);
|
AutoUseTaskManager.getInstance().removeAutoBuff(player, oldShortcut.getId());
|
||||||
AutoUseTaskManager.getInstance().removeAutoSkill(player, id);
|
AutoUseTaskManager.getInstance().removeAutoSkill(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ITEM:
|
||||||
|
{
|
||||||
|
AutoUseTaskManager.getInstance().removeAutoSupplyItem(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ACTION:
|
||||||
|
{
|
||||||
|
AutoUseTaskManager.getInstance().removeAutoAction(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,16 +93,13 @@ public class RequestShortCutReg implements IClientIncomingPacket
|
|||||||
// Activate if any other similar shortcut is activated.
|
// Activate if any other similar shortcut is activated.
|
||||||
for (Shortcut shortcut : player.getAllShortCuts())
|
for (Shortcut shortcut : player.getAllShortCuts())
|
||||||
{
|
{
|
||||||
if (!shortcut.isAutoUse() || (shortcut.getType() != _type))
|
if (!shortcut.isAutoUse() || (shortcut.getId() != _id) || (shortcut.getType() != _type))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_id == shortcut.getId())
|
player.addAutoShortcut(_slot, _page);
|
||||||
{
|
break;
|
||||||
player.addAutoShortcut(_slot, _page);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,34 +57,47 @@ public class RequestShortCutDel implements IClientIncomingPacket
|
|||||||
// Delete the shortcut.
|
// Delete the shortcut.
|
||||||
final Shortcut oldShortcut = player.getShortCut(_slot, _page);
|
final Shortcut oldShortcut = player.getShortCut(_slot, _page);
|
||||||
player.deleteShortCut(_slot, _page);
|
player.deleteShortCut(_slot, _page);
|
||||||
boolean removed = true;
|
|
||||||
|
|
||||||
// Keep other similar shortcuts activated.
|
if (oldShortcut != null)
|
||||||
if ((oldShortcut != null) && oldShortcut.isAutoUse())
|
|
||||||
{
|
{
|
||||||
player.removeAutoShortcut(_slot, _page);
|
boolean removed = true;
|
||||||
for (Shortcut shortcut : player.getAllShortCuts())
|
|
||||||
|
// Keep other similar shortcuts activated.
|
||||||
|
if (oldShortcut.isAutoUse())
|
||||||
{
|
{
|
||||||
if (oldShortcut.getId() == shortcut.getId())
|
player.removeAutoShortcut(_slot, _page);
|
||||||
|
for (Shortcut shortcut : player.getAllShortCuts())
|
||||||
{
|
{
|
||||||
player.addAutoShortcut(shortcut.getSlot(), shortcut.getPage());
|
if ((oldShortcut.getId() == shortcut.getId()) && (oldShortcut.getType() == shortcut.getType()))
|
||||||
removed = false;
|
{
|
||||||
|
player.addAutoShortcut(shortcut.getSlot(), shortcut.getPage());
|
||||||
|
removed = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Remove auto used ids.
|
||||||
// Remove auto used ids.
|
if (removed)
|
||||||
if (removed)
|
|
||||||
{
|
|
||||||
final int id = oldShortcut == null ? -1 : oldShortcut.getId();
|
|
||||||
if (_slot > 263)
|
|
||||||
{
|
{
|
||||||
AutoUseTaskManager.getInstance().removeAutoSupplyItem(player, id);
|
switch (oldShortcut.getType())
|
||||||
}
|
{
|
||||||
else
|
case SKILL:
|
||||||
{
|
{
|
||||||
AutoUseTaskManager.getInstance().removeAutoBuff(player, id);
|
AutoUseTaskManager.getInstance().removeAutoBuff(player, oldShortcut.getId());
|
||||||
AutoUseTaskManager.getInstance().removeAutoSkill(player, id);
|
AutoUseTaskManager.getInstance().removeAutoSkill(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ITEM:
|
||||||
|
{
|
||||||
|
AutoUseTaskManager.getInstance().removeAutoSupplyItem(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ACTION:
|
||||||
|
{
|
||||||
|
AutoUseTaskManager.getInstance().removeAutoAction(player, oldShortcut.getId());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,16 +93,13 @@ public class RequestShortCutReg implements IClientIncomingPacket
|
|||||||
// Activate if any other similar shortcut is activated.
|
// Activate if any other similar shortcut is activated.
|
||||||
for (Shortcut shortcut : player.getAllShortCuts())
|
for (Shortcut shortcut : player.getAllShortCuts())
|
||||||
{
|
{
|
||||||
if (!shortcut.isAutoUse() || (shortcut.getType() != _type))
|
if (!shortcut.isAutoUse() || (shortcut.getId() != _id) || (shortcut.getType() != _type))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_id == shortcut.getId())
|
player.addAutoShortcut(_slot, _page);
|
||||||
{
|
break;
|
||||||
player.addAutoShortcut(_slot, _page);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user