|
|
@@ -56,6 +56,7 @@ public class PropMgr {
|
|
|
public List<PropInfo> ListForBag()
|
|
|
{
|
|
|
List<PropInfo> list = LoginMgr.myUserInfo.bagList;
|
|
|
+ if (CommonConfig.SpecialVersion1) list = GetDebugLocalBagList();
|
|
|
foreach (var propInfo in list)
|
|
|
{
|
|
|
propInfo.config = (PropConfig) propConfigs[propInfo.id];
|
|
|
@@ -65,7 +66,9 @@ public class PropMgr {
|
|
|
public List<PropInfo> ListForEquipped()
|
|
|
{
|
|
|
List<PropInfo> list = new List<PropInfo>();
|
|
|
- foreach (var propInfo in LoginMgr.myUserInfo.bagList)
|
|
|
+ List<PropInfo> myProps = LoginMgr.myUserInfo.bagList;
|
|
|
+ if (CommonConfig.SpecialVersion1) myProps = GetDebugLocalBagList();
|
|
|
+ foreach (var propInfo in myProps)
|
|
|
{
|
|
|
if (propInfo.inuse) {
|
|
|
propInfo.config = (PropConfig) propConfigs[propInfo.id];
|
|
|
@@ -80,6 +83,7 @@ public class PropMgr {
|
|
|
if (propConfig.type == 1 || propConfig.type == 2)
|
|
|
{
|
|
|
List<PropInfo> myProps = LoginMgr.myUserInfo.bagList;
|
|
|
+ if (CommonConfig.SpecialVersion1) myProps = GetDebugLocalBagList();
|
|
|
foreach (var myProp in myProps)
|
|
|
{
|
|
|
if (myProp.id == propConfig.id && myProp.count > 0) return true;
|
|
|
@@ -114,16 +118,55 @@ public class PropMgr {
|
|
|
}
|
|
|
}
|
|
|
propInfo.inuse = !propInfo.inuse;
|
|
|
+ if (CommonConfig.SpecialVersion1) {
|
|
|
+ SaveDebugLocalBagList();
|
|
|
+ return propInfo.inuse;
|
|
|
+ }
|
|
|
LoginMgr.myUserInfo.Save();
|
|
|
return propInfo.inuse;
|
|
|
}
|
|
|
|
|
|
- public void DebugAddAndUseProp(int id)
|
|
|
- {
|
|
|
- PropInfo propInfo = new PropInfo();
|
|
|
- propInfo.id = id;
|
|
|
- propInfo.inuse = true;
|
|
|
- LoginMgr.myUserInfo.bagList.Add(propInfo);
|
|
|
+ private List<PropInfo> _debugLocalBagList;
|
|
|
+ private int _debugLocalBagList_uid = -1;
|
|
|
+ private List<PropInfo> GetDebugLocalBagList() {
|
|
|
+ if (_debugLocalBagList_uid != LoginMgr.myUserInfo.id) {
|
|
|
+ _debugLocalBagList_uid = LoginMgr.myUserInfo.id;
|
|
|
+ _debugLocalBagList = null;
|
|
|
+ }
|
|
|
+ if (_debugLocalBagList == null) {
|
|
|
+ try {
|
|
|
+ string str = PlayerPrefs.GetString("sv1_baglist," + LoginMgr.myUserInfo.id, null);
|
|
|
+ _debugLocalBagList = JsonConvert.DeserializeObject<List<PropInfo>>(str);
|
|
|
+ } catch (System.Exception) {}
|
|
|
+ if (_debugLocalBagList == null) {
|
|
|
+ _debugLocalBagList = new List<PropInfo>();
|
|
|
+ for (int i = 2; i <= 5; i++) {
|
|
|
+ PropInfo propInfo = new PropInfo();
|
|
|
+ propInfo.id = 10 + i;
|
|
|
+ propInfo.count = 1;
|
|
|
+ _debugLocalBagList.Add(propInfo);
|
|
|
+ if (propInfo.id == 12) {
|
|
|
+ propInfo.inuse = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (int i = 2; i <= 5; i++) {
|
|
|
+ PropInfo propInfo = new PropInfo();
|
|
|
+ propInfo.id = 20 + i;
|
|
|
+ propInfo.count = 1;
|
|
|
+ _debugLocalBagList.Add(propInfo);
|
|
|
+ if (propInfo.id == 25) {
|
|
|
+ propInfo.inuse = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return _debugLocalBagList;
|
|
|
+ }
|
|
|
+ private void SaveDebugLocalBagList() {
|
|
|
+ if (_debugLocalBagList != null) {
|
|
|
+ string str = JsonConvert.SerializeObject(_debugLocalBagList);
|
|
|
+ PlayerPrefs.SetString("sv1_baglist," + LoginMgr.myUserInfo.id, str);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
public class PropInfo {
|