├── .gitattributes
├── .gitignore
├── GameRoom.iml
├── JAR_to_EXE.xml
├── LICENSE.MD
├── libs
├── jinput-dx8.dll
├── jinput-dx8_64.dll
├── jinput-raw.dll
├── jinput-raw_64.dll
└── jinput-wintab.dll
└── src
├── META-INF
└── MANIFEST.MF
├── bingads.properties
├── com
└── gameroom
│ ├── Launcher.java
│ ├── data
│ ├── LevenshteinDistance.java
│ ├── game
│ │ ├── GameFolderManager.java
│ │ ├── GameWatcher.java
│ │ ├── entry
│ │ │ ├── Company.java
│ │ │ ├── Emulator.java
│ │ │ ├── GameEntry.java
│ │ │ ├── GameEntryUtils.java
│ │ │ ├── GameGenre.java
│ │ │ ├── GameTheme.java
│ │ │ ├── Platform.java
│ │ │ └── Serie.java
│ │ ├── scanner
│ │ │ ├── FolderGameScanner.java
│ │ │ ├── GameScanner.java
│ │ │ ├── LauncherScanner.java
│ │ │ ├── OnGameFound.java
│ │ │ ├── OnScannerResultHandler.java
│ │ │ ├── ROMScanner.java
│ │ │ ├── ScanPeriod.java
│ │ │ ├── ScanTask.java
│ │ │ └── ScannerProfile.java
│ │ └── scraper
│ │ │ ├── IGDBScraper.java
│ │ │ ├── LauncherGameScraper.java
│ │ │ ├── MSStoreScraper.java
│ │ │ ├── OnDLDoneHandler.java
│ │ │ ├── OnSteamPreEntryFound.java
│ │ │ ├── SteamLocalScraper.java
│ │ │ ├── SteamOnlineScraper.java
│ │ │ ├── SteamPreEntry.java
│ │ │ └── SteamProfile.java
│ ├── http
│ │ ├── HTTPDownloader.java
│ │ ├── SimpleImageInfo.java
│ │ ├── URLTools.java
│ │ ├── YoutubeSoundtrackScrapper.java
│ │ ├── images
│ │ │ ├── ImageDownloadTask.java
│ │ │ └── ImageUtils.java
│ │ └── key
│ │ │ ├── CipherUtils.java
│ │ │ └── KeyChecker.java
│ ├── io
│ │ ├── DataBase.java
│ │ └── FileUtils.java
│ └── migration
│ │ ├── LoadingWindow.java
│ │ ├── OldGameEntry.java
│ │ ├── OldGenre.java
│ │ ├── OldPredefinedSetting.java
│ │ ├── OldSettingValue.java
│ │ ├── OldSettings.java
│ │ └── OldTheme.java
│ ├── system
│ ├── SchedulableTask.java
│ ├── application
│ │ ├── GameRoomUpdater.java
│ │ ├── GameStarter.java
│ │ ├── MessageListener.java
│ │ ├── MessageTag.java
│ │ ├── Monitor.java
│ │ ├── OnLaunchAction.java
│ │ ├── SupportService.java
│ │ └── settings
│ │ │ ├── GeneralSettings.java
│ │ │ ├── PredefinedSetting.java
│ │ │ └── SettingValue.java
│ ├── device
│ │ ├── ControllerButtonListener.java
│ │ ├── GameController.java
│ │ ├── StatsUtils.java
│ │ └── XboxControllerTest.java
│ ├── internet
│ │ ├── DownloadStatus.java
│ │ └── FileDownloader.java
│ └── os
│ │ ├── PowerMode.java
│ │ ├── Terminal.java
│ │ ├── TerminalTest.java
│ │ ├── WinReg.java
│ │ ├── WindowsShortcut.java
│ │ └── mslinks
│ │ ├── LinkInfo.java
│ │ ├── LinkTargetIDList.java
│ │ ├── Main.java
│ │ ├── Serializable.java
│ │ ├── ShellLink.java
│ │ ├── ShellLinkException.java
│ │ ├── ShellLinkHeader.java
│ │ ├── UnsupportedCLSIDException.java
│ │ ├── data
│ │ ├── BitSet32.java
│ │ ├── CNRLink.java
│ │ ├── CNRLinkFlags.java
│ │ ├── ConsoleFlags.java
│ │ ├── FileAttributesFlags.java
│ │ ├── Filetime.java
│ │ ├── GUID.java
│ │ ├── HotKeyFlags.java
│ │ ├── ItemID.java
│ │ ├── LinkFlags.java
│ │ ├── LinkInfoFlags.java
│ │ ├── Size.java
│ │ └── VolumeID.java
│ │ ├── extra
│ │ ├── ConsoleData.java
│ │ ├── ConsoleFEData.java
│ │ ├── EnvironmentVariable.java
│ │ ├── Stub.java
│ │ ├── Tracker.java
│ │ └── VistaIDList.java
│ │ └── io
│ │ ├── ByteReader.java
│ │ ├── ByteWriter.java
│ │ └── Bytes.java
│ └── ui
│ ├── GeneralToast.java
│ ├── Main.java
│ ├── UIValues.java
│ ├── control
│ ├── ValidEntryCondition.java
│ ├── button
│ │ ├── DualImageButton.java
│ │ ├── HelpButton.java
│ │ ├── ImageButton.java
│ │ ├── MouseEnteredHandler.java
│ │ ├── MouseExitedHandler.java
│ │ ├── OnActionHandler.java
│ │ └── gamebutton
│ │ │ ├── AddIgnoreGameButton.java
│ │ │ ├── GameButton.java
│ │ │ ├── InfoGameButton.java
│ │ │ └── TileGameButton.java
│ ├── drawer
│ │ ├── DrawerButton.java
│ │ ├── DrawerMenu.java
│ │ ├── GroupType.java
│ │ ├── SortType.java
│ │ └── submenu
│ │ │ ├── ButtonItem.java
│ │ │ ├── CheckBoxItem.java
│ │ │ ├── SelectableItem.java
│ │ │ ├── SubMenu.java
│ │ │ ├── SubMenuFactory.java
│ │ │ └── TextItem.java
│ ├── specific
│ │ ├── FloatingSearchBar.java
│ │ ├── ScanButton.java
│ │ ├── SearchBar.java
│ │ └── YoutubePlayerAndButton.java
│ └── textfield
│ │ ├── AppPathField.java
│ │ ├── CMDTextField.java
│ │ ├── PathTextField.java
│ │ ├── PlayTimeField.java
│ │ └── TimeTextField.java
│ ├── dialog
│ ├── ActivationKeyDialog.java
│ ├── ChoiceDialog.java
│ ├── ConsoleOutputDialog.java
│ ├── EmulationDialog.java
│ ├── GameRoomAlert.java
│ ├── GameRoomCustomAlert.java
│ ├── GameRoomDialog.java
│ ├── GamesFoldersDialog.java
│ ├── NonScrapedListDialog.java
│ ├── SearchDialog.java
│ ├── SteamProfileSelector.java
│ ├── UpdateDialog.java
│ ├── WebBrowser.java
│ ├── WindowFocusManager.java
│ ├── selector
│ │ ├── AppSelectorDialog.java
│ │ ├── GameScannerSelector.java
│ │ ├── IGDBImageSelector.java
│ │ ├── IgnoredEntrySelector.java
│ │ └── MSStoreAppSelector.java
│ └── test
│ │ ├── ActivationKeyDialogTest.java
│ │ ├── ChoiceDialogTest.java
│ │ ├── FileChooserTest.java
│ │ └── SearchDialogTest.java
│ ├── pane
│ ├── OnItemSelectedHandler.java
│ ├── SelectListPane.java
│ ├── gamestilepane
│ │ ├── CoverTilePane.java
│ │ ├── GamesTilePane.java
│ │ ├── GroupRowTilePane.java
│ │ ├── GroupsFactory.java
│ │ ├── RowCoverTilePane.java
│ │ └── ToAddRowTilePane.java
│ └── platform
│ │ ├── EmulatorSettingsPane.java
│ │ └── PlatformSettingsPane.java
│ ├── scene
│ ├── BaseScene.java
│ ├── GameEditScene.java
│ ├── GameInfoScene.java
│ ├── MainScene.java
│ ├── SettingsScene.java
│ └── exitaction
│ │ ├── ClassicExitAction.java
│ │ ├── CustomExitAction.java
│ │ ├── ExitAction.java
│ │ └── MultiAddExitAction.java
│ └── theme
│ ├── Theme.java
│ ├── ThemeUtils.java
│ └── UIScale.java
├── gamegenres.properties
├── gamegenres_de.properties
├── gamegenres_en.properties
├── gamegenres_fr.properties
├── gamethemes.properties
├── gamethemes_de.properties
├── gamethemes_en.properties
├── gamethemes_fr.properties
├── package
└── windows
│ └── GameRoom.ico
├── platforms.properties
├── platforms_en.properties
├── platforms_fr.properties
├── res
├── com
│ └── gameroom
│ │ └── ui
│ │ └── icon
│ │ ├── icon.png
│ │ ├── icon128.png
│ │ ├── icon16.png
│ │ ├── icon256.png
│ │ ├── icon32.png
│ │ ├── icon512.png
│ │ └── icon64.png
├── defaultImages
│ ├── barTile.jpg
│ ├── barTile120.jpg
│ ├── cover.jpg
│ ├── cover1024.jpg
│ ├── cover256.jpg
│ └── cover512.jpg
├── icons
│ ├── arrow
│ │ ├── down.png
│ │ ├── left.png
│ │ ├── right.png
│ │ └── up.png
│ ├── backgroundMask.png
│ ├── dialog
│ │ ├── confirmationIcon.png
│ │ ├── errorIcon.png
│ │ ├── infoIcon.png
│ │ └── warningIcon.png
│ ├── folder.png
│ ├── home.png
│ ├── launcher-dark
│ │ ├── 3ds.png
│ │ ├── battle.net.png
│ │ ├── ds.png
│ │ ├── gamecube.png
│ │ ├── gb.png
│ │ ├── gba.png
│ │ ├── gbc.png
│ │ ├── gog.png
│ │ ├── microsoft_store.png
│ │ ├── msdos.png
│ │ ├── n64.png
│ │ ├── nes.png
│ │ ├── origin.png
│ │ ├── pc.png
│ │ ├── ps2.png
│ │ ├── ps3.png
│ │ ├── psp.png
│ │ ├── psx.png
│ │ ├── snes.png
│ │ ├── steam.png
│ │ ├── uplay.png
│ │ ├── wii.png
│ │ └── wiiu.png
│ ├── launcher
│ │ ├── 3ds.png
│ │ ├── battlenet.png
│ │ ├── ds.png
│ │ ├── gamecube.png
│ │ ├── gb.png
│ │ ├── gba.png
│ │ ├── gbc.png
│ │ ├── gog.png
│ │ ├── microsoft_store.png
│ │ ├── msdos.png
│ │ ├── n64.png
│ │ ├── nes.png
│ │ ├── origin.png
│ │ ├── pc.png
│ │ ├── ps2.png
│ │ ├── ps2.png.bak2
│ │ ├── ps2.png.bak3
│ │ ├── ps3.png
│ │ ├── psp.png
│ │ ├── psx.png
│ │ ├── snes.png
│ │ ├── steam.png
│ │ ├── uplay.png
│ │ ├── wii.png
│ │ └── wiiu.png
│ ├── main
│ │ ├── add.png
│ │ ├── edit.png
│ │ ├── group.png
│ │ ├── quit.png
│ │ ├── scan.png
│ │ ├── search.png
│ │ ├── settings.png
│ │ └── sort.png
│ ├── mute.png
│ ├── pathField
│ │ ├── folder.png
│ │ └── search.png
│ ├── search.png
│ ├── sound.png
│ └── tile
│ │ ├── add.png
│ │ ├── addAll.png
│ │ ├── ignore.png
│ │ ├── info.png
│ │ ├── loading.png
│ │ ├── play.png
│ │ ├── toDownload.png
│ │ └── warning.png
├── log4j2.xml
├── sql
│ ├── init.sql
│ └── update_1120.sql
└── theme.css
├── settings.properties
├── settings_de.properties
├── settings_en.properties
├── settings_fr.properties
├── strings.properties
├── strings_de.properties
├── strings_en.properties
├── strings_fr.properties
└── tests
└── FileUtilsTest.java
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
2 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
3 |
4 | # User-specific stuff:
5 | .idea/*
6 |
7 | ## File-based project format:
8 | *.iws
9 |
10 | ## Plugin-specific files:
11 |
12 | # IntelliJ
13 | /out/
14 |
15 | # mpeltonen/sbt-idea plugin
16 | .idea_modules/
17 |
18 | # JIRA plugin
19 | atlassian-ide-plugin.xml
20 |
21 | # Crashlytics plugin (for Android Studio and IntelliJ)
22 | com_crashlytics_export_strings.xml
23 | crashlytics.properties
24 | crashlytics-build.properties
25 | fabric.properties
26 |
27 | entries
28 | *.log
29 | /cache/
30 | */cover.bmp
31 | */entry.properties
32 | */cover.jpg
33 | /Games
34 | /ToAdd
35 | GameRoom.exe
36 |
--------------------------------------------------------------------------------
/GameRoom.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/JAR_to_EXE.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
19 |
20 |
21 | Done!
22 |
23 |
--------------------------------------------------------------------------------
/libs/jinput-dx8.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/libs/jinput-dx8.dll
--------------------------------------------------------------------------------
/libs/jinput-dx8_64.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/libs/jinput-dx8_64.dll
--------------------------------------------------------------------------------
/libs/jinput-raw.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/libs/jinput-raw.dll
--------------------------------------------------------------------------------
/libs/jinput-raw_64.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/libs/jinput-raw_64.dll
--------------------------------------------------------------------------------
/libs/jinput-wintab.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/libs/jinput-wintab.dll
--------------------------------------------------------------------------------
/src/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Main-Class: com.gameroom.Launcher
3 | Implementation-Version: 1.1.2.0
4 |
--------------------------------------------------------------------------------
/src/bingads.properties:
--------------------------------------------------------------------------------
1 | environment=Sandbox
--------------------------------------------------------------------------------
/src/com/gameroom/data/LevenshteinDistance.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data;
2 |
3 | import com.gameroom.data.game.GameWatcher;
4 | import com.gameroom.data.game.entry.GameEntry;
5 | import com.gameroom.data.game.scraper.IGDBScraper;
6 | import com.mashape.unirest.http.exceptions.UnirestException;
7 | import org.json.JSONArray;
8 | import org.json.JSONException;
9 |
10 | /**
11 | * Created by LM on 11/01/2017.
12 | */
13 | public class LevenshteinDistance {
14 |
15 | public static int distance(String a, String b) {
16 | a = a.toLowerCase();
17 | b = b.toLowerCase();
18 | // i == 0
19 | int[] costs = new int[b.length() + 1];
20 | for (int j = 0; j < costs.length; j++)
21 | costs[j] = j;
22 | for (int i = 1; i <= a.length(); i++) {
23 | // j == 0; nw = lev(i - 1, j)
24 | costs[0] = i;
25 | int nw = i - 1;
26 | for (int j = 1; j <= b.length(); j++) {
27 | int cj = Math.min(1 + Math.min(costs[j], costs[j - 1]), a.charAt(i - 1) == b.charAt(j - 1) ? nw : nw + 1);
28 | nw = costs[j];
29 | costs[j] = cj;
30 | }
31 | }
32 | return costs[b.length()];
33 | }
34 |
35 | public static int closestName(String searchedName, JSONArray searchResult) throws JSONException {
36 | int closestId = -1;
37 | int minDistance = -1;
38 | for (int i = 0; i < searchResult.length(); i++) {
39 | String name = searchResult.getJSONObject(i).getString("name");
40 | int id = searchResult.getJSONObject(i).getInt("id");
41 |
42 | int distance = distance(searchedName, name);
43 | if (minDistance == -1 || distance < minDistance) {
44 | minDistance = distance;
45 | closestId = id;
46 | }
47 | if (minDistance == 0) {
48 | break;
49 | }
50 |
51 | }
52 | return closestId;
53 | }
54 |
55 | public static GameEntry getClosestEntry(String searchedName, JSONArray searchResults, int maxDistance) throws JSONException, UnirestException {
56 | if (searchResults != null) {
57 | int minDistance = -1;
58 | int jsonIndex = 0;
59 | for (int i = 0; i < searchResults.length(); i++) {
60 | String name = searchResults.getJSONObject(i).getString("name");
61 |
62 | String cleanName = GameWatcher.formatNameForComparison(name);
63 | String cleanMSName = GameWatcher.formatNameForComparison(searchedName);
64 | int distance = LevenshteinDistance.distance(cleanMSName, cleanName);
65 | if (minDistance == -1 || distance < minDistance) {
66 | minDistance = distance;
67 | jsonIndex = i;
68 | }
69 | if (minDistance < maxDistance) {
70 | break;
71 | }
72 | }
73 | if (minDistance >= 0 && minDistance < maxDistance) {
74 | return IGDBScraper.getGameEntries(searchResults).get(jsonIndex);
75 | }
76 | }
77 | return null;
78 | }
79 |
80 | /*public static List getSortedIds(String searchedName, JSONArray resultArray) throws JSONException{
81 | ArrayList items = new ArrayList<>();
82 | for (Object obj : resultArray) {
83 | JSONObject jsob = ((JSONObject) obj);
84 | items.add(new SortingItem(jsob.getInt("id"), distance(searchedName,jsob.getString("name"))));
85 | }
86 | items.sort(Comparator.comparingInt(o -> o.distance));
87 |
88 | ArrayList sortedIds = new ArrayList<>();
89 | for(SortingItem item : items){
90 | sortedIds.add(item.id);
91 | }
92 | return sortedIds;
93 | }*/
94 |
95 | private static class SortingItem {
96 | int id;
97 | int distance;
98 |
99 | public SortingItem(int id, int distance) {
100 | this.id = id;
101 | this.distance = distance;
102 | }
103 | }
104 | }
--------------------------------------------------------------------------------
/src/com/gameroom/data/game/GameFolderManager.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.game;
2 |
3 | import com.gameroom.data.game.entry.Platform;
4 | import com.gameroom.data.io.DataBase;
5 |
6 | import java.io.File;
7 | import java.sql.PreparedStatement;
8 | import java.sql.ResultSet;
9 | import java.sql.SQLException;
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 | /**
14 | * @author LM. Garret (admin@gameroom.me)
15 | * @date 19/07/2017.
16 | */
17 | public class GameFolderManager {
18 | private final static String[] EXCLUDED_GAMES_FOLDERS = new String[]{
19 | "C:\\Program Files (x86)","C:\\Program Files","C:\\ProgramData", "C:\\"
20 | };
21 | public static List getPCFolders(){
22 | ArrayList folders = new ArrayList<>();
23 | try {
24 | PreparedStatement statement = DataBase.getUserConnection().prepareStatement("SELECT path FROM GameFolder WHERE platform_id=?");
25 | statement.setInt(1,Platform.PC_ID);
26 | ResultSet set = statement.executeQuery();
27 | while(set.next()){
28 | String path = set.getString("path");
29 | if(path != null && !path.isEmpty()){
30 | folders.add(new File(path));
31 | }else{
32 | folders.add(null);
33 | }
34 | }
35 | statement.close();
36 | } catch (SQLException e) {
37 | e.printStackTrace();
38 | }
39 | return folders;
40 | }
41 |
42 | public static boolean addPCFolder(File folder){
43 | try {
44 | PreparedStatement statement = DataBase.getUserConnection().prepareStatement("INSERT INTO GameFolder(path,platform_id) VALUES (?,?)");
45 | statement.setString(1,folder != null ? folder.getAbsolutePath() : "");
46 | statement.setInt(2,Platform.PC.getId());
47 | statement.execute();
48 | statement.close();
49 | return true;
50 | } catch (SQLException e) {
51 | e.printStackTrace();
52 | }
53 | return false;
54 | }
55 |
56 | public static boolean deletePCFolder(File folder){
57 | String path = folder.getAbsolutePath();
58 | try {
59 | PreparedStatement statement = DataBase.getUserConnection().prepareStatement("DELETE FROM GameFolder WHERE platform_id=? AND path=?");
60 | statement.setInt(1,Platform.PC.getId());
61 | statement.setString(2,folder != null ? folder.getAbsolutePath() : "");
62 | statement.execute();
63 | statement.close();
64 | return true;
65 | } catch (SQLException e) {
66 | e.printStackTrace();
67 | }
68 | return false;
69 | }
70 |
71 | public static boolean isFolderExcluded(File folder){
72 | if(folder == null){
73 | return false;
74 | }
75 | for(String s : EXCLUDED_GAMES_FOLDERS){
76 | if(folder.getAbsolutePath().equals(s)){
77 | return true;
78 | }
79 | }
80 | return false;
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/game/entry/GameGenre.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.game.entry;
2 |
3 | import com.gameroom.data.io.DataBase;
4 | import com.gameroom.ui.Main;
5 |
6 | import java.sql.*;
7 | import java.util.Collection;
8 | import java.util.HashMap;
9 |
10 | /**
11 | * Created by LM on 12/08/2016.
12 | */
13 | public class GameGenre {
14 | private final static HashMap ID_MAP = new HashMap<>();
15 | private String key;
16 | private int id;
17 |
18 | private GameGenre(int id, String key) {
19 | this.key = key;
20 | this.id = id;
21 | }
22 |
23 | @Override
24 | public String toString() {
25 | return getDisplayName();
26 | }
27 |
28 | public String getDisplayName() {
29 | return Main.GAME_GENRES_BUNDLE.getString(key);
30 | }
31 |
32 | public static GameGenre getGenreFromID(int id) {
33 | if (ID_MAP.isEmpty()) {
34 | try {
35 | initWithDb();
36 | } catch (SQLException e) {
37 | e.printStackTrace();
38 | }
39 | }
40 | GameGenre genre = ID_MAP.get(id);
41 | if (genre == null) {
42 | //try to see if it exists in db
43 | try {
44 | Connection connection = DataBase.getUserConnection();
45 | PreparedStatement statement = connection.prepareStatement("select * from GameGenre where igdb_id = ?");
46 | statement.setInt(1, id);
47 | ResultSet set = statement.executeQuery();
48 | if (set.next()) {
49 | int genreId = set.getInt("igdb_id");
50 | String key = set.getString("name_key");
51 | GameGenre newGenre = new GameGenre(genreId, key);
52 | ID_MAP.put(genreId, newGenre);
53 |
54 | return newGenre;
55 | }
56 | statement.close();
57 | } catch (SQLException e) {
58 | e.printStackTrace();
59 | }
60 |
61 | }
62 | return genre;
63 | }
64 |
65 | private static void initWithDb() throws SQLException {
66 | Connection connection = DataBase.getUserConnection();
67 | Statement statement = connection.createStatement();
68 | ResultSet set = statement.executeQuery("select * from GameGenre");
69 | while (set.next()) {
70 | int id = set.getInt("igdb_id");
71 | String key = set.getString("name_key");
72 | ID_MAP.put(id, new GameGenre(id, key));
73 | }
74 | statement.close();
75 | }
76 |
77 | public String getKey() {
78 | return key;
79 | }
80 |
81 | public static int getIGDBId(String nameKey) {
82 | if (nameKey == null || nameKey.isEmpty()) {
83 | return -1;
84 | }
85 |
86 | try {
87 | Connection connection = DataBase.getUserConnection();
88 | PreparedStatement getIdQuery = connection.prepareStatement("SELECT igdb_id FROM GameGenre WHERE name_key = ?");
89 | getIdQuery.setString(1, nameKey);
90 | ResultSet result = getIdQuery.executeQuery();
91 |
92 | if (result.next()) {
93 | int id = result.getInt(1);
94 | result.close();
95 | return id;
96 | }
97 | } catch (SQLException e) {
98 | e.printStackTrace();
99 | }
100 | return -1;
101 |
102 | }
103 |
104 | public static Collection values() {
105 | return ID_MAP.values();
106 | }
107 |
108 | public static String getDisplayString(Collection genres){
109 | if(genres == null || genres.isEmpty()){
110 | return "-";
111 | }
112 | String temp = "";
113 | int i = 0;
114 | for(GameGenre genre : genres){
115 | if(genre!=null) {
116 | temp += genre.getDisplayName();
117 | if (i != genres.size() - 1) {
118 | temp += ", ";
119 | }
120 | }
121 | i++;
122 | }
123 | return temp;
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/game/entry/GameTheme.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.game.entry;
2 |
3 | import com.gameroom.data.io.DataBase;
4 | import com.gameroom.ui.Main;
5 |
6 | import java.sql.*;
7 | import java.util.Collection;
8 | import java.util.HashMap;
9 |
10 | /**
11 | * Created by LM on 13/08/2016.
12 | */
13 | public class GameTheme{
14 | private final static HashMap ID_MAP = new HashMap<>();
15 | private String key;
16 | private int id;
17 |
18 | private GameTheme(int id, String key) {
19 | this.key = key;
20 | this.id = id;
21 | }
22 |
23 | @Override
24 | public String toString() {
25 | return getDisplayName();
26 | }
27 |
28 | public String getDisplayName() {
29 | return Main.GAME_THEMES_BUNDLE.getString(key);
30 | }
31 |
32 |
33 | public static GameTheme getThemeFromId(int id) {
34 | if (ID_MAP.size() == 0) {
35 | try {
36 | initWithDb();
37 | } catch (SQLException e) {
38 | e.printStackTrace();
39 | }
40 | }
41 | GameTheme theme = ID_MAP.get(id);
42 | if (theme == null) {
43 | //try to see if it exists in db
44 | try {
45 | Connection connection = DataBase.getUserConnection();
46 | PreparedStatement statement = connection.prepareStatement("select * from GameTheme where igdb_id = ?");
47 | statement.setInt(1, id);
48 | ResultSet set = statement.executeQuery();
49 | if (set.next()) {
50 | int genreId = set.getInt("igdb_id");
51 | String key = set.getString("name_key");
52 | GameTheme newTheme = new GameTheme(genreId, key);
53 | ID_MAP.put(genreId, newTheme);
54 |
55 | return newTheme;
56 | }
57 | statement.close();
58 | } catch (SQLException e) {
59 | e.printStackTrace();
60 | }
61 |
62 | }
63 | return theme;
64 | }
65 |
66 | private static void initWithDb() throws SQLException {
67 | Connection connection = DataBase.getUserConnection();
68 | Statement statement = connection.createStatement();
69 | ResultSet set = statement.executeQuery("select * from GameTheme");
70 | while (set.next()) {
71 | int id = set.getInt("igdb_id");
72 | String key = set.getString("name_key");
73 | ID_MAP.put(id, new GameTheme(id, key));
74 | }
75 | statement.close();
76 | }
77 |
78 | public String getKey() {
79 | return key;
80 | }
81 |
82 | public static int getIGDBId(String nameKey) {
83 | if (nameKey == null || nameKey.isEmpty()) {
84 | return -1;
85 | }
86 |
87 | try {
88 | Connection connection = DataBase.getUserConnection();
89 | PreparedStatement getIdQuery = connection.prepareStatement("SELECT igdb_id FROM GameTheme WHERE name_key = ?");
90 | getIdQuery.setString(1, nameKey);
91 | ResultSet result = getIdQuery.executeQuery();
92 |
93 | if (result.next()) {
94 | int id = result.getInt(1);
95 | result.close();
96 | return id;
97 | }
98 | } catch (SQLException e) {
99 | e.printStackTrace();
100 | }
101 | return -1;
102 |
103 | }
104 |
105 | public static Collection values() {
106 | return ID_MAP.values();
107 | }
108 |
109 | public static String getDisplayString(Collection themes){
110 | if(themes == null || themes.isEmpty()){
111 | return "-";
112 | }
113 | String temp = "";
114 | int i = 0;
115 | for(GameTheme theme : themes){
116 | if(theme!=null) {
117 | temp += theme.getDisplayName();
118 | if (i != themes.size() - 1) {
119 | temp += ", ";
120 | }
121 | }
122 | i++;
123 | }
124 | return temp;
125 | }
126 | }
127 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/game/scanner/LauncherScanner.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.game.scanner;
2 |
3 | import com.gameroom.data.game.GameWatcher;
4 | import com.gameroom.data.game.scraper.LauncherGameScraper;
5 |
6 | /**
7 | * Created by LM on 29/08/2016.
8 | */
9 | public class LauncherScanner extends FolderGameScanner {
10 |
11 | public LauncherScanner(GameWatcher parentLooker, ScannerProfile profile) {
12 | super(parentLooker);
13 | this.profile = profile;
14 | }
15 |
16 | @Override
17 | public void scanAndAddGames() {
18 | LauncherGameScraper.scanInstalledGames(this);
19 | }
20 |
21 | @Override
22 | public String getScannerName(){
23 | return profile.name()+" scanner";
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/game/scanner/OnGameFound.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.game.scanner;
2 |
3 | import com.gameroom.data.game.entry.GameEntry;
4 |
5 | /**
6 | * Created by LM on 06/01/2017.
7 | */
8 | public interface OnGameFound {
9 | public void handle(GameEntry entry);
10 | }
11 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/game/scanner/OnScannerResultHandler.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.game.scanner;
2 |
3 | import com.gameroom.data.game.entry.GameEntry;
4 | import com.gameroom.ui.control.button.gamebutton.GameButton;
5 |
6 | /**
7 | * Created by LM on 17/08/2016.
8 | */
9 | public interface OnScannerResultHandler {
10 |
11 | GameButton gameToAddFound(GameEntry entry);
12 |
13 | void onAllGamesFound(int gamesCount);
14 | }
15 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/game/scanner/ROMScanner.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.game.scanner;
2 |
3 | import com.gameroom.data.game.GameWatcher;
4 | import com.gameroom.data.game.entry.GameEntry;
5 | import com.gameroom.data.game.entry.Platform;
6 | import com.gameroom.data.http.key.KeyChecker;
7 | import com.gameroom.data.io.FileUtils;
8 | import com.gameroom.ui.GeneralToast;
9 | import com.gameroom.ui.Main;
10 |
11 | import java.io.File;
12 |
13 | import static com.gameroom.data.game.GameWatcher.cleanNameForDisplay;
14 | import static com.gameroom.ui.Main.MAIN_SCENE;
15 |
16 | /**
17 | * @author LM. Garret (admin@gameroom.me)
18 | * @date 20/07/2017.
19 | */
20 | public class ROMScanner extends FolderGameScanner {
21 | public ROMScanner(GameWatcher parentLooker) {
22 | super(parentLooker);
23 | }
24 |
25 | @Override
26 | public void scanAndAddGames() {
27 | if (!KeyChecker.assumeSupporterMode()) {
28 | return;
29 | }
30 | Platform.getNonPCPlatforms().forEach(platform -> {
31 | if (platform.getROMFolder() == null || platform.getROMFolder().isEmpty()) {
32 | return;
33 | }
34 | File ROMFolder = new File(platform.getROMFolder());
35 | if (!ROMFolder.exists() || !ROMFolder.isDirectory()) {
36 | return;
37 | }
38 | File[] children = ROMFolder.listFiles();
39 | if (children == null) {
40 | return;
41 | }
42 | for (File f : children) {
43 | ScanTask task = new ScanTask(this, () -> {
44 | File file = FileUtils.tryResolveLnk(f);
45 | if(file.exists()) {
46 | GameEntry potentialEntry = new GameEntry(cleanNameForDisplay(
47 | f.getName(),
48 | platform.getSupportedExtensions()
49 | )); //f because we prefer to use the .lnk name if its the case !
50 |
51 | potentialEntry.setPath(file.getAbsolutePath());
52 | if (checkValidToAdd(potentialEntry, false)) {
53 | if (isPotentiallyAGame(file, platform.getSupportedExtensions())) {
54 | potentialEntry.setInstalled(true);
55 | potentialEntry.setPlatform(platform);
56 | addGameEntryFound(potentialEntry);
57 | }
58 | }
59 | }
60 | return null;
61 | });
62 | GameWatcher.getInstance().submitTask(task);
63 | }
64 | });
65 | }
66 |
67 | @Override
68 | protected void displayStartToast() {
69 | if (MAIN_SCENE != null) {
70 | GeneralToast.displayToast(Main.getString("scanning") + " " + Main.getString("rom_folders"), MAIN_SCENE.getParentStage(), GeneralToast.DURATION_SHORT);
71 | }
72 | }
73 |
74 | @Override
75 | public String getScannerName(){
76 | return "ROMs scanner";
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/game/scanner/ScanPeriod.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.game.scanner;
2 |
3 | import com.gameroom.ui.Main;
4 |
5 | import java.util.concurrent.TimeUnit;
6 |
7 | /**
8 | * Created by LM on 07/01/2017.
9 | */
10 | public enum ScanPeriod {
11 | TEN_MINUTES(0, 10), HALF_HOUR(0, 30), HOUR(1, 0), FIVE_HOURS(5, 0), TEN_HOURS(10, 0), START_ONLY(-1, -1), NEVER(-2,-2);
12 | private final static int ONLY_START_CONSTANT = -1;
13 | private final static int NEVER_CONSTANT = -2;
14 |
15 | private int hours;
16 | private int minutes;
17 |
18 | ScanPeriod(int hours, int minutes) {
19 | this.hours = hours;
20 | this.minutes = minutes;
21 | }
22 |
23 | public static ScanPeriod fromString(String s){
24 | for(ScanPeriod period : ScanPeriod.values()){
25 | if(s.equals(period.toString())){
26 | return period;
27 | }
28 | }
29 | return null;
30 | }
31 |
32 | @Override
33 | public String toString() {
34 | String s = "";
35 | if (minutes > 0) {
36 | if (minutes == 1) {
37 | s = minutes + " " + Main.getString("minute") + " " + s;
38 | } else {
39 | s = minutes + " " + Main.getString("minutes") + " " + s;
40 | }
41 | }
42 | if (hours > 0) {
43 | if (hours == 1) {
44 | s = hours + " " + Main.getString("hour") + " " + s;
45 | } else {
46 | s = hours + " " + Main.getString("hours") + " " + s;
47 | }
48 | }
49 | if (minutes == ONLY_START_CONSTANT || hours == ONLY_START_CONSTANT) {
50 | s = Main.getString("only_at_start");
51 | }else if(minutes == NEVER_CONSTANT ||hours == NEVER_CONSTANT){
52 | s = Main.getString("never");
53 | }
54 | return s.trim();
55 | }
56 |
57 | public long toMillis() {
58 | if (minutes == ONLY_START_CONSTANT || hours == ONLY_START_CONSTANT) {
59 | return ONLY_START_CONSTANT;
60 | }else if(minutes == NEVER_CONSTANT ||hours == NEVER_CONSTANT){
61 | return NEVER_CONSTANT;
62 | }
63 |
64 | return TimeUnit.MINUTES.toMillis(minutes) + TimeUnit.HOURS.toMillis(hours);
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/game/scanner/ScanTask.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.game.scanner;
2 |
3 | import java.util.concurrent.Callable;
4 | import java.util.concurrent.CountDownLatch;
5 |
6 | /** This class is to be only used to performing scanning of games. Why couldn't we just use a {@link Callable} ? This
7 | * will add a latch to the given {@link GameScanner} in constructor that will countdown only when the task has finished
8 | * executing or failed with an exception (which we can not guarantee with a {@link Callable} adding itself {@link CountDownLatch}
9 | * to the {@link GameScanner}).
10 | * This allows the {@link GameScanner} to know when all the {@link ScanTask} he has created have been executed.
11 | * @author LM. Garret (admin@gameroom.me)
12 | * @date 16/10/2017.
13 | */
14 | public class ScanTask implements Callable {
15 | private Callable callable;
16 | private CountDownLatch latch;
17 |
18 | /**
19 | * Creates a basic {@link ScanTask}
20 | * @param scanner the scanner that is creating this task. A latch will be added to it using {@link GameScanner#addLatch(CountDownLatch)}
21 | * @param callable the action to execute. May be null or throw exceptions, we don't mind
22 | */
23 | public ScanTask(GameScanner scanner, Callable callable){
24 | this.callable = callable;
25 | latch = new CountDownLatch(1);
26 |
27 | if(scanner != null){
28 | scanner.addLatch(latch);
29 | }
30 | }
31 |
32 | @Override
33 | public Object call() throws Exception {
34 | if(callable != null){
35 | try {
36 | callable.call();
37 | }catch (Exception e){
38 | e.printStackTrace();
39 | }
40 | }
41 | latch.countDown();
42 | return null;
43 | }
44 |
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/game/scanner/ScannerProfile.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.game.scanner;
2 |
3 | import com.gameroom.data.game.entry.Platform;
4 | import com.gameroom.ui.Main;
5 |
6 | import static com.gameroom.system.application.settings.GeneralSettings.settings;
7 |
8 | /**
9 | * Created by LM on 04/01/2017.
10 | */
11 | public enum ScannerProfile {
12 | STEAM(Platform.STEAM_ID, "steam_scanner_name")
13 | , STEAM_ONLINE(Platform.STEAM_ONLINE_ID, "steam_online_scanner_name")
14 | , GOG(Platform.GOG_ID,"gog_scanner_name")
15 | , ORIGIN(Platform.ORIGIN_ID,"origin_scanner_name")
16 | , UPLAY(Platform.UPLAY_ID,"uplay_scanner_name")
17 | , BATTLE_NET(Platform.BATTLENET_ID,"battle-net_scanner_name")
18 | , MICROSOFT_STORE(Platform.MICROSOFT_STORE_ID,"microsoft_store_scanner_name");
19 |
20 | private int platformId;
21 | private String stringKey;
22 |
23 | ScannerProfile(int platformId, String stringKey) {
24 | this.platformId = platformId;
25 | this.stringKey = stringKey;
26 | }
27 |
28 | @Override
29 | public String toString(){
30 | return Main.getString(stringKey);
31 | }
32 |
33 | public int getPlatformId() {
34 | return platformId;
35 | }
36 |
37 | public boolean isEnabled(){
38 | return settings().isGameScannerEnabled(this);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/game/scraper/OnDLDoneHandler.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.game.scraper;
2 |
3 | import java.io.File;
4 |
5 | /**
6 | * Created by LM on 06/08/2016.
7 | */
8 | public interface OnDLDoneHandler {
9 | void run(File outputFile);
10 | }
11 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/game/scraper/OnSteamPreEntryFound.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.game.scraper;
2 |
3 | /**
4 | * Created by LM on 06/01/2017.
5 | */
6 | public interface OnSteamPreEntryFound {
7 |
8 | public void handle(SteamPreEntry preEntry);
9 | }
10 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/game/scraper/SteamPreEntry.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.game.scraper;
2 |
3 | import com.gameroom.data.game.entry.GameEntry;
4 | import com.gameroom.data.game.entry.Platform;
5 |
6 | /**
7 | * Created by LM on 10/08/2016.
8 | */
9 | public class SteamPreEntry {
10 | private String name;
11 | private int id;
12 |
13 | public SteamPreEntry(String name, int id) {
14 | this.name = name;
15 | this.id = id;
16 | }
17 |
18 | public int getId() {
19 | return id;
20 | }
21 |
22 | public String getName() {
23 | return name;
24 | }
25 |
26 | public GameEntry toGameEntry() {
27 | GameEntry entry = new GameEntry(getName());
28 | entry.setPlatform(Platform.STEAM_ID);
29 | entry.setPlatformGameId(getId());
30 | return entry;
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/game/scraper/SteamProfile.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.game.scraper;
2 |
3 | import java.util.HashMap;
4 |
5 | /**
6 | * Created by LM on 21/02/2017.
7 | */
8 | public class SteamProfile {
9 | private String accountName;
10 | private String accountId;
11 | private static HashMap SCANNED_PROFILES = new HashMap<>();
12 |
13 | public SteamProfile(String accountName, String accountId) {
14 | this.accountName = accountName;
15 | this.accountId = accountId;
16 | SCANNED_PROFILES.put(accountName,this);
17 | }
18 |
19 | public String getAccountName() {
20 | return accountName;
21 | }
22 |
23 | public String getAccountId() {
24 | return accountId;
25 | }
26 |
27 | public static SteamProfile fromAccountName(String accountName){
28 | return SCANNED_PROFILES.get(accountName);
29 | }
30 |
31 | @Override
32 | public int hashCode(){
33 | return accountId.hashCode();
34 | }
35 |
36 | @Override
37 | public boolean equals(Object object){
38 | if (object == null){
39 | return false;
40 | }
41 | if(object instanceof SteamProfile){
42 | if(object.hashCode() == hashCode()){
43 | return true;
44 | }
45 | }
46 | return false;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/http/HTTPDownloader.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.http;
2 |
3 | /**
4 | * Created by LM on 13/07/2016.
5 | */
6 |
7 | import javax.net.ssl.HttpsURLConnection;
8 | import java.io.File;
9 | import java.io.FileOutputStream;
10 | import java.io.IOException;
11 | import java.io.InputStream;
12 | import java.net.HttpURLConnection;
13 | import java.net.URL;
14 |
15 | /**
16 | * A utility that downloads a file from a URL.
17 | *
18 | * @author www.codejava.net
19 | */
20 | public class HTTPDownloader {
21 | private static final int BUFFER_SIZE = 4096;
22 | private final static String HTTPS = "https";
23 |
24 | /**
25 | * Downloads a file from a URL
26 | *
27 | * @param fileURL HTTP URL of the file to be downloaded
28 | * @param saveDir path of the directory to save the file
29 | * @throws IOException
30 | */
31 | public static boolean downloadFile(String fileURL, String saveDir, String fileName)
32 | throws IOException {
33 |
34 | URL url = new URL(fileURL);
35 |
36 | boolean isHttps = fileURL.startsWith(HTTPS);
37 | HttpURLConnection httpConn = isHttps ? (HttpsURLConnection) url.openConnection() : (HttpURLConnection) url.openConnection();
38 | httpConn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11");
39 | int responseCode = httpConn.getResponseCode();
40 |
41 | // always check HTTP response code first
42 | if (responseCode == HttpURLConnection.HTTP_OK) {
43 |
44 | String disposition = httpConn.getHeaderField("Content-Disposition");
45 | String contentType = httpConn.getContentType();
46 | int contentLength = httpConn.getContentLength();
47 |
48 | /*System.out.println("Content-Type = " + contentType);
49 | System.out.println("Content-Disposition = " + disposition);
50 | System.out.println("Content-Length = " + contentLength);
51 | System.out.println("fileName = " + fileName);*/
52 |
53 | // opens input stream from the HTTP connection
54 | InputStream inputStream = httpConn.getInputStream();
55 | String saveFilePath = saveDir + File.separator + fileName;
56 |
57 | // opens an output stream to save into file
58 | FileOutputStream outputStream = new FileOutputStream(saveFilePath);
59 |
60 | int bytesRead = -1;
61 | byte[] buffer = new byte[BUFFER_SIZE];
62 | while ((bytesRead = inputStream.read(buffer)) != -1) {
63 | outputStream.write(buffer, 0, bytesRead);
64 | }
65 |
66 | outputStream.close();
67 | inputStream.close();
68 | httpConn.disconnect();
69 | //System.out.println("File downloaded");
70 | return true;
71 | } else {
72 | httpConn.disconnect();
73 | System.out.println("No file to download. Server replied HTTP code: " + responseCode);
74 | return false;
75 | }
76 | }
77 |
78 | public static void main(String[] args) {
79 | String imageURL = "https://images.igdb.com/igdb/image/upload/t_cover_big_2x/vdzfsbissgp55fvfxccp.jpg";
80 | File output = new File("cache/");
81 | try {
82 | output.mkdir();
83 | downloadFile(imageURL, output.getAbsolutePath(), "1020_cover_big_2x.jpg");
84 | } catch (IOException e) {
85 | e.printStackTrace();
86 | }
87 | }
88 | }
--------------------------------------------------------------------------------
/src/com/gameroom/data/http/URLTools.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.http;
2 |
3 | import com.gameroom.ui.Main;
4 |
5 | import java.io.IOException;
6 | import java.net.InetSocketAddress;
7 | import java.net.Socket;
8 |
9 | /**
10 | * Created by LM on 03/08/2016.
11 | */
12 | public class URLTools {
13 | private final static int HTTPS_PORT = 443;
14 | private final static int HTTP_PORT = 80;
15 |
16 | public final static String HTTPS_PREFIX= "https://";
17 | public final static String HTTP_PREFIX= "http://";
18 |
19 |
20 | public static boolean pingHttps(String host,int timeout) {
21 | try (Socket socket = new Socket()) {
22 | socket.connect(new InetSocketAddress(host, HTTPS_PORT), timeout);
23 | Main.LOGGER.debug("Host "+host+" reachable (https)");
24 | return true;
25 | } catch (IOException e) {
26 | Main.LOGGER.debug("Host "+host+" unreachable (https)");
27 | return false; // Either timeout or unreachable or failed DNS lookup.
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/http/key/CipherUtils.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.http.key;
2 |
3 | import org.apache.commons.lang.RandomStringUtils;
4 | import org.json.JSONObject;
5 |
6 | import javax.crypto.*;
7 | import javax.crypto.spec.IvParameterSpec;
8 | import javax.xml.bind.DatatypeConverter;
9 | import java.nio.charset.StandardCharsets;
10 | import java.security.*;
11 | import java.security.spec.X509EncodedKeySpec;
12 | import java.util.Base64;
13 |
14 | /**
15 | * @author LM. Garret (admin@gameroom.me)
16 | * @date 21/10/2017.
17 | */
18 | public class CipherUtils {
19 | public final static String API_PUB_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyoET+mUijKlhWe0TiOOZ\n" +
20 | "XsqmT3YkKWxHjZmYkM6+hqv2pwMC9i8/rCJQKdIe1YAq+s1b2RHKX4qdFt410hZ+\n" +
21 | "3gwgCAS8iV+mBqwIYpHT2truMj3lIKmrvw+OIqgbef0zUpJjhes+0+gH41Mr1jtJ\n" +
22 | "euQ1/uBiJD1W9e4SHBZqVXltnEmmP9STfrOFOrrd7BsNDUdNgHrjZUCWW0B/NSHr\n" +
23 | "gXu+hunIloozNQoV9xJi5Jwf6TfxlM3QfiSVlkmP4FDftSAkJ/F7vBGpwNyoRCCW\n" +
24 | "KmBJDNwPAwZc5X3NLV7RqOUVM62ABAr6Pi3TQQPHvNQbXfKtD66FCTuxnSAkn0+g\n" +
25 | "swIDAQAB\n";
26 |
27 | public static PublicKey loadPublicKey() throws Exception {
28 |
29 | // strip of newlines, whitespaces
30 | String publicKeyPEM = API_PUB_KEY.replaceAll("\\s", "");
31 |
32 | // decode to get the binary DER representation
33 | byte[] publicKeyDER = Base64.getDecoder().decode(publicKeyPEM);
34 |
35 | KeyFactory keyFactory = KeyFactory.getInstance("RSA");
36 | return keyFactory.generatePublic(new X509EncodedKeySpec(publicKeyDER));
37 | }
38 |
39 | private static String cipher(String clearText, Key key, String algo) throws Exception {
40 | Cipher cipher = Cipher.getInstance(algo);
41 |
42 | if (algo.equals("AES/CBC/PKCS5PADDING")) {
43 | byte[] ivBytes = DatatypeConverter.parseBase64Binary(getEncryptionIV());
44 | cipher.init(Cipher.ENCRYPT_MODE, key, new IvParameterSpec(ivBytes));
45 | byte[] encBytes = cipher.doFinal(clearText.getBytes("UTF-8"));
46 | // concat iv + encripted bytes
47 | byte[] concat = new byte[ivBytes.length + encBytes.length];
48 | System.arraycopy(ivBytes, 0, concat, 0, ivBytes.length);
49 | System.arraycopy(encBytes, 0, concat, ivBytes.length, encBytes.length);
50 | return DatatypeConverter.printBase64Binary(concat);
51 | } else {
52 | cipher.init(Cipher.ENCRYPT_MODE, key);
53 | byte[] encrypted = cipher.doFinal(clearText.getBytes(StandardCharsets.UTF_8));
54 | return Base64.getEncoder().encodeToString(encrypted);
55 | }
56 | }
57 |
58 | public static String cipherRSA(String clearText, SecretKey keyRSA) throws Exception {
59 | return cipher(clearText, keyRSA, "RSA/ECB/PKCS1Padding");
60 | }
61 |
62 | public static String cipherAESKeyWithRSA(SecretKey keyAES, Key keyRSA) throws Exception {
63 | return cipher(Base64.getEncoder().encodeToString(keyAES.getEncoded()), keyRSA, "RSA/ECB/PKCS1Padding");
64 | }
65 |
66 | public static String cipherAES(JSONObject obj, SecretKey keyAES) throws Exception {
67 | if (obj == null) {
68 | throw new IllegalArgumentException("JSONObject cannot be null !");
69 | }
70 | String key_salt = "salt_" + RandomStringUtils.randomAlphanumeric(10);
71 | obj.put(key_salt, RandomStringUtils.randomAlphanumeric(20));
72 | return cipher(obj.toString(), keyAES, "AES/CBC/PKCS5PADDING");
73 | }
74 |
75 | public static SecretKey generateAES128Key() throws NoSuchAlgorithmException {
76 | KeyGenerator keyGen = KeyGenerator.getInstance("AES");
77 | keyGen.init(128); // for example
78 | return keyGen.generateKey();
79 | }
80 |
81 | private static String getEncryptionIV() {
82 | SecureRandom random = new SecureRandom();
83 | byte[] ivBytes = new byte[16];
84 | random.nextBytes(ivBytes);
85 | return DatatypeConverter.printBase64Binary(ivBytes);
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/migration/OldGenre.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.migration;
2 |
3 | import com.google.gson.Gson;
4 |
5 | /**
6 | * Created by LM on 01/03/2017.
7 | */
8 | public enum OldGenre {
9 | POINT_AND_CLICK("point_and_click"),
10 | FIGHTING("fighting"),
11 | SHOOTER("fps"),
12 | MUSIC("music"),
13 | PLATFORM("platform"),
14 | PUZZLE("puzzle"),
15 | RACING("racing"),
16 | REAL_TIME_STRATEGY("rts"),
17 | ROLE_PLAYING("rpg"),
18 | SIMULATOR("simulator"),
19 | SPORT("sport"),
20 | STRATEGY("strategy"),
21 | TURN_BASED_STRATEGY("tbs"),
22 | TACTICAL("tactical"),
23 | HACK_AND_SLASH_BEAT_EM_UP("hack_and_slash"),
24 | QUIZ_TRIVIA("quiz"),
25 | PINBALL("pinball"),
26 | ADVENTURE("adventure"),
27 | INDIE("indie"),
28 | ARCADE("arcade");
29 |
30 | private String key;
31 |
32 | OldGenre(String key) {
33 | this.key = key;
34 | }
35 |
36 | public static String toJson(OldGenre[] genres) {
37 | Gson gson = new Gson();
38 | return gson.toJson(genres, OldGenre[].class);
39 | }
40 |
41 | public static OldGenre[] fromJson(String json) {
42 | Gson gson = new Gson();
43 | return gson.fromJson(json, OldGenre[].class);
44 | }
45 |
46 | public String getKey() {
47 | return key;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/migration/OldSettings.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.migration;
2 |
3 | import com.gameroom.data.game.entry.Platform;
4 | import com.gameroom.data.game.scraper.SteamPreEntry;
5 | import com.gameroom.data.io.DataBase;
6 | import com.gameroom.ui.Main;
7 |
8 | import java.io.File;
9 | import java.io.FileInputStream;
10 | import java.io.IOException;
11 | import java.io.InputStream;
12 | import java.sql.Connection;
13 | import java.sql.PreparedStatement;
14 | import java.sql.SQLException;
15 | import java.util.HashMap;
16 | import java.util.Properties;
17 |
18 | import static com.gameroom.ui.Main.FILES_MAP;
19 |
20 | /**
21 | * Created by LM on 02/06/2017.
22 | */
23 | public class OldSettings {
24 | protected static HashMap settingsMap = new HashMap<>();
25 |
26 | public static void transferOldSettings() {
27 | File configFile = FILES_MAP.get("config.properties");
28 | if (!configFile.exists()) { //already migrated
29 | return;
30 | }
31 | Properties prop = new Properties();
32 | InputStream input = null;
33 |
34 | try {
35 | input = new FileInputStream(Main.FILES_MAP.get("config.properties"));
36 |
37 | // load a properties file
38 | prop.load(input);
39 |
40 | for (OldPredefinedSetting predefinedSetting : OldPredefinedSetting.values()) {
41 | OldSettingValue.loadSetting(settingsMap, prop, predefinedSetting);
42 | }
43 | for (OldPredefinedSetting predefinedSetting : OldPredefinedSetting.values()) {
44 | if (predefinedSetting.equals(OldPredefinedSetting.GAMES_FOLDER)) {
45 | OldSettingValue value = settingsMap.get(predefinedSetting.getKey());
46 | if(value != null && value.toString() != null && !value.toString().isEmpty()){
47 | try {
48 | Connection connection = DataBase.getUserConnection();
49 | PreparedStatement statement = connection.prepareStatement("INSERT OR REPLACE INTO GameFolder (path,platform_id) VALUES (?,?)");
50 | statement.setString(1, value.toString().replace("\"",""));
51 | statement.setInt(2, Platform.PC_ID);
52 | statement.execute();
53 | statement.close();
54 | } catch (SQLException e) {
55 | e.printStackTrace();
56 | }
57 | }
58 | } else {
59 | OldSettingValue.toDB(settingsMap, predefinedSetting);
60 | }
61 | }
62 |
63 | } catch (IOException | SQLException ex) {
64 | ex.printStackTrace();
65 |
66 | } finally {
67 | if (input != null) {
68 | try {
69 | input.close();
70 | } catch (IOException e) {
71 | e.printStackTrace();
72 | }
73 | }
74 | }
75 | }
76 |
77 | protected static File[] getIgnoredFiles() {
78 | OldSettingValue setting = settingsMap.get(OldPredefinedSetting.IGNORED_GAME_FOLDERS.getKey());
79 | if (setting == null || setting.getSettingValue() == null) {
80 | return new File[0];
81 | }
82 | return (File[]) setting.getSettingValue();
83 | }
84 |
85 | protected static SteamPreEntry[] getIgnoredSteamApps() {
86 | OldSettingValue setting = settingsMap.get(OldPredefinedSetting.IGNORED_STEAM_APPS.getKey());
87 | if (setting == null || setting.getSettingValue() == null) {
88 | return new SteamPreEntry[0];
89 | }
90 | return (SteamPreEntry[]) setting.getSettingValue();
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/src/com/gameroom/data/migration/OldTheme.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.data.migration;
2 |
3 | import com.google.gson.Gson;
4 |
5 | /**
6 | * Created by LM on 02/03/2017.
7 | */
8 | public enum OldTheme {
9 | ACTION("action"),
10 | FANTASY("fantasy"),
11 | SCIENCE_FICTION("science_fiction"),
12 | HORROR("horror"),
13 | THRILLER("thriller"),
14 | SURVIVAL("survival"),
15 | HISTORICAL("historical"),
16 | STEALTH("stealth"),
17 | COMEDY("comedy"),
18 | BUSINESS("business"),
19 | DRAMA("drama"),
20 | NON_FICTION("non_fiction"),
21 | SANDBOX("sandbox"),
22 | EDUCATIONAL("educational"),
23 | KIDS("kids"),
24 | OPEN_WORLD("open_world"),
25 | WARFARE("warfare"),
26 | PARTY("party"),
27 | EXPLORE_EXPAND_EXPLOIT_EXTERMINATE("4x"),
28 | EROTIC("erotic"),
29 | MYSTERY("mystery");
30 |
31 | private String key;
32 |
33 | OldTheme(String key) {
34 | this.key = key;
35 | }
36 |
37 | public static String toJson(OldTheme[] genres) {
38 | Gson gson = new Gson();
39 | return gson.toJson(genres, OldTheme[].class);
40 | }
41 |
42 | public static OldTheme[] fromJson(String json) {
43 | Gson gson = new Gson();
44 | return gson.fromJson(json, OldTheme[].class);
45 | }
46 |
47 | public String getKey() {
48 | return key;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/com/gameroom/system/application/MessageListener.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.system.application;
2 |
3 | /**
4 | * Created by LM on 28/07/2016.
5 | */
6 | public interface MessageListener {
7 |
8 | void onMessageReceived(MessageTag tag, String payload);
9 | }
10 |
--------------------------------------------------------------------------------
/src/com/gameroom/system/application/MessageTag.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.system.application;
2 |
3 | /**
4 | * Created by LM on 28/07/2016.
5 | */
6 | public enum MessageTag {
7 | CLOSE_APP("CLOSE_APP", false)
8 | ,NEW_UPDATE("NEW_UPDATE", true)
9 | ,ERROR("ERROR", false)
10 | ,NO_UPDATE("NO_UPDATE", false);
11 |
12 | private String tag;
13 | private boolean hasPayload;
14 | MessageTag(String tag, boolean hasPayload){
15 | this.tag = tag;
16 | this.hasPayload = hasPayload;
17 | }
18 |
19 | @Override
20 | public String toString(){
21 | return tag;
22 | }
23 | public boolean hasPayload(){
24 | return hasPayload;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/com/gameroom/system/application/OnLaunchAction.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.system.application;
2 |
3 | import com.gameroom.ui.Main;
4 |
5 | /**
6 | * Created by LM on 16/07/2016.
7 | */
8 | public enum OnLaunchAction {
9 | DO_NOTHING("onLaunch_do_nothing"),
10 | CLOSE("onLaunch_close_"),
11 | HIDE("onLaunch_hide")
12 | ;
13 |
14 | private final String ressourceKey;
15 |
16 | OnLaunchAction(final String ressourceKey) {
17 | this.ressourceKey = ressourceKey;
18 | }
19 |
20 | @Override
21 | public String toString() {
22 | return Main.getString(ressourceKey);
23 | }
24 | public static OnLaunchAction fromString(String key){
25 | for(OnLaunchAction action : OnLaunchAction.values()){
26 | if(action.ressourceKey.equals(key)){
27 | return action;
28 | }
29 | }
30 | return DO_NOTHING;
31 | }
32 | public String getRessourceKey(){
33 | return ressourceKey;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/com/gameroom/system/application/settings/SettingValue.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.system.application.settings;
2 |
3 | import com.google.gson.Gson;
4 | import com.google.gson.reflect.TypeToken;
5 | import javafx.beans.property.SimpleBooleanProperty;
6 |
7 | /** This class represents the value of a given {@link PredefinedSetting}. It is generic and thus can be used to store
8 | * different type of settings (double, boolean, String). Be careful, as the value is jsonified in order to be stored
9 | * into the DB (for later reads), then it is not possible to use generic types (e.g. ArrayList) as those will
10 | * not be correctly read afterwards. It is necessary to store to the lower abstraction possible!
11 | *
12 | * @author LM. Garret (admin@gameroom.me)
13 | * @date 08/08/2016
14 | */
15 |
16 | public class SettingValue {
17 | public final static String CATEGORY_GENERAL = "general";
18 | public final static String CATEGORY_NONE = "none";
19 | public final static String CATEGORY_UI = "ui";
20 | public final static String CATEGORY_ON_GAME_START = "onGameStart";
21 | public final static String CATEGORY_SCAN= "scan";
22 |
23 |
24 | private final static Gson GSON = new Gson();
25 | private T settingValue;
26 | private String category;
27 | private Class valueClass;
28 |
29 | private TypeToken typeToken;
30 |
31 | private SettingValue(T settingValue, TypeToken typeToken, String category){
32 | this.settingValue = settingValue;
33 | this.category = category;
34 | this.typeToken = typeToken;
35 | }
36 | public SettingValue(T settingValue, Class valueClass, String category){
37 | this.settingValue = settingValue;
38 | this.category = category;
39 | this.valueClass = valueClass;
40 | }
41 | public T getSettingValue(){
42 | return settingValue;
43 | }
44 |
45 | public void setSettingValue(T settingValue) {
46 | this.settingValue = settingValue;
47 | }
48 |
49 | public TypeToken getTypeToken(){
50 | return typeToken;
51 | }
52 |
53 | @Override
54 | public String toString(){
55 | if(getValueClass()!= null && settingValue instanceof SimpleBooleanProperty){
56 | return GSON.toJson(((SimpleBooleanProperty)settingValue).getValue());
57 | }
58 | return GSON.toJson(settingValue);
59 | }
60 |
61 | /** Creates a {@link SettingValue} corresponding to the given predefinedSetting, which value is determined by the jsonValue.
62 | * Might return null in case of an invalid value
63 | * @param predefinedSetting the predefined setting this settings value corresponds to.
64 | * @param jsonValue defines what the value of this setting is
65 | * @return a {@link SettingValue} if the jsonValue is correct, null otherwise
66 | */
67 | public static SettingValue getSettingValue(PredefinedSetting predefinedSetting, String jsonValue){
68 | SettingValue settingValue = null;
69 | if (predefinedSetting.getDefaultValue().getValueClass() != null) {
70 | if (predefinedSetting.getDefaultValue().getSettingValue() instanceof SimpleBooleanProperty) {
71 | Boolean storedValue = GSON.fromJson(jsonValue, Boolean.class);
72 | SimpleBooleanProperty b = new SimpleBooleanProperty(storedValue);
73 | settingValue = new SettingValue(b, predefinedSetting.getDefaultValue().getValueClass(), predefinedSetting.getDefaultValue().getCategory());
74 | } else {
75 | settingValue = new SettingValue(GSON.fromJson(jsonValue, predefinedSetting.getDefaultValue().getValueClass()), predefinedSetting.getDefaultValue().getValueClass(), predefinedSetting.getDefaultValue().getCategory());
76 | }
77 | } else {
78 | settingValue = new SettingValue(GSON.fromJson(jsonValue, predefinedSetting.getDefaultValue().getTypeToken().getType()), predefinedSetting.getDefaultValue().getTypeToken().getRawType(), predefinedSetting.getDefaultValue().getCategory());
79 | }
80 | return settingValue;
81 | }
82 |
83 | public String getCategory() {
84 | return category;
85 | }
86 |
87 | public Class getValueClass() {
88 | return valueClass;
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/src/com/gameroom/system/device/ControllerButtonListener.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.system.device;
2 |
3 | /**
4 | * Created by LM on 26/07/2016.
5 | */
6 | public interface ControllerButtonListener {
7 | void onButtonPressed(String buttonId);
8 | void onButtonReleased(String buttonId);
9 | }
10 |
--------------------------------------------------------------------------------
/src/com/gameroom/system/device/XboxControllerTest.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.system.device;
2 |
3 | import com.gameroom.ui.Main;
4 |
5 | /**
6 | * Created by LM on 26/07/2016.
7 | */
8 | class XboxControllerTest {
9 | public static void main(String[] args) {
10 | GameController c = new GameController(new ControllerButtonListener() {
11 | @Override
12 | public void onButtonPressed(String buttonId) {
13 | switch (buttonId) {
14 | case GameController.BUTTON_A:
15 | Main.LOGGER.debug("A pressed");
16 | break;
17 | case GameController.BUTTON_B:
18 | Main.LOGGER.debug("B pressed");
19 | break;
20 | case GameController.BUTTON_X:
21 | Main.LOGGER.debug("X pressed");
22 | break;
23 | case GameController.BUTTON_Y:
24 | Main.LOGGER.debug("Y pressed");
25 | break;
26 | case GameController.BUTTON_DPAD_UP:
27 | Main.LOGGER.debug("DPAD up pressed");
28 | break;
29 | case GameController.BUTTON_DPAD_LEFT:
30 | Main.LOGGER.debug("DPAD left pressed");
31 | break;
32 | case GameController.BUTTON_DPAD_DOWN:
33 | Main.LOGGER.debug("DPAD down pressed");
34 | break;
35 | case GameController.BUTTON_DPAD_RIGHT:
36 | Main.LOGGER.debug("DPAD right pressed");
37 | break;
38 | default:
39 | break;
40 | }
41 |
42 | }
43 |
44 | @Override
45 | public void onButtonReleased(String buttonId) {
46 |
47 | }
48 | });
49 | //noinspection InfiniteLoopStatement
50 | while (true){
51 | try {
52 | Thread.sleep(500);
53 | } catch (InterruptedException e) {
54 | e.printStackTrace();
55 | }
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/com/gameroom/system/internet/DownloadStatus.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.system.internet;
2 |
3 | /**
4 | * Created by LM on 30/07/2016.
5 | */
6 | public enum DownloadStatus {
7 | DOWNLOADING,
8 | PAUSED,
9 | COMPLETE,
10 | CANCELLED,
11 | ERROR;
12 | }
13 |
--------------------------------------------------------------------------------
/src/com/gameroom/system/os/PowerMode.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.system.os;
2 |
3 | import com.gameroom.ui.Main;
4 |
5 | import java.io.IOException;
6 | import java.util.ArrayList;
7 | import java.util.UUID;
8 |
9 | /**
10 | * Created by LM on 14/07/2016.
11 | */
12 | public class PowerMode {
13 | private UUID uuid;
14 | private String alias;
15 |
16 | public PowerMode(UUID uuid, String alias) {
17 | this.uuid = uuid;
18 | this.alias = alias;
19 | }
20 | public PowerMode(UUID uuid){
21 | this.uuid = uuid;
22 | this.alias = getAlias(uuid);
23 | }
24 |
25 | private UUID getUuid() {
26 | return uuid;
27 | }
28 |
29 | public String getAlias() {
30 | return alias;
31 | }
32 | public void activate(){
33 | Terminal terminal = new Terminal();
34 | try {
35 | Main.LOGGER.info("Activating power mode : "+alias);
36 | terminal.execute("powercfg", "-setactive", uuid.toString());
37 | } catch (IOException e1) {
38 | e1.printStackTrace();
39 | }
40 | }
41 | @Override
42 | public String toString(){
43 | return "Mode " + alias + " : uuid=" + uuid;
44 | }
45 |
46 | private static PowerMode readFromLine(String cmdLine) {
47 | if (cmdLine.contains("GUID")) {
48 | int guidStart = cmdLine.indexOf(":") + 2;
49 | int guidEnd = cmdLine.indexOf(" (");
50 |
51 | int aliasStart = cmdLine.indexOf(" (") + 3;
52 | int aliasEnd = cmdLine.indexOf(")");
53 |
54 | String uuid = cmdLine.substring(guidStart, guidEnd);
55 | String alias = cmdLine.substring(aliasStart, aliasEnd);
56 |
57 | return new PowerMode(UUID.fromString(uuid), alias);
58 | }
59 | return null;
60 | }
61 |
62 | private static ArrayList readFromLines(String[] cmdLines) {
63 | ArrayList result = new ArrayList<>();
64 | for (String line : cmdLines) {
65 | PowerMode mode = readFromLine(line);
66 | if (mode != null) {
67 | result.add(mode);
68 | }
69 | }
70 | return result;
71 | }
72 |
73 | public static ArrayList getPowerModesAvailable() {
74 | Terminal terminal = new Terminal();
75 | try {
76 | String[] result = terminal.execute("powercfg", "-list");
77 | ArrayList powerModes = readFromLines(result);
78 |
79 | Main.LOGGER.info("Available power modes : ");
80 | for(PowerMode pm : powerModes){
81 | Main.LOGGER.debug("\t-"+pm);
82 | }
83 | return powerModes;
84 |
85 | } catch (IOException e1) {
86 | e1.printStackTrace();
87 | }
88 | return null;
89 | }
90 | public static PowerMode getActivePowerMode(){
91 | Terminal terminal = new Terminal();
92 | try {
93 | String[] result = terminal.execute("powercfg", "-getactivescheme");
94 | ArrayList powerModes = readFromLines(result);
95 |
96 | for(PowerMode pm : powerModes){
97 | Main.LOGGER.info("Current power mode : "+pm.getAlias());
98 | return pm;
99 | }
100 | } catch (IOException e1) {
101 | e1.printStackTrace();
102 | }
103 | return null;
104 | }
105 | private static String getAlias(UUID uuid){
106 | for(PowerMode pm : getPowerModesAvailable()){
107 | if(pm.getUuid().equals(uuid)){
108 | return pm.getAlias();
109 | }
110 | }
111 | return null;
112 | }
113 |
114 | }
--------------------------------------------------------------------------------
/src/com/gameroom/system/os/TerminalTest.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.system.os;
2 |
3 | import javafx.application.Application;
4 | import javafx.scene.Scene;
5 | import javafx.scene.control.Button;
6 | import javafx.scene.layout.StackPane;
7 | import javafx.stage.Stage;
8 | import com.gameroom.system.application.settings.PredefinedSetting;
9 | import com.gameroom.ui.Main;
10 |
11 | import java.awt.*;
12 | import java.io.IOException;
13 | import java.util.ResourceBundle;
14 |
15 | import static com.gameroom.system.application.settings.GeneralSettings.settings;
16 | import static com.gameroom.ui.Main.*;
17 |
18 | /**
19 | * Created by LM on 12/07/2016.
20 | */
21 | public class TerminalTest extends Application {
22 |
23 | private static StackPane contentPane;
24 | private static Scene scene;
25 |
26 |
27 | private static void initScene() {
28 | Button launchButton = new Button("Launch");
29 |
30 | Terminal terminal = new Terminal();
31 |
32 |
33 | launchButton.setOnAction(e -> {
34 | try {
35 | String[] result = terminal.execute("powercfg", "-list");
36 | for(String s : result){
37 | Main.LOGGER.debug("[cmd powercfg] "+s);
38 | }
39 | } catch (IOException e1) {
40 | e1.printStackTrace();
41 | }
42 | }
43 | );
44 | contentPane.getChildren().addAll(launchButton);
45 | }
46 |
47 | @Override
48 | public void start(Stage primaryStage) throws Exception {
49 | contentPane = new StackPane();
50 | scene = new Scene(contentPane, 640, 480);
51 | initScene();
52 | primaryStage.setTitle("UITest");
53 | primaryStage.setScene(scene);
54 | primaryStage.show();
55 | }
56 |
57 | public static void main(String[] args) {
58 | Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
59 | SCREEN_WIDTH = (int) screenSize.getWidth();
60 | SCREEN_HEIGHT = (int) screenSize.getHeight();
61 | Main.setRessourceBundle(ResourceBundle.getBundle("strings", settings().getLocale(PredefinedSetting.LOCALE)));
62 |
63 | launch(args);
64 | }
65 | }
--------------------------------------------------------------------------------
/src/com/gameroom/system/os/WinReg.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.system.os;
2 |
3 | import com.gameroom.ui.Main;
4 |
5 | import java.io.File;
6 | import java.io.IOException;
7 |
8 | /**
9 | * @author LM. Garret (admin@gameroom.me)
10 | * @date 07/06/2017.
11 | */
12 | public class WinReg {
13 | public final static String HKLM = "HKLM";
14 |
15 | public static String readString(String hkey, String key, String valueName) {
16 | Terminal terminal = new Terminal(false);
17 | try {
18 | String[] result = terminal.execute("reg query", hkey + "\\" + key, "/v", valueName);
19 | String lineStart = valueName + " " + "REG_SZ ";
20 | for (String line : result) {
21 | if (line.trim().startsWith(lineStart)) {
22 | return line.trim().substring(lineStart.length());
23 | }
24 | }
25 | } catch (IOException e) {
26 | Main.LOGGER.error("WinReg: could not find reg key");
27 | e.printStackTrace();
28 | }
29 | return null;
30 | }
31 |
32 | public static String readDataPath() {
33 | String dataPath32 = readString(HKLM, "Software\\GameRoom", "DataPath");
34 | if (dataPath32 != null) {
35 | return dataPath32;
36 | }
37 | String dataPath64 = readString(HKLM, "Software\\WOW6432NODE\\GameRoom", "DataPath");
38 | if (dataPath64 != null) {
39 | return dataPath64;
40 | }
41 | String appdataFolder = System.getenv("APPDATA");
42 | return appdataFolder + File.separator + "GameRoom";
43 | }
44 |
45 | public static String readHWGUID() {
46 | String machineGuid32 = readString(HKLM, "SOFTWARE\\Microsoft\\Cryptography", "MachineGuid");
47 | if (machineGuid32 != null && !machineGuid32.isEmpty()) {
48 | return machineGuid32;
49 | }
50 | String machineGuid64 = readString(HKLM, "SOFTWARE\\WOW6432NODE\\Microsoft\\Cryptography", "MachineGuid");
51 | if (machineGuid64 != null && !machineGuid64.isEmpty()) {
52 | return machineGuid64;
53 | }
54 | return null;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/com/gameroom/system/os/mslinks/LinkTargetIDList.java:
--------------------------------------------------------------------------------
1 | /*
2 | https://github.com/BlackOverlord666/mslinks
3 |
4 | Copyright (c) 2015 Dmitrii Shamrikov
5 |
6 | Licensed under the WTFPL
7 | You may obtain a copy of the License at
8 |
9 | http://www.wtfpl.net/about/
10 |
11 | Unless required by applicable law or agreed to in writing, software
12 | distributed under the License is distributed on an "AS IS" BASIS,
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | */
15 | package com.gameroom.system.os.mslinks;
16 |
17 | import com.gameroom.system.os.mslinks.data.ItemID;
18 | import com.gameroom.system.os.mslinks.io.ByteReader;
19 | import com.gameroom.system.os.mslinks.io.ByteWriter;
20 |
21 | import java.io.ByteArrayOutputStream;
22 | import java.io.IOException;
23 | import java.util.LinkedList;
24 |
25 | public class LinkTargetIDList extends LinkedList implements Serializable {
26 |
27 | public LinkTargetIDList() {}
28 |
29 | public LinkTargetIDList(ByteReader data) throws IOException, ShellLinkException {
30 | int size = (int)data.read2bytes();
31 |
32 | int pos = data.getPosition();
33 |
34 | boolean binary = false;
35 | int s = (int)data.read2bytes();
36 | while (s != 0) {
37 | s -= 2;
38 | if (binary) {
39 | byte[] b = new byte[s];
40 | for (int i=0; i> 1];
75 | for (int i=0, j=0; j 16)
74 | throw new ShellLinkException("netbios name length must be <= 16");
75 | netbios = s;
76 | return this;
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/src/com/gameroom/system/os/mslinks/extra/VistaIDList.java:
--------------------------------------------------------------------------------
1 | /*
2 | https://github.com/BlackOverlord666/mslinks
3 |
4 | Copyright (c) 2015 Dmitrii Shamrikov
5 |
6 | Licensed under the WTFPL
7 | You may obtain a copy of the License at
8 |
9 | http://www.wtfpl.net/about/
10 |
11 | Unless required by applicable law or agreed to in writing, software
12 | distributed under the License is distributed on an "AS IS" BASIS,
13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | */
15 | package com.gameroom.system.os.mslinks.extra;
16 |
17 | import com.gameroom.system.os.mslinks.Serializable;
18 | import com.gameroom.system.os.mslinks.ShellLinkException;
19 | import com.gameroom.system.os.mslinks.io.ByteReader;
20 | import com.gameroom.system.os.mslinks.io.ByteWriter;
21 |
22 | import java.io.IOException;
23 | import java.util.LinkedList;
24 |
25 | public class VistaIDList implements Serializable {
26 |
27 | public static final int signature = 0xA000000C;
28 |
29 | private LinkedList list = new LinkedList<>();
30 |
31 | public VistaIDList(ByteReader br, int size) throws ShellLinkException, IOException {
32 | if (size < 0xa)
33 | throw new ShellLinkException();
34 |
35 | int s = (int)br.read2bytes();
36 | while (s != 0) {
37 | s -= 2;
38 | byte[] b = new byte[s];
39 | for (int i=0; i> 8));
21 | }
22 |
23 | public static int reverse(int n) {
24 | return ((n & 0xff) << 24) | ((n & 0xff00) << 8) | ((n & 0xff0000) >> 8) | ((n & 0xff000000) >>> 24);
25 | }
26 |
27 | public static long reverse(long n) {
28 | return ((n & 0xff) << 56) | ((n & 0xff00) << 40) | ((n & 0xff0000) << 24) | ((n & 0xff000000) << 8) |
29 | ((n & 0xff00000000L) >> 8) | ((n & 0xff0000000000L) >> 24) | ((n & 0xff000000000000L) >> 40) | ((n & 0xff00000000000000L) >>> 56);
30 | }
31 |
32 | public static short makeShortB(byte b0, byte b1) {
33 | return (short)((Bytes.i(b0) << 8) | Bytes.i(b1));
34 | }
35 |
36 | public static int makeIntB(byte b0, byte b1, byte b2, byte b3) {
37 | return (Bytes.i(b0) << 24) | (Bytes.i(b1) << 16) | (Bytes.i(b2) << 8) | Bytes.i(b3);
38 | }
39 |
40 | public static long makeLongB(byte b0, byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7) {
41 | return (Bytes.l(b0) << 56) | (Bytes.l(b1) << 48) | (Bytes.l(b2) << 40) | (Bytes.l(b3) << 32) | (Bytes.l(b4) << 24) | (Bytes.l(b5) << 16) | (Bytes.l(b6) << 8) | Bytes.l(b7);
42 | }
43 |
44 | public static short makeShortL(byte b0, byte b1) {
45 | return (short)((Bytes.i(b1) << 8) | Bytes.i(b0));
46 | }
47 |
48 | public static int makeIntL(byte b0, byte b1, byte b2, byte b3) {
49 | return (Bytes.i(b3) << 24) | (Bytes.i(b2) << 16) | (Bytes.i(b1) << 8) | Bytes.i(b0);
50 | }
51 |
52 | public static long makeLongL(byte b0, byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7) {
53 | return (Bytes.l(b7) << 56) | (Bytes.l(b6) << 48) | (Bytes.l(b5) << 40) | (Bytes.l(b4) << 32) | (Bytes.l(b3) << 24) | (Bytes.l(b2) << 16) | (Bytes.l(b1) << 8) | Bytes.l(b0);
54 | }
55 |
56 | private static long l(byte b) {
57 | return b & 0xffL;
58 | }
59 |
60 | private static int i(byte b) {
61 | return b & 0xff;
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/UIValues.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui;
2 |
3 | import javafx.geometry.Insets;
4 |
5 | /**
6 | * @author LM. Garret (admin@gameroom.me)
7 | * @date 16/10/2017.
8 | */
9 | public enum UIValues {
10 | CONTROL_HUGE(Constants.OFFSET_HUGE),
11 | CONTROL_BIG(Constants.OFFSET_BIG),
12 | CONTROL_MEDIUM(Constants.OFFSET_MEDIUM),
13 | CONTROL_SMALL(Constants.OFFSET_SMALL),
14 | CONTROL_XSMALL(Constants.OFFSET_XSMALL);
15 |
16 | private int[] values = new int[4];
17 |
18 | UIValues(int offset) {
19 | for (int i = 0; i < values.length; i++) {
20 | values[i] = offset;
21 | }
22 | }
23 |
24 | UIValues(int top, int right, int bottom, int left) {
25 | values[0] = top;
26 | values[1] = right;
27 | values[2] = bottom;
28 | values[3] = left;
29 | }
30 |
31 | public Insets insets() {
32 | return new Insets(
33 | values[0] * Constants.getScreenFactor(),
34 | values[1] * Constants.getScreenFactor(),
35 | values[2] * Constants.getScreenFactor(),
36 | values[3] * Constants.getScreenFactor()
37 | );
38 | }
39 |
40 | public static class Constants {
41 | private final static int OFFSET_NONE = 0;
42 | private final static int OFFSET_XSMALL = 5;
43 | private final static int OFFSET_SMALL = 10;
44 | private final static int OFFSET_MEDIUM = 20;
45 | private final static int OFFSET_BIG = 30;
46 | private final static int OFFSET_HUGE = 50;
47 |
48 | public static double offsetXSmall() {
49 | return OFFSET_XSMALL * getScreenFactor();
50 | }
51 |
52 | public static double offsetSmall() {
53 | return OFFSET_SMALL * getScreenFactor();
54 | }
55 |
56 | public static double offsetMedium() {
57 | return OFFSET_MEDIUM * getScreenFactor();
58 | }
59 |
60 | public static double offsetNone() {
61 | return OFFSET_NONE * getScreenFactor();
62 | }
63 |
64 | public static double getOffsetBig() {
65 | return OFFSET_BIG * getScreenFactor();
66 | }
67 |
68 | public static double offsetHuge() {
69 | return OFFSET_HUGE * getScreenFactor();
70 | }
71 |
72 |
73 | private static double getScreenFactor() {
74 | return Main.SCREEN_WIDTH / 1920;
75 | }
76 |
77 | }
78 | }
79 |
80 |
81 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/ValidEntryCondition.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control;
2 |
3 | /**
4 | * Created by LM on 10/08/2016.
5 | */
6 | public interface ValidEntryCondition{
7 | StringBuilder message = new StringBuilder();
8 |
9 | boolean isValid();
10 | void onInvalid();
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/button/DualImageButton.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.button;
2 |
3 | import javafx.event.ActionEvent;
4 |
5 | /**
6 | * Created by LM on 02/08/2016.
7 | */
8 | public class DualImageButton extends ImageButton {
9 | private String state1Id, state2Id;
10 | private String currentState;
11 |
12 | private OnActionHandler[] actions = new OnActionHandler[2];
13 |
14 | public DualImageButton(String state1Id, String state2Id, double width, double height) {
15 | super(state1Id, width, height);
16 | this.state1Id = state1Id;
17 | this.state2Id = state2Id;
18 | this.currentState = state1Id;
19 |
20 | actions[0] = new OnActionHandler() {
21 | @Override
22 | public void handle(ActionEvent me) {
23 | toggleState();
24 | }
25 | };
26 |
27 | setOnAction(event -> {
28 | for (OnActionHandler action : actions) {
29 | if (action != null)
30 | action.handle(event);
31 | }
32 | });
33 |
34 | }
35 | public void forceState(String state, boolean applyAction) {
36 | if (!currentState.equals(state)) {
37 | toggleState();
38 | }
39 | if(applyAction){
40 | actions[1].handle(null);
41 | }
42 | }
43 |
44 | public void forceState(String state) {
45 | forceState(state,false);
46 | }
47 |
48 | private void toggleState() {
49 | String currentId = inFirstState() ? state2Id : state1Id;
50 | setImageViewId(currentId);
51 | currentState = inFirstState() ? state2Id : state1Id;
52 | }
53 |
54 | /**
55 | * Should call this method, as setOnAction would override icon and state toggling
56 | */
57 | public void setOnDualAction(OnActionHandler oah) {
58 | actions[1] = oah;
59 | }
60 |
61 | public boolean inFirstState() {
62 | return currentState.equals(state1Id);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/button/HelpButton.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.button;
2 |
3 | import javafx.scene.control.Tooltip;
4 | import com.gameroom.ui.dialog.GameRoomAlert;
5 |
6 | import static com.gameroom.system.application.settings.GeneralSettings.settings;
7 |
8 | /** This displays a question mark icon that holds a given tooltip
9 | *
10 | * @author LM. Garret (admin@gameroom.me)
11 | * @date 09/06/2017.
12 | */
13 | public class HelpButton extends ImageButton {
14 | public HelpButton(String explanation) {
15 | super("help-icon", 22*settings().getUIScale().getScale(), 22*settings().getUIScale().getScale());
16 | setOnAction(event -> GameRoomAlert.info(explanation));
17 | setTooltip(new Tooltip(explanation));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/button/MouseEnteredHandler.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.button;
2 |
3 |
4 | import javafx.scene.input.MouseEvent;
5 |
6 | /**
7 | * Created by LM on 12/07/2016.
8 | */
9 | public interface MouseEnteredHandler {
10 | void handle(MouseEvent me);
11 | }
12 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/button/MouseExitedHandler.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.button;
2 |
3 |
4 | import javafx.scene.input.MouseEvent;
5 |
6 | /**
7 | * Created by LM on 12/07/2016.
8 | */
9 | public interface MouseExitedHandler {
10 | void handle(MouseEvent me);
11 | }
12 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/button/OnActionHandler.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.button;
2 |
3 | import javafx.event.ActionEvent;
4 |
5 | /**
6 | * Created by LM on 02/08/2016.
7 | */
8 | public interface OnActionHandler {
9 | void handle(ActionEvent me);
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/button/gamebutton/InfoGameButton.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.button.gamebutton;
2 |
3 | import com.gameroom.data.game.entry.GameEntry;
4 | import com.gameroom.ui.Main;
5 | import javafx.scene.image.Image;
6 | import javafx.scene.image.ImageView;
7 | import javafx.scene.layout.Pane;
8 | import com.gameroom.ui.scene.BaseScene;
9 |
10 | import static com.gameroom.system.application.settings.GeneralSettings.settings;
11 |
12 | /**
13 | * Created by LM on 12/07/2016.
14 | */
15 | public class InfoGameButton extends GameButton {
16 | private int width;
17 | private int height;
18 |
19 | public InfoGameButton(GameEntry entry, BaseScene scene, Pane parent) {
20 | super(entry, scene, parent);
21 | COVER_SCALE_EFFECT_FACTOR = 1.03;
22 | disableNode(titleBox);
23 | disableNode(infoButton);
24 | disableNode(playTimeLabel);
25 | setOnMouseExited(eh -> {
26 | setFocused(false);
27 | });
28 | setOnMouseEntered(eh -> {
29 | setFocused(true);
30 | });
31 | scene.heightProperty().addListener(cl -> {
32 | height = (int) (scene.getParentStage().getHeight() * 2/ 3);
33 | width = (int) (height / COVER_HEIGHT_WIDTH_RATIO);
34 | setHeight(height);
35 | setWidth(width);
36 | });
37 |
38 | height = (int) (scene.getParentStage().getHeight() * 2/ 3);
39 | width = (int) (height / COVER_HEIGHT_WIDTH_RATIO);
40 |
41 | initContentSize(getCoverWidth(),getCoverHeight());
42 | }
43 |
44 | @Override
45 | protected int getCoverWidth() {
46 | return width;
47 | }
48 |
49 | @Override
50 | protected int getCoverHeight() {
51 | return height;
52 | }
53 |
54 | @Override
55 | protected void initCoverView() {
56 | coverView = new ImageView();
57 | coverView.setFitWidth(getCoverWidth());
58 | coverView.setFitHeight(getCoverHeight());
59 | }
60 |
61 | @Override
62 | protected void onNewTileWidth(double width) {}
63 |
64 | @Override
65 | protected void onNewTileHeight(double height) {}
66 |
67 | public void setImage(Image imageFile) {
68 | coverView.setImage(imageFile);
69 | }
70 |
71 | public Image getImage() {
72 | return coverView.getImage();
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/button/gamebutton/TileGameButton.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.button.gamebutton;
2 |
3 | import com.gameroom.data.game.entry.GameEntry;
4 | import javafx.scene.image.ImageView;
5 | import javafx.scene.layout.TilePane;
6 | import com.gameroom.ui.scene.BaseScene;
7 |
8 | import static com.gameroom.ui.Main.SCREEN_WIDTH;
9 |
10 | /**
11 | * Created by LM on 02/07/2016.
12 | */
13 | public class TileGameButton extends GameButton {
14 | private double imageCoverWidth = -1;
15 | private double imageCoverHeight = -1;
16 |
17 |
18 | public TileGameButton(GameEntry entry, TilePane parent, BaseScene scene) {
19 | this(entry,parent,scene,-1,-1);
20 | }
21 | public TileGameButton(GameEntry entry, TilePane parent, BaseScene scene,double imageCoverWidth,double imageCoverHeight) {
22 | super(entry, scene, parent);
23 | onNewTileWidth(parent.getPrefTileWidth());
24 | onNewTileHeight(parent.getPrefTileHeight());
25 |
26 | initContentSize(parent);
27 |
28 | this.imageCoverHeight = imageCoverHeight;
29 | this.imageCoverWidth = imageCoverWidth;
30 | }
31 |
32 | @Override
33 | protected int getCoverHeight() {
34 | return imageCoverHeight!= -1? (int) imageCoverHeight : (int) (SCREEN_WIDTH / 8 * COVER_HEIGHT_WIDTH_RATIO);
35 | }
36 |
37 | @Override
38 | protected int getCoverWidth() {
39 | return imageCoverWidth!= -1? (int) imageCoverWidth : (int) (SCREEN_WIDTH / 8);
40 | }
41 |
42 | @Override
43 | protected void initCoverView() {
44 | coverView = new ImageView();
45 | }
46 |
47 | @Override
48 | protected void onNewTileWidth(double width) {
49 | }
50 |
51 | @Override
52 | protected void onNewTileHeight(double height) {
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/drawer/DrawerButton.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.drawer;
2 |
3 | import javafx.beans.property.BooleanProperty;
4 | import javafx.beans.property.SimpleBooleanProperty;
5 | import javafx.css.PseudoClass;
6 | import com.gameroom.ui.control.button.ImageButton;
7 |
8 | /**
9 | * Created by LM on 09/02/2017.
10 | */
11 | public class DrawerButton extends ImageButton {
12 | private boolean selectionable = false;
13 | private static PseudoClass SELECTED_PSEUDO_CLASS = PseudoClass.getPseudoClass("submenu-opened");
14 | private BooleanProperty selected = new SimpleBooleanProperty(false);
15 |
16 | public DrawerButton(String cssId, DrawerMenu parentMenu) {
17 | super(cssId, parentMenu.getPrefWidth(), parentMenu.getPrefWidth());
18 | getStyleClass().add("drawer-button");
19 | setFocusTraversable(false);
20 | selected.addListener(e -> pseudoClassStateChanged(SELECTED_PSEUDO_CLASS, selected.get()));
21 |
22 | parentMenu.prefWidthProperty().addListener((observable, oldValue, newValue) -> {
23 | setFitWidth(newValue.doubleValue());
24 | setFitHeight(newValue.doubleValue());
25 | });
26 | }
27 |
28 | public boolean isSelected() {
29 | return selected.get();
30 | }
31 |
32 | public void setSelected(boolean selected) {
33 | this.selected.set(selected);
34 | }
35 |
36 | public boolean isSelectionable() {
37 | return selectionable;
38 | }
39 |
40 | public void setSelectionable(boolean selectionable) {
41 | this.selectionable = selectionable;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/drawer/GroupType.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.drawer;
2 |
3 | import com.gameroom.ui.Main;
4 |
5 | /**
6 | * Created by LM on 09/02/2017.
7 | */
8 | public enum GroupType {
9 | DEFAULT("groupBy_default"),
10 | THEME("groupBy_theme"),
11 | GENRE("groupBy_genre"),
12 | SERIE("groupBy_serie"),
13 | LAUNCHER("groupBy_launcher");
14 |
15 | private String id;
16 |
17 | GroupType(String id){
18 | this.id = id;
19 | }
20 |
21 | public String getName(){
22 | return Main.getString(id);
23 | }
24 |
25 | public String getId() {
26 | return id;
27 | }
28 |
29 | public static GroupType fromId(String id){
30 | for(GroupType s : GroupType.values()){
31 | if (s.id.equals(id)){
32 | return s;
33 | }
34 | }
35 | return DEFAULT;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/drawer/SortType.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.drawer;
2 |
3 | import com.gameroom.ui.Main;
4 |
5 | /**
6 | * Created by LM on 09/02/2017.
7 | */
8 | public enum SortType {
9 | NAME("sortBy_name"),
10 | RATING("sortBy_rating"),
11 | PLAY_TIME("sortBy_playtime"),
12 | RELEASE_DATE("sortBy_release_date");
13 |
14 | private String id;
15 |
16 | SortType(String id){
17 | this.id = id;
18 | }
19 |
20 | public String getName(){
21 | return Main.getString(id);
22 | }
23 |
24 | public String getId() {
25 | return id;
26 | }
27 |
28 | public static SortType fromId(String id){
29 | for(SortType s : SortType.values()){
30 | if (s.id.equals(id)){
31 | return s;
32 | }
33 | }
34 | return NAME;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/drawer/submenu/ButtonItem.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.drawer.submenu;
2 |
3 | import javafx.scene.control.Button;
4 | import com.gameroom.ui.Main;
5 |
6 | /**
7 | * Created by LM on 10/02/2017.
8 | */
9 | public class ButtonItem extends Button {
10 |
11 | public ButtonItem(String textId){
12 | super(Main.getString(textId));
13 | getStyleClass().add("button-drawer-item");
14 | setFocusTraversable(false);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/drawer/submenu/CheckBoxItem.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.drawer.submenu;
2 |
3 | import javafx.scene.control.CheckBox;
4 | import com.gameroom.ui.Main;
5 |
6 | /**
7 | * Created by LM on 10/02/2017.
8 | */
9 | public class CheckBoxItem extends CheckBox{
10 |
11 | public CheckBoxItem(String text, boolean isStringId){
12 | super(isStringId ? Main.getString(text) : text);
13 | //getStyleClass().remove("check-box");
14 | getStyleClass().add("checkbox-drawer-item");
15 | setFocusTraversable(false);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/drawer/submenu/SelectableItem.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.drawer.submenu;
2 |
3 | /**
4 | * Created by LM on 10/02/2017.
5 | */
6 | public interface SelectableItem {
7 |
8 | public void setSelected(boolean b);
9 | public boolean isSelected();
10 | }
11 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/drawer/submenu/TextItem.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.drawer.submenu;
2 |
3 | import javafx.beans.property.BooleanProperty;
4 | import javafx.beans.property.SimpleBooleanProperty;
5 | import javafx.css.PseudoClass;
6 | import javafx.scene.control.Button;
7 | import com.gameroom.ui.Main;
8 |
9 | /**
10 | * Created by LM on 10/02/2017.
11 | */
12 | public class TextItem extends Button implements SelectableItem {
13 | private static PseudoClass SELECTED_PSEUDO_CLASS = PseudoClass.getPseudoClass("selected");
14 | private BooleanProperty selected = new SimpleBooleanProperty(false);
15 |
16 | public TextItem(String textId){
17 | super(Main.getString(textId));
18 | getStyleClass().remove("button");
19 | getStyleClass().add("text-drawer-item");
20 | setFocusTraversable(false);
21 | selected.addListener(e -> pseudoClassStateChanged(SELECTED_PSEUDO_CLASS, selected.get()));
22 | }
23 |
24 |
25 | public boolean isSelected() {
26 | return selected.get();
27 | }
28 |
29 | public void setSelected(boolean selected) {
30 | this.selected.set(selected);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/specific/FloatingSearchBar.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.specific;
2 |
3 | import com.gameroom.ui.UIValues;
4 | import javafx.beans.value.ChangeListener;
5 | import javafx.geometry.Insets;
6 | import javafx.geometry.Pos;
7 | import javafx.scene.control.TextField;
8 | import javafx.scene.layout.HBox;
9 | import com.gameroom.ui.control.button.ImageButton;
10 |
11 | import static com.gameroom.ui.Main.SCREEN_HEIGHT;
12 | import static com.gameroom.ui.Main.SCREEN_WIDTH;
13 |
14 | /**
15 | * Created by LM on 10/02/2017.
16 | */
17 | public class FloatingSearchBar extends HBox {
18 | private SearchBar searchBar;
19 | private ImageButton closeButton;
20 |
21 | public FloatingSearchBar(ChangeListener changeListener){
22 | searchBar = new SearchBar(changeListener);
23 |
24 | closeButton = new ImageButton("toaddtile-ignore-button", searchBar.getImgSize()/1.5, searchBar.getImgSize()/1.5);
25 | closeButton.setFocusTraversable(false);
26 | closeButton.setPadding(UIValues.CONTROL_SMALL.insets());
27 | closeButton.setOnAction(event -> {
28 | hide();
29 | clearSearchField();
30 | });
31 |
32 | getChildren().addAll(searchBar,closeButton);
33 |
34 | setId("search-bar");
35 | setAlignment(Pos.BASELINE_CENTER);
36 | setFocusTraversable(false);
37 | setPickOnBounds(false);
38 |
39 | searchBar.setPadding(UIValues.CONTROL_XSMALL.insets());
40 |
41 | //setPadding(new Insets(10*SCREEN_HEIGHT/1080,0*SCREEN_WIDTH/1920,10*SCREEN_HEIGHT/1080,0*SCREEN_WIDTH/1920));
42 |
43 | }
44 |
45 | public void clearSearchField() {
46 | searchBar.clearSearchField();
47 | }
48 |
49 | public TextField getSearchField() {
50 | return searchBar.getSearchField();
51 | }
52 |
53 | public void show(){
54 | setVisible(true);
55 | setMouseTransparent(false);
56 | }
57 |
58 | public void hide(){
59 | setVisible(false);
60 | setMouseTransparent(true);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/specific/ScanButton.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.specific;
2 |
3 | import com.gameroom.data.game.GameWatcher;
4 | import javafx.animation.*;
5 | import javafx.util.Duration;
6 | import com.gameroom.ui.control.drawer.DrawerButton;
7 | import com.gameroom.ui.control.drawer.DrawerMenu;
8 |
9 | import static com.gameroom.ui.control.button.gamebutton.AddIgnoreGameButton.ROTATION_TIME;
10 |
11 | /**
12 | * Created by LM on 07/01/2017.
13 | */
14 | public class ScanButton extends DrawerButton {
15 | private final static String CSS_ID = "scan-button";
16 | private Timeline rotateAnim;
17 |
18 | public ScanButton(DrawerMenu menu) {
19 | super(CSS_ID, menu);
20 | setStyle("-fx-background-color: transparent;");
21 | setFocusTraversable(false);
22 | setOnAction(event -> {
23 | GameWatcher.getInstance().start(true);
24 | });
25 | GameWatcher.getInstance().addOnSearchStartedListener(() -> {
26 | setMouseTransparent(true);
27 | rotateAnim.play();
28 | });
29 | GameWatcher.getInstance().addOnSearchDoneListener(() -> {
30 | setMouseTransparent(false);
31 | rotateAnim.stop();
32 | });
33 |
34 | rotateAnim = new Timeline(
35 | new KeyFrame(Duration.seconds(0),
36 | new KeyValue(rotateProperty(), rotateProperty().getValue(), Interpolator.LINEAR)),
37 | new KeyFrame(Duration.seconds(ROTATION_TIME),
38 | new KeyValue(rotateProperty(), 360, Interpolator.LINEAR)
39 | ));
40 | rotateAnim.setCycleCount(Animation.INDEFINITE);
41 | rotateAnim.setAutoReverse(false);
42 | rotateAnim.setOnFinished(event -> rotateProperty().setValue(0));
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/specific/SearchBar.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.specific;
2 |
3 | import com.gameroom.ui.UIValues;
4 | import javafx.beans.value.ChangeListener;
5 | import javafx.geometry.Pos;
6 | import javafx.scene.control.TextField;
7 | import javafx.scene.layout.HBox;
8 | import javafx.scene.layout.Priority;
9 | import com.gameroom.ui.control.button.ImageButton;
10 |
11 | import static com.gameroom.ui.Main.SCREEN_WIDTH;
12 |
13 | /**
14 | * @author LM. Garret (admin@gameroom.me)
15 | * @date 09/06/2017.
16 | */
17 | public class SearchBar extends HBox {
18 | private TextField searchField;
19 | private ImageButton searchButton;
20 | private double imgSize;
21 |
22 | public SearchBar(ChangeListener changeListener){
23 | imgSize =20*SCREEN_WIDTH/1080;
24 | searchButton = new ImageButton("search-button", imgSize, imgSize);
25 | searchButton.setFocusTraversable(false);
26 | searchButton.setPadding(UIValues.CONTROL_SMALL.insets());
27 | //searchButton.setPadding(new Insets(20*SCREEN_HEIGHT/1080,20*SCREEN_WIDTH/1080,20*SCREEN_HEIGHT/1080,20*SCREEN_WIDTH/1080));
28 |
29 | searchField = new TextField();
30 | searchField.setFocusTraversable(false);
31 | searchField.textProperty().addListener(changeListener);
32 | //searchField.setPadding(new Insets(10*SCREEN_HEIGHT/1080,10*SCREEN_WIDTH/1080,10*SCREEN_HEIGHT/1080,10*SCREEN_WIDTH/1080));
33 |
34 | getChildren().addAll(searchButton,searchField);
35 |
36 | setAlignment(Pos.BASELINE_CENTER);
37 | setFocusTraversable(false);
38 | setPickOnBounds(false);
39 |
40 | setHgrow(searchField, Priority.ALWAYS);
41 | setHgrow(searchButton,Priority.NEVER);
42 | }
43 |
44 | public void clearSearchField() {
45 | searchField.clear();
46 | }
47 |
48 | public TextField getSearchField() {
49 | return searchField;
50 | }
51 |
52 | public void show(){
53 | setVisible(true);
54 | setMouseTransparent(false);
55 | }
56 |
57 | public void hide(){
58 | setVisible(false);
59 | setMouseTransparent(true);
60 | }
61 |
62 | public double getImgSize() {
63 | return imgSize;
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/textfield/AppPathField.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.textfield;
2 |
3 | import com.gameroom.ui.UIValues;
4 | import javafx.scene.control.ButtonBar;
5 | import javafx.scene.control.ButtonType;
6 | import javafx.stage.Window;
7 | import com.gameroom.ui.Main;
8 | import com.gameroom.ui.control.button.ImageButton;
9 | import com.gameroom.ui.dialog.GameRoomAlert;
10 | import com.gameroom.ui.dialog.selector.AppSelectorDialog;
11 |
12 | import java.io.File;
13 | import java.util.Optional;
14 |
15 | import static com.gameroom.ui.Main.SCREEN_WIDTH;
16 |
17 | /**
18 | * Created by LM on 05/01/2017.
19 | */
20 | public class AppPathField extends PathTextField {
21 | public AppPathField(String initialPath, Window ownerWindow, int fileChooserCode, String fileChooserTitle, String[] extensions) {
22 | super(initialPath, ownerWindow, fileChooserCode, fileChooserTitle,extensions);
23 |
24 | double imgSize = 30 * SCREEN_WIDTH / 1920;
25 | ImageButton searchButton = new ImageButton("app-path-field-search-button", imgSize, imgSize);
26 | searchButton.setFocusTraversable(false);
27 |
28 | buttonsBox.getChildren().add(0, searchButton);
29 |
30 | searchButton.setOnAction(event -> {
31 | if(getTextField().getText() == null){
32 | GameRoomAlert.error(Main.getString("invalid_gamesFolder_exist"));
33 | return;
34 | }
35 | File file = new File(getTextField().getText());
36 | if (!file.exists()) {
37 | GameRoomAlert.error(Main.getString("invalid_gamesFolder_exist"));
38 | } else if (file.isDirectory()) {
39 | try {
40 | AppSelectorDialog selector = new AppSelectorDialog(file,getExtensions());
41 | selector.searchApps();
42 | Optional ignoredOptionnal = selector.showAndWait();
43 | ignoredOptionnal.ifPresent(pairs -> {
44 | if (pairs.getButtonData().equals(ButtonBar.ButtonData.OK_DONE) && selector.getSelectedFile() != null) {
45 | getTextField().setText(selector.getSelectedFile().getAbsolutePath());
46 | }
47 | });
48 | } catch (IllegalArgumentException e) {
49 | GameRoomAlert.warning(Main.getString("invalid_gamesFolder_is_no_folder"));
50 | }
51 | } else {
52 | GameRoomAlert.warning(Main.getString("invalid_gamesFolder_is_no_folder"));
53 | }
54 | });
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/control/textfield/CMDTextField.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.control.textfield;
2 |
3 | import javafx.beans.value.ChangeListener;
4 | import javafx.beans.value.ObservableValue;
5 | import javafx.scene.control.TextArea;
6 | import com.gameroom.ui.Main;
7 |
8 | /**
9 | * Created by LM on 06/09/2016.
10 | */
11 | public class CMDTextField extends TextArea {
12 | private final static int DEFAULT_PREFERRED_ROW_MAX = 5;
13 | private int maxRow;
14 |
15 | private CMDTextField(String initialValue, int maxRow){
16 | super(initialValue);
17 | setPrefRowCount(1);
18 | setPromptText(Main.getString("warning_cmd"));
19 | this.maxRow = maxRow;
20 | textProperty().addListener(new ChangeListener() {
21 | @Override
22 | public void changed(ObservableValue extends String> observable, String oldValue, String newValue) {
23 | setPrefRowCount(getRowCount(newValue));
24 | }
25 | });
26 | setPrefRowCount(getRowCount(initialValue));
27 | }
28 | private int getRowCount(String text){
29 | if(text!=null) {
30 | int lineCount = 1;
31 | for (int i = 0; i < text.length(); i++) {
32 | if (text.charAt(i) == '\n') {
33 | lineCount++;
34 | }
35 | }
36 | if (lineCount > maxRow) {
37 | lineCount = maxRow;
38 | }
39 | return lineCount;
40 | }
41 | return 1;
42 | }
43 | public CMDTextField(String initialValue){
44 | this(initialValue,DEFAULT_PREFERRED_ROW_MAX);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/dialog/ActivationKeyDialog.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.dialog;
2 |
3 | import javafx.scene.control.ButtonBar;
4 | import javafx.scene.control.ButtonType;
5 | import javafx.scene.control.Label;
6 | import javafx.scene.control.TextField;
7 | import javafx.scene.layout.BorderPane;
8 | import com.gameroom.ui.Main;
9 | import com.gameroom.ui.UIValues;
10 |
11 | import static com.gameroom.system.application.settings.GeneralSettings.settings;
12 |
13 | /**
14 | * Created by LM on 05/08/2016.
15 | */
16 | public class ActivationKeyDialog extends GameRoomDialog{
17 |
18 | private String supporterKey = "";
19 | private TextField keyField = new TextField();
20 |
21 | public ActivationKeyDialog(){
22 | super();
23 | getDialogPane().setPrefWidth(Main.SCREEN_WIDTH*(1/3.0)*Main.SCREEN_WIDTH/1920);
24 |
25 | setTitle(Main.getString("supporter_key"));
26 | keyField.setPromptText(Main.getString("supporter_key_visit_gameroom_me"));
27 | keyField.textProperty().addListener((observable, oldValue, newValue) -> {
28 | supporterKey = newValue;
29 | });
30 | BorderPane.setMargin(keyField, UIValues.CONTROL_MEDIUM.insets());
31 |
32 | initTopPane();
33 | mainPane.setCenter(keyField);
34 |
35 | ButtonType buyButton = new ButtonType(com.gameroom.ui.Main.getString("more_infos")+"!", ButtonBar.ButtonData.LEFT);
36 | ButtonType cancelButton = new ButtonType(com.gameroom.ui.Main.getString("cancel"), ButtonBar.ButtonData.CANCEL_CLOSE);
37 | ButtonType activateButton = new ButtonType(Main.getString("activate"), ButtonBar.ButtonData.OK_DONE);
38 |
39 | getDialogPane().getButtonTypes().addAll(buyButton,cancelButton,activateButton);
40 | }
41 |
42 | private void initTopPane() {
43 | Label infoLabel = new Label(Main.getString("input_here_supporter_key")+" "+Main.getString("supporter_key_infos",settings().getSupporterKeyPrice()+"€"));
44 | infoLabel.setWrapText(true);
45 | BorderPane.setMargin(infoLabel, UIValues.CONTROL_MEDIUM.insets());
46 |
47 | mainPane.setTop(infoLabel);
48 | }
49 |
50 | public String getSupporterKey() {
51 | return supporterKey;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/dialog/ChoiceDialog.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.dialog;
2 |
3 | import javafx.event.Event;
4 | import javafx.event.EventHandler;
5 | import javafx.geometry.Insets;
6 | import javafx.geometry.Pos;
7 | import javafx.scene.control.ButtonBar;
8 | import javafx.scene.control.ButtonType;
9 | import javafx.scene.control.Label;
10 | import javafx.scene.input.MouseEvent;
11 | import javafx.scene.layout.BorderPane;
12 | import javafx.scene.layout.VBox;
13 | import com.gameroom.ui.Main;
14 | import com.gameroom.ui.UIValues;
15 |
16 |
17 | /**
18 | * Created by LM on 05/07/2016.
19 | */
20 | public class ChoiceDialog extends GameRoomDialog {
21 |
22 | public ChoiceDialog(ChoiceDialogButton... choiceDialogButtons) {
23 | super();
24 |
25 | VBox choicesBox = new VBox();
26 | choicesBox.setFillWidth(true);
27 | choicesBox.setSpacing(10* Main.SCREEN_HEIGHT /1080);
28 | choicesBox.getChildren().addAll(choiceDialogButtons);
29 | choicesBox.getStyleClass().add("vbox");
30 | for(ChoiceDialogButton db : choiceDialogButtons){
31 | db.setPadding(UIValues.CONTROL_SMALL.insets());
32 | db.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler() {
33 | @Override
34 | public void handle(Event event) {
35 | ChoiceDialog.this.setResult(db.getButtonType());
36 | ChoiceDialog.this.close();
37 | }
38 | });
39 | }
40 |
41 | mainPane.setCenter(choicesBox);
42 | mainPane.getStyleClass().add("container");
43 | ButtonType cancelButton = new ButtonType(Main.getString("cancel"), ButtonBar.ButtonData.CANCEL_CLOSE);
44 | getDialogPane().getButtonTypes().addAll(cancelButton);
45 |
46 | }
47 | public void setHeader(String text){
48 | Label header = new Label(text);
49 | //header.setStyle("-fx-font-size: 26.0px;");
50 | header.getStyleClass().add("header-panel");
51 | mainPane.setTop(header);
52 | BorderPane.setMargin(header, new Insets(20* Main.SCREEN_WIDTH /1920, 20* Main.SCREEN_HEIGHT /1080,40* Main.SCREEN_WIDTH /1920, 20* Main.SCREEN_HEIGHT /1080));
53 | }
54 |
55 |
56 | public static class ChoiceDialogButton extends BorderPane{
57 | private Label titleLabel;
58 | private Label descriptionLabel;
59 |
60 | public ChoiceDialogButton(String title, String description){
61 | super();
62 | titleLabel = new Label(title);
63 | /*titleLabel.setStyle("-fx-font-family: 'Helvetica Neue';\n" +
64 | " -fx-font-size: 24.0px;\n" +
65 | " -fx-font-weight: 600;");*/
66 | titleLabel.getStyleClass().add("title-label");
67 | //TODO fix not theming to corresponding class
68 | descriptionLabel = new Label(description);
69 | /*descriptionLabel.setStyle("-fx-font-family: 'Helvetica Neue';\n" +
70 | " -fx-font-size: 16.0px;\n" +
71 | " -fx-font-weight: 600;");*/
72 | descriptionLabel.setWrapText(true);
73 | descriptionLabel.getStyleClass().add("description-label");
74 | BorderPane.setAlignment(descriptionLabel, Pos.CENTER_LEFT);
75 | getStyleClass().addAll("search-result-row");
76 | setTop(titleLabel);
77 | setCenter(descriptionLabel);
78 | }
79 |
80 | public ButtonType getButtonType() {
81 | return new ButtonType(titleLabel.getText(), ButtonBar.ButtonData.OK_DONE);
82 | }
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/dialog/ConsoleOutputDialog.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.dialog;
2 |
3 | import javafx.geometry.Insets;
4 | import javafx.geometry.Pos;
5 | import javafx.scene.control.ButtonBar;
6 | import javafx.scene.control.ButtonType;
7 | import javafx.scene.control.ScrollPane;
8 | import javafx.scene.control.TextArea;
9 | import javafx.scene.layout.BorderPane;
10 | import com.gameroom.ui.Main;
11 | import com.gameroom.ui.UIValues;
12 |
13 | import java.awt.*;
14 | import java.io.File;
15 | import java.io.IOException;
16 | import java.util.Optional;
17 |
18 |
19 | /**
20 | * Created by LM on 11/08/2016.
21 | */
22 | public class ConsoleOutputDialog extends GameRoomDialog {
23 | private TextArea textArea = new TextArea("");
24 | private boolean showing = false;
25 |
26 | public ConsoleOutputDialog(){
27 | textArea.setEditable(false);
28 | textArea.setWrapText(true);
29 | textArea.setPadding(UIValues.CONTROL_SMALL.insets());
30 | /*textArea.setStyle("-fx-font-family: 'Helvetica Neue';\n" +
31 | " -fx-background-color: derive(-dark, 20%);\n"+
32 | " -fx-font-size: 16.0px;\n" +
33 | " -fx-font-size: 16.0px;\n" +
34 | " -fx-text-fill: -fx-text-base-color;\n"+
35 | " -fx-font-weight: 600;");*/
36 | textArea.setId("console-text-area");
37 | mainPane.setTop(new javafx.scene.control.Label("Console"));
38 | ScrollPane pane = new ScrollPane();
39 | pane.setFitToWidth(true);
40 | pane.setFitToHeight(true);
41 | pane.setContent(textArea);
42 | mainPane.setPadding(new Insets(30 * Main.SCREEN_HEIGHT / 1080
43 | , 30 * Main.SCREEN_WIDTH / 1920
44 | , 20 * Main.SCREEN_HEIGHT / 1080
45 | , 30 * Main.SCREEN_WIDTH / 1920));
46 | BorderPane.setAlignment(mainPane.getTop(), Pos.CENTER);
47 | BorderPane.setMargin(mainPane.getTop(),new Insets(10 * Main.SCREEN_HEIGHT / 1080
48 | , 10 * Main.SCREEN_WIDTH / 1920
49 | , 10 * Main.SCREEN_HEIGHT / 1080
50 | , 10 * Main.SCREEN_WIDTH / 1920));
51 |
52 | mainPane.setPrefWidth(Main.SCREEN_WIDTH * 1 / 3 * Main.SCREEN_WIDTH / 1920);
53 | mainPane.setPrefHeight(Main.SCREEN_HEIGHT * 2 / 3 * Main.SCREEN_HEIGHT / 1080);
54 |
55 | mainPane.setCenter(pane);
56 |
57 | ButtonType openLog = new ButtonType(Main.getString("open_log"), ButtonBar.ButtonData.LEFT);
58 | getDialogPane().getButtonTypes().addAll(new ButtonType(Main.getString("ok"), ButtonBar.ButtonData.OK_DONE));
59 | getDialogPane().getButtonTypes().addAll(openLog);
60 | setOnHiding(event -> {
61 | textArea.setText("");
62 | showing = false;
63 | });
64 | }
65 | public void appendLine(String line){
66 | textArea.setText(textArea.getText()+"\n"+line);
67 | }
68 | public void showConsole(){
69 | if(!showing){
70 | showing = true;
71 | Optional result = showAndWait();
72 | result.ifPresent(buttonType -> {
73 | if(buttonType.getText().equals(Main.getString("open_log"))){
74 | try {
75 | Desktop.getDesktop().open(new File("log"+File.separator+"GameRoom.log"));
76 | } catch (IOException e) {
77 | e.printStackTrace();
78 | }
79 | }
80 | });
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/dialog/GameRoomAlert.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.dialog;
2 |
3 | import javafx.beans.NamedArg;
4 | import javafx.event.EventHandler;
5 | import javafx.scene.control.Alert;
6 | import javafx.scene.control.Button;
7 | import javafx.scene.control.ButtonType;
8 | import javafx.scene.input.KeyCode;
9 | import javafx.scene.input.KeyEvent;
10 | import javafx.stage.Modality;
11 | import javafx.stage.StageStyle;
12 | import com.gameroom.ui.Main;
13 | import com.gameroom.ui.theme.ThemeUtils;
14 |
15 | import java.util.Optional;
16 |
17 | import static com.gameroom.system.application.settings.GeneralSettings.settings;
18 | import static com.gameroom.ui.Main.MAIN_SCENE;
19 |
20 | /**
21 | * Created by LM on 06/08/2016.
22 | */
23 | public class GameRoomAlert extends Alert {
24 | public GameRoomAlert(AlertType alertType) {
25 | this(alertType, "");
26 | }
27 |
28 | public GameRoomAlert(@NamedArg("alertType") AlertType alertType, @NamedArg("contentText") String contentText, ButtonType... buttons) {
29 | super(alertType, contentText, buttons);
30 |
31 | setHeaderText(null);
32 | initStyle(StageStyle.UNDECORATED);
33 | ThemeUtils.applyCurrentTheme(this);
34 | getDialogPane().setStyle("-fx-font-size: " + Double.toString(settings().getUIScale().getFontSize()) + "px;");
35 |
36 | if(MAIN_SCENE != null) {
37 | initOwner(MAIN_SCENE.getParentStage());
38 | }
39 | initModality(Modality.WINDOW_MODAL);
40 |
41 | getButtonTypes().forEach(buttonType -> {
42 | getDialogPane().lookupButton(buttonType).focusedProperty().addListener((observable, oldValue, newValue) -> {
43 | WindowFocusManager.dialogFocusChanged(GameRoomDialog.isDialogFocused(this));
44 | });
45 | });
46 |
47 | EventHandler fireOnEnter = event -> {
48 | if (KeyCode.ENTER.equals(event.getCode())
49 | && event.getTarget() instanceof Button) {
50 | ((Button) event.getTarget()).fire();
51 | }
52 | };
53 |
54 | getButtonTypes().stream()
55 | .map(getDialogPane()::lookupButton)
56 | .forEach(button ->
57 | button.addEventHandler(
58 | KeyEvent.KEY_PRESSED,
59 | fireOnEnter
60 | )
61 | );
62 |
63 | }
64 |
65 | public static ButtonType warning(String s) {
66 | return displayAlert(AlertType.WARNING, s);
67 | }
68 |
69 | public static ButtonType confirmation(String s) {
70 | return displayAlert(AlertType.CONFIRMATION, s);
71 | }
72 |
73 | public static ButtonType info(String s) {
74 | return displayAlert(AlertType.INFORMATION, s);
75 | }
76 |
77 | public static ButtonType error(String s) {
78 | return displayAlert(AlertType.ERROR, s);
79 | }
80 |
81 | public static ButtonType errorGameRoomAPI() {
82 | return error(Main.getString("error_gameroom_api"));
83 | }
84 |
85 | private static ButtonType displayAlert(AlertType type, String s) {
86 | ButtonType[] buttonChosen = new ButtonType[1];
87 | Main.runAndWait(() -> {
88 | GameRoomAlert alert = new GameRoomAlert(type, s);
89 | Optional result = alert.showAndWait();
90 |
91 | result.ifPresent(buttonType -> {
92 | buttonChosen[0] = buttonType;
93 | });
94 | });
95 | return buttonChosen[0];
96 | }
97 |
98 | }
99 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/dialog/GameRoomCustomAlert.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.dialog;
2 |
3 | import javafx.scene.Node;
4 |
5 | /**
6 | * Created by LM on 15/09/2016.
7 | */
8 | public class GameRoomCustomAlert extends GameRoomDialog {
9 | public void setBottom(Node content){
10 | mainPane.setBottom(content);
11 | }
12 | public void setCenter(Node text){
13 | mainPane.setCenter(text);
14 | }
15 | public void setPrefWidth(double height) {
16 | mainPane.setPrefWidth(height);
17 | }
18 |
19 | public void setPrefHeight(double height){
20 | mainPane.setPrefHeight(height);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/dialog/GameRoomDialog.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.dialog;
2 |
3 | import javafx.scene.control.Dialog;
4 | import javafx.scene.control.DialogPane;
5 | import javafx.scene.layout.BorderPane;
6 | import javafx.scene.layout.StackPane;
7 | import javafx.stage.Modality;
8 | import javafx.stage.StageStyle;
9 | import com.gameroom.ui.theme.ThemeUtils;
10 |
11 | import static com.gameroom.system.application.settings.GeneralSettings.settings;
12 | import static com.gameroom.ui.Main.MAIN_SCENE;
13 |
14 | /**
15 | * Created by LM on 06/08/2016.
16 | */
17 | public abstract class GameRoomDialog extends Dialog {
18 | protected StackPane rootStackPane;
19 | protected BorderPane mainPane;
20 |
21 | protected GameRoomDialog(){
22 | this(Modality.WINDOW_MODAL);
23 | }
24 |
25 | protected GameRoomDialog(Modality modality){
26 | super();
27 | DialogPane dialogPane = new DialogPane();
28 | mainPane = new BorderPane();
29 | rootStackPane = new StackPane();
30 | rootStackPane.getChildren().add(mainPane);
31 | if(!modality.equals(Modality.NONE)) {
32 | if (MAIN_SCENE != null && MAIN_SCENE.getParentStage() != null){
33 | initOwner(MAIN_SCENE.getParentStage());
34 | }
35 | }
36 | dialogPane.setContent(rootStackPane);
37 | dialogPane.getStyleClass().add("dialog-pane");
38 | setDialogPane(dialogPane);
39 | ThemeUtils.applyCurrentTheme(dialogPane);
40 | dialogPane.setStyle("-fx-font-size: "+Double.toString(settings().getUIScale().getFontSize())+"px;");
41 | initStyle(StageStyle.UNDECORATED);
42 | initModality(modality);
43 |
44 | getDialogPane().getButtonTypes().forEach(buttonType -> {
45 | getDialogPane().lookupButton(buttonType).focusedProperty().addListener((observable, oldValue, newValue) -> {
46 | WindowFocusManager.dialogFocusChanged(isDialogFocused(this));
47 | });
48 | });
49 | }
50 |
51 |
52 | /** Checks if a given {@link Dialog} is focused, by checking if any of its composing {@link javafx.scene.Node} is focused.
53 | *
54 | * @param dialog dialog to check
55 | * @return true if the dialog is considered focused, false otherwise
56 | */
57 | static boolean isDialogFocused(Dialog dialog){
58 | if(dialog == null){
59 | return false;
60 | }
61 | if(dialog.getDialogPane() != null && dialog.getDialogPane().isFocused()){
62 | return true;
63 | }
64 | if(dialog.getGraphic()!=null && dialog.getGraphic().isFocused()){
65 | return true;
66 | }
67 | boolean focused[] = {false};
68 | if(dialog.getDialogPane() != null){
69 | dialog.getDialogPane().getButtonTypes().forEach(buttonType -> {
70 | focused[0] = focused[0] || dialog.getDialogPane().lookupButton(buttonType).isFocused();
71 | });
72 | }
73 | return focused[0];
74 | }
75 |
76 | public BorderPane getMainPane() {
77 | return mainPane;
78 | }
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/dialog/SteamProfileSelector.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.dialog;
2 |
3 | import com.gameroom.data.game.scraper.SteamProfile;
4 | import javafx.geometry.Insets;
5 | import javafx.scene.Node;
6 | import javafx.scene.control.ButtonBar;
7 | import javafx.scene.control.ButtonType;
8 | import javafx.scene.control.ComboBox;
9 | import javafx.scene.control.Label;
10 | import javafx.util.StringConverter;
11 | import com.gameroom.system.application.settings.PredefinedSetting;
12 | import com.gameroom.ui.Main;
13 |
14 | import java.util.List;
15 |
16 | import static com.gameroom.system.application.settings.GeneralSettings.settings;
17 |
18 | /**
19 | * Created by LM on 21/02/2017.
20 | */
21 | public class SteamProfileSelector extends GameRoomDialog {
22 | private ComboBox comboBox;
23 |
24 | public SteamProfileSelector(List profiles) {
25 | super();
26 | mainPane.getStyleClass().add("container");
27 | ButtonType okButton = new ButtonType(Main.getString("ok"), ButtonBar.ButtonData.OK_DONE);
28 | getDialogPane().getButtonTypes().addAll(okButton);
29 |
30 | mainPane.setCenter(createCenterPane(profiles));
31 | mainPane.setTop(createTopPane());
32 | }
33 |
34 | private Node createTopPane() {
35 | Label titleLabel = new Label(Main.getString("select_steam_profile"));
36 | titleLabel.setPadding(new Insets(20 * Main.SCREEN_HEIGHT / 1080, 20 * Main.SCREEN_WIDTH / 1920, 10 * Main.SCREEN_HEIGHT / 1080, 20 * Main.SCREEN_WIDTH / 1920));
37 | return titleLabel;
38 | }
39 |
40 | private Node createCenterPane(List profiles) {
41 | comboBox = new ComboBox<>();
42 | comboBox.getItems().addAll(profiles);
43 |
44 | comboBox.setConverter(new StringConverter() {
45 | @Override
46 | public String toString(SteamProfile object) {
47 | return object.getAccountName();
48 | }
49 |
50 | @Override
51 | public SteamProfile fromString(String string) {
52 | return null;
53 | }
54 | });
55 |
56 | SteamProfile selectedProfile = settings().getSteamProfileToScan();
57 | if(selectedProfile != null && profiles.contains(selectedProfile)){
58 | comboBox.setValue(selectedProfile);
59 | }else if(profiles.size() > 1){
60 | comboBox.setValue(profiles.get(0));
61 | settings().setSettingValue(PredefinedSetting.STEAM_PROFILE,profiles.get(0));
62 | }
63 |
64 | comboBox.setOnAction(event -> {
65 | settings().setSettingValue(PredefinedSetting.STEAM_PROFILE,comboBox.getValue());
66 | });
67 | return comboBox;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/dialog/WebBrowser.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.dialog;
2 |
3 | import javafx.scene.control.Button;
4 | import javafx.scene.control.ButtonBar;
5 | import javafx.scene.control.ButtonType;
6 | import javafx.scene.control.Label;
7 | import javafx.scene.layout.HBox;
8 | import javafx.scene.layout.Pane;
9 | import javafx.scene.layout.StackPane;
10 | import javafx.scene.web.WebView;
11 | import com.gameroom.ui.Main;
12 | import com.gameroom.ui.UIValues;
13 |
14 | import java.awt.*;
15 | import java.io.IOException;
16 | import java.net.URI;
17 | import java.net.URISyntaxException;
18 | import java.util.Optional;
19 |
20 | import static com.gameroom.ui.Main.LOGGER;
21 |
22 | /**
23 | * Created by LM on 09/01/2017.
24 | */
25 | public class WebBrowser extends GameRoomDialog {
26 | private String initialUrl;
27 | private WebView webView;
28 | private Label urlLabel = new Label();
29 | private Button forwardButton = new Button("\uD83E\uDC62");
30 | private Button backButton = new Button("\uD83E\uDC68");
31 |
32 | public WebBrowser(String url) {
33 | super();
34 | this.initialUrl = url;
35 | mainPane.getStyleClass().add("container");
36 | ButtonType okButton = new ButtonType(Main.getString("close"), ButtonBar.ButtonData.OK_DONE);
37 | ButtonType cancelButton = new ButtonType(Main.getString("open_in_browser"), ButtonBar.ButtonData.LEFT);
38 | getDialogPane().getButtonTypes().addAll(cancelButton, okButton);
39 |
40 | mainPane.setCenter(createCenterPane());
41 | mainPane.setTop(createTopPane());
42 |
43 | setOnHiding(event -> {
44 | onClose();
45 | });
46 | }
47 |
48 | private void onClose() {
49 | webView.getEngine().load("about:blank");
50 | webView = null;
51 | // Delete cookies
52 | java.net.CookieHandler.setDefault(new java.net.CookieManager());
53 | }
54 |
55 | private Pane createTopPane() {
56 | urlLabel.textProperty().bind(webView.getEngine().locationProperty());
57 | backButton.setOnAction(e -> webView.getEngine().getHistory().go(-1));
58 | forwardButton.setOnAction(e -> webView.getEngine().getHistory().go(1));
59 | HBox box = new HBox(UIValues.Constants.offsetSmall());
60 | box.setFocusTraversable(false);
61 | box.getChildren().addAll(backButton, forwardButton, urlLabel);
62 | box.setPadding(UIValues.CONTROL_SMALL.insets());
63 | return box;
64 | }
65 |
66 | private Pane createCenterPane() {
67 | webView = new WebView();
68 | webView.getEngine().setOnError(event -> {
69 | LOGGER.error("WebView error : " + event.getMessage());
70 | });
71 | webView.getEngine().load(initialUrl);
72 | StackPane contentPane = new StackPane();
73 | contentPane.getChildren().add(webView);
74 | return contentPane;
75 | }
76 |
77 | public static void openSupporterKeyBuyBrowser(){
78 | WebBrowser browser = new WebBrowser("https://gameroom.me/downloads/key");
79 | Optional webResult = browser.showAndWait();
80 | webResult.ifPresent(buttonType -> {
81 | if(buttonType.getText().equals(Main.getString("open_in_browser"))){
82 | try {
83 | Desktop.getDesktop().browse(new URI("https://gameroom.me/downloads/key"));
84 | } catch (IOException | URISyntaxException e1) {
85 | LOGGER.error(e1.getMessage());
86 | GameRoomAlert.error(Main.getString("error")+" "+e1.getMessage());
87 | }
88 | }else if(buttonType.getText().equals(Main.getString("close"))){
89 |
90 | }
91 | });
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/dialog/test/ChoiceDialogTest.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.dialog.test;
2 |
3 | import javafx.application.Application;
4 | import javafx.scene.Scene;
5 | import javafx.scene.control.Button;
6 | import javafx.scene.control.ButtonType;
7 | import javafx.scene.layout.StackPane;
8 | import javafx.stage.Stage;
9 | import com.gameroom.system.application.settings.PredefinedSetting;
10 | import com.gameroom.ui.Main;
11 | import com.gameroom.ui.dialog.ChoiceDialog;
12 |
13 | import java.awt.*;
14 | import java.util.Optional;
15 | import java.util.ResourceBundle;
16 |
17 | import static com.gameroom.system.application.settings.GeneralSettings.settings;
18 | import static com.gameroom.ui.Main.*;
19 |
20 | /**
21 | * Created by LM on 05/07/2016.
22 | */
23 |
24 | /**
25 | * Created by LM on 05/07/2016.
26 | */
27 | public class ChoiceDialogTest extends Application {
28 |
29 | private static StackPane contentPane;
30 | private static Scene scene;
31 |
32 |
33 | private static void initScene() {
34 | Button launchButton = new Button("Launch");
35 |
36 |
37 | ChoiceDialog choiceDialog = new ChoiceDialog(
38 | new ChoiceDialog.ChoiceDialogButton("This is a test", "More specifically this is really a test, I hope that it will work"),
39 | new ChoiceDialog.ChoiceDialogButton("This is an other test", "I hope that it will work, blablablablabnalablablabalm, more specifically this is really a test."));
40 | choiceDialog.setResizable(true);
41 | launchButton.setOnAction(e -> {
42 | Optional result = choiceDialog.showAndWait();
43 | result.ifPresent(letter -> {
44 | System.out.println("Choice : " + letter.getText());
45 | });
46 | }
47 | );
48 | choiceDialog.setHeader("This is a test header");
49 | contentPane.getChildren().addAll(launchButton);
50 |
51 | }
52 |
53 | @Override
54 | public void start(Stage primaryStage) throws Exception {
55 | contentPane = new StackPane();
56 | scene = new Scene(contentPane, SCREEN_WIDTH, SCREEN_HEIGHT);
57 | initScene();
58 | primaryStage.setTitle("UITest");
59 | primaryStage.setScene(scene);
60 | primaryStage.show();
61 | }
62 |
63 | public static void main(String[] args) {
64 | Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
65 | SCREEN_WIDTH = (int) 1920;
66 | SCREEN_HEIGHT = (int) 1080;
67 | Main.setRessourceBundle(ResourceBundle.getBundle("strings", settings().getLocale(PredefinedSetting.LOCALE)));
68 | launch(args);
69 | }
70 | }
--------------------------------------------------------------------------------
/src/com/gameroom/ui/dialog/test/FileChooserTest.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.dialog.test;
2 |
3 | import javafx.application.Application;
4 | import javafx.scene.Scene;
5 | import javafx.scene.control.Button;
6 | import javafx.scene.control.Dialog;
7 | import javafx.scene.layout.StackPane;
8 | import javafx.stage.DirectoryChooser;
9 | import javafx.stage.Modality;
10 | import javafx.stage.Stage;
11 |
12 | import java.awt.*;
13 |
14 | import static com.gameroom.ui.Main.SCREEN_HEIGHT;
15 | import static com.gameroom.ui.Main.SCREEN_WIDTH;
16 |
17 | /**
18 | * Created by LM on 06/01/2017.
19 | */
20 | public class FileChooserTest extends Application {
21 | private static Scene scene;
22 |
23 | public static void main(String[] args) {
24 | Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
25 | SCREEN_WIDTH = (int) 1920;
26 | SCREEN_HEIGHT = (int) 1080;
27 |
28 | launch(args);
29 | }
30 |
31 | @Override
32 | public void start(Stage primaryStage) throws Exception {
33 | StackPane scenePane = new StackPane();
34 | scene = new Scene(scenePane, SCREEN_WIDTH, SCREEN_HEIGHT);
35 | primaryStage.setTitle("UITest");
36 | primaryStage.setScene(scene);
37 | primaryStage.show();
38 |
39 | initDialog();
40 | }
41 |
42 |
43 | private static void initDialog() {
44 | DirectoryChooser chooser = new DirectoryChooser();
45 |
46 | Button testButton = new Button("Test");
47 | testButton.setOnAction((e) -> chooser.showDialog(scene.getWindow()));
48 |
49 | Dialog dialog = new Dialog();
50 | dialog.getDialogPane().setContent(testButton);
51 | dialog.initModality(Modality.WINDOW_MODAL);
52 | dialog.initOwner(scene.getWindow());
53 | dialog.showAndWait();
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/dialog/test/SearchDialogTest.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.dialog.test;
2 |
3 | import javafx.application.Application;
4 | import javafx.scene.Scene;
5 | import javafx.scene.control.Button;
6 | import javafx.scene.control.ButtonType;
7 | import javafx.scene.layout.StackPane;
8 | import javafx.stage.Stage;
9 | import com.gameroom.system.application.settings.PredefinedSetting;
10 | import com.gameroom.ui.Main;
11 | import com.gameroom.ui.dialog.SearchDialog;
12 |
13 | import java.awt.*;
14 | import java.util.Optional;
15 | import java.util.ResourceBundle;
16 |
17 | import static com.gameroom.system.application.settings.GeneralSettings.settings;
18 | import static com.gameroom.ui.Main.*;
19 |
20 | /**
21 | * Created by LM on 12/07/2016.
22 | */
23 | public class SearchDialogTest extends Application {
24 |
25 | private static StackPane contentPane;
26 | private static Scene scene;
27 |
28 |
29 | private static void initScene() {
30 | Button launchButton = new Button("Launch");
31 |
32 | SearchDialog dialog = new SearchDialog("test");
33 |
34 | launchButton.setOnAction(e -> {
35 | Optional result = dialog.showAndWait();
36 | result.ifPresent(letter -> {
37 | System.out.println("Choice : " + dialog.getResult());
38 | });
39 | }
40 | );
41 | //dialog.setHeader("This is a test header");
42 | contentPane.getChildren().addAll(launchButton);
43 | }
44 |
45 | @Override
46 | public void start(Stage primaryStage) throws Exception {
47 | contentPane = new StackPane();
48 | scene = new Scene(contentPane, 640, 480);
49 | initScene();
50 | primaryStage.setTitle("UITest");
51 | primaryStage.setScene(scene);
52 | primaryStage.show();
53 | }
54 |
55 | public static void main(String[] args) {
56 | Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
57 | SCREEN_WIDTH = (int) screenSize.getWidth();
58 | SCREEN_HEIGHT = (int) screenSize.getHeight();
59 | Main.setRessourceBundle(ResourceBundle.getBundle("strings", settings().getLocale(PredefinedSetting.LOCALE)));
60 |
61 | launch(args);
62 | }
63 | }
--------------------------------------------------------------------------------
/src/com/gameroom/ui/pane/OnItemSelectedHandler.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.pane;
2 |
3 | /**
4 | * Created by LM on 11/08/2016.
5 | */
6 | public interface OnItemSelectedHandler {
7 | void handle(SelectListPane.ListItem item);
8 | }
9 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/pane/gamestilepane/GroupRowTilePane.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.pane.gamestilepane;
2 |
3 | import com.gameroom.data.game.entry.GameEntry;
4 | import com.gameroom.ui.scene.MainScene;
5 |
6 | /**
7 | * Created by LM on 18/08/2016.
8 | */
9 | public abstract class GroupRowTilePane extends RowCoverTilePane {
10 | private boolean autoAddMatchingEntries = true;
11 |
12 | public GroupRowTilePane(MainScene parentScene) {
13 | super(parentScene, TYPE_NAME);
14 | maxColumn = Integer.MAX_VALUE;
15 | }
16 | @Override
17 | public boolean isValidToAdd(GameEntry entry) {
18 | return fillsRequirement(entry);
19 | }
20 | @Override
21 | protected void onNotFoundForUpdate(GameEntry newEntry){
22 | if(autoAddMatchingEntries && fillsRequirement(newEntry)){
23 | addGame(newEntry);
24 | }
25 | }
26 | public abstract boolean fillsRequirement(GameEntry entry);
27 |
28 | public boolean isAutoAddMatchingEntries() {
29 | return autoAddMatchingEntries;
30 | }
31 |
32 | public void setAutoAddMatchingEntries(boolean autoAddMatchingEntries) {
33 | this.autoAddMatchingEntries = autoAddMatchingEntries;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/pane/platform/EmulatorSettingsPane.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.pane.platform;
2 |
3 | import com.gameroom.data.game.entry.Emulator;
4 | import com.gameroom.data.game.entry.Platform;
5 | import javafx.beans.value.ChangeListener;
6 | import javafx.beans.value.ObservableValue;
7 | import javafx.geometry.Insets;
8 | import javafx.geometry.Pos;
9 | import javafx.scene.control.Label;
10 | import javafx.scene.control.Tooltip;
11 | import javafx.scene.layout.*;
12 | import javafx.stage.Window;
13 | import com.gameroom.ui.Main;
14 | import com.gameroom.ui.control.textfield.PathTextField;
15 |
16 | import java.io.File;
17 | import java.sql.SQLException;
18 |
19 | import static com.gameroom.ui.Main.SCREEN_WIDTH;
20 |
21 | /**
22 | * @author LM. Garret (admin@gameroom.me)
23 | * @date 08/06/2017.
24 | */
25 | public class EmulatorSettingsPane extends BorderPane {
26 | public Emulator emulator;
27 |
28 | public EmulatorSettingsPane(Emulator emulator, Window window) {
29 | this.emulator = emulator;
30 |
31 | try {
32 | Platform.initWithDb();
33 | } catch (SQLException e) {
34 | e.printStackTrace();
35 | }
36 |
37 | initTop();
38 | initCenter(window);
39 | }
40 |
41 | private void initTop() {
42 | StackPane topPane = new StackPane();
43 | topPane.getStyleClass().add("header");
44 |
45 | Label titleLabel = new Label(emulator.toString());
46 | //titleLabel.setId("titleLabel");
47 | titleLabel.getStyleClass().add("small-title-label");
48 |
49 | topPane.getChildren().add(titleLabel);
50 | StackPane.setAlignment(titleLabel, Pos.CENTER);
51 | StackPane.setMargin(titleLabel, new Insets(30 * Main.SCREEN_HEIGHT / 1080
52 | , 12 * Main.SCREEN_WIDTH / 1920
53 | , 15 * Main.SCREEN_HEIGHT / 1080
54 | , 15 * Main.SCREEN_WIDTH / 1920));
55 | setTop(topPane);
56 | }
57 |
58 | private void initCenter(Window window) {
59 | int rowCount = 0;
60 |
61 | //init gridpane
62 | GridPane contentPane = new GridPane();
63 | //contentPane.setGridLinesVisible(true);
64 | contentPane.setVgap(20 * SCREEN_WIDTH / 1920);
65 | contentPane.setHgap(10 * SCREEN_WIDTH / 1920);
66 | ColumnConstraints cc1 = new ColumnConstraints();
67 | cc1.setPercentWidth(20);
68 | contentPane.getColumnConstraints().add(cc1);
69 | ColumnConstraints cc2 = new ColumnConstraints();
70 | cc2.setPercentWidth(80);
71 | contentPane.getColumnConstraints().add(cc2);
72 |
73 | /********PROGRAM PATH **************/
74 | PathTextField pathField = new PathTextField(emulator.getPath().getAbsolutePath(), window, PathTextField.FILE_CHOOSER_APPS, Main.getString("select_program"));
75 | pathField.getTextField().setPrefColumnCount(50);
76 | pathField.getTextField().textProperty().addListener(new ChangeListener() {
77 | @Override
78 | public void changed(ObservableValue extends String> observable, String oldValue, String newValue) {
79 | File newPath = new File(newValue);
80 | if (newPath.exists()) {
81 | emulator.setPath(newPath);
82 | }
83 | }
84 | });
85 | Label pathLabel = new Label(Main.getString("path") + " :");
86 | pathLabel.setTooltip(new Tooltip(Main.getString("path")));
87 | contentPane.add(pathLabel, 0, rowCount);
88 | contentPane.add(pathField, 1, rowCount);
89 | rowCount++;
90 |
91 | //TODO add a "found" indicator for emulator path
92 |
93 | setCenter(contentPane);
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/scene/exitaction/ClassicExitAction.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.scene.exitaction;
2 |
3 | import javafx.stage.Stage;
4 | import com.gameroom.ui.scene.BaseScene;
5 |
6 | /**
7 | * Created by LM on 17/07/2016.
8 | */
9 | public class ClassicExitAction extends ExitAction{
10 | public ClassicExitAction(BaseScene currentScene, Stage parentStage, BaseScene previousScene) {
11 | super(new Runnable() {
12 | @Override
13 | public void run() {
14 | currentScene.fadeTransitionTo(previousScene, parentStage);
15 | }
16 | });
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/scene/exitaction/CustomExitAction.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.scene.exitaction;
2 |
3 | /**
4 | * Created by LM on 08/08/2016.
5 | */
6 | class CustomExitAction extends ExitAction {
7 | public CustomExitAction(Runnable exitAction) {
8 | super(exitAction);
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/scene/exitaction/ExitAction.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.scene.exitaction;
2 |
3 | /**
4 | * Created by LM on 17/07/2016.
5 | */
6 | public abstract class ExitAction {
7 | private Runnable exitAction;
8 | ExitAction(Runnable exitAction){
9 | this.exitAction = exitAction;
10 | }
11 | public void run(){
12 | exitAction.run();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/scene/exitaction/MultiAddExitAction.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.scene.exitaction;
2 |
3 | import com.gameroom.ui.scene.GameEditScene;
4 |
5 | /**
6 | * Created by LM on 17/07/2016.
7 | */
8 | public class MultiAddExitAction extends ExitAction {
9 | private GameEditScene gameEditScene;
10 |
11 | public MultiAddExitAction(Runnable exitAction,GameEditScene editScene) {
12 | super(exitAction);
13 | this.gameEditScene = editScene;
14 | }
15 |
16 | public GameEditScene getGameEditScene() {
17 | return gameEditScene;
18 | }
19 |
20 | public void setGameEditScene(GameEditScene gameEditScene) {
21 | this.gameEditScene = gameEditScene;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/com/gameroom/ui/theme/UIScale.java:
--------------------------------------------------------------------------------
1 | package com.gameroom.ui.theme;
2 |
3 | import com.gameroom.ui.Main;
4 |
5 | /**
6 | * Created by LM on 25/12/2016.
7 | */
8 | public enum UIScale {
9 | EXTRA_SMALL("uiscale_extra_small",0.5)
10 | ,SMALL("uiscale_small",0.75)
11 | ,NORMAL("uiscale_normal",1.0)
12 | ,BIG("uiscale_big",1.25)
13 | ,EXTRA_BIG("uiscale_extra_big",1.5);
14 |
15 | private final static double DEFAULT_FONT_SIZE = 19.0;
16 |
17 | private String displayNameKey;
18 | private double fontSize = DEFAULT_FONT_SIZE;
19 | private double scale = 1.0;
20 |
21 | UIScale(String displayNameKey, double scale){
22 | this.displayNameKey =displayNameKey;
23 | this.fontSize=DEFAULT_FONT_SIZE*scale;
24 | this.scale = scale;
25 | }
26 |
27 | public String getDisplayName(){
28 | return Main.getString(displayNameKey);
29 | }
30 |
31 | public double getFontSize(){
32 | return fontSize;
33 | }
34 |
35 | public double getScale(){
36 | return scale;
37 | }
38 |
39 | public static UIScale fromString(String s){
40 | if(s == null || s.isEmpty()){
41 | return NORMAL;
42 | }
43 | switch (s){
44 | case "uiscale_extra_small":
45 | return EXTRA_SMALL;
46 | case "uiscale_small":
47 | return SMALL;
48 | case "uiscale_normal":
49 | return NORMAL;
50 | case "uiscale_big":
51 | return BIG;
52 | case "uiscale_extra_big":
53 | return EXTRA_BIG;
54 | default:
55 | return NORMAL;
56 |
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/gamegenres.properties:
--------------------------------------------------------------------------------
1 | point_and_click = Point-and-click
2 | fighting = Fighting
3 | fps = FPS
4 | music = Music
5 | platform = Platform
6 | puzzle = Puzzle
7 | racing = Racing
8 | rts = RTS
9 | rpg = RPG
10 | simulator = Simulator
11 | sport = Sport
12 | strategy = Strategy
13 | tbs = TBS
14 | tactical = Tactical
15 | hack_and_slash = Hack and slash/Beat 'em up
16 | quiz = Quiz/Trivia
17 | pinball = Pinball
18 | adventure = Adventure
19 | indie = Indie
20 | arcade = Arcade
--------------------------------------------------------------------------------
/src/gamegenres_de.properties:
--------------------------------------------------------------------------------
1 | point_and_click = Point-and-click
2 | fighting = K\u00E4mpfen
3 | fps = FPS
4 | music = Musik
5 | platform = Plattform
6 | puzzle = Puzzle
7 | racing = Racing
8 | rts = RTS
9 | rpg = RPG
10 | simulator = Simulator
11 | sport = Sport
12 | strategy = Strategy
13 | tbs = TBS
14 | tactical = Tactical
15 | hack_and_slash = Hack and slash/Beat 'em up
16 | quiz = Quiz/Trivia
17 | pinball = Pinball
18 | adventure = Adventure
19 | indie = Indie
20 | arcade = Arcade
--------------------------------------------------------------------------------
/src/gamegenres_en.properties:
--------------------------------------------------------------------------------
1 | point_and_click = Point-and-click
2 | fighting = Fighting
3 | fps = FPS
4 | music = Music
5 | platform = Platform
6 | puzzle = Puzzle
7 | racing = Racing
8 | rts = RTS
9 | rpg = RPG
10 | simulator = Simulator
11 | sport = Sport
12 | strategy = Strategy
13 | tbs = TBS
14 | tactical = Tactical
15 | hack_and_slash = Hack and slash/Beat 'em up
16 | quiz = Quiz/Trivia
17 | pinball = Pinball
18 | adventure = Adventure
19 | indie = Indie
20 | arcade = Arcade
--------------------------------------------------------------------------------
/src/gamegenres_fr.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/gamegenres_fr.properties
--------------------------------------------------------------------------------
/src/gamethemes.properties:
--------------------------------------------------------------------------------
1 | action=Action
2 | fantasy=Fantasy
3 | science_fiction=Science fiction
4 | horror=Horror
5 | thriller=Thriller
6 | survival=Survival
7 | historical=Historical
8 | stealth=Stealth
9 | comedy=Comedy
10 | business=Business
11 | drama=Drama
12 | non_fiction=Non-fiction
13 | sandbox=Sandbox
14 | educational=Educational
15 | kids=Kids
16 | open_world=Open world
17 | warfare=Warfare
18 | party=Party
19 | 4x=4X (explore, expand, exploit, and exterminate)
20 | erotic=Erotic
21 | mystery=Mystery
--------------------------------------------------------------------------------
/src/gamethemes_de.properties:
--------------------------------------------------------------------------------
1 | action=Action
2 | fantasy=Fantasie
3 | science_fiction=Science fiction
4 | horror=Horror
5 | thriller=Thriller
6 | survival=Survival
7 | historical=Historisch
8 | stealth=Stealth
9 | comedy=Comedy
10 | business=Business
11 | drama=Drama
12 | non_fiction=Non-fiction
13 | sandbox=Sandbox
14 | educational=Educational
15 | kids=Kids
16 | open_world=Open world
17 | warfare=Warfare
18 | party=Party
19 | 4x=4X (explore, expand, exploit, and exterminate)
20 | erotic=Erotic
21 | mystery=Mystery
--------------------------------------------------------------------------------
/src/gamethemes_en.properties:
--------------------------------------------------------------------------------
1 | action=Action
2 | fantasy=Fantasy
3 | science_fiction=Science fiction
4 | horror=Horror
5 | thriller=Thriller
6 | survival=Survival
7 | historical=Historical
8 | stealth=Stealth
9 | comedy=Comedy
10 | business=Business
11 | drama=Drama
12 | non_fiction=Non-fiction
13 | sandbox=Sandbox
14 | educational=Educational
15 | kids=Kids
16 | open_world=Open world
17 | warfare=Warfare
18 | party=Party
19 | 4x=4X (explore, expand, exploit, and exterminate)
20 | erotic=Erotic
21 | mystery=Mystery
--------------------------------------------------------------------------------
/src/gamethemes_fr.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/gamethemes_fr.properties
--------------------------------------------------------------------------------
/src/package/windows/GameRoom.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/package/windows/GameRoom.ico
--------------------------------------------------------------------------------
/src/platforms.properties:
--------------------------------------------------------------------------------
1 | emulator_dolphin=Dolphin
2 | gamecube=GameCube
3 | wii=Wii
4 | windows=Windows
--------------------------------------------------------------------------------
/src/platforms_en.properties:
--------------------------------------------------------------------------------
1 | emulator_dolphin=Dolphin
2 | gamecube=GameCube
3 | wii=Wii
4 | windows=Windows
--------------------------------------------------------------------------------
/src/platforms_fr.properties:
--------------------------------------------------------------------------------
1 | emulator_dolphin=Dolphin
2 | gamecube=GameCube
3 | wii=Wii
4 | windows=Windows
--------------------------------------------------------------------------------
/src/res/com/gameroom/ui/icon/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/com/gameroom/ui/icon/icon.png
--------------------------------------------------------------------------------
/src/res/com/gameroom/ui/icon/icon128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/com/gameroom/ui/icon/icon128.png
--------------------------------------------------------------------------------
/src/res/com/gameroom/ui/icon/icon16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/com/gameroom/ui/icon/icon16.png
--------------------------------------------------------------------------------
/src/res/com/gameroom/ui/icon/icon256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/com/gameroom/ui/icon/icon256.png
--------------------------------------------------------------------------------
/src/res/com/gameroom/ui/icon/icon32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/com/gameroom/ui/icon/icon32.png
--------------------------------------------------------------------------------
/src/res/com/gameroom/ui/icon/icon512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/com/gameroom/ui/icon/icon512.png
--------------------------------------------------------------------------------
/src/res/com/gameroom/ui/icon/icon64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/com/gameroom/ui/icon/icon64.png
--------------------------------------------------------------------------------
/src/res/defaultImages/barTile.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/defaultImages/barTile.jpg
--------------------------------------------------------------------------------
/src/res/defaultImages/barTile120.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/defaultImages/barTile120.jpg
--------------------------------------------------------------------------------
/src/res/defaultImages/cover.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/defaultImages/cover.jpg
--------------------------------------------------------------------------------
/src/res/defaultImages/cover1024.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/defaultImages/cover1024.jpg
--------------------------------------------------------------------------------
/src/res/defaultImages/cover256.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/defaultImages/cover256.jpg
--------------------------------------------------------------------------------
/src/res/defaultImages/cover512.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/defaultImages/cover512.jpg
--------------------------------------------------------------------------------
/src/res/icons/arrow/down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/arrow/down.png
--------------------------------------------------------------------------------
/src/res/icons/arrow/left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/arrow/left.png
--------------------------------------------------------------------------------
/src/res/icons/arrow/right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/arrow/right.png
--------------------------------------------------------------------------------
/src/res/icons/arrow/up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/arrow/up.png
--------------------------------------------------------------------------------
/src/res/icons/backgroundMask.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/backgroundMask.png
--------------------------------------------------------------------------------
/src/res/icons/dialog/confirmationIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/dialog/confirmationIcon.png
--------------------------------------------------------------------------------
/src/res/icons/dialog/errorIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/dialog/errorIcon.png
--------------------------------------------------------------------------------
/src/res/icons/dialog/infoIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/dialog/infoIcon.png
--------------------------------------------------------------------------------
/src/res/icons/dialog/warningIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/dialog/warningIcon.png
--------------------------------------------------------------------------------
/src/res/icons/folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/folder.png
--------------------------------------------------------------------------------
/src/res/icons/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/home.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/3ds.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/3ds.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/battle.net.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/battle.net.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/ds.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/ds.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/gamecube.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/gamecube.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/gb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/gb.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/gba.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/gba.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/gbc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/gbc.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/gog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/gog.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/microsoft_store.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/microsoft_store.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/msdos.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/msdos.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/n64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/n64.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/nes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/nes.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/origin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/origin.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/pc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/pc.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/ps2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/ps2.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/ps3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/ps3.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/psp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/psp.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/psx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/psx.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/snes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/snes.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/steam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/steam.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/uplay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/uplay.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/wii.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/wii.png
--------------------------------------------------------------------------------
/src/res/icons/launcher-dark/wiiu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher-dark/wiiu.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/3ds.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/3ds.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/battlenet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/battlenet.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/ds.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/ds.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/gamecube.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/gamecube.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/gb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/gb.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/gba.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/gba.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/gbc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/gbc.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/gog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/gog.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/microsoft_store.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/microsoft_store.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/msdos.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/msdos.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/n64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/n64.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/nes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/nes.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/origin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/origin.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/pc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/pc.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/ps2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/ps2.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/ps2.png.bak2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/ps2.png.bak2
--------------------------------------------------------------------------------
/src/res/icons/launcher/ps2.png.bak3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/ps2.png.bak3
--------------------------------------------------------------------------------
/src/res/icons/launcher/ps3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/ps3.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/psp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/psp.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/psx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/psx.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/snes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/snes.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/steam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/steam.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/uplay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/uplay.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/wii.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/wii.png
--------------------------------------------------------------------------------
/src/res/icons/launcher/wiiu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/launcher/wiiu.png
--------------------------------------------------------------------------------
/src/res/icons/main/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/main/add.png
--------------------------------------------------------------------------------
/src/res/icons/main/edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/main/edit.png
--------------------------------------------------------------------------------
/src/res/icons/main/group.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/main/group.png
--------------------------------------------------------------------------------
/src/res/icons/main/quit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/main/quit.png
--------------------------------------------------------------------------------
/src/res/icons/main/scan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/main/scan.png
--------------------------------------------------------------------------------
/src/res/icons/main/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/main/search.png
--------------------------------------------------------------------------------
/src/res/icons/main/settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/main/settings.png
--------------------------------------------------------------------------------
/src/res/icons/main/sort.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/main/sort.png
--------------------------------------------------------------------------------
/src/res/icons/mute.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/mute.png
--------------------------------------------------------------------------------
/src/res/icons/pathField/folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/pathField/folder.png
--------------------------------------------------------------------------------
/src/res/icons/pathField/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/pathField/search.png
--------------------------------------------------------------------------------
/src/res/icons/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/search.png
--------------------------------------------------------------------------------
/src/res/icons/sound.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/sound.png
--------------------------------------------------------------------------------
/src/res/icons/tile/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/tile/add.png
--------------------------------------------------------------------------------
/src/res/icons/tile/addAll.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/tile/addAll.png
--------------------------------------------------------------------------------
/src/res/icons/tile/ignore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/tile/ignore.png
--------------------------------------------------------------------------------
/src/res/icons/tile/info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/tile/info.png
--------------------------------------------------------------------------------
/src/res/icons/tile/loading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/tile/loading.png
--------------------------------------------------------------------------------
/src/res/icons/tile/play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/tile/play.png
--------------------------------------------------------------------------------
/src/res/icons/tile/toDownload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/tile/toDownload.png
--------------------------------------------------------------------------------
/src/res/icons/tile/warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/res/icons/tile/warning.png
--------------------------------------------------------------------------------
/src/res/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/res/sql/update_1120.sql:
--------------------------------------------------------------------------------
1 | BEGIN TRANSACTION;
2 | pragma foreign_keys = OFF;
3 | DROP TABLE IF EXISTS temp_GameEntry;
4 | ALTER TABLE GameEntry RENAME TO temp_GameEntry;
5 |
6 | CREATE TABLE IF NOT EXISTS GameEntry (
7 | id integer PRIMARY KEY AUTOINCREMENT,
8 | name text,
9 | release_date datetime,
10 | description text,
11 | aggregated_rating integer,
12 | path text,
13 | cmd_before text,
14 | cmd_after text,
15 | launch_args text,
16 | yt_hash text,
17 | added_date datetime,
18 | last_played_date datetime,
19 | initial_playtime integer,
20 | cover_hash text,
21 | wp_hash text,
22 | igdb_id integer,
23 | installed integer default 1,
24 | waiting_scrap integer default 0,
25 | toAdd integer default 0,
26 | ignored integer default 0,
27 | runAsAdmin integer default 0,
28 | sorting_name text,
29 | alternative_names text,
30 | monitor_process text
31 | );
32 |
33 | INSERT INTO GameEntry
34 | SELECT
35 | id, name, release_date,description,aggregated_rating,path,cmd_before,cmd_after,launch_args,yt_hash,added_date,
36 | last_played_date,
37 | initial_playtime,
38 | cover_hash,
39 | wp_hash ,
40 | igdb_id ,
41 | installed ,
42 | waiting_scrap,
43 | toAdd,
44 | ignored ,
45 | runAsAdmin,
46 | null,
47 | null,
48 | null
49 | FROM
50 | temp_GameEntry;
51 |
52 | DROP TABLE temp_GameEntry;
53 | pragma foreign_keys = ON;
54 |
55 | INSERT OR REPLACE INTO Platform(id,name_key,is_pc,default_supported_extensions,igdb_id) VALUES (21,"microsoft_store",1,"exe",6);
56 | INSERT OR REPLACE INTO Platform(id,name_key,is_pc,default_supported_extensions,igdb_id) VALUES (22,"3ds",0,"3ds,3dsx,elf,axf,cci,cxi,app",37);
57 | INSERT OR REPLACE INTO Emulator(id,name,default_path,default_args_schema) VALUES (10,"Citra", "C:\Program Files\Citra\citra-qt.exe","%p");
58 | INSERT OR REPLACE INTO emulates(emu_id,platform_id) VALUES(10,22);
59 | INSERT OR REPLACE INTO Platform(id,name_key,is_pc,default_supported_extensions,igdb_id) VALUES (23,"ds",0,"nds,zip,7z,rar,gz",20);
60 | INSERT OR REPLACE INTO Emulator(id,name,default_path,default_args_schema) VALUES (11,"DeSmuME", "C:\Program Files\desmume-0.9.11-win32\DeSmuME_0.9.11_x86.exe","%p");
61 | INSERT OR REPLACE INTO emulates(emu_id,platform_id) VALUES(11,23),(5,23);
62 | COMMIT;
--------------------------------------------------------------------------------
/src/settings.properties:
--------------------------------------------------------------------------------
1 | locale_label = Language
2 | locale_tooltip = Select the language of GameRoom
3 |
4 | onGameLaunchAction_label = After game start
5 | onGameLaunchAction_tooltip = Select what GameRoom should do after starting a game
6 |
7 | fullScreen_label = Fullscreen
8 | fullScreen_tooltip = Activate fullscreen mod
9 |
10 | gamingPowerMode_label = Gaming Power Mode
11 | gamingPowerMode_tooltip = Select a power mode to activate after starting a game
12 |
13 | enableGamingPowerMode_label = Enable Gaming Power Mode
14 | enableGamingPowerMode_tooltip = Enable switching to the selected gaming power mode after starting a game
15 |
16 | startMinimized_label = Start minimized
17 | startMinimized_tooltip = Enable to start GameRoom minimized
18 |
19 | enableXboxControllerSupport_label = Enable game controller support
20 | enableXboxControllerSupport_tooltip = Enables game controller support, CPU hungry only when GameRoom is on the front
21 |
22 | gamesFolder_label = Games folder
23 | gamesFolder_tooltip = Folder of your games, GameRoom will scan it to search for new games
24 |
25 | supporterKey_label = Supporter key
26 | supporterKey_tooltip = Supporter key
27 |
28 | disableMainSceneWallpaper_label = Disable background image
29 | disableMainSceneWallpaper_tooltip = Disable background image on main screen, recommended for low RAM devices
30 |
31 | noNotifications_label = Disable all notifications
32 | noNotifications_tooltip = Disable all notifications
33 |
34 | manage_ignored_steam_games_label = Manage ignored Steam games
35 | manage_ignored_steam_games_tooltip = GameRoom won't ask you anymore if you want to add those games
36 |
37 |
38 | manage_ignored_game_folders_label = Manage ignored games
39 | manage_ignored_game_folders_tooltip = GameRoom won't ask you anymore if you want to add those folder as games
40 |
41 |
42 | disableGameMainTheme_label = Disable playing game's theme
43 | disableGameMainTheme_tooltip = Disable playing game's theme, recommended for low RAM devices
44 |
45 | advancedMode_label = Advanced mode
46 | advancedMode_tooltip = Unlocks more settings and options, use at your own risk!
47 | debugMode_label=Debug mode
48 | debugMode_tooltip=Opens a console when an error occurs, allowing to copy the error log
49 | startWithWindows_label=Start with Windows
50 | startWithWindows_tooltip=Starts GameRoom at Windows' startup
51 | uiscale_label=UI Scale
52 | uiscale_tooltip=Changes the scale of the interface
53 | theme_label=Theme
54 | theme_tooltip=Choose between various themes!
55 | enabledGameScanners_label=Game scanners
56 | enabledGameScanners_tooltip=Enable/Disable game scanners
57 | noToasts_label=Disable toasts
58 | noToasts_tooltip=Toasts are messages displayed on the window's bottom
59 | disableScrollbarFullScreen_label=Disable scrollbar in fullscreen
60 | disableScrollbarFullScreen_tooltip=Disable scrollbar in fullscreen
61 | scanPeriod_label=Scan every
62 | scanPeriod_tooltip=Scan every
63 | steamProfile_label=Steam profile to scan
64 | steamProfile_tooltip=Select the Steam profile to scan for non-installed games
65 | syncSteamPlaytime_label=Sync Steam playtimes
66 | syncSteamPlaytime_tooltip=Keeps your Steam games playtimes up to date with your account
67 | emulators_label=Emulators
68 | emulators_tooltip=Configure your emulators
69 | controller_label=Controller
70 | controller_tooltip=Choose the controller to use
71 | allowCollectSystemInfo_label=Allow GameRoom to collect some system info
72 | allowCollectSystemInfo_tooltip=GameRoom will send some system info (GPU name, CPU name, RAM amount, OS version, number of games) to one of GameRoom's server, to be only used for statistics and developement purposes. \nThis data is never transferred nor sold to any third parties.
73 |
--------------------------------------------------------------------------------
/src/settings_de.properties:
--------------------------------------------------------------------------------
1 | locale_label = Sprache
2 | locale_tooltip = W\u00E4hle die Sprache f\u00FCr Gameroom
3 |
4 | onGameLaunchAction_label = Nach dem Spielstart
5 | onGameLaunchAction_tooltip = W\u00E4hle was Gameroom nach einem Spielstart machen soll.
6 |
7 | fullScreen_label = Vollbildmodus
8 | fullScreen_tooltip = Aktiviere Vollbildmodus
9 | gamingPowerMode_label = Gaming Power Mode
10 | gamingPowerMode_tooltip = W\u00E4hle einen Powermodus nach dem Spielstart
11 |
12 | enableGamingPowerMode_label = Aktiviere Gaming Power Mode
13 | enableGamingPowerMode_tooltip = Aktiviere wechsel zu einem Power Mode nach dem Start des Spieles
14 |
15 | startMinimized_label = Starte minimiert
16 | startMinimized_tooltip = Aktiviere starten von GameRoom minimiert
17 |
18 | enableXboxControllerSupport_label = Aktiviere Gamecontroller Unterst\u00FCtzung
19 | enableXboxControllerSupport_tooltip = Erm\u00F6glicht Game-Controller-Unterst\u00FCtzung, CPU nur hungrig, wenn GameRoom auf der Vorderseite ist
20 |
21 | gamesFolder_label = Spieleordner
22 | gamesFolder_tooltip = Ordner Ihrer Spiele, GameRoom wird es scannen, um nach neuen Spielen zu suchen
23 |
24 | supporterKey_label = Supporterschl\u00FCssel
25 | supporterKey_tooltip = Supporterschl\u00FCssel
26 |
27 | disableMainSceneWallpaper_label = Deaktiviere Hintergrundimage
28 | disableMainSceneWallpaper_tooltip = Deaktivieren Sie das Hintergrundbild auf dem Hauptbildschirm, empfohlen f\u00FCr niedrige RAM-Ger\u00E4te
29 |
30 |
31 | noNotifications_label = Deaktivieren Sie alle Benachrichtigungen
32 | noNotifications_tooltip = Deaktivieren Sie alle Benachrichtigungen
33 |
34 | manage_ignored_steam_games_label = Verwalten Sie ignorierte Steam-Spiele
35 | manage_ignored_steam_games_tooltip = GameRoom wird dich nicht mehr fragen, ob du diese Spiele hinzuf\u00FCgen willst
36 |
37 | manage_ignored_game_folders_label=Verwalten von ignorierten Ordnern
38 | manage_ignored_game_folders_tooltip=GameRoom wird dich nicht mehr fragen, ob du diesen Ordner als Spiele hinzuf\u00FCgen m\u00F6chtest
39 | disableGameMainTheme_label = Deaktivieren Sie das Spiel des Spiels
40 | disableGameMainTheme_tooltip = Deaktivieren Sie das Spiel des Spiels, empfohlen f\u00FCr niedrige RAM-Ger\u00E4te
41 |
42 | advancedMode_label = Erweiterungmodus
43 | advancedMode_tooltip = Entsperrt mehr Einstellungen und Optionen, verwenden Sie auf eigene Gefahr!
44 | debugMode_label=Debugmodus
45 | debugMode_tooltip=\u00D6ffnet eine Konsole, wenn ein Fehler auftritt, so dass das Fehlerprotokoll kopiert werden kann
46 | startWithWindows_label=Starte mit Windows
47 | startWithWindows_tooltip=Startet GameRoom als Startup mit Windows
48 | uiscale_label=UI Gr\u00F6\u00DFe
49 | uiscale_tooltip=\u00C4ndert die Skalierung der Schnittstelle
50 | theme_label=Thema
51 | theme_tooltip=W\u00E4hlen Sie zwischen verschiedenen Themas!
52 | enabledGameScanners_label=Spielscanner
53 | enabledGameScanners_tooltip=Aktiviere/Deaktiviere den Spielscanner
54 | noToasts_label=Deaktivieren Sie Toasts
55 | noToasts_tooltip=Toasts sind Nachrichten, die auf der Unterseite des Fensters angezeigt werden
56 | disableScrollbarFullScreen_tooltip=Deaktivieren Sie die Bildlaufleiste im Vollbildmodus
57 | disableScrollbarFullScreen_label=Deaktivieren Sie die Bildlaufleiste im Vollbildmodus
58 | scanPeriod_label=Deaktivieren Sie die Bildlaufleiste im Vollbildmodus
59 | scanPeriod_tooltip=Scanne alle
60 | steamProfile_label=Steamprofil zum Scannen
61 | steamProfile_tooltip=W\u00E4hlen Sie das Steam-Profil aus, um nach nicht installierten Spielen zu suchen
--------------------------------------------------------------------------------
/src/settings_en.properties:
--------------------------------------------------------------------------------
1 | locale_label = Language
2 | locale_tooltip = Select the language of GameRoom
3 |
4 | onGameLaunchAction_label = After game start
5 | onGameLaunchAction_tooltip = Select what GameRoom should do after starting a game
6 |
7 | fullScreen_label = Fullscreen
8 | fullScreen_tooltip = Activate fullscreen mod
9 |
10 | gamingPowerMode_label = Gaming Power Mode
11 | gamingPowerMode_tooltip = Select a power mode to activate after starting a game
12 |
13 | enableGamingPowerMode_label = Enable Gaming Power Mode
14 | enableGamingPowerMode_tooltip = Enable switching to the selected gaming power mode after starting a game
15 |
16 | startMinimized_label = Start minimized
17 | startMinimized_tooltip = Enable to start GameRoom minimized
18 |
19 | enableXboxControllerSupport_label = Enable game controller support
20 | enableXboxControllerSupport_tooltip = Enables game controller support, CPU hungry only when GameRoom is on the front
21 |
22 | gamesFolder_label = Games folder
23 | gamesFolder_tooltip = Folder of your games, GameRoom will scan it to search for new games
24 |
25 | supporterKey_label = Supporter key
26 | supporterKey_tooltip = Supporter key
27 |
28 | disableMainSceneWallpaper_label = Disable background image
29 | disableMainSceneWallpaper_tooltip = Disable background image on main screen, recommended for low RAM devices
30 |
31 |
32 | noNotifications_label = Disable all notifications
33 | noNotifications_tooltip = Disable all notifications
34 |
35 | manage_ignored_steam_games_label = Manage ignored Steam games
36 | manage_ignored_steam_games_tooltip = GameRoom won't ask you anymore if you want to add those games
37 |
38 | manage_ignored_game_folders_label=Manage ignored games
39 | manage_ignored_game_folders_tooltip=GameRoom won't ask you anymore if you want to add those folder as games
40 | disableGameMainTheme_label = Disable playing game's theme
41 | disableGameMainTheme_tooltip = Disable playing game's theme, recommended for low RAM devices
42 |
43 | advancedMode_label = Advanced mode
44 | advancedMode_tooltip = Unlocks more settings and options, use at your own risk!
45 | debugMode_label=Debug mode
46 | debugMode_tooltip=Opens a console when an error occurs, allowing to copy the error log
47 | startWithWindows_label=Start with Windows
48 | startWithWindows_tooltip=Starts GameRoom at Windows' startup
49 | uiscale_label=UI Scale
50 | uiscale_tooltip=Changes the scale of the interface
51 | theme_label=Theme
52 | theme_tooltip=Choose between various themes!
53 | enabledGameScanners_label=Game scanners
54 | enabledGameScanners_tooltip=Enable/Disable game scanners
55 | noToasts_label=Disable toasts
56 | noToasts_tooltip=Toasts are messages displayed on the window's bottom
57 | disableScrollbarFullScreen_tooltip=Disable scrollbar in fullscreen
58 | disableScrollbarFullScreen_label=Disable scrollbar in fullscreen
59 | scanPeriod_label=Scan every
60 | scanPeriod_tooltip=Scan every
61 | steamProfile_label=Steam profile to scan
62 | steamProfile_tooltip=Select the Steam profile to scan for non-installed games
63 | syncSteamPlaytime_label=Sync Steam playtimes
64 | syncSteamPlaytime_tooltip=Keeps your Steam games playtimes up to date with your account
65 | emulators_label=Emulators
66 | emulators_tooltip=Configure your emulators
67 | controller_label=Controller
68 | controller_tooltip=Choose the controller to use
69 |
--------------------------------------------------------------------------------
/src/settings_fr.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/settings_fr.properties
--------------------------------------------------------------------------------
/src/strings_fr.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameRoomPC/GameRoom/b60e2d8f4e70060931921e1d273e4e259b3ea350/src/strings_fr.properties
--------------------------------------------------------------------------------
/src/tests/FileUtilsTest.java:
--------------------------------------------------------------------------------
1 | package tests;
2 |
3 | import com.gameroom.data.io.FileUtils;
4 | import org.junit.Test;
5 |
6 | import java.io.File;
7 |
8 | /**
9 | * Created by LM on 26/10/2016.
10 | */
11 | public class FileUtilsTest {
12 |
13 | @Test
14 | public final void testInitOrCreateFile(){
15 | File f = FileUtils.initOrCreateFile("test/testfile.jpg");
16 | assert (f.exists());
17 | f.delete();
18 | }
19 | @Test
20 | public final void testInitOrCreateFolder(){
21 | File f = FileUtils.initOrCreateFolder("test/testfolder");
22 | assert (f.exists());
23 | f.delete();
24 | }
25 | @Test
26 | public final void testRelativizePath(){
27 | File absoluteFile = new File("D:\\Downloads\\Compressed");
28 | File folder = new File("D:\\Downloads");
29 | assert(FileUtils.relativizePath(absoluteFile,folder).getPath().equals("Compressed"));
30 | }
31 | @Test
32 | public final void testClearFolder(){
33 | File f = FileUtils.initOrCreateFile("test/testToDelete1.jpg");
34 | File testFolder = FileUtils.initOrCreateFolder("test");
35 | FileUtils.clearFolder(testFolder);
36 | assert (testFolder.listFiles().length==0);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------