Commit 4b74e797 authored by fallenstardust's avatar fallenstardust

移除修改版本号功能

parent 19863e3d
......@@ -2,9 +2,6 @@
#define __CONFIG_H
#pragma once
#define DEF_PRO_VERSION 0x1343
#ifndef __GAME_CONFIG
#define _IRR_STATIC_LIB_
#define IRR_COMPILE_WITH_DX9_DEV_PACK
......@@ -112,7 +109,7 @@ using namespace io;
using namespace gui;
using namespace os;
extern unsigned short PRO_VERSION;
extern const unsigned short PRO_VERSION;
extern int enable_log;
extern bool exit_on_return;
extern bool bot_mode;
......
......@@ -25,7 +25,7 @@
#include <COGLESDriver.h>
#endif
unsigned short PRO_VERSION = DEF_PRO_VERSION;
const unsigned short PRO_VERSION = 0x1343;
namespace ygo {
......@@ -40,7 +40,6 @@ bool Game::Initialize() {
srand(time(0));
irr::SIrrlichtCreationParameters params = irr::SIrrlichtCreationParameters();
#ifdef _IRR_ANDROID_PLATFORM_
PRO_VERSION = android::getIntSetting(app, "game_version", PRO_VERSION);
android::InitOptions *options = android::getInitOptions(app);
glversion = options->getOpenglVersion();
if (glversion == 0) {
......@@ -1582,7 +1581,6 @@ void Game::RefreshBot() {
void Game::LoadConfig() {
wchar_t wstr[256];
if(gameConf._init)return;
PRO_VERSION = android::getIntSetting(appMain, "game_version", PRO_VERSION);
gameConf._init = TRUE;
gameConf.antialias = 1;
gameConf.serverport = 7911;
......
......@@ -6,12 +6,6 @@ IRRLICHT_PROJECT_PATH := $(LOCAL_PATH)
#LOCAL_SRC_FILES := $(IRRLICHT_PROJECT_PATH)/../irrlicht/lib/Android/$(TARGET_ARCH_ABI)/libIrrlicht.a
#include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := game_version
LOCAL_SRC_FILES := $(LOCAL_PATH)/jni/version.cpp
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := YGOMobile
......
#define __GAME_CONFIG
#include <jni.h>
#include "../Classes/gframe/config.h"
extern "C" {
JNIEXPORT jint JNICALL Java_cn_garymb_ygomobile_core_GameConfig_getGameVersion(
JNIEnv* env, jclass clazz) {
return (jint)DEF_PRO_VERSION;
}
}
......@@ -888,3 +888,5 @@
!setname 0x114 空牙团 空牙団
!setname 0x115 闪刀 閃刀
!setname 0x1115 闪刀姬 閃刀姫
!setname 0x116 圣像骑士 パラディオン
!setname 0x117 魔神仪 魔神儀
\ No newline at end of file
......@@ -9,8 +9,8 @@ android {
applicationId "cn.garymb.ygomobile"
minSdkVersion 16
targetSdkVersion 22
versionCode 31090421
versionName "3.1.9"
versionCode 32010424
versionName "3.2.1"
vectorDrawables.useSupportLibrary = true
ndk {
abiFilters "armeabi-v7a", "x86"
......
......@@ -433,24 +433,23 @@ public class AppsSettings {
}
return v;
}
public int resetGameVersion() {
int version = GameConfig.getVersion();
if (getIntSettings(Constants.PREF_GAME_VERSION, 0) == 0) {
//用户没设置过版本号
return version;
}
saveIntSettings(Constants.PREF_GAME_VERSION, GameConfig.getVersion());
return version;
}
public int getGameVersion() {
return getIntSettings(Constants.PREF_GAME_VERSION, GameConfig.getVersion());
}
public void setGameVersion(int v) {
saveIntSettings(Constants.PREF_GAME_VERSION, v);
}
/* public int resetGameVersion() {
* int version = GameConfig.getVersion();
* if (getIntSettings(Constants.PREF_GAME_VERSION, 0) == 0) {
* //用户没设置过版本号
* return version;
* }
* saveIntSettings(Constants.PREF_GAME_VERSION, GameConfig.getVersion());
* return version;
* }
*
* public int getGameVersion() {
* return getIntSettings(Constants.PREF_GAME_VERSION, GameConfig.getVersion());
*}
*
* public void setGameVersion(int v) {
* saveIntSettings(Constants.PREF_GAME_VERSION, v);
}*/
public String getVersionString(int value) {
int last = (value & 0xf);
......@@ -459,7 +458,7 @@ public class AppsSettings {
return String.format("%X.%03X.%X", b, m, last);
}
public int getVersionValue(String str) {
/* public int getVersionValue(String str) {
str = str.trim().toLowerCase(Locale.US);
int v = -1;
if(str.contains(".")){
......@@ -485,7 +484,7 @@ public class AppsSettings {
}
}
return v;
}
}*/
public void saveSettings(String key, String value) {
if ("lastdeck".equals(key)) {
......
......@@ -115,11 +115,11 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
AppsSettings.get().setUseExtraCards(false);
}
}
if (needsUpdate) {
if(AppsSettings.get().resetGameVersion() == 0){
VUiKit.show(mContext, mContext.getString(R.string.reset_game_ver_fail));
}
}
/* if (needsUpdate) {
* if(AppsSettings.get().resetGameVersion() == 0){
* VUiKit.show(mContext, mContext.getString(R.string.reset_game_ver_fail));
* }
* }*/
//设置字体
new ConfigManager(mSettings.getSystemConfig()).setFontSize(mSettings.getFontSize());
// copyCoreConfig(new File(mSettings.getResourcePath(), GameSettings.CORE_CONFIG_PATH).getAbsolutePath());
......
......@@ -79,7 +79,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
addPreferencesFromResource(R.xml.preference_game);
bind(PREF_GAME_PATH, mSettings.getResourcePath());
bind(PREF_GAME_VERSION, mSettings.getVersionString(mSettings.getGameVersion()));
// bind(PREF_GAME_VERSION, mSettings.getVersionString(mSettings.getGameVersion()));
bind(PREF_SOUND_EFFECT, mSettings.isSoundEffect());
bind(PREF_LOCK_SCREEN, mSettings.isLockSreenOrientation());
bind(PREF_FONT_ANTIALIAS, mSettings.isFontAntiAlias());
......@@ -108,7 +108,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
public boolean onPreferenceChange(Preference preference, Object value) {
super.onPreferenceChange(preference, value);
if (!isInit) {
if (PREF_GAME_VERSION.equals(preference.getKey())) {
/*if (PREF_GAME_VERSION.equals(preference.getKey())) {
int v = AppsSettings.get().getVersionValue(value.toString());
if (v > 0 && v <= AppsSettings.get().getVersionValue("0xF99F")) {
mSettings.setGameVersion(v);
......@@ -122,7 +122,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
}
return false;
}
}
}*/
if (PREF_FONT_SIZE.equals(preference.getKey())) {
int size = Constants.DEF_PREF_FONT_SIZE;
try {
......
......@@ -5,11 +5,7 @@
<Preference
android:key="pref_key_game_res_path"
android:persistent="true"
android:title="@string/settings_game_res_path"/>
<EditTextPreference
android:key="game_version"
android:persistent="true"
android:title="@string/game_version"
android:title="@string/settings_game_res_path"
/>
<ListPreference
android:entries="@array/opengl_version"
......
......@@ -6,7 +6,7 @@ import java.util.Locale;
public class A {
@Test
/*@Test
public void testVersion() {
System.out.println(getVersionString(0x233E));
System.out.println(getVersionString(0xF99F));
......@@ -15,7 +15,7 @@ public class A {
System.out.println(getVersionValue("1.034.00"));
System.out.println(getVersionValue("1.034.0"));
System.out.println(getVersionString(4928));
}
}*/
public String getVersionString(int value) {
int last = (value & 0xf);
......@@ -24,7 +24,7 @@ public class A {
return String.format("%X.%03X.%X", b, m, last);
}
public int getVersionValue(String str) {
/*public int getVersionValue(String str) {
str = str.trim().toLowerCase(Locale.US);
int v = -1;
if(str.contains(".")){
......@@ -50,5 +50,5 @@ public class A {
}
}
return v;
}
}*/
}
\ No newline at end of file
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