diff options
author | volzhs <volzhs@gmail.com> | 2015-07-01 15:13:10 +0900 |
---|---|---|
committer | volzhs <volzhs@gmail.com> | 2015-07-01 15:13:10 +0900 |
commit | f6668dc9db34fc4a3ef9e9e309e0fc248c3f51a8 (patch) | |
tree | 0c9a6e5cd8b6d3fdfab3cb6aff41458a08841133 /platform | |
parent | 903e6b37c0ed94cd0b3447dd3ff471abbfaa4460 (diff) | |
parent | b4d5f7e154973e8fb93a9a0af6ffa0b065e2c50c (diff) |
Merge branch 'master' of https://github.com/okamstudio/godot into fix_android_payments
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/export/export.cpp | 8 | ||||
-rw-r--r-- | platform/iphone/app_delegate.mm | 23 |
2 files changed, 27 insertions, 4 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index d169ec51d5..0f9ce8081f 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -317,7 +317,7 @@ bool EditorExportPlatformAndroid::_set(const StringName& p_name, const Variant& apk_expansion_pkey=p_value; else if (n.begins_with("permissions/")) { - String what = n.get_slice("/",1).to_upper(); + String what = n.get_slicec('/',1).to_upper(); bool state = p_value; if (state) perms.insert(what); @@ -325,7 +325,7 @@ bool EditorExportPlatformAndroid::_set(const StringName& p_name, const Variant& perms.erase(what); } else if (n.begins_with("user_permissions/")) { - int which = n.get_slice("/",1).to_int(); + int which = n.get_slicec('/',1).to_int(); ERR_FAIL_INDEX_V(which,MAX_USER_PERMISSIONS,false); user_perms[which]=p_value; @@ -390,11 +390,11 @@ bool EditorExportPlatformAndroid::_get(const StringName& p_name,Variant &r_ret) r_ret=apk_expansion_pkey; else if (n.begins_with("permissions/")) { - String what = n.get_slice("/",1).to_upper(); + String what = n.get_slicec('/',1).to_upper(); r_ret = perms.has(what); } else if (n.begins_with("user_permissions/")) { - int which = n.get_slice("/",1).to_int(); + int which = n.get_slicec('/',1).to_int(); ERR_FAIL_INDEX_V(which,MAX_USER_PERMISSIONS,false); r_ret=user_perms[which]; } else diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index 2c7a0a0790..dba37ab1b8 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -138,6 +138,29 @@ static int frame_count = 0; Main::setup2(); ++frame_count; + // this might be necessary before here + for (NSString* key in [[NSBundle mainBundle] infoDictionary]) { + NSObject* value = [xyz objectForKey:key]; + String ukey = String::utf8([key UTF8String]); + + // we need a NSObject to Variant conversor + + if ([value isKindOfClass:[NSString class]]) { + NSString* str = (NSString*)value; + String uval = String::utf8([str UTF8String]); + + Globals::get_singleton()->set("Info.plist/"+ukey, uval); + + } else if ([value isKindOfClass:[NSNumber class]]) { + + NSNumber* n = (NSNumber*)value; + double dval = [n doubleValue]; + + Globals::get_singleton()->set("Info.plist/"+ukey, dval); + }; + // do stuff + } + } break; /* case 3: { |