This repository has been archived by the owner on Jun 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
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
12 changed files
with
245 additions
and
19 deletions.
There are no files selected for viewing
Binary file added
BIN
+72.4 MB
companion-win/null/hearthstats/videos/2015_Jan/29_13h41_Rogue_Win_VS_Warlock.mp4
Binary file not shown.
Binary file added
BIN
+50.9 MB
companion-win/null/hearthstats/videos/2015_Jan/29_13h47_Rogue_Win_VS_Druid.mp4
Binary file not shown.
Binary file added
BIN
+89.7 MB
companion-win/null/hearthstats/videos/2015_Jan/29_13h57_Rogue_Win_VS_Mage.mp4
Binary file not shown.
Binary file added
BIN
+93.5 MB
companion-win/null/hearthstats/videos/2015_Jan/29_14h54_Mage_Loss_VS_Hunter.mp4
Binary file not shown.
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
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
121 changes: 121 additions & 0 deletions
121
companion/src/main/scala/net/hearthstats/ui/LandingFrame.scala
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,121 @@ | ||
package net.hearthstats.ui | ||
|
||
import net.hearthstats.util.{Browse, Translation} | ||
import net.hearthstats.hstatsapi.API | ||
import net.hearthstats.ui.log.Log | ||
import net.hearthstats.config.{Environment, UserConfig} | ||
import net.hearthstats.ui.util.OptionTextField | ||
import net.hearthstats.ui.util.StringOptionTextField | ||
import net.hearthstats.ui.notification.NotificationQueue | ||
|
||
import java.awt.event.{ ActionEvent, ActionListener } | ||
import java.awt.{ Dimension, Font, Graphics, Color } | ||
import java.io.File | ||
import java.awt.image.BufferedImage | ||
import javax.imageio.ImageIO | ||
import javax.swing._ | ||
import net.miginfocom.swing.MigLayout | ||
|
||
|
||
class LandingFrame(translation: Translation, | ||
uilog: Log, | ||
config: UserConfig, | ||
api: API, | ||
val notificationQueue: NotificationQueue, | ||
val environment: Environment)extends JFrame{ | ||
import translation.t | ||
import config._ | ||
|
||
private val signInButton = new JButton("Sign In") | ||
private val registerButton = new JButton("Register") | ||
private val registerUrl:String = "http://hearthstats.net/users/sign_up" | ||
|
||
|
||
def createLandingPage(){ | ||
val icon = new ImageIcon(getClass.getResource("/images/icon.png")).getImage | ||
val titleLabel = new JLabel("Hearthstats Uploader") | ||
titleLabel.setFont(new Font("Ariel",Font.BOLD,24)) | ||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE) | ||
setIconImage(icon) | ||
setLocation(windowX, windowY) | ||
setSize(windowWidth, windowHeight) | ||
setMinimumSize(new Dimension(500, 600)) | ||
setVisible(true) | ||
updateTitle | ||
|
||
setLayout(new MigLayout) | ||
setBackground(Color.WHITE) | ||
|
||
add(new JLabel(" "), "wrap") | ||
add(new JLabel(new ImageIcon(ImageIO.read(getClass.getResource("/images/icon.png"))))) | ||
|
||
add(titleLabel, "wrap") | ||
add(new JLabel(" "),"wrap") | ||
|
||
//entering userID | ||
add(new JLabel(t("LandingPanel.label.userId") + " "), "") | ||
var userEmailField: JTextField = new StringOptionTextField(config.email) | ||
add(userEmailField, "wrap") | ||
config.email.set(userEmailField.getText()) | ||
|
||
//entering user Password | ||
add(new JLabel(t("LandingPanel.label.password") + " "), "") | ||
var passwordField: JTextField = new StringOptionTextField(config.password) | ||
add(passwordField, "wrap") | ||
config.password.set(passwordField.getText()) | ||
|
||
|
||
add(new JLabel(" "), "wrap") | ||
|
||
//add a sign in button | ||
signInButton.addActionListener(new ActionListener { | ||
override def actionPerformed(arg0: ActionEvent) { | ||
checkForPassword | ||
}}) | ||
add(signInButton, "") | ||
|
||
//add a register button | ||
registerButton.addActionListener(new ActionListener { | ||
override def actionPerformed(arg0: ActionEvent) { | ||
Browse(registerUrl) | ||
}}) | ||
add(registerButton, "") | ||
|
||
//add a first time help link | ||
val firstTimeHelpIcon = new HelpIcon("https://github.com/HearthStats/HearthStats.net-Uploader/wiki/Options:-Game-Language", | ||
"First time tutorial") | ||
add(firstTimeHelpIcon, "") | ||
add(new JLabel(" "), "wrap") | ||
|
||
} | ||
|
||
//update title | ||
def updateTitle | ||
{ | ||
var title = "HearthStats Companion" | ||
setTitle(title) | ||
} | ||
|
||
//close login page | ||
def closeLandingPage | ||
{ | ||
config.closedLandingPage.set(true) | ||
} | ||
|
||
//check if password and email matched | ||
def checkForPassword{ | ||
try{ | ||
if (api.login(config.email.get, config.password.get)){ | ||
closeLandingPage | ||
} | ||
else{ | ||
add(new JLabel("Email or password is incorrect")) | ||
println("invalid password or email") | ||
} | ||
} | ||
catch{ | ||
case(e) => println("entered nothing") | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.