Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F119022
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
7 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/data/levelpacks/classic/levels.lst b/data/levelpacks/classic/levels.lst
index 103be12..783d04b 100644
--- a/data/levelpacks/classic/levels.lst
+++ b/data/levelpacks/classic/levels.lst
@@ -1,25 +1,26 @@
+name="classic"
description="Default level pack"
levelfile(BabySteps.map)
levelfile(ShadowBlocks.map)
levelfile(LittleHelp.map)
levelfile(FirstSpikes.map)
levelfile(SomeSpikes.map)
levelfile(Tricky.map)
levelfile(Jumper.map)
levelfile(FreeFall.map)
levelfile(Control.map)
levelfile(Tower.map)
levelfile(Jumping.map)
levelfile(UpDown.map)
levelfile(Spiky.map)
levelfile(Headache.map)
levelfile(FreeFall2.map)
levelfile(Timing.map)
levelfile(Carry.map)
levelfile(Road.map)
levelfile(Lab.map)
levelfile(LeftRight.map)
levelfile(Shadow.map)
levelfile(Here.map)
levelfile(End.map)
levelfile(Credits.map)
\ No newline at end of file
diff --git a/data/levelpacks/default/levels.lst b/data/levelpacks/default/levels.lst
index 3ada16f..b0cd049 100755
--- a/data/levelpacks/default/levels.lst
+++ b/data/levelpacks/default/levels.lst
@@ -1,20 +1,21 @@
+name="default"
description=Default
levelfile(map01.map)
levelfile(map02.map)
levelfile(1.map)
levelfile(2.map)
levelfile(3.map)
levelfile(4.map)
levelfile(5.map)
levelfile(map03.map)
levelfile(map04.map)
levelfile(map05.map)
levelfile(Remote.map)
levelfile(QuickSwap.map)
levelfile(Sweeper.map)
levelfile(Towers.map)
levelfile(Timing.map)
levelfile(Skyscrapers.map)
levelfile(Switches.map)
levelfile(Regroup.map)
levelfile(Volcano.map)
diff --git a/data/levelpacks/tutorial/levels.lst b/data/levelpacks/tutorial/levels.lst
index 078336c..a0d22df 100755
--- a/data/levelpacks/tutorial/levels.lst
+++ b/data/levelpacks/tutorial/levels.lst
@@ -1,27 +1,28 @@
+name="tutorial"
congratulations="You have finished the tutorial!"
description="Step by step introduction"
levelfile(tut01.map,"Walk in the park")
levelfile(tut02.map,"First jumps")
levelfile(tut03.map,"Jumping around")
levelfile(tut04.map,"First spikes")
levelfile(tut05.map,Shadow)
levelfile(tut06.map,"Shadow walk")
levelfile(tut07.map,"Shadow challenge")
levelfile(tut08.map,Teamwork)
levelfile(tut09.map,Fragile)
levelfile(tut10.map,Checkpoints)
levelfile(tut11.map,"Moving blocks")
levelfile(tut12.map,"Moving shadow blocks")
levelfile(tut13.map,"Moving spikes")
levelfile(tut14.map,"Conveyor madness")
levelfile(tut15.map,Triggering)
levelfile(tut16.map,"The switch")
levelfile(tut17.map,"Toggle trigger")
levelfile(tut18.map,"Stop trigger")
levelfile(tut19.map,"First portals")
levelfile(tut20.map,"Portal mayhem")
levelfile(tut21.map,Swappoints)
levelfile(tut22.map,"Shadow swap")
levelfile(tut23.map,"Collecting Keys")
levelfile(tut24.map,Warning)
levelfile(tut25.map,Final)
diff --git a/src/LevelPackManager.cpp b/src/LevelPackManager.cpp
index 38ccc9a..3e0f52c 100644
--- a/src/LevelPackManager.cpp
+++ b/src/LevelPackManager.cpp
@@ -1,134 +1,136 @@
/*
* Copyright (C) 2012 Me and My Shadow
*
* This file is part of Me and My Shadow.
*
* Me and My Shadow is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Me and My Shadow is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Me and My Shadow. If not, see <http://www.gnu.org/licenses/>.
*/
#include "LevelPackManager.h"
#include "LevelPack.h"
#include "FileManager.h"
+#include "Functions.h"
#include <stdio.h>
void LevelPackManager::loadLevelPack(std::string path){
//Load the levelpack.
LevelPack* levelpack=new LevelPack();
levelpack->loadLevels(path+"/levels.lst");
//Check if the entry doesn't already exist.
if(levelpacks.find(levelpack->levelpackPath)!=levelpacks.end()){
cerr<<"WARNING: Levelpack entry \""+levelpack->levelpackPath+"\" already exist."<<endl;
return;
}
//It doesn't exist so add it.
levelpacks[levelpack->levelpackPath]=levelpack;
//Check if it's the tutorial level pack.
//FIXME: If the folder name contains "tutorial" then it doesn't work :|
if(levelpack->type==MAIN
&& levelpack->levelpackPath.find("tutorial")!=string::npos)
{
tutorialLevelPackPath=levelpack->levelpackPath;
}
}
void LevelPackManager::addLevelPack(LevelPack* levelpack){
//Check if the entry doesn't already exist.
if(levelpacks.find(levelpack->levelpackPath)!=levelpacks.end()){
cerr<<"WARNING: Levelpack entry \""+levelpack->levelpackPath+"\" already exist."<<endl;
return;
}
//It doesn't exist so add it.
levelpacks[levelpack->levelpackPath]=levelpack;
}
void LevelPackManager::removeLevelPack(std::string path){
std::map<std::string,LevelPack*>::iterator it=levelpacks.find(path);
//Check if the entry exists.
if(it!=levelpacks.end()){
levelpacks.erase(it);
}else{
cerr<<"WARNING: Levelpack entry \""+path+"\" doesn't exist."<<endl;
}
}
LevelPack* LevelPackManager::getLevelPack(std::string path){
std::map<std::string,LevelPack*>::iterator it=levelpacks.find(path);
//Check if the entry exists.
if(it!=levelpacks.end()){
return it->second;
}else{
cerr<<"WARNING: Levelpack entry \""+path+"\" doesn't exist."<<endl;
return NULL;
}
}
vector<pair<string,string> > LevelPackManager::enumLevelPacks(int type){
//The vector that will be returned.
+ //NOTE: The names of the levelpacks are translated before adding them to the vector.
vector<pair<string,string> > v;
//Now do the type dependent adding.
switch(type){
case ALL_PACKS:
{
std::map<std::string,LevelPack*>::iterator i;
for(i=levelpacks.begin();i!=levelpacks.end();++i){
//We add everything except the "Custom Levels" pack since that's also in "Levels".
if(i->second->levelpackName!="Custom Levels")
- v.push_back(pair<string,string>(i->first,i->second->levelpackName));
+ v.push_back(pair<string,string>(i->first,_CC(i->second->getDictionaryManager(),i->second->levelpackName)));
}
break;
}
case CUSTOM_PACKS:
{
std::map<std::string,LevelPack*>::iterator i;
for(i=levelpacks.begin();i!=levelpacks.end();++i){
//Only add levelpacks that are of the custom type, one exception is the "Custom Levels" pack.
if(i->second->type==CUSTOM || i->second->levelpackName=="Custom Levels")
- v.push_back(pair<string,string>(i->first,i->second->levelpackName));
+ v.push_back(pair<string,string>(i->first,_CC(i->second->getDictionaryManager(),i->second->levelpackName)));
}
break;
}
}
//And return the vector.
return v;
}
void LevelPackManager::updateLanguage(){
std::map<std::string,LevelPack*>::iterator i;
for(i=levelpacks.begin();i!=levelpacks.end();++i){
i->second->updateLanguage();
}
}
LevelPackManager::~LevelPackManager(){
//We call destroy().
destroy();
}
void LevelPackManager::destroy(){
//Loop through the levelpacks and delete them.
std::map<std::string,LevelPack*>::iterator i;
for(i=levelpacks.begin();i!=levelpacks.end();++i){
delete i->second;
}
levelpacks.clear();
tutorialLevelPackPath.clear();
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, May 17, 12:40 AM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
63865
Default Alt Text
(7 KB)
Attached To
Mode
R79 meandmyshadow
Attached
Detach File
Event Timeline