Commit 871e518e authored by fallenstardust's avatar fallenstardust

ygomobileActivity.oncreate读取arg

parent 27124927
...@@ -68,6 +68,7 @@ int main(int argc, char* argv[]) { ...@@ -68,6 +68,7 @@ int main(int argc, char* argv[]) {
//android //android
for(int i = 0; i < argc; ++i) { for(int i = 0; i < argc; ++i) {
const char* arg = argv[i].c_str(); const char* arg = argv[i].c_str();
os::Printer::log("kkargv ", arg);
#else #else
//pc的第一个是exe的路径 //pc的第一个是exe的路径
for(int i = 1; i < argc; ++i) { for(int i = 1; i < argc; ++i) {
...@@ -93,7 +94,7 @@ int main(int argc, char* argv[]) { ...@@ -93,7 +94,7 @@ int main(int argc, char* argv[]) {
ygo::mainGame->HideElement(ygo::mainGame->wMainMenu); ygo::mainGame->HideElement(ygo::mainGame->wMainMenu);
ClickButton(ygo::mainGame->btnJoinHost); ClickButton(ygo::mainGame->btnJoinHost);
break; break;
} else if(!strcmp(arg, "-r")) { // Replay } else if (arg[0] == '-' && arg[1] == 'r') { // Replay
exit_on_return = !keep_on_return; exit_on_return = !keep_on_return;
int index = 0; int index = 0;
if((i+1) < argc){//下一个参数是录像名 if((i+1) < argc){//下一个参数是录像名
......
...@@ -118,6 +118,9 @@ public class YGOMobileActivity extends NativeActivity implements ...@@ -118,6 +118,9 @@ public class YGOMobileActivity extends NativeActivity implements
mFullScreenUtils = new FullScreenUtils(this, app().isImmerSiveMode()); mFullScreenUtils = new FullScreenUtils(this, app().isImmerSiveMode());
mFullScreenUtils.fullscreen(); mFullScreenUtils.fullscreen();
mFullScreenUtils.onCreate(); mFullScreenUtils.onCreate();
//argv
mArgV = getIntent().getStringArrayExtra(IrrlichtBridge.EXTRA_ARGV);
//
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
Log.e("YGOStarter", "跳转完成" + System.currentTimeMillis()); Log.e("YGOStarter", "跳转完成" + System.currentTimeMillis());
if (sChainControlXPostion < 0) { if (sChainControlXPostion < 0) {
...@@ -198,8 +201,6 @@ public class YGOMobileActivity extends NativeActivity implements ...@@ -198,8 +201,6 @@ public class YGOMobileActivity extends NativeActivity implements
} }
private void handleExternalCommand(Intent intent) { private void handleExternalCommand(Intent intent) {
//argv
mArgV = intent.getStringArrayExtra(IrrlichtBridge.EXTRA_ARGV);
// //
YGOGameOptions options = intent YGOGameOptions options = intent
.getParcelableExtra(YGOGameOptions.YGO_GAME_OPTIONS_BUNDLE_KEY); .getParcelableExtra(YGOGameOptions.YGO_GAME_OPTIONS_BUNDLE_KEY);
......
...@@ -158,7 +158,6 @@ public class YGOStarter { ...@@ -158,7 +158,6 @@ public class YGOStarter {
* 或者(播放完不退出游戏):-k -r 1111.yrp * 或者(播放完不退出游戏):-k -r 1111.yrp
*/ */
public static void startGame(Activity activity, YGOGameOptions options, String[] args) { public static void startGame(Activity activity, YGOGameOptions options, String[] args) {
Log.i("kk arg", args[0] + " " + args[1]);
//如果距离上次加入游戏的时间大于1秒才处理 //如果距离上次加入游戏的时间大于1秒才处理
if (System.currentTimeMillis() - lasttime >= 1000) { if (System.currentTimeMillis() - lasttime >= 1000) {
lasttime = System.currentTimeMillis(); lasttime = System.currentTimeMillis();
...@@ -173,7 +172,8 @@ public class YGOStarter { ...@@ -173,7 +172,8 @@ public class YGOStarter {
intent.putExtra(YGOGameOptions.YGO_GAME_OPTIONS_BUNDLE_TIME, System.currentTimeMillis()); intent.putExtra(YGOGameOptions.YGO_GAME_OPTIONS_BUNDLE_TIME, System.currentTimeMillis());
} }
if (args != null) { if (args != null) {
intent.putExtra(IrrlichtBridge.EXTRA_ARGV, args[0] + " " + args[1]); Log.i("kk arg", args[0]+""+args[1]);
intent.putExtra(IrrlichtBridge.EXTRA_ARGV, args);
} }
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Log.e("YGOStarter", "跳转前" + System.currentTimeMillis()); Log.e("YGOStarter", "跳转前" + System.currentTimeMillis());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment