Skip to content

Commit

Permalink
New code templates
Browse files Browse the repository at this point in the history
  • Loading branch information
AndusDEV committed Sep 8, 2021
1 parent 9f4a267 commit d1e1d06
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 1 deletion.
Binary file modified out/SkriptEditor.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/java/pl/andus/skeditor/Constants.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package pl.andus.skeditor;

public class Constants {
static String version = "1.1";
static String version = "1.2";
}
26 changes: 26 additions & 0 deletions src/main/java/pl/andus/skeditor/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,20 @@ public Main() {

JMenuItem cmdTemp = new JMenuItem("Command");
JMenuItem variablesTemp = new JMenuItem("Variables");
JMenu onActTemp = new JMenu("On Action");

JMenuItem onDeathTemp = new JMenuItem("On death");
JMenuItem onJoinTemp = new JMenuItem("On join");
JMenuItem onFJoinTemp = new JMenuItem("On first join");
JMenuItem onLeaveTemp = new JMenuItem("On leave");
onActTemp.add(onDeathTemp);
onActTemp.add(onJoinTemp);
onActTemp.add(onFJoinTemp);
onActTemp.add(onLeaveTemp);

templateMenu.add(cmdTemp);
templateMenu.add(variablesTemp);
templateMenu.add(onActTemp);

JMenuItem lightTheme = new JMenuItem("Light");
JMenuItem darkTheme = new JMenuItem("Dark");
Expand Down Expand Up @@ -178,6 +189,21 @@ public Main() {
" {_lvar} = 0 # Local Variable. You can change it's name in '{_ }'. You can change value of it after '='\n", textArea.getCaretPosition());
});

onDeathTemp.addActionListener(e -> textArea.insert("\n\non death of player:\n" +
" if attacker is a player: # check if attacker is a player\n" +
" broadcast \"&cPlayer &4&l%victim% &chas been killed by &a&l%attacker%\" # send message what player killed\n" +
" else:\n" +
" broadcast \"&cPlayer &4&l%victim% &cdied.\"\n", textArea.getCaretPosition()));

onJoinTemp.addActionListener(e -> textArea.insert("\n\non join:\n" +
" broadcast \"&9Player &a&l%player% &9joined on the server\"\n", textArea.getCaretPosition()));

onFJoinTemp.addActionListener(e -> textArea.insert("\n\non first join:\n" +
" broadcast \"&9Player &a&l&o%player% &9joined on server for the first time\"\n", textArea.getCaretPosition()));

onLeaveTemp.addActionListener(e -> textArea.insert("\n\non leave:\n" +
" broadcast \"&9Player &c&l%player% &9left the server\"\n", textArea.getCaretPosition()));

lightTheme.addActionListener(e -> {
// menu
menuBar.setBackground(Color.white);
Expand Down
Binary file modified target/classes/pl/andus/skeditor/Constants.class
Binary file not shown.
Binary file modified target/classes/pl/andus/skeditor/Main.class
Binary file not shown.
Binary file modified target/classes/pl/andus/skeditor/ShowDialog.class
Binary file not shown.

0 comments on commit d1e1d06

Please sign in to comment.