-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
14 changed files
with
692 additions
and
45 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
131 changes: 87 additions & 44 deletions
131
serverpackcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/GuiProps.kt
Large diffs are not rendered by default.
Oops, something went wrong.
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
46 changes: 46 additions & 0 deletions
46
...gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/menu/about/TipOfTheDayItem.kt
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,46 @@ | ||
/* Copyright (C) 2023 Griefed | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 | ||
* USA | ||
* | ||
* The full license can be found at https:github.com/Griefed/ServerPackCreator/blob/main/LICENSE | ||
*/ | ||
package de.griefed.serverpackcreator.gui.window.menu.about | ||
|
||
import de.griefed.serverpackcreator.gui.GuiProps | ||
import de.griefed.serverpackcreator.gui.window.MainFrame | ||
import de.griefed.serverpackcreator.gui.window.tips.TipOfTheDayManager | ||
import javax.swing.JMenuItem | ||
|
||
/** | ||
* Menuitem to display the tip of the day. | ||
* | ||
* @author Griefed | ||
*/ | ||
class TipOfTheDayItem(guiProps: GuiProps, mainFrame: MainFrame): JMenuItem(Gui.menubar_gui_menuitem_tipoftheday.toString()) { | ||
|
||
private val tipManager = TipOfTheDayManager(mainFrame.frame,guiProps) | ||
|
||
init { | ||
this.addActionListener { showTip() } | ||
} | ||
|
||
/** | ||
* @author Griefed | ||
*/ | ||
fun showTip() { | ||
tipManager.showTipOfTheDay() | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...packcreator-gui/src/main/kotlin/de/griefed/serverpackcreator/gui/window/tips/CustomTip.kt
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,36 @@ | ||
/* Copyright (C) 2023 Griefed | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 | ||
* USA | ||
* | ||
* The full license can be found at https:github.com/Griefed/ServerPackCreator/blob/main/LICENSE | ||
*/ | ||
package de.griefed.serverpackcreator.gui.window.tips | ||
|
||
import tokyo.northside.swing.tips.DefaultTip | ||
import javax.swing.ImageIcon | ||
|
||
/** | ||
* @author Griefed | ||
*/ | ||
class CustomTip(name: String, tip: Any, private val imageResource: String): DefaultTip(name,tip) { | ||
fun getImage(): ImageIcon? { | ||
return try { | ||
ImageIcon(this.javaClass.getResource(imageResource)) | ||
} catch (_: Exception) { | ||
null | ||
} | ||
} | ||
} |
Oops, something went wrong.