new way to define the selectionType. No more use of EnableColorPicking and so on!
allowed values are: selectbuf color frustrum Default is selectbuf again as Colorpicking still makes trouble.
This commit is contained in:
parent
3f175b8a6a
commit
c5dd29f4ff
|
@ -4213,18 +4213,7 @@ string Game::getDebugStats(std::map<int,string> &factionDebugInfo) {
|
||||||
str+= "ExploredCellsLookupItemCache: " + world.getExploredCellsLookupItemCacheStats()+"\n";
|
str+= "ExploredCellsLookupItemCache: " + world.getExploredCellsLookupItemCacheStats()+"\n";
|
||||||
str+= "FowAlphaCellsLookupItemCache: " + world.getFowAlphaCellsLookupItemCacheStats()+"\n";
|
str+= "FowAlphaCellsLookupItemCache: " + world.getFowAlphaCellsLookupItemCacheStats()+"\n";
|
||||||
|
|
||||||
const bool selectBufPickingSelection = Config::getInstance().getBool("EnableSelectBufPicking","false");
|
str += "Selection type: "+toLower(Config::getInstance().getString("SelectionType",Config::selectBufPicking))+"\n";
|
||||||
//const bool colorPickingSelection = Config::getInstance().getBool("EnableColorPicking","true");
|
|
||||||
const bool frustumPickingSelection = Config::getInstance().getBool("EnableFrustumPicking","false");
|
|
||||||
if(selectBufPickingSelection) {
|
|
||||||
str += "Unit selection type: selectBuf\n";
|
|
||||||
}
|
|
||||||
else if(frustumPickingSelection) {
|
|
||||||
str += "Unit selection type: frustrum\n";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
str += "Unit selection type: color picking\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
//str+= "AllFactionsCacheStats: " + world.getAllFactionsCacheStats()+"\n";
|
//str+= "AllFactionsCacheStats: " + world.getAllFactionsCacheStats()+"\n";
|
||||||
//str+= "AttackWarningCount: " + intToStr(world.getUnitUpdater()->getAttackWarningCount()) + "\n";
|
//str+= "AttackWarningCount: " + intToStr(world.getUnitUpdater()->getAttackWarningCount()) + "\n";
|
||||||
|
|
|
@ -73,6 +73,11 @@ const char *Config::glestkeys_ini_filename = "glestkeys.ini";
|
||||||
const char *Config::glestuserkeys_ini_filename = "glestuserkeys.ini";
|
const char *Config::glestuserkeys_ini_filename = "glestuserkeys.ini";
|
||||||
|
|
||||||
const char *Config::ACTIVE_MOD_PROPERTY_NAME = "current_mod_name";
|
const char *Config::ACTIVE_MOD_PROPERTY_NAME = "current_mod_name";
|
||||||
|
|
||||||
|
const char *Config::colorPicking = "color";
|
||||||
|
const char *Config::selectBufPicking = "frustrum";
|
||||||
|
const char *Config::frustrumPicking = "selectbuf";
|
||||||
|
|
||||||
map<string,string> Config::customRuntimeProperties;
|
map<string,string> Config::customRuntimeProperties;
|
||||||
|
|
||||||
// =====================================================
|
// =====================================================
|
||||||
|
|
|
@ -66,6 +66,10 @@ public:
|
||||||
|
|
||||||
static const char *ACTIVE_MOD_PROPERTY_NAME;
|
static const char *ACTIVE_MOD_PROPERTY_NAME;
|
||||||
|
|
||||||
|
static const char *colorPicking;
|
||||||
|
static const char *selectBufPicking;
|
||||||
|
static const char *frustrumPicking;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
Config();
|
Config();
|
||||||
|
|
|
@ -6691,15 +6691,13 @@ Vec3f Renderer::computeScreenPosition(const Vec3f &worldPos) {
|
||||||
void Renderer::computeSelected( Selection::UnitContainer &units, const Object *&obj,
|
void Renderer::computeSelected( Selection::UnitContainer &units, const Object *&obj,
|
||||||
const bool withObjectSelection,
|
const bool withObjectSelection,
|
||||||
const Vec2i &posDown, const Vec2i &posUp) {
|
const Vec2i &posDown, const Vec2i &posUp) {
|
||||||
//const bool selectBufPickingSelection = Config::getInstance().getBool("EnableSelectBufPicking","false");
|
const string selectionType=toLower(Config::getInstance().getString("SelectionType",Config::selectBufPicking));
|
||||||
const bool colorPickingSelection = Config::getInstance().getBool("EnableColorPicking","true");
|
|
||||||
const bool frustumPickingSelection = Config::getInstance().getBool("EnableFrustumPicking","false");
|
|
||||||
|
|
||||||
if(colorPickingSelection == true) {
|
if(selectionType==Config::colorPicking) {
|
||||||
selectUsingColorPicking(units,obj, withObjectSelection,posDown, posUp);
|
selectUsingColorPicking(units,obj, withObjectSelection,posDown, posUp);
|
||||||
}
|
}
|
||||||
/// Frustrum approach --> Currently not accurate enough
|
/// Frustrum approach --> Currently not accurate enough
|
||||||
else if(frustumPickingSelection == true) {
|
else if(selectionType==Config::frustrumPicking) {
|
||||||
selectUsingFrustumSelection(units,obj, withObjectSelection,posDown, posUp);
|
selectUsingFrustumSelection(units,obj, withObjectSelection,posDown, posUp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -201,15 +201,14 @@ MenuStateOptions::MenuStateOptions(Program *program, MainMenu *mainMenu):
|
||||||
listBoxSelectionType.pushBackItem("SelectBuffer");
|
listBoxSelectionType.pushBackItem("SelectBuffer");
|
||||||
listBoxSelectionType.pushBackItem("ColorPicking");
|
listBoxSelectionType.pushBackItem("ColorPicking");
|
||||||
listBoxSelectionType.pushBackItem("FrustumPicking");
|
listBoxSelectionType.pushBackItem("FrustumPicking");
|
||||||
bool isColorpicking= config.getBool("EnableColorPicking","false");
|
|
||||||
bool isFrustumPicking=config.getBool("EnableFrustumPicking","false");
|
const string selectionType=toLower(config.getString("SelectionType",Config::selectBufPicking));
|
||||||
bool isSelectBuf= config.getBool("EnableSelectBufPicking","true");
|
if( selectionType==Config::colorPicking)
|
||||||
if( isSelectBuf == true && isColorpicking == false && isFrustumPicking == false )
|
listBoxSelectionType.setSelectedItemIndex(1);
|
||||||
listBoxSelectionType.setSelectedItemIndex(0);
|
else if ( selectionType==Config::frustrumPicking )
|
||||||
else if(isColorpicking == false && isFrustumPicking == true)
|
|
||||||
listBoxSelectionType.setSelectedItemIndex(2);
|
listBoxSelectionType.setSelectedItemIndex(2);
|
||||||
else
|
else
|
||||||
listBoxSelectionType.setSelectedItemIndex(1);
|
listBoxSelectionType.setSelectedItemIndex(0);
|
||||||
currentLine-=lineOffset;
|
currentLine-=lineOffset;
|
||||||
|
|
||||||
//shadows
|
//shadows
|
||||||
|
@ -1774,19 +1773,13 @@ void MenuStateOptions::saveConfig(){
|
||||||
|
|
||||||
int selectionTypeindex= listBoxSelectionType.getSelectedItemIndex();
|
int selectionTypeindex= listBoxSelectionType.getSelectedItemIndex();
|
||||||
if(selectionTypeindex==0){
|
if(selectionTypeindex==0){
|
||||||
config.setBool("EnableSelectBufPicking", true);
|
config.setString("SelectionType",Config::selectBufPicking);
|
||||||
config.setBool("EnableColorPicking", false);
|
|
||||||
config.setBool("EnableFrustumPicking", false);
|
|
||||||
}
|
}
|
||||||
else if (selectionTypeindex==1){
|
else if (selectionTypeindex==1){
|
||||||
config.setBool("EnableSelectBufPicking", false);
|
config.setString("SelectionType",Config::colorPicking);
|
||||||
config.setBool("EnableColorPicking", true);
|
|
||||||
config.setBool("EnableFrustumPicking", false);
|
|
||||||
}
|
}
|
||||||
else if (selectionTypeindex==2){
|
else if (selectionTypeindex==2){
|
||||||
config.setBool("EnableSelectBufPicking", false);
|
config.setString("SelectionType",Config::frustrumPicking);
|
||||||
config.setBool("EnableColorPicking", false);
|
|
||||||
config.setBool("EnableFrustumPicking", true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int index= listBoxShadows.getSelectedItemIndex();
|
int index= listBoxShadows.getSelectedItemIndex();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user