-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
新增:设置炫彩皮肤(没有原皮肤但有炫彩皮肤的情况下,此功能可以突破游戏限制)
- Loading branch information
Showing
12 changed files
with
208 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ public class ChampionBO { | |
/** | ||
* 英雄id | ||
*/ | ||
private int id; | ||
private Integer id; | ||
/** | ||
* 英雄中文名 | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package yalong.site.bo; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
|
||
/** | ||
* @author yalong | ||
*/ | ||
@Data | ||
@AllArgsConstructor | ||
public class SkinBO { | ||
|
||
/** | ||
* 皮肤id | ||
*/ | ||
private Integer id; | ||
/** | ||
* 皮肤中文名 | ||
*/ | ||
private String name; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/main/java/yalong/site/frame/panel/client/PickSkinBox.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package yalong.site.frame.panel.client; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import yalong.site.cache.FrameCache; | ||
import yalong.site.cache.FrameInnerCache; | ||
import yalong.site.cache.GameDataCache; | ||
import yalong.site.frame.bo.ComponentBO; | ||
import yalong.site.frame.bo.ItemBO; | ||
import yalong.site.frame.panel.base.BaseComboBox; | ||
|
||
import java.awt.*; | ||
import java.awt.event.ItemEvent; | ||
import java.awt.event.ItemListener; | ||
|
||
/** | ||
* @author yaLong | ||
*/ | ||
@Slf4j | ||
public class PickSkinBox extends BaseComboBox<ItemBO> { | ||
|
||
public PickSkinBox() { | ||
this.addItem(new ItemBO(null, "选择皮肤")); | ||
this.addItemListener(listener()); | ||
} | ||
|
||
/** | ||
* @return 带布局的盒子 | ||
*/ | ||
public static ComponentBO builder() { | ||
PickSkinBox box = new PickSkinBox(); | ||
FrameInnerCache.pickSkinBox = box; | ||
GridBagConstraints grid = new GridBagConstraints( | ||
// 第(0,4)个格子 | ||
0, 4, | ||
// 占3列,占1行 | ||
3, 1, | ||
//横向占100%长度,纵向占100%长度 | ||
100, 100, | ||
//居中,组件小的话就两边铺满窗格 | ||
GridBagConstraints.CENTER, GridBagConstraints.NONE, | ||
// 窗格之间的距离 | ||
new Insets(0, 0, 0, 0), | ||
// 增加组件的首选宽度和高度 | ||
0, 0 | ||
); | ||
return new ComponentBO(box, grid); | ||
} | ||
|
||
private ItemListener listener() { | ||
return e -> { | ||
if (e.getStateChange() == ItemEvent.SELECTED) { | ||
ItemBO item = (ItemBO) e.getItem(); | ||
if (item.getValue() == null) { | ||
GameDataCache.skinId = null; | ||
} else { | ||
GameDataCache.skinId = Integer.parseInt(item.getValue()); | ||
} | ||
|
||
} | ||
}; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters