Skip to content

Commit

Permalink
fix search message
Browse files Browse the repository at this point in the history
  • Loading branch information
nicol authored and nicol committed Sep 18, 2023
1 parent 5ebde11 commit 4cc2b89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public class SearchMessage extends AbstractMessage {

public SearchMessage(MTGProduct item) {
this.item=item;
setMessage("search "+ item);
setTypeMessage(MSG_TYPE.SEARCH);
setMessage("I'm searching "+ item);
}

public MTGProduct getItem() {
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/org/magic/gui/components/NetworkChatPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
import org.magic.api.beans.messages.StatutMessage;
import org.magic.api.beans.messages.TalkMessage;
import org.magic.api.beans.messages.TechMessageUsers;
import org.magic.api.interfaces.MTGCardsProvider;
import org.magic.api.interfaces.MTGNetworkClient;
import org.magic.game.model.Player;
import org.magic.game.model.Player.STATUS;
import org.magic.gui.abstracts.MTGUIComponent;
import org.magic.gui.components.dialog.CardSearchImportDialog;
import org.magic.gui.components.widgets.JLangLabel;
import org.magic.gui.renderer.JsonMessageRenderer;
import org.magic.gui.renderer.PlayerRenderer;
Expand Down Expand Up @@ -298,8 +298,9 @@ public void keyReleased(java.awt.event.KeyEvent e) {

btnSearch.addActionListener(al->{
try {
var mc = MTG.getEnabledPlugin(MTGCardsProvider.class).searchCardByName(editorPane.getText().trim(), null, false).get(0);
var msg = new SearchMessage(mc);
var diag = new CardSearchImportDialog();
diag.setVisible(true);
var msg = new SearchMessage(diag.getSelected());
client.sendMessage(msg);
} catch (IOException e1) {
logger.error(e1);
Expand Down

0 comments on commit 4cc2b89

Please sign in to comment.