Skip to content

Commit

Permalink
GH-230 Modernize & fix welcome message rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
mdziekon committed Jul 3, 2022
1 parent eaf2305 commit 231b6ca
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 29 deletions.
3 changes: 1 addition & 2 deletions language/en/firstlogin.lang
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php

$_Lang['FirstLogin_Title'] = 'Welcome';
$_Lang['LoginPage_Header'] = 'Welcome to '.$_GameConfig['game_name'].'!';

$_Lang['LoginPage_Text'] = '<center><b class="orange">Welcome to '.$_GameConfig['game_name'].'!</b><br/><br/>';
$_Lang['LoginPage_Text'] = '<center><b class="orange">Welcome to {GameName}!</b><br/><br/>';
$_Lang['LoginPage_Text'] .= '<b>This is your first log in, that\'s why we would like to introduce you to the gameplay settings of this Game Server:</b></center><br/>';
$_Lang['LoginPage_Text'] .= '<span style="line-height: 18px;"><b class="minw">Universe:</b> <b class="lime">1</b><br/>';
$_Lang['LoginPage_Text'] .= '<b class="minw">Game speed:</b> <b class="lime">{GameSpeed}x</b><br/><b class="minw">Resources speed:</b> <b class="lime">{ResSpeed}x</b><br/><b class="minw">Fleets speed:</b> <b class="lime">{FleetSpeed}x</b><br/>';
Expand Down
3 changes: 1 addition & 2 deletions language/fr/firstlogin.lang
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php

$_Lang['FirstLogin_Title'] = 'Bienvenue';
$_Lang['LoginPage_Header'] = 'Bienvenue sur '.$_GameConfig['game_name'].' !';

$_Lang['LoginPage_Text'] = '<center><b class="orange">Bienvenue sur '.$_GameConfig['game_name'].' !</b><br/><br/>';
$_Lang['LoginPage_Text'] = '<center><b class="orange">Bienvenue sur {GameName} !</b><br/><br/>';
$_Lang['LoginPage_Text'] .= '<b>Pour ta première connexion, nous aimerions te présenter les paramètres de cet univers :</b></center><br/>';
$_Lang['LoginPage_Text'] .= '<span style="line-height: 18px;"><b class="minw">Univers :</b> <b class="lime">1</b><br/>';
$_Lang['LoginPage_Text'] .= '<b class="minw">Vitesse du jeu :</b> <b class="lime">{GameSpeed}x</b><br/><b class="minw">Production des ressources :</b> <b class="lime">{ResSpeed}x</b><br/><b class="minw">Vitesse des flottes :</b> <b class="lime">{FleetSpeed}x</b><br/>';
Expand Down
5 changes: 2 additions & 3 deletions language/pl/firstlogin.lang
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php

$_Lang['FirstLogin_Title'] = 'Powitanie';
$_Lang['LoginPage_Header'] = 'Witamy w '.$_GameConfig['game_name'].'!';

$_Lang['LoginPage_Text'] = '<center><b class="orange">Witaj serdecznie na jednym z serwerów '.$_GameConfig['game_name'].'!</b><br/><br/>';
$_Lang['LoginPage_Text'] = '<center><b class="orange">Witaj serdecznie na jednym z serwerów {GameName}!</b><br/><br/>';
$_Lang['LoginPage_Text'] .= '<b>Jest to twoje pierwsze logowanie, dlatego też pragniemy przedstawić ustawienia tego Serwera:</b></center><br/>';
$_Lang['LoginPage_Text'] .= '<span style="line-height: 18px;"><b class="minw">Universum:</b> <b class="lime">1</b><br/>';
$_Lang['LoginPage_Text'] .= '<b class="minw">Prędkość gry:</b> <b class="lime">{GameSpeed}x</b><br/><b class="minw">Prędkość wydobycia:</b> <b class="lime">{ResSpeed}x</b><br/><b class="minw">Prędkość flot:</b> <b class="lime">{FleetSpeed}x</b><br/>';
Expand All @@ -13,7 +12,7 @@ $_Lang['LoginPage_Text'] .= '<b class="minw">Czasowa Ochrona nowych Graczy:</
$_Lang['LoginPage_Text'] .= '<b class="minw"><b class="help" title="Po osiągnięciu tej ilości punktów nie będą obowiązywały żadne ograniczenia punktowe co do ataków na lub przez Ciebie">Próg procentowej Ochrony:</b></b> <b class="lime">{Protection_PointsLimit} pkt.</b><br/>';
$_Lang['LoginPage_Text'] .= '</span><br/><br/>';
//$_Lang['LoginPage_Text'] .= '<center><b class="red">Jako prezent dostajesz całkowicie darmowe Konto Pro na okres 10-ciu dni, które możesz aktywować w dowolnym momencie gry!</b></center><br/><br/>';
$_Lang['LoginPage_Text'] .= '<b>Jeśli jesteś nowym graczem</b>, z pewnością zainteresuje Cię wykonanie <a class="orange" href="tasks.php?cat=1"><b>&#187; Zadań Wprowadzających</b></a>, które pomogą Ci odnaleźć się w świecie '.$_GameConfig['game_name'].' i nauczą podstaw gry.<br/>';
$_Lang['LoginPage_Text'] .= '<b>Jeśli jesteś nowym graczem</b>, z pewnością zainteresuje Cię wykonanie <a class="orange" href="tasks.php?cat=1"><b>&#187; Zadań Wprowadzających</b></a>, które pomogą Ci odnaleźć się w świecie {GameName} i nauczą podstaw gry.<br/>';
$_Lang['LoginPage_Text'] .= '<center><b>Życzymy udanych łowów i powodzenia w grze!</b></center>';

