[成就]更好的分类选择
-
一些liquidsource自定义构建版本具有特殊分类(例如,没有“Fun”分类,或者可以使用其他分类),导致与js的兼容性较差
如果你遇到了上述情况,或者想让你的js更兼容,你可以尝试添加我的代码,让你的js更兼容Step 1
添加 var JOptionPane = Java.type("javax.swing.JOptionPane");
它允许您使用Java弹幕样式Step 2
添加两个数组
var listshowchoose = ["按钮(push-button)", "列表(tabulation)"];
var choose = ["World", "Fun", "Movement", "Render", "Combat", "Player", "Misc", "Exploit", "自定义(Custom)"];
它们用于保存我们需要的分类Step 3
使用Java弹出窗口获取所需的显示表单
var listshowset = JOptionPane.showOptionDialog(null,"请选择展示形式(Please select a presentation form):","形式选择(Presentation form)",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,listshowchoose,listshowchoose[0]);
var listshow = listshowchoose[listshowset]Step 4
使用判断显示不同的Java弹出表单
最后将字符串传输到chooselist
这一步的关键是不同的Java弹出格式输出不同的值类型
有些需要再次访问数组
if(listshow == "按钮(push-button)") {
var chooseset = JOptionPane.showOptionDialog(null,"请选择分类(Please select a classification):","分类(classify)",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,choose,choose[0]);
var chooselist = choose[chooseset]
}else{
var chooselist = JOptionPane.showInputDialog(null,"请选择分类(Please select a classification):","分类(classify)",JOptionPane.QUESTION_MESSAGE,null,choose,choose[0]);
}
Step 5
在Java弹出窗口的判断中实现自定义分类
if(chooselist == "自定义(Custom)") {
var chooselist = JOptionPane.showInputDialog(null,"请输入自定义名称(Please enter a custom name):","请首字母大写(The first letter should be capitalized)",JOptionPane.WARNING_MESSAGE);
}Step 6
将原始类别更改为chooselist
this.getCategory = function () {
return chooselist;
}Step 7
最终结果
var JOptionPane = Java.type("javax.swing.JOptionPane");
// Classification List
var listshowchoose = ["按钮(push-button)", "列表(tabulation)"];
var choose = ["World", "Fun", "Movement", "Render", "Combat", "Player", "Misc", "Exploit", "自定义(Custom)"];var listshowset = JOptionPane.showOptionDialog(null,"请选择展示形式(Please select a presentation form):","形式选择(Presentation form)",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,listshowchoose,listshowchoose[0]);
var listshow = listshowchoose[listshowset]if(listshow == "按钮(push-button)") {
var chooseset = JOptionPane.showOptionDialog(null,"请选择分类(Please select a classification):","分类(classify)",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,choose,choose[0]);
var chooselist = choose[chooseset]
if(chooselist == "自定义(Custom)") {
var chooselist = JOptionPane.showInputDialog(null,"请输入自定义名称(Please enter a custom name):","请首字母大写(The first letter should be capitalized)",JOptionPane.WARNING_MESSAGE);
}
}else{
var chooselist = JOptionPane.showInputDialog(null,"请选择分类(Please select a classification):","分类(classify)",JOptionPane.QUESTION_MESSAGE,null,choose,choose[0]);
if(chooselist == "自定义(Custom)") {
var chooselist = JOptionPane.showInputDialog(null,"请输入自定义名称(Please enter a custom name):","请首字母大写(The first letter should be capitalized)",JOptionPane.WARNING_MESSAGE);
}
}this.getCategory = function () {
return chooselist;
}我希望你喜欢!
非常感谢。