Fixed wrong path in modpack selection ui

This commit is contained in:
huangyuhui 2016-02-15 20:37:45 +08:00
parent cb337fc22f
commit cb125b83cb
10 changed files with 47 additions and 15 deletions

View File

@ -26,7 +26,7 @@ if (!hasProperty('mainClass')) {
ext.mainClass = 'org.jackhuang.hellominecraft.launcher.Main'
}
def buildnumber = System.getenv("BUILD_NUMBER") == null ? ".10" : "."+System.getenv("BUILD_NUMBER")
def buildnumber = System.getenv("BUILD_NUMBER") == null ? ".233" : "."+System.getenv("BUILD_NUMBER")
String mavenGroupId = 'HMCL'
String mavenVersion = '2.4.0' + buildnumber

View File

@ -16,17 +16,23 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jScrollPane1" pref="400" max="32767" attributes="0"/>
<Component id="jScrollPane1" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="lblTitle" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jScrollPane1" pref="270" max="32767" attributes="0"/>
<Component id="lblTitle" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" pref="250" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
</Group>
@ -51,12 +57,19 @@
<Component class="javax.swing.JButton" name="jButton1">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="ui.button.test" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="ui.button.preview" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="lblTitle">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/jackhuang/hellominecraft/lang/I18N.properties" key="modpack.desc" replaceFormat="C.i18n(&quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
</SubComponents>
</Form>

View File

@ -61,6 +61,7 @@ public class ModpackDescriptionPanel extends javax.swing.JPanel {
jScrollPane1 = new javax.swing.JScrollPane();
txtDescription = new javax.swing.JTextPane();
jButton1 = new javax.swing.JButton();
lblTitle = new javax.swing.JLabel();
txtDescription.addCaretListener(new javax.swing.event.CaretListener() {
public void caretUpdate(javax.swing.event.CaretEvent evt) {
@ -69,26 +70,33 @@ public class ModpackDescriptionPanel extends javax.swing.JPanel {
});
jScrollPane1.setViewportView(txtDescription);
jButton1.setText(C.i18n("ui.button.test")); // NOI18N
jButton1.setText(C.i18n("ui.button.preview")); // NOI18N
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
lblTitle.setText(C.i18n("modpack.desc")); // NOI18N
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
.addComponent(jScrollPane1)
.addGroup(layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jButton1))
.addGroup(layout.createSequentialGroup()
.addComponent(lblTitle)
.addGap(0, 0, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 270, Short.MAX_VALUE)
.addComponent(lblTitle)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton1))
);
@ -101,18 +109,19 @@ public class ModpackDescriptionPanel extends javax.swing.JPanel {
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
try {
Object msgs[] = new Object[2];
msgs[0] = C.i18n("ui.button.test");
msgs[0] = C.i18n("ui.button.preview");
msgs[1] = new WebPage(new Markdown4jProcessor().process(txtDescription.getText()));
((WebPage) msgs[1]).setPreferredSize(new Dimension(800, 350));
JOptionPane.showOptionDialog(null, msgs, (String) msgs[0], JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, null, null);
} catch (Exception e) {
MessageBox.Show(StrUtils.getStackTrace(e), "Error", MessageBox.WARNING_MESSAGE);
MessageBox.Show(StrUtils.getStackTrace(e), C.i18n("message.error"), MessageBox.WARNING_MESSAGE);
}
}//GEN-LAST:event_jButton1ActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JLabel lblTitle;
private javax.swing.JTextPane txtDescription;
// End of variables declaration//GEN-END:variables
}

View File