$_Lang['LoginPage_Input'] = 'Rozpocznij grę!';
Expand Down
34 changes: 15 additions & 19 deletions overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,22 @@
$TPL = gettemplate('firstlogin');
$_DontShowMenus = true;

$Search = array
(
'{GameSpeed}', '{ResSpeed}', '{FleetSpeed}', '{FleetDebris}', '{DefFlDebris}', '{DefMiDebris}',
'{MotherSize}', '{OpenTime}', '{Protection_NewPlayerTime}', '{Protection_PointsLimit}'
$_Lang['LoginPage_Text'] = parsetemplate(
$_Lang['LoginPage_Text'],
[
'GameName' => $_GameConfig['game_name'],
'GameSpeed' => prettyNumber($_GameConfig['game_speed'] / 2500),
'ResSpeed' => prettyNumber($_GameConfig['resource_multiplier']),
'FleetSpeed' => prettyNumber($_GameConfig['fleet_speed'] / 2500),
'FleetDebris' => $_GameConfig['Fleet_Cdr'],
'DefFlDebris' => $_GameConfig['Defs_Cdr'],
'DefMiDebris' => $_GameConfig['Debris_Def_Rocket'],
'MotherSize' => $_GameConfig['initial_fields'],
'OpenTime' => prettyDate('d m Y - H:i:s', SERVER_MAINOPEN_TSTAMP, 1),
'Protection_NewPlayerTime' => prettyNumber($_GameConfig['Protection_NewPlayerTime'] / 3600),
'Protection_PointsLimit' => prettyNumber($_GameConfig['no_noob_protect'] * 1000),
]
);
$Replace = array
(
prettyNumber($_GameConfig['game_speed'] / 2500),
prettyNumber($_GameConfig['resource_multiplier']),
prettyNumber($_GameConfig['fleet_speed'] / 2500),
$_GameConfig['Fleet_Cdr'],
$_GameConfig['Defs_Cdr'],
$_GameConfig['Debris_Def_Rocket'],
$_GameConfig['initial_fields'],
prettyDate('d m Y - H:i:s', SERVER_MAINOPEN_TSTAMP, 1),
prettyNumber($_GameConfig['Protection_NewPlayerTime'] / 3600),
prettyNumber($_GameConfig['no_noob_protect'] * 1000)
);

$_Lang['LoginPage_Text'] = str_replace($Search, $Replace, $_Lang['LoginPage_Text']);

Overview\Screens\FirstLogin\Utils\Effects\updateUserOnFirstLogin([
'userId' => $_User['id'],
Expand Down
3 changes: 0 additions & 3 deletions templates/default_template/firstlogin.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ $(document).ready(function()
</script>
<br />
<table style="width: 950px;">
<tr>
<td class="c"><center>{LoginPage_Header}</center></td>
</tr>
<tr>
<td class="b pad5">
{LoginPage_Text}
Expand Down

0 comments on commit 231b6ca

Please sign in to comment.