forked from One-Piece-Online/OPOnline
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainMenu.php
More file actions
181 lines (160 loc) · 6.2 KB
/
MainMenu.php
File metadata and controls
181 lines (160 loc) · 6.2 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<?php
include_once 'MenuBar.php';
include "HostFiles/Redirector.php";
include_once "Libraries/PlayerSettings.php";
include_once 'Assets/patreon-php-master/src/PatreonDictionary.php';
include_once "APIKeys/APIKeys.php";
if (!empty($_SESSION['error'])) {
$error = $_SESSION['error'];
unset($_SESSION['error']);
echo "<script>alert('" . $error . "')</script>";
}
$language = TryGet("language", 1);
$settingArray = [];
$defaultFormat = 0;
$defaultVisibility = (isset($_SESSION["useruid"]) ? 1 : 0);
if (isset($_SESSION["userid"])) {
$savedSettings = LoadSavedSettings($_SESSION["userid"]);
for ($i = 0; $i < count($savedSettings); $i += 2) {
$settingArray[$savedSettings[intval($i)]] = $savedSettings[intval($i) + 1];
}
if (isset($_GET['language'])) {
ChangeSetting("", $SET_Language, $language, $_SESSION["userid"]);
} else if (isset($settingArray[$SET_Language])) $language = $settingArray[$SET_Language];
if (isset($settingArray[$SET_Format])) $defaultFormat = $settingArray[$SET_Format];
if (isset($settingArray[$SET_GameVisibility])) $defaultVisibility = $settingArray[$SET_GameVisibility];
}
$_SESSION['language'] = $language;
if (isset($_SESSION["isPatron"])) $isPatron = $_SESSION["isPatron"];
else $isPatron = false;
$createGameText = ($language == 1 ? "Create Game" : "ゲームを作る");
$languageText = ($language == 1 ? "Language" : "言語");
$createNewGameText = ($language == 1 ? "Create New Game" : "新しいゲームを作成する");
$starterDecksText = ($language == 1 ? "Starter Decks" : "おすすめデッキ");
$canSeeQueue = isset($_SESSION["useruid"]);
?>
<style>
</style>
<div style="text-align: center; padding-top: 45px;">
<h1 style='color:white;'>Karabast</h1>
<h3 style='color:white;'>A fan-made Star Wars Unlimited TCG Simulator</h3>
</div>
<div class="ContentWindow" style='width:27%; left:20px; top:60px; bottom:30px; overflow-y:auto;'>
<?php
try {
include "ServerChecker.php";
} catch (\Exception $e) {
}
?>
</div>
<?php
if (IsMobile()) echo ("<div class='ContentWindow' style='top:240px; left:32%; width:60%; bottom: 0px; overflow-y:visible'>");
else echo ("<div class='ContentWindow' style='top:225px; left:32%; width:36%; bottom: 30px; overflow-y:auto'>");
?>
<h5>Karabast is an open-source, fan-made platform. It's still a work in progress so let us know if you find any bugs :)</h5>
<h1><?php echo ($createNewGameText); ?></h1>
<?php
echo ("<form style='width:100%;display:inline-block;' action='CreateGame.php'>");
$favoriteDecks = [];
if (isset($_SESSION["userid"])) {
$favoriteDecks = LoadFavoriteDecks($_SESSION["userid"]);
if (count($favoriteDecks) > 0) {
$selIndex = -1;
if (isset($settingArray[$SET_FavoriteDeckIndex])) $selIndex = $settingArray[$SET_FavoriteDeckIndex];
echo ("<div class='SelectDeckInput'>Favorite Decks: ");
echo ("<select style='height:34px; width:60%;' name='favoriteDecks' id='favoriteDecks'>");
for ($i = 0; $i < count($favoriteDecks); $i += 4) {
echo ("<option value='" . $i . "<fav>" . $favoriteDecks[$i] . "'" . ($i == $selIndex ? " selected " : "") . ">" . $favoriteDecks[$i + 1] . "</option>");
}
echo ("</select></div>");
}
}
/*
if (count($favoriteDecks) == 0) {
echo ("<div><label class='SelectDeckInput'>" . $starterDecksText . ": </label>");
echo ("<select name='decksToTry' id='decksToTry'>");
echo ("</select></div>");
}
*/
echo ("<br>");
?>
<label for="fabdb">Deck Data (Copy Json from <u><a style='color:lightblue;' href='https://onepiecetopdecks.com/' target='_blank'>One Piece Top Decks</a></u>):</label>
<textarea type="textfield" rows="4" id="fabdb" name="fabdb"></textarea>
<?php
if (isset($_SESSION["userid"])) {
echo ("<span style='display:inline;'>");
echo ("<labelfor='favoriteDeck'><input class='inputFavoriteDeck' type='checkbox' id='favoriteDeck' name='favoriteDeck' />");
echo ("Save deck to ❤️ favorites</label>");
echo ("</span>");
}
echo ("<br>");
?>
<br>
<label for="gameDescription" class='SelectDeckInput'>Game Name:</label>
<input type="text" id="gameDescription" name="gameDescription" placeholder="Game #"><br><br>
<?php
echo ("<label for='format' class='SelectDeckInput'>Format: </label>");
echo ("<select name='format' id='format'>");
if ($canSeeQueue) {
echo ("<option value='cc' " . ($defaultFormat == 0 ? " selected" : "") . ">Standard Constructed</option>");
}
echo ("<option value='livinglegendscc'" . ($defaultFormat == 4 ? " selected" : "") . ">Open Format</option>");
echo ("</select>");
?>
<BR>
<BR>
<?php
if ($canSeeQueue) {
echo '<label for="public"><input class="SelectDeckInput" type="radio" id="public" name="visibility" value="public" ' . ($defaultVisibility == 1 ? 'checked="checked"' : "") . '>';
echo (' Public</label>');
}
?>
<label for="private">
<input type="radio" class='SelectDeckInput' id="private" name="visibility" value="private" <?php if ($defaultVisibility == 0) echo 'checked="checked"'; ?> />
Private</label>
<label for="deckTestMode">
<input class='SelectDeckInput' type="checkbox" id="deckTestMode" name="deckTestMode" value="deckTestMode">
Single Player</label>
<div style=' text-align:center;'>
<input type="submit" style="font-size:28px;" value="<?php echo ($createGameText); ?>">
</div>
<BR>
</form>
</div>
</div>
<div class="ContentWindow" style='right:20px; top:60px; bottom:30px; width:27%; <?php if (IsMobile()) echo ("display:none; "); ?>'>
<h1>News</h1>
<div style="position: relative;">
<div style='vertical-align:middle; text-align:center;'>
</div>
</div>
<?php
/*
if (!$isPatron) {
echo '<div>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8442966023291783"
crossorigin="anonymous"></script>
<!-- MainMenu -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-8442966023291783"
data-ad-slot="5060625180"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>';
}
*/
?>
<BR>
</div>
<script>
function changeLanguage() {
window.location.search = '?language=' + document.getElementById('languageSelect').value;
}
</script>
<?php
include_once 'Disclaimer.php';
?>