Crossfire JXClient, Trunk
PlayerLoginSkinEvent.java
Go to the documentation of this file.
1 /*
2  * This file is part of JXClient, the Fullscreen Java Crossfire Client.
3  *
4  * JXClient is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * JXClient is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with JXClient; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * Copyright (C) 2005-2008 Yann Chachkoff
19  * Copyright (C) 2006-2017,2019-2023 Andreas Kirschbaum
20  * Copyright (C) 2010-2012,2014-2018,2020-2023 Nicolas Weeger
21  */
22 
23 package com.realtime.crossfire.jxclient.skin.events;
24 
29 import org.jetbrains.annotations.NotNull;
30 import org.jetbrains.annotations.Nullable;
31 
36 public class PlayerLoginSkinEvent implements SkinEvent {
37 
42  private final boolean login;
43 
47  @NotNull
48  private final CommandList commandList;
49 
53  @NotNull
54  private final ItemSet itemSet;
55 
59  @NotNull
61 
62  @Override
63  public void playerChanged(@Nullable final CfItem player) {
64  //noinspection VariableNotUsedInsideIf
65  if (player == null) {
66  if (!login) {
68  }
69  } else {
70  if (login) {
72  }
73  }
74  }
75 
76  @Override
77  public void openContainerChanged(final int tag) {
78  // ignore
79  }
80 
81  };
82 
90  public PlayerLoginSkinEvent(final boolean login, @NotNull final CommandList commandList, @NotNull final ItemSet itemSet) {
91  this.login = login;
92  this.commandList = commandList;
93  this.itemSet = itemSet;
94  this.itemSet.addItemSetListener(itemSetListener);
95  }
96 
97  @Override
98  public void dispose() {
100  }
101 
102 }
com.realtime.crossfire.jxclient
com.realtime.crossfire.jxclient.gui.commandlist.CommandList
Definition: CommandList.java:34
com.realtime.crossfire.jxclient.skin.events.PlayerLoginSkinEvent.commandList
final CommandList commandList
Definition: PlayerLoginSkinEvent.java:48
com.realtime.crossfire.jxclient.skin.events.PlayerLoginSkinEvent.login
final boolean login
Definition: PlayerLoginSkinEvent.java:42
com.realtime.crossfire.jxclient.skin.events.PlayerLoginSkinEvent
Definition: PlayerLoginSkinEvent.java:36
com.realtime.crossfire.jxclient.skin.events.PlayerLoginSkinEvent.dispose
void dispose()
Definition: PlayerLoginSkinEvent.java:98
com.realtime.crossfire.jxclient.items.ItemSet
Definition: ItemSet.java:44
com.realtime.crossfire.jxclient.gui.commandlist
Definition: CommandList.java:23
com.realtime.crossfire.jxclient.gui
com.realtime.crossfire.jxclient.items.CfItem
Definition: CfItem.java:37
com.realtime.crossfire.jxclient.gui.commandlist.CommandList.execute
void execute()
Definition: CommandList.java:99
com.realtime.crossfire.jxclient.skin.events.PlayerLoginSkinEvent.PlayerLoginSkinEvent
PlayerLoginSkinEvent(final boolean login, @NotNull final CommandList commandList, @NotNull final ItemSet itemSet)
Definition: PlayerLoginSkinEvent.java:90
com.realtime.crossfire.jxclient.skin.events.SkinEvent
Definition: SkinEvent.java:29
com.realtime.crossfire.jxclient.items.ItemSet.removeItemSetListener
void removeItemSetListener(@NotNull final ItemSetListener listener)
Definition: ItemSet.java:103
com.realtime.crossfire
com.realtime
com
com.realtime.crossfire.jxclient.items.ItemSet.addItemSetListener
void addItemSetListener(@NotNull final ItemSetListener listener)
Definition: ItemSet.java:95
com.realtime.crossfire.jxclient.items
Definition: AbstractItemView.java:23
com.realtime.crossfire.jxclient.items.ItemSetListener
Definition: ItemSetListener.java:32
com.realtime.crossfire.jxclient.skin.events.PlayerLoginSkinEvent.itemSetListener
final ItemSetListener itemSetListener
Definition: PlayerLoginSkinEvent.java:60
com.realtime.crossfire.jxclient.skin.events.PlayerLoginSkinEvent.itemSet
final ItemSet itemSet
Definition: PlayerLoginSkinEvent.java:54