use of delta.games.lotro.character.CharacterEquipment in project lotro-companion by dmorcellet.
the class MainTestStashWindow method main.
/**
* Basic main method for test.
* @param args Not used.
*/
public static void main(String[] args) {
LotroTestUtils utils = new LotroTestUtils();
CharacterFile toon = utils.getMainToon();
// Copy gear to stash
ItemsStash stash = toon.getStash();
CharacterData data = toon.getInfosManager().getLastCharacterDescription();
CharacterEquipment gear = data.getEquipment();
for (EQUIMENT_SLOT slot : EQUIMENT_SLOT.values()) {
Item item = gear.getItemForSlot(slot);
if (item != null) {
Item clone = ItemFactory.clone(item);
stash.addItem(clone);
}
}
StashWindowController controller = new StashWindowController(toon);
controller.show();
}
use of delta.games.lotro.character.CharacterEquipment in project lotro-companion by dmorcellet.
the class AllEssencesEditionPanelController method initEditors.
private void initEditors() {
CharacterEquipment equipment = _toon.getEquipment();
for (EQUIMENT_SLOT slot : EQUIMENT_SLOT.values()) {
SingleItemEssencesEditionController controller = new SingleItemEssencesEditionController(_parent, slot);
Item item = equipment.getItemForSlot(slot);
controller.setItem(item);
_editors.add(controller);
}
}
use of delta.games.lotro.character.CharacterEquipment in project lotro-companion by dmorcellet.
the class EquipmentPanelController method handleCopyToStash.
private void handleCopyToStash(EQUIMENT_SLOT slot) {
CharacterEquipment equipment = _toonData.getEquipment();
SlotContents contents = equipment.getSlotContents(slot, false);
if (contents != null) {
Item item = contents.getItem();
if (item != null) {
ItemsStash stash = _toon.getStash();
Item newItem = ItemFactory.clone(item);
stash.addItem(newItem);
Integer stashId = newItem.getStashIdentifier();
item.setStashIdentifier(stashId);
_toon.saveStash();
// Broadcast stash update event...
CharacterEvent event = new CharacterEvent(CharacterEventType.CHARACTER_STASH_UPDATED, _toon, null);
EventsManager.invokeEvent(event);
}
}
}
use of delta.games.lotro.character.CharacterEquipment in project lotro-companion by dmorcellet.
the class EquipmentPanelController method handleRemoveItem.
private void handleRemoveItem(EQUIMENT_SLOT slot) {
CharacterEquipment equipment = _toonData.getEquipment();
SlotContents contents = equipment.getSlotContents(slot, false);
if (contents != null) {
contents.setItem(null);
contents.setItemId(null);
}
refreshToon();
}
use of delta.games.lotro.character.CharacterEquipment in project lotro-companion by dmorcellet.
the class EquipmentPanelController method getItemForSlot.
private Item getItemForSlot(EQUIMENT_SLOT slot) {
CharacterEquipment equipment = _toonData.getEquipment();
Item item = equipment.getItemForSlot(slot);
return item;
}
Aggregations