diff --git a/mk/linux/makedata.sh b/mk/linux/makedata.sh index 6deaa156..4bdcf194 100755 --- a/mk/linux/makedata.sh +++ b/mk/linux/makedata.sh @@ -32,6 +32,7 @@ find glest.ini \( -name "*" \) -exec cp -p "{}" $RELEASEDIR/glest_linux.ini ';' find glestkeys.ini \( -name "*" \) -exec cp -p --parents "{}" $RELEASEDIR ';' find configuration.xml \( -name "*" \) -exec cp -p --parents "{}" $RELEASEDIR ';' +find commondata/ \( -name "*" \) -not \( -name .svn -prune \) -not \( -name "*~" -prune \) -not \( -name "*.bak" -prune \) -exec cp -p --parents "{}" $RELEASEDIR ';' find data/ \( -name "*" \) -not \( -name .svn -prune \) -not \( -name "*~" -prune \) -not \( -name "*.bak" -prune \) -exec cp -p --parents "{}" $RELEASEDIR ';' find docs/ \( -name "*" \) -not \( -name .svn -prune \) -not \( -name "*~" -prune \) -not \( -name "*.bak" -prune \) -exec cp -p --parents "{}" $RELEASEDIR ';' find maps/ \( -name "*" \) -not \( -name .svn -prune \) -not \( -name "*~" -prune \) -not \( -name "*.bak" -prune \) -exec cp -p --parents "{}" $RELEASEDIR ';' diff --git a/mk/linux/makerelease.sh b/mk/linux/makerelease.sh index 5e1d0e3f..19336aa7 100755 --- a/mk/linux/makerelease.sh +++ b/mk/linux/makerelease.sh @@ -1,50 +1,39 @@ #!/bin/bash -VERSION=`./mg-version.sh --version` +VERSION=$(./mg-version.sh --version) RELEASENAME=megaglest-source -#RELEASEDIR="`pwd`/release/$RELEASENAME-$VERSION" -RELEASEDIR="`pwd`/release/$RELEASENAME-$VERSION/megaglest-$VERSION" +PACKAGE="$RELEASENAME-$VERSION.tar.xz" +CURRENTDIR="$(dirname $(readlink -f $0))" +RELEASEDIR="$CURRENTDIR/release/$RELEASENAME-$VERSION/megaglest-$VERSION" +SOURCEDIR="$CURRENTDIR/../../source/" echo "Creating source package in $RELEASEDIR" -rm -rf $RELEASEDIR -mkdir -p $RELEASEDIR -mkdir -p $RELEASEDIR/source -# copy sources -pushd "`pwd`/../../source" -find glest_game/ \( -name "*.cpp" -o -name "*.h" -o -name "*.c" -o -name "CMake*" \) -exec cp -p --parents "{}" $RELEASEDIR/source ';' -find shared_lib/ \( -name "*.cpp" -o -name "*.h" -o -name "*.c" -o -name "CMake*" \) -exec cp -p --parents "{}" $RELEASEDIR/source ';' -find glest_map_editor/ \( -name "*.cpp" -o -name "*.h" -o -name "*.xpm" -o -name "*.c" -o -name "CMake*" \) -exec cp -p --parents "{}" $RELEASEDIR/source ';' -find g3d_viewer/ \( -name "*.cpp" -o -name "*.h" -o -name "*.c" -o -name "CMake*" \) -exec cp -p --parents "{}" $RELEASEDIR/source ';' -find configurator/ \( -name "*.cpp" -o -name "*.h" -o -name "*.c" -o -name "CMake*" \) -exec cp -p --parents "{}" $RELEASEDIR/source ';' -find masterserver/ \( -name "*.php" -o -name "*.sql" -o -name "CMake*" \) -exec cp -p --parents "{}" $RELEASEDIR/source ';' -find tools/ \( -name "*.cpp" -o -name "*.h" -o -name "*.c" -o -name "*.pl" -o -name "*.sh" -o -name "*.css" -o -name "*.html" -o -name "*.ini" -o -name "*.ico" -o -name "*.txt" -o -name "*.dtd" -o -name "*.png" -o -name "*.py" -o -name "README" -o -name "INSTALL" -o -name "COPYING" -o -name "CMake*" \) -exec cp -p --parents "{}" $RELEASEDIR/source ';' +[[ -d "$RELEASEDIR" ]] && rm -rf "$RELEASEDIR" +mkdir -p "$RELEASEDIR" -pushd "../" -find mk/cmake/ \( -name "*.cmake" \) -exec cp -p --parents "{}" $RELEASEDIR ';' -find mk/macosx/ \( -name "*.txt" -o -name "*.plist" -o -name "*.icns" -o -name "PkgInfo" \) -exec cp -p --parents "{}" $RELEASEDIR ';' -popd +svn export --force "$SOURCEDIR" "$RELEASEDIR/source" -popd +#cp -r "$CURRENTDIR/../cmake/" "$RELEASEDIR" +#cp -r "$CURRENTDIR/../macosx/" "$RELEASEDIR" +#cp -r "$CURRENTDIR/../../docs" $RELEASEDIR +#cp "$CURRENTDIR/"*.ini $RELEASEDIR +#cp "$CURRENTDIR/glest.ico" $RELEASEDIR +#cp "$CURRENTDIR/megaglest.png" $RELEASEDIR +#cp "$CURRENTDIR/megaglest.desktop" $RELEASEDIR +#cp "$CURRENTDIR/start_megaglest"* $RELEASEDIR +#cp "$CURRENTDIR/../../CMake"* $RELEASEDIR +mkdir -p "$RELEASEDIR/mk/cmake/" +svn export --force "$CURRENTDIR/../cmake/" "$RELEASEDIR/mk/cmake/" +mkdir -p "$RELEASEDIR/mk/macosx/" +svn export --force "$CURRENTDIR/../macosx/" "$RELEASEDIR/mk/macosx/" +svn export --force "$CURRENTDIR/../../docs" $RELEASEDIR +cp "$CURRENTDIR/"*.ini $RELEASEDIR +cp "$CURRENTDIR/glest.ico" $RELEASEDIR +cp "$CURRENTDIR/megaglest.png" $RELEASEDIR +cp "$CURRENTDIR/megaglest.desktop" $RELEASEDIR +cp "$CURRENTDIR/start_megaglest"* $RELEASEDIR +cp "$CURRENTDIR/../../CMake"* $RELEASEDIR -cp -p ../../docs/*.txt $RELEASEDIR -cp -p glest.ini $RELEASEDIR -cp -p glestkeys.ini $RELEASEDIR -cp -p servers.ini $RELEASEDIR -cp -p glest.ico $RELEASEDIR -cp -p megaglest.png $RELEASEDIR -cp -p megaglest.desktop $RELEASEDIR -cp -p start_megaglest $RELEASEDIR -cp -p start_megaglest_configurator $RELEASEDIR -cp -p start_megaglest_mapeditor $RELEASEDIR -cp -p start_megaglest_g3dviewer $RELEASEDIR -cp -p ../../CMake* $RELEASEDIR - -pushd release -PACKAGE="$RELEASENAME-$VERSION.tar.bz2" -echo "creating $PACKAGE" -rm "$PACKAGE" - -tar -c --bzip2 -f "$PACKAGE" "$RELEASENAME-$VERSION" -#7za a "$RELEASENAME-$VERSION.7z" "$RELEASENAME-$VERSION" -popd +echo "Creating $PACKAGE" +tar cJf "release/$PACKAGE" -C "$CURRENTDIR/release/" "$RELEASENAME-$VERSION" diff --git a/mk/windoze/Installer/MegaGlestInstaller.nsi b/mk/windoze/Installer/MegaGlestInstaller.nsi index c14213ff..288905bd 100644 --- a/mk/windoze/Installer/MegaGlestInstaller.nsi +++ b/mk/windoze/Installer/MegaGlestInstaller.nsi @@ -201,6 +201,7 @@ Section "${APNAME} (required)" File "..\..\..\source\tools\glexemel\g3d_logo.png" SetOutPath $INSTDIR + File /r /x .svn /x mydata "..\..\..\data\glest_game\commondata" File /r /x .svn /x mydata "..\..\..\data\glest_game\data" File /r /x .svn /x mydata "..\..\..\data\glest_game\docs" File /r /x .svn /x mydata "..\..\..\data\glest_game\maps" @@ -278,6 +279,7 @@ Section "Uninstall" Delete $INSTDIR\xerces-c_3_0.dll Delete $INSTDIR\*.log + Delete $INSTDIR\commondata\*.* Delete $INSTDIR\data\*.* Delete $INSTDIR\docs\*.* Delete $INSTDIR\maps\*.* @@ -287,6 +289,7 @@ Section "Uninstall" Delete $INSTDIR\tilesets\*.* Delete $INSTDIR\tutorials\*.* + RMDir /r $INSTDIR\commondata RMDir /r $INSTDIR\data RMDir /r $INSTDIR\docs RMDir /r $INSTDIR\maps diff --git a/source/glest_game/gui/gui.cpp b/source/glest_game/gui/gui.cpp index ee23cef5..67b47e81 100644 --- a/source/glest_game/gui/gui.cpp +++ b/source/glest_game/gui/gui.cpp @@ -120,7 +120,7 @@ void Gui::init(Game *game){ this->console= game->getConsole(); this->world= game->getWorld(); this->game=game; - selection.init(this, world->getThisFactionIndex()); + selection.init(this, world->getThisFactionIndex(), world->getThisTeamIndex()); } void Gui::end(){ @@ -609,15 +609,17 @@ void Gui::mouseDownDisplayUnitBuild(int posDisplay){ } -string Gui::computeDefaultInfoString(){ - +string Gui::computeDefaultInfoString() { Lang &lang= Lang::getInstance(); string result=""; + //printf("\n\n\n\n********* selection.isCommandable() [%d] selection.isUniform() [%d]\n\n",selection.isCommandable(),selection.isUniform()); - if(selection.isCommandable() && selection.isUniform()){ - // default is the description extension - result=selection.getFrontUnit()->getDescExtension(); + if(selection.isUniform()) { + if(selection.isObserver() || selection.isCommandable()) { + // default is the description extension + result = selection.getFrontUnit()->getDescExtension(); + } } return result; } diff --git a/source/glest_game/gui/selection.cpp b/source/glest_game/gui/selection.cpp index 2f152c1c..97552361 100644 --- a/source/glest_game/gui/selection.cpp +++ b/source/glest_game/gui/selection.cpp @@ -26,8 +26,9 @@ namespace Glest{ namespace Game{ // class Selection // ===================================================== -void Selection::init(Gui *gui, int factionIndex){ +void Selection::init(Gui *gui, int factionIndex, int teamIndex) { this->factionIndex= factionIndex; + this->teamIndex = teamIndex; this->gui= gui; } @@ -35,8 +36,7 @@ Selection::~Selection(){ clear(); } -void Selection::select(Unit *unit){ - +void Selection::select(Unit *unit) { //check size //if(selectedUnits.size() >= maxUnits){ if(selectedUnits.size() >= Config::getInstance().getInt("MaxUnitSelectCount",intToStr(maxUnits).c_str())) { @@ -44,19 +44,19 @@ void Selection::select(Unit *unit){ } //check if already selected - for(int i=0; iisDead()){ + if(unit->isDead()) { return; } //check if multisel - if(!unit->getType()->getMultiSelect() && !isEmpty()){ + if(!unit->getType()->getMultiSelect() && !isEmpty()) { return; } @@ -128,13 +128,19 @@ bool Selection::isUniform() const{ return true; } -bool Selection::isEnemy() const{ +bool Selection::isEnemy() const { return selectedUnits.size() == 1 && - (selectedUnits.front()->getFactionIndex() != factionIndex || - factionIndex == (GameConstants::maxPlayers -1 + fpt_Observer)); + selectedUnits.front()->getFactionIndex() != factionIndex; } -bool Selection::isCommandable() const{ +bool Selection::isObserver() const { + return selectedUnits.size() == 1 && + (teamIndex == (GameConstants::maxPlayers -1 + fpt_Observer)); +} + +bool Selection::isCommandable() const { + //printf("\n\n\n\n********* selection.isCommandable() ---> isEmpty() [%d] isEnemy() [%d] selectedUnits.size() [%d]\n\n",isEmpty(),isEnemy(),(int)selectedUnits.size()); + return !isEmpty() && !isEnemy() && diff --git a/source/glest_game/gui/selection.h b/source/glest_game/gui/selection.h index 503fe7c9..a2b93a3b 100644 --- a/source/glest_game/gui/selection.h +++ b/source/glest_game/gui/selection.h @@ -39,12 +39,13 @@ public: private: int factionIndex; + int teamIndex; UnitContainer selectedUnits; UnitContainer groups[maxGroups]; Gui *gui; public: - void init(Gui *gui, int factionIndex); + void init(Gui *gui, int factionIndex, int teamIndex); virtual ~Selection(); void select(Unit *unit); @@ -56,6 +57,8 @@ public: bool isEmpty() const {return selectedUnits.empty();} bool isUniform() const; bool isEnemy() const; + bool isObserver() const; + //bool isComandable() const; bool isCommandable() const; bool isCancelable() const;