*/
public BagDialog(ArrayList<PlayerItem> bag) {
m_items = new ArrayList<PlayerItem>();
//Assign Potion Fave
if(GameClient.getInstance().getOurPlayer().getItemQuantity(4)>0){
m_items.add(new PlayerItem(4,GameClient.getInstance().getOurPlayer().getItemQuantity(4)));
}else if(GameClient.getInstance().getOurPlayer().getItemQuantity(3)>0){
m_items.add(new PlayerItem(3,GameClient.getInstance().getOurPlayer().getItemQuantity(3)));
}else if(GameClient.getInstance().getOurPlayer().getItemQuantity(2)>0){
m_items.add(new PlayerItem(2,GameClient.getInstance().getOurPlayer().getItemQuantity(2)));
}else {
m_items.add(new PlayerItem(1,GameClient.getInstance().getOurPlayer().getItemQuantity(1)));
}
//Assign Antidote Fave
if(GameClient.getInstance().getOurPlayer().getItemQuantity(5)>0){
m_items.add(new PlayerItem(5,GameClient.getInstance().getOurPlayer().getItemQuantity(5)));
}else if(GameClient.getInstance().getOurPlayer().getItemQuantity(21)>0){
m_items.add(new PlayerItem(21,GameClient.getInstance().getOurPlayer().getItemQuantity(21)));
}else {
m_items.add(new PlayerItem(16,GameClient.getInstance().getOurPlayer().getItemQuantity(16)));
}
//Assign Repel Fave
if(GameClient.getInstance().getOurPlayer().getItemQuantity(87)>0){
m_items.add(new PlayerItem(87,GameClient.getInstance().getOurPlayer().getItemQuantity(87)));
}else if(GameClient.getInstance().getOurPlayer().getItemQuantity(86)>0){
m_items.add(new PlayerItem(86,GameClient.getInstance().getOurPlayer().getItemQuantity(86)));
}else {
m_items.add(new PlayerItem(85,GameClient.getInstance().getOurPlayer().getItemQuantity(85)));
}
//Assign EscapeRope Fave
m_items.add(new PlayerItem(91,GameClient.getInstance().getOurPlayer().getItemQuantity(91)));
//Assign PokeBall Fave
if(GameClient.getInstance().getOurPlayer().getItemQuantity(38)>0){
m_items.add(new PlayerItem(38,GameClient.getInstance().getOurPlayer().getItemQuantity(38)));
}else if(GameClient.getInstance().getOurPlayer().getItemQuantity(37)>0){
m_items.add(new PlayerItem(37,GameClient.getInstance().getOurPlayer().getItemQuantity(37)));
}else if(GameClient.getInstance().getOurPlayer().getItemQuantity(36)>0){
m_items.add(new PlayerItem(36,GameClient.getInstance().getOurPlayer().getItemQuantity(36)));
}else {
m_items.add(new PlayerItem(35,GameClient.getInstance().getOurPlayer().getItemQuantity(35)));
}
initGUI();
}