Check first run of the game. TODO: add proper tutorial, nickname changing to prevent tons of talats
This commit is contained in:
parent
d3c13c380c
commit
f13b1e246b
|
@ -20,4 +20,7 @@
|
|||
<string name="xash_not_installed_msg">Для того, чтобы продолжить вам необходимо установить Xash3D на ваше устройство</string>
|
||||
<string name="install_xash">Установить</string>
|
||||
<string name="cancel">Отмена</string>
|
||||
<string name="first_run_reminder_title">Напоминание при первом запуске</string>
|
||||
<string name="first_run_reminder_msg">Добро пожаловать в CS16Client! Хочу лишний раз напомнить, что для игры вам необходимы папки "cstrike" и "valve с оригинальной Steam установки Counter-Strike 1.6. Приятной игры!</string>
|
||||
<string name="ok">Хорошо!</string>
|
||||
</resources>
|
||||
|
|
|
@ -21,5 +21,8 @@
|
|||
<string name="xash_not_installed_msg">To continue, you must install Xash3D engine on your device</string>
|
||||
<string name="install_xash">Install</string>
|
||||
<string name="cancel">Cancel</string>
|
||||
<string name="first_run_reminder_title">First run reminder</string>
|
||||
<string name="first_run_reminder_msg">Welcome to CS16Client! I just want to remind you that to play this game you must copy original Counter-Strike 1.6 files(only "cstrike" and "valve" folders) from your Steam installation of the game to your device. Good luck, have fun!</string>
|
||||
<string name="ok">OK!</string>
|
||||
<!--<string name="ad_unit_id">Не дам! :P</string>-->
|
||||
</resources>
|
||||
|
|
|
@ -61,7 +61,7 @@ import com.google.android.gms.common.ConnectionResult;
|
|||
import in.celest.xash3d.cs16client.R;
|
||||
|
||||
public class LauncherActivity extends Activity {
|
||||
public static final int PAK_VERSION = 3;
|
||||
public static final int PAK_VERSION = 4;
|
||||
public final static int sdk = Integer.valueOf(Build.VERSION.SDK);
|
||||
public final static String TAG = "LauncherActivity";
|
||||
|
||||
|
@ -78,14 +78,6 @@ public class LauncherActivity extends Activity {
|
|||
static int mClicks;
|
||||
static Boolean mDev;
|
||||
static Boolean mFirstTime;
|
||||
|
||||
String getDefaultPath()
|
||||
{
|
||||
File dir = Environment.getExternalStorageDirectory();
|
||||
if( dir != null && dir.exists() )
|
||||
return dir.getPath() + "/xash";
|
||||
return "/sdcard/xash";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -113,6 +105,9 @@ public class LauncherActivity extends Activity {
|
|||
mClicks = 0;
|
||||
mDev = mPref.getBoolean("dev", false);
|
||||
|
||||
// TODO: extend firsttime with requesting player nickname!
|
||||
mFirstTime = mPref.getBoolean( "firsttime", true );
|
||||
|
||||
mCmdArgs. setText (mPref.getString ("argv" , "-console"));
|
||||
mEnableZBot.setChecked(mPref.getBoolean("zbots" , true ));
|
||||
mEnableYaPB.setChecked(mPref.getBoolean("yapbs" , false));
|
||||
|
@ -135,6 +130,11 @@ public class LauncherActivity extends Activity {
|
|||
// Just don't let app crash.
|
||||
Log.e( TAG, "Something happened during load ad. " + e.getMessage() );
|
||||
}
|
||||
|
||||
if( mFirstTime )
|
||||
{
|
||||
showTutorial();
|
||||
}
|
||||
}
|
||||
|
||||
public void startXash(View view)
|
||||
|
@ -146,6 +146,7 @@ public class LauncherActivity extends Activity {
|
|||
editor.putString("argv", argv);
|
||||
editor.putBoolean("zbots", mEnableZBot.isChecked());
|
||||
editor.putBoolean("yapbs", mEnableYaPB.isChecked());
|
||||
if( mFirstTime ) editor.putBoolean("firsttime", false);
|
||||
editor.commit();
|
||||
|
||||
extractPAK(this, false);
|
||||
|
@ -190,6 +191,9 @@ public class LauncherActivity extends Activity {
|
|||
// Check myself for GP version
|
||||
argv = argv + " -noch";
|
||||
|
||||
if( mFirstTime )
|
||||
argv = argv + " -firsttime";
|
||||
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("in.celest.xash3d.START");
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
|
@ -210,6 +214,18 @@ public class LauncherActivity extends Activity {
|
|||
}
|
||||
}
|
||||
|
||||
public void showTutorial( )
|
||||
{
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder( this );
|
||||
|
||||
// TODO: must be less dumb someday...
|
||||
builder.setTitle( R.string.first_run_reminder_title )
|
||||
.setMessage( R.string.first_run_reminder_msg )
|
||||
.setPositiveButton( R.string.ok,
|
||||
.show();
|
||||
}
|
||||
|
||||
|
||||
public void showXashInstallDialog( )
|
||||
{
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder( this );
|
||||
|
|
|
@ -137,7 +137,9 @@ int __MsgFunc_ServerName( const char *name, int size, void *buf )
|
|||
}
|
||||
|
||||
#ifdef __ANDROID__
|
||||
void __CmdFunc_MouseSucks( void ) { }
|
||||
bool evdev_open = false;
|
||||
void __CmdFunc_MouseSucksOpen( void ) { evdev_open = true; }
|
||||
void __CmdFunc_MouseSucksClose( void ) { evdev_open = false; }
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -148,8 +150,8 @@ void CHud :: Init( void )
|
|||
//HOOK_COMMAND( "gunsmoke", GunSmoke );
|
||||
|
||||
#ifdef __ANDROID__
|
||||
HOOK_COMMAND( "evdev_mouseopen", MouseSucks );
|
||||
HOOK_COMMAND( "evdev_mouseclose", MouseSucks );
|
||||
HOOK_COMMAND( "evdev_mouseopen", MouseSucksOpen );
|
||||
HOOK_COMMAND( "evdev_mouseclose", MouseSucksClose );
|
||||
#endif
|
||||
|
||||
HOOK_MESSAGE( Logo );
|
||||
|
@ -263,10 +265,10 @@ void CHud :: Init( void )
|
|||
|
||||
if( g_iMobileAPIVersion )
|
||||
{
|
||||
static byte color[] = {255, 255, 255, 255};
|
||||
gMobileAPI.pfnTouchResetDefaultButtons();
|
||||
gMobileAPI.pfnTouchAddDefaultButton("_settings", "touch_defaults/settings.tga", "menu_touchoptions",
|
||||
0.0, 0.0, 1.0, 1.0, color, 0, 1.0f, TOUCH_FL_NOEDIT | TOUCH_FL_DEF_SHOW );
|
||||
if( gEngfuncs.CheckParm( "-firsttime", NULL ) )
|
||||
{
|
||||
ClientCmd( "touch_presets/phone_ahsim.cfg" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ float rel_pitch;
|
|||
bool bMouseInUse = false;
|
||||
|
||||
extern Vector dead_viewangles;
|
||||
extern bool evdev_open;
|
||||
|
||||
#define F 1U<<0 // Forward
|
||||
#define B 1U<<1 // Back
|
||||
|
@ -127,8 +128,9 @@ void IN_ClientMoveEvent( float forwardmove, float sidemove )
|
|||
|
||||
void IN_ClientLookEvent( float relyaw, float relpitch )
|
||||
{
|
||||
if( ( evdev_grab && evdev_grab->value != 0.0f ) || bMouseInUse ) return;
|
||||
|
||||
#ifdef __ANDROID__
|
||||
if( evdev_open || bMouseInUse ) return;
|
||||
#endif
|
||||
rel_yaw += relyaw;
|
||||
rel_pitch += relpitch;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue