Skip to content

Commit

Permalink
v1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Rizlim authored and Rizlim committed Feb 13, 2019
1 parent 61dc83d commit c4b4b5e
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 8 deletions.
8 changes: 8 additions & 0 deletions src/main/kotlin/PAL2/Database/DataBaseHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ fun removePoELoc(string: String)
connection.close()
}

fun updateRunAddonWhenLaunching(runOnLaunch: Boolean, aid: Int)
{
val connection = connectToDB()
connection.createStatement().executeUpdate("update InstalledAddon set run_on_launch = $runOnLaunch where aid = $aid;")
connection.close()
}


fun updateAddonConfig(lc: String, installDir: String, aid: Int, addonName: String, version:String, runOnLaunch: Boolean)
{
val connection = connectToDB()
Expand Down
11 changes: 10 additions & 1 deletion src/main/kotlin/PAL2/GUI/CoreController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import GUI.PopUp.Updated_HTML_Popup
import PAL2.Database.*
import PAL2.GUI.Loader.Loader
import PAL2.SystemHandling.FileDownloader
import PAL2.SystemHandling.launchAddons
import PAL2.SystemHandling.removeAddon
import PAL2.SystemHandling.updateAddon
import PAL_DataClasses.PAL_AddonTableRow
Expand Down Expand Up @@ -601,7 +602,15 @@ class CoreController : Initializable
@FXML
fun launchPoE(event: MouseEvent)
{
PAL2.SystemHandling.launchPoE()
if (event.button == MouseButton.PRIMARY)
{
PAL2.SystemHandling.launchPoE()
}
else if (event.button == MouseButton.SECONDARY)
{
launchAddons()
}

}

@FXML
Expand Down
38 changes: 32 additions & 6 deletions src/main/kotlin/PAL2/GUI/InstalledAnchor.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package PAL2.GUI

import PAL2.Database.getRunAddonOnLaunch
import PAL2.Database.updateRunAddonWhenLaunching
import PAL2.SystemHandling.launchAddon
import PAL2.SystemHandling.updateAddon
import javafx.application.Platform
import javafx.event.EventHandler
import javafx.scene.control.Hyperlink
import javafx.scene.control.CheckBox
import javafx.scene.image.Image
import javafx.scene.image.ImageView
import javafx.scene.input.MouseButton
Expand All @@ -27,12 +29,15 @@ class InstalledAnchor(var aid: Int, var iconUrl: String?, var addonName: String,
lateinit var textAddonName: Text
lateinit var textNewestVersion: Text
lateinit var textLastCheck: Text
lateinit var textEnabled: Text

lateinit var bTextVersion: Text
lateinit var bTextLastCheck: Text
lateinit var bTextNewVersion: Text

var imageViewInfo = ImageView()
lateinit var checkBox: CheckBox

//var imageViewInfo = ImageView()

var anchorButton = AnchorPane()
var rectButton = Rectangle(75.0, 25.0)
Expand All @@ -45,6 +50,7 @@ class InstalledAnchor(var aid: Int, var iconUrl: String?, var addonName: String,
initTopText()
initBottomText()
initButton()
initCheckBox()

// Check up to date
if (version == newestVersion)
Expand All @@ -59,10 +65,28 @@ class InstalledAnchor(var aid: Int, var iconUrl: String?, var addonName: String,
setListners()
}

private fun initCheckBox()
{
checkBox = CheckBox("")
anchorPane.children.add(checkBox)
checkBox.layoutX = 542.5
checkBox.layoutY = 20.0
checkBox.isSelected = getRunAddonOnLaunch(aid)
}

private fun setListners()
{
anchorListner()
setDownloadUpdateListner()
checkBoxListener()
}

private fun checkBoxListener()
{
checkBox.onMouseClicked = EventHandler()
{
updateRunAddonWhenLaunching(checkBox.isSelected, aid)
}
}

fun anchorListner()
Expand Down Expand Up @@ -131,7 +155,7 @@ class InstalledAnchor(var aid: Int, var iconUrl: String?, var addonName: String,
textButton.layoutY = 25.0
}
}

/*
fun isGGGAproved()
{
Platform.runLater {
Expand All @@ -144,7 +168,7 @@ class InstalledAnchor(var aid: Int, var iconUrl: String?, var addonName: String,
Platform.runLater {
imageViewInfo.image = Image(javaClass.getResource("/icons/gggAproveQ.png").openStream())
}
}
}*/

private fun initButton()
{
Expand Down Expand Up @@ -215,8 +239,9 @@ class InstalledAnchor(var aid: Int, var iconUrl: String?, var addonName: String,
textAddonName.textAlignment = TextAlignment.LEFT
textNewestVersion = textTopFactory("Newest Version", 325.0, 100.0)
textLastCheck = textTopFactory("Last Check", 425.0, 100.0)
textEnabled = textTopFactory("Enabled", 525.0, 50.0)

anchorPane.children.addAll(textAddonName, textNewestVersion, textLastCheck)
anchorPane.children.addAll(textAddonName, textNewestVersion, textLastCheck, textEnabled)
}

fun bottomTextFactory(arg: String, x: Double, ww: Double): Text
Expand Down Expand Up @@ -246,12 +271,13 @@ class InstalledAnchor(var aid: Int, var iconUrl: String?, var addonName: String,

fun initImg()
{
/*
imageViewInfo.layoutX = 530.0
imageViewInfo.layoutY = 2.5
imageViewInfo.fitHeight = 35.0
imageViewInfo.fitWidth = 35.0
imageViewInfo.image = Image(javaClass.getResource("/icons/gggAproveQ.png").openStream())
anchorPane.children.add(imageViewInfo)
anchorPane.children.add(imageViewInfo)*/

displayImage.layoutX = 2.5
displayImage.layoutY = 2.5
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/PAL2/GlobalData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class GlobalData
{
companion object
{
var version = "1.0.3"
var version = "1.0.4"
var debugging = false
var install_dir = ""
var github_token = ""
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/update_notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@

</style>
<body>
<div class="block_1 hline-bottom"><h1>Version 1.0.4</h1></div>
<ul>
<li>You can now set the addons on launch by selecting them in the installed tab and clicking to enable.</li>
<li>When clicking "Launch Path of Exile" with the RIGHT mouse button it will launch your addons instead.</li>
</ul>

<div class="block_1 hline-bottom"><h1>Version 1.0.3</h1></div>
<ul>
<li>Fix download bug</li>
Expand Down

0 comments on commit c4b4b5e

Please sign in to comment.