@ -177,8 +177,12 @@ public class ModpackInitializationPanel extends javax.swing.JPanel {
fc.setMultiSelectionEnabled(false);
fc.setFileFilter(new FileNameExtensionFilter(C.i18n("modpack") + "(*.zip)", "zip"));
fc.showSaveDialog(this);
if (fc.getSelectedFile() != null)
txtModpackLocation.setText(fc.getSelectedFile().getAbsolutePath());
if (fc.getSelectedFile() != null) {
String path = fc.getSelectedFile().getAbsolutePath();
if (!path.endsWith(".zip"))
path += ".zip";
txtModpackLocation.setText(path);
}
}//GEN-LAST:event_cboModpackLocationActionPerformed
private void txtModpackLocationCaretUpdate(javax.swing.event.CaretEvent evt) {//GEN-FIRST:event_txtModpackLocationCaretUpdate

View File

@ -149,6 +149,7 @@ ui.button.clear=清除
ui.button.close=关闭
ui.button.explore=浏览
ui.button.test=测试
ui.button.preview=预览
button.cancel=取消
button.ok=确定
@ -235,7 +236,7 @@ modpack.incorrect_format.no_json=整合包格式错误pack.json丢失
modpack.incorrect_format.no_jar=整合包格式错误pack.json丢失jar字段
modpack.cannot_read_version=读取游戏版本失败
modpack.not_a_valid_location=不是一个有效整合包位置
modpack.warning=<html>在制作整合包前,请您确认您选择的版本可以正常启动,<br/>并保证您的Minecraft是正式版而非快照版<br/>而且不应当将不允许非官方途径传播的Mod纳入整合包。</html>
modpack.warning=<html>在制作整合包前,请您确认您选择的版本可以正常启动,<br/>并保证您的Minecraft是正式版而非快照版<br/>而且不应当将不允许非官方途径传播的Mod、材质包等纳入整合包。</html>
modpack.name=整合包名称
modpack.not_a_valid_name=整合包名称不能为空

View File

@ -149,6 +149,7 @@ ui.button.clear=\u6e05\u9664
ui.button.close=\u5173\u95ed
ui.button.explore=\u6d4f\u89c8
ui.button.test=\u6d4b\u8bd5
ui.button.preview=\u9884\u89c8
button.cancel=\u53d6\u6d88
button.ok=\u786e\u5b9a
@ -235,7 +236,7 @@ modpack.incorrect_format.no_json=\u6574\u5408\u5305\u683c\u5f0f\u9519\u8bef\uff0
modpack.incorrect_format.no_jar=\u6574\u5408\u5305\u683c\u5f0f\u9519\u8bef\uff0cpack.json\u4e22\u5931jar\u5b57\u6bb5
modpack.cannot_read_version=\u8bfb\u53d6\u6e38\u620f\u7248\u672c\u5931\u8d25
modpack.not_a_valid_location=\u4e0d\u662f\u4e00\u4e2a\u6709\u6548\u6574\u5408\u5305\u4f4d\u7f6e
modpack.warning=<html>\u5728\u5236\u4f5c\u6574\u5408\u5305\u524d\uff0c\u8bf7\u60a8\u786e\u8ba4\u60a8\u9009\u62e9\u7684\u7248\u672c\u53ef\u4ee5\u6b63\u5e38\u542f\u52a8\uff0c<br/>\u5e76\u4fdd\u8bc1\u60a8\u7684Minecraft\u662f\u6b63\u5f0f\u7248\u800c\u975e\u5feb\u7167\u7248\uff0c<br/>\u800c\u4e14\u4e0d\u5e94\u5f53\u5c06\u4e0d\u5141\u8bb8\u975e\u5b98\u65b9\u9014\u5f84\u4f20\u64ad\u7684Mod\u7eb3\u5165\u6574\u5408\u5305\u3002</html>
modpack.warning=<html>\u5728\u5236\u4f5c\u6574\u5408\u5305\u524d\uff0c\u8bf7\u60a8\u786e\u8ba4\u60a8\u9009\u62e9\u7684\u7248\u672c\u53ef\u4ee5\u6b63\u5e38\u542f\u52a8\uff0c<br/>\u5e76\u4fdd\u8bc1\u60a8\u7684Minecraft\u662f\u6b63\u5f0f\u7248\u800c\u975e\u5feb\u7167\u7248\uff0c<br/>\u800c\u4e14\u4e0d\u5e94\u5f53\u5c06\u4e0d\u5141\u8bb8\u975e\u5b98\u65b9\u9014\u5f84\u4f20\u64ad\u7684Mod\u3001\u6750\u8d28\u5305\u7b49\u7eb3\u5165\u6574\u5408\u5305\u3002</html>
modpack.name=\u6574\u5408\u5305\u540d\u79f0
modpack.not_a_valid_name=\u6574\u5408\u5305\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a

View File

@ -149,6 +149,7 @@ ui.button.clear=Clear
ui.button.close=Close
ui.button.explore=Explore
ui.button.test=Test
ui.button.preview=Preview
button.cancel=Cancel
button.ok=OK

View File

@ -149,6 +149,7 @@ ui.button.clear=Clear
ui.button.close=Close
ui.button.explore=Explore
ui.button.test=Test
ui.button.preview=Preview
button.cancel=Cancel
button.ok=OK

View File

@ -149,6 +149,7 @@ ui.button.clear=清除
ui.button.close=關閉
ui.button.explore=瀏覽
ui.button.test=測試
ui.button.preview=預覽
button.cancel=取消
button.ok=確定
@ -235,7 +236,7 @@ modpack.incorrect_format.no_json=懶人包格式錯誤pack.json丟失
modpack.incorrect_format.no_jar=懶人包格式錯誤pack.json丟失jar字段
modpack.cannot_read_version=讀取遊戲版本失敗
modpack.not_a_valid_location=不是一个有效懒人包位置
modpack.warning=<html>在製作懶人包前,請您確認您選擇的版本可以正常啟動,<br/>並保證您的Minecraft是正式版而非快照版,<br/>而且不應當將不允許非官方途徑傳播的Mod納入整合包。 </html>
modpack.warning=<html>在製作懶人包前,請您確認您選擇的版本可以正常啟動,<br/>並保證您的Minecraft是正式版而非快照版,<br/>而且不應當將不允許非官方途徑傳播的Mod、材質包等納入整合包。 </html>
modpack.name=懶人包名稱
modpack.not_a_valid_name=懶人包名稱不能為空

View File

@ -149,6 +149,7 @@ ui.button.clear=\u6e05\u9664
ui.button.close=\u95dc\u9589
ui.button.explore=\u700f\u89bd
ui.button.test=\u6e2c\u8a66
ui.button.preview=\u9810\u89bd
button.cancel=\u53d6\u6d88
button.ok=\u78ba\u5b9a
@ -235,7 +236,7 @@ modpack.incorrect_format.no_json=\u61f6\u4eba\u5305\u683c\u5f0f\u932f\u8aa4\uff0
modpack.incorrect_format.no_jar=\u61f6\u4eba\u5305\u683c\u5f0f\u932f\u8aa4\uff0cpack.json\u4e1f\u5931jar\u5b57\u6bb5
modpack.cannot_read_version=\u8b80\u53d6\u904a\u6232\u7248\u672c\u5931\u6557
modpack.not_a_valid_location=\u4e0d\u662f\u4e00\u4e2a\u6709\u6548\u61d2\u4eba\u5305\u4f4d\u7f6e
modpack.warning=<html>\u5728\u88fd\u4f5c\u61f6\u4eba\u5305\u524d,\u8acb\u60a8\u78ba\u8a8d\u60a8\u9078\u64c7\u7684\u7248\u672c\u53ef\u4ee5\u6b63\u5e38\u555f\u52d5,\u200b\u200b<br/>\u4e26\u4fdd\u8b49\u60a8\u7684Minecraft\u662f\u6b63\u5f0f\u7248\u800c\u975e\u5feb\u7167\u7248,<br/>\u800c\u4e14\u4e0d\u61c9\u7576\u5c07\u4e0d\u5141\u8a31\u975e\u5b98\u65b9\u9014\u5f91\u50b3\u64ad\u7684Mod\u7d0d\u5165\u6574\u5408\u5305\u3002 </html>
modpack.warning=<html>\u5728\u88fd\u4f5c\u61f6\u4eba\u5305\u524d,\u8acb\u60a8\u78ba\u8a8d\u60a8\u9078\u64c7\u7684\u7248\u672c\u53ef\u4ee5\u6b63\u5e38\u555f\u52d5,\u200b\u200b<br/>\u4e26\u4fdd\u8b49\u60a8\u7684Minecraft\u662f\u6b63\u5f0f\u7248\u800c\u975e\u5feb\u7167\u7248,<br/>\u800c\u4e14\u4e0d\u61c9\u7576\u5c07\u4e0d\u5141\u8a31\u975e\u5b98\u65b9\u9014\u5f91\u50b3\u64ad\u7684Mod\u3001\u6750\u8cea\u5305\u7b49\u7d0d\u5165\u6574\u5408\u5305\u3002 </html>
modpack.name=\u61f6\u4eba\u5305\u540d\u7a31
modpack.not_a_valid_name=\u61f6\u4eba\u5305\u540d\u7a31\u4e0d\u80fd\u70ba\u7a7a