Skip to content

Commit

Permalink
fix update color on stock table
Browse files Browse the repository at this point in the history
  • Loading branch information
nicol authored and nicol committed Nov 18, 2024
1 parent d1f2c6b commit 1b59082
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
8 changes: 6 additions & 2 deletions src/main/java/org/magic/api/beans/enums/EnumCondition.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,14 @@ public ImageIcon getIcon()
@Override
public synchronized void paintIcon(Component c, Graphics g, int x, int y) {
Graphics2D g2 = (Graphics2D) g;
Ellipse2D.Double circle = new Ellipse2D.Double(0, 0, MTGConstants.TABLE_ROW_HEIGHT, MTGConstants.TABLE_ROW_HEIGHT);

Ellipse2D.Double circle = new Ellipse2D.Double(0, 0, MTGConstants.TABLE_ROW_HEIGHT-2, MTGConstants.TABLE_ROW_HEIGHT-2);
g2.setColor(getColor());
g2.fill(circle);

g2.setColor(Color.black);
g2.draw(circle);


}
};
}
Expand Down
12 changes: 3 additions & 9 deletions src/main/java/org/magic/gui/renderer/StockTableRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.magic.services.MTGConstants;
import org.magic.services.PluginRegistry;
import org.magic.services.tools.ImageTools;
import org.magic.services.tools.UITools;

public class StockTableRenderer implements TableCellRenderer{

Expand Down Expand Up @@ -90,15 +91,8 @@ else if(value instanceof MTGCollection c)
}


if(value==null)
return pane;





if (((MTGStockItem) table.getModel().getValueAt(row, 0)).isUpdated()) {
pane.setBackground(Color.GREEN);
if (((MTGStockItem) UITools.getModelValueAt(table, row, 0)).isUpdated()) {
pane.setBackground(MTGConstants.COLOR_UPDATE);
pane.setForeground(table.getForeground());
} else if (isSelected) {
pane.setBackground(table.getSelectionBackground());
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/magic/services/MTGConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public static String[] getDefaultCollectionsNames() {
public static final Color COLLECTION_90PC = new Color(188, 245, 169);
public static final Color COLLECTION_50PC = Color.ORANGE;
public static final Color COLLECTION_1PC = Color.YELLOW;

public static final Color COLOR_UPDATE = new Color(0, 220, 0);

//IMAGES CONSTANTS
public static final URL URL_MANA_SYMBOLS = MTGConstants.class.getResource(ICON_DIR+"/mana/Mana.png");
Expand Down Expand Up @@ -326,6 +326,7 @@ public static ImageIcon getIconFor(Class<?> c) {
//EnumExtra CONSTANTS
public static final float WEIGHT_BOOSTER=28.7f;




}
19 changes: 18 additions & 1 deletion src/main/resources/data/boosters.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2753,20 +2753,37 @@
<starter lang="en" num="1" extra="play" url="https://www.dicearcade.com.au/assets/full/D36310000.png"/>
<bundle lang="en" num="1" url="https://www.trader-online.de/out/pictures/master/product/1/foundations_beginner_box_englisch_english_guenstig_billig_kaufen_tcg_mtg_fnd.png" desc="beginner box"/>
<bundle lang="en" num="2" url="https://www.dicearcade.com.au/assets/full/D36350000.png"/>

</edition>

<edition id="J25">
<set lang="en" num="1" url="https://i0.wp.com/mtgazone.com/wp-content/uploads/2024/06/MTG-Foundations.png"/>
<booster lang="en" num="1" extra="jump" url="https://www.laribouldingue.ca/cdn/shop/files/MTGFND_EN_Bstr_Jmp_01_02_500x909.png"/>
<box lang="en" num="1" extra="jump" url="https://www.trader-online.de/out/pictures/master/product/1/foundations_jumpstart_booster_display_englisch_english_guenstig_billig_kaufen_tcg_mtg_fnd.png"/>
</edition>



<edition id="DSC">
<set lang="en" num="1" url="https://media.wizards.com/2024/images/daily/en_CAZrDSqF06WE.png"/>
<constructpack lang="en" num="1" url="https://media.wizards.com/2024/images/daily/en_kV0Ofw2mowjQ.png" desc="Miracle Worker"/>
<constructpack lang="en" num="2" url="https://media.wizards.com/2024/images/daily/en_1VVqeQqmIePr.png" desc="Death Toll"/>
<constructpack lang="en" num="3" url="https://media.wizards.com/2024/images/daily/en_GITpwsK7Abc4.png" desc="Jump Scare !"/>
<constructpack lang="en" num="4" url="https://media.wizards.com/2024/images/daily/en_QaJPChLUiLcR.png" desc="Endless Punishment"/>
</edition>

<edition id="MB2">
<set lang="en" num="1" url="https://images.ctfassets.net/s5n2t79q9icq/XOdITHsd94w7A69iHonLj/01fdae0320319c82db8df7cf28c63ed4/LOGO.png"/>
<box lang="en" num="1" extra="draft" url="https://media.wizards.com/2024/images/daily/nA12WtuPo.png"/>
<booster lang="en" num="1" extra="draft" url="https://media.wizards.com/2024/images/daily/qwer12BX23.png"/>
</edition>

<edition id="DFT">
<set lang="en" num="1" url="https://images.ctfassets.net/s5n2t79q9icq/1s8ocS6wdQICyC0raPWdO4/3fec32f79f88853904a44cfc4d5ddc4c/dSeihHhY6478009Lk_EN.png"/>
</edition>

<edition id="INR">
<set lang="en" num="1" url="https://images.ctfassets.net/s5n2t79q9icq/7358s8yvDA4PVKlRPhDzVz/6ec17ac8b7952687fb257a90145f5ae7/Lduih34879dgkj-600x380_EN.png"/>
</edition>


</boosterUrls>

0 comments on commit 1b59082

Please sign in to comment.