Compare commits
22 Commits
Author | SHA1 | Date | |
---|---|---|---|
b8ca5dc498
|
|||
dbdba120c3 | |||
33a46c4cbf
|
|||
d81aa56e49 | |||
95496536db | |||
8f3b61462a | |||
cff5ec76bf | |||
1bbfe800e1 | |||
c722a39116
|
|||
911983bff4
|
|||
6feb1c3dad | |||
7da58c7dbe | |||
86c05c0363
|
|||
a3c03c4bc7 | |||
9444e8198f | |||
730a0ab383 | |||
a10e2aceb6 | |||
f0fe4bb981 | |||
32883a2639 | |||
0e293768d7 | |||
6a5b2f555c | |||
8d210d756d |
@ -27,7 +27,7 @@ compileTestKotlin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group 'org.hso'
|
group 'org.hso'
|
||||||
version '1.0'
|
version '1.0.1'
|
||||||
archivesBaseName = 'TextureSync'
|
archivesBaseName = 'TextureSync'
|
||||||
mainClassName = 'org.hso.texturesyncclient.app.Main'
|
mainClassName = 'org.hso.texturesyncclient.app.Main'
|
||||||
|
|
||||||
|
@ -18,9 +18,7 @@ import org.hso.texturesyncclient.view.mainView.MainView
|
|||||||
import org.hso.texturesyncclient.view.mainView.MainViewController
|
import org.hso.texturesyncclient.view.mainView.MainViewController
|
||||||
import org.hso.texturesyncclient.view.startupView.StartupView
|
import org.hso.texturesyncclient.view.startupView.StartupView
|
||||||
import org.hso.texturesyncclient.view.startupView.StartupViewController
|
import org.hso.texturesyncclient.view.startupView.StartupViewController
|
||||||
import tornadofx.Controller
|
import tornadofx.*
|
||||||
import tornadofx.find
|
|
||||||
import tornadofx.observable
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.FileOutputStream
|
import java.io.FileOutputStream
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
@ -51,7 +49,7 @@ class RootController : Controller() {
|
|||||||
val uuid = UUID.randomUUID()
|
val uuid = UUID.randomUUID()
|
||||||
val format = if (File(path).extension.toLowerCase() == "png") TextureFormat.PNG else TextureFormat.JPEG
|
val format = if (File(path).extension.toLowerCase() == "png") TextureFormat.PNG else TextureFormat.JPEG
|
||||||
val bimg = ImageIO.read(File(path)) //image for obtaining resolution
|
val bimg = ImageIO.read(File(path)) //image for obtaining resolution
|
||||||
val resolution = Pair(bimg.height, bimg.width)
|
val resolution = Pair(bimg.width, bimg.height)
|
||||||
val cal = Calendar.getInstance() //calendar obj with current time
|
val cal = Calendar.getInstance() //calendar obj with current time
|
||||||
val hash = Sha256(data)
|
val hash = Sha256(data)
|
||||||
|
|
||||||
@ -103,6 +101,8 @@ class RootController : Controller() {
|
|||||||
println("[auto] Connection to Server successful")
|
println("[auto] Connection to Server successful")
|
||||||
switchStartupToMain()
|
switchStartupToMain()
|
||||||
showAll()
|
showAll()
|
||||||
|
|
||||||
|
return // abort
|
||||||
} else {
|
} else {
|
||||||
println("[auto] no server found")
|
println("[auto] no server found")
|
||||||
}
|
}
|
||||||
@ -119,6 +119,8 @@ class RootController : Controller() {
|
|||||||
println("[file] Connection to Server successful")
|
println("[file] Connection to Server successful")
|
||||||
switchStartupToMain()
|
switchStartupToMain()
|
||||||
showAll()
|
showAll()
|
||||||
|
|
||||||
|
return // abort
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
println(e)
|
println(e)
|
||||||
println("[file] Connection to Server NOT successful")
|
println("[file] Connection to Server NOT successful")
|
||||||
@ -137,6 +139,8 @@ class RootController : Controller() {
|
|||||||
switchStartupToMain()
|
switchStartupToMain()
|
||||||
showAll()
|
showAll()
|
||||||
println("swithing to MainView @ initCon")
|
println("swithing to MainView @ initCon")
|
||||||
|
|
||||||
|
return // abort
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
println(e)
|
println(e)
|
||||||
println("Connection to Server NOT successful")
|
println("Connection to Server NOT successful")
|
||||||
@ -183,7 +187,7 @@ class RootController : Controller() {
|
|||||||
fun exportTexture(data: Texture) {
|
fun exportTexture(data: Texture) {
|
||||||
val directoryChooser = DirectoryChooser()
|
val directoryChooser = DirectoryChooser()
|
||||||
directoryChooser.title = "Export Verzeichnis wählen"
|
directoryChooser.title = "Export Verzeichnis wählen"
|
||||||
directoryChooser.initialDirectory = File(lastExportDir)
|
directoryChooser.initialDirectory = if(File(lastExportDir).exists()) File(lastExportDir) else File(System.getProperty("user.home"))
|
||||||
|
|
||||||
|
|
||||||
val alertExport = JFXInfoAlert(
|
val alertExport = JFXInfoAlert(
|
||||||
@ -295,20 +299,20 @@ class RootController : Controller() {
|
|||||||
|
|
||||||
fun switchStartupToMain() {
|
fun switchStartupToMain() {
|
||||||
Platform.runLater {
|
Platform.runLater {
|
||||||
find(StartupView::class).replaceWith(MainView::class, sizeToScene = true, centerOnScreen = true)
|
find(StartupView::class).replaceWith(MainView::class, ViewTransition.FadeThrough(0.01.seconds))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// These runLater calls should be unnecessary
|
// These runLater calls should be unnecessary
|
||||||
fun switchMainToImport() {
|
fun switchMainToImport() {
|
||||||
Platform.runLater {
|
Platform.runLater {
|
||||||
find(MainView::class).replaceWith(ImportView::class, sizeToScene = true, centerOnScreen = true)
|
find(MainView::class).replaceWith(ImportView::class, ViewTransition.FadeThrough(0.01.seconds))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun switchImportToMain() {
|
fun switchImportToMain() {
|
||||||
Platform.runLater {
|
Platform.runLater {
|
||||||
find(ImportView::class).replaceWith(MainView::class, sizeToScene = true, centerOnScreen = true)
|
find(ImportView::class).replaceWith(MainView::class, ViewTransition.FadeThrough(0.01.seconds))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,9 +49,7 @@ class ImportViewController : Controller() {
|
|||||||
fun btnImportAction() {
|
fun btnImportAction() {
|
||||||
rootc.importTexture(iv.tfFilePath.text, iv.tfName.text, iv.cvTags.chips)
|
rootc.importTexture(iv.tfFilePath.text, iv.tfName.text, iv.cvTags.chips)
|
||||||
RootController.switchImportToMain()
|
RootController.switchImportToMain()
|
||||||
iv.tfFilePath.clear()
|
reset()
|
||||||
iv.tfName.clear()
|
|
||||||
iv.cvTags.chips.clear()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun validateImport() {
|
fun validateImport() {
|
||||||
@ -61,8 +59,13 @@ class ImportViewController : Controller() {
|
|||||||
|
|
||||||
fun btnBackAction() {
|
fun btnBackAction() {
|
||||||
RootController.switchImportToMain()
|
RootController.switchImportToMain()
|
||||||
|
reset()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun reset() {
|
||||||
iv.tfFilePath.clear()
|
iv.tfFilePath.clear()
|
||||||
iv.tfName.clear()
|
iv.tfName.clear()
|
||||||
iv.cvTags.chips.clear()
|
iv.cvTags.chips.clear()
|
||||||
|
iv.preview.root.isVisible = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ class MainViewController : Controller() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DetailView actions
|
// MainView actions
|
||||||
|
|
||||||
fun cvSearchAction(tags: ObservableList<String>) {
|
fun cvSearchAction(tags: ObservableList<String>) {
|
||||||
// show spinner, block ui
|
// show spinner, block ui
|
||||||
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "texture-sync-server"
|
name = "texture-sync-server"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
authors = ["CodeSteak <codesteak@shellf.art>"]
|
authors = ["CodeSteak <codesteak@shellf.art>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ impl QueryFilter {
|
|||||||
|
|
||||||
SpecialInName(name) => Score::RequiredMatch(
|
SpecialInName(name) => Score::RequiredMatch(
|
||||||
//
|
//
|
||||||
texture.name.contains(name),
|
texture.name.to_lowercase().contains(&name.to_lowercase()),
|
||||||
),
|
),
|
||||||
|
|
||||||
SpecialBeforeDate(date) => Score::RequiredMatch(texture.added_on <= *date),
|
SpecialBeforeDate(date) => Score::RequiredMatch(texture.added_on <= *date),
|
||||||
|
Reference in New Issue
Block a user