Compare commits

..

No commits in common. "master" and "master" have entirely different histories.

7 changed files with 43 additions and 308 deletions

View File

@ -21,7 +21,6 @@ Voxelands requires:
* g++ (or other C++ compiler) * g++ (or other C++ compiler)
* bzip2 * bzip2
* jpeg * jpeg
* libxml2
# Install # Install
@ -29,7 +28,7 @@ Voxelands requires:
Install dependencies. Here's an example for Debian/Ubuntu: Install dependencies. Here's an example for Debian/Ubuntu:
sudo apt install build-essential libirrlicht-dev cmake libbz2-dev zlib1g-dev libfreetype6-dev libpng-dev libjpeg-dev libogg-dev libvorbis-dev libopenal-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libxml2-dev sudo apt install build-essential libirrlicht-dev cmake libbz2-dev zlib1g-dev libfreetype6-dev libpng-dev libjpeg-dev libogg-dev libvorbis-dev libopenal-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev
You can install Git for easily keeping your copy up-to-date. You can install Git for easily keeping your copy up-to-date.
If you dont want Git, read below on how to get the source without Git. If you dont want Git, read below on how to get the source without Git.
@ -60,34 +59,6 @@ Build a version that runs directly from the source directory:
- You can select between Release and Debug build by `-DCMAKE_BUILD_TYPE=<Debug or Release>`. - You can select between Release and Debug build by `-DCMAKE_BUILD_TYPE=<Debug or Release>`.
- Debug build is slower, but gives much more useful output in a debugger. - Debug build is slower, but gives much more useful output in a debugger.
### Errors
Some buildings errors are currently known. If the building occured an error, it might be one of them:
#### Crash when building with translation.
**Error :**
[ 2%] Linking CXX static library libcguittfont.a
[ 2%] Built target cguittfont
make: *** [Makefile:152 : all] Erreur 2
**Git issue:** [#19](https://git.minetest.land/oerkki/voxelands/issues/19)
**Possible fixes:**
1. Change your default build language to english: (Add the `sudo` keyword for ubuntu-based devices)
apt-get install language-pack-en
dpkg-reconfigure locales
2. Delete translations files by simply deleting the `po` folder.
#### The `-DRUN_IN_PLACE` CMake option doesn't work.
**Git issue:** [#19](https://git.minetest.land/oerkki/voxelands/issues/11)
This error is fixed since the version 2404 of Voxelands. If you get them, check if the dowloaded version is the good one.
# Use # Use
Simply run `./bin/voxelands` from any console/terminal. Simply run `./bin/voxelands` from any console/terminal.

View File

@ -285,7 +285,6 @@ endif()
set(voxelands_SRCS set(voxelands_SRCS
${common_SRCS} ${common_SRCS}
${audio_SRCS} ${audio_SRCS}
tutorial.cpp
sky.cpp sky.cpp
hud.cpp hud.cpp
content_mapblock.cpp content_mapblock.cpp

View File

@ -53,7 +53,6 @@
#include "main.h" #include "main.h"
#endif #endif
#include "hud.h" #include "hud.h"
#include "tutorial.h"
#include "sky.h" #include "sky.h"
#include "selection_mesh.h" #include "selection_mesh.h"
@ -2301,24 +2300,6 @@ void the_game(
client.getEnv().getTime() client.getEnv().getTime()
); );
} }
// FIXME
{
core::dimension2d<u32> screensize = driver->getScreenSize();
s32 x = (screensize.Width/2);
s32 y = (screensize.Height/2);
LocalPlayer* player = client.getLocalPlayer();
Tutorial *tuto = player->tutorial;
if (input->isKeyDown(getKeySetting(tuto->getCurrentTutorialCompletionValue())))
tuto->setCurrentTutorialToNext();
std::string tutotext = tuto->getCurrentTutorialText();
std::wstring text = narrow_to_wide(tutotext);
core::dimension2d<u32> textsize = guienv->getSkin()->getFont()->getDimension(text.c_str());
core::rect<s32> rect((x-412)-(textsize.Width/2), y+10, (x-412)+(textsize.Width/2), y+10+textsize.Height);
guienv->addStaticText(text.c_str(),rect);
}
} }
/* /*

View File

@ -72,8 +72,7 @@ Player::Player():
m_home(0,0,0), m_home(0,0,0),
m_hashome(false), m_hashome(false),
m_character(PLAYER_DEFAULT_CHARDEF), m_character(PLAYER_DEFAULT_CHARDEF),
m_given_clothes(false), m_given_clothes(false)
tutorial(new Tutorial())
{ {
updateName("<not set>"); updateName("<not set>");
for (u8 i=0; i<PLAYERFLAG_COUNT; i++) { for (u8 i=0; i<PLAYERFLAG_COUNT; i++) {
@ -1308,4 +1307,5 @@ video::ITexture* LocalPlayer::getTexture()
return g_texturesource->getTextureRaw(tex); return g_texturesource->getTextureRaw(tex);
} }
#endif #endif

View File

@ -32,19 +32,18 @@
#endif #endif
#include "inventory.h" #include "inventory.h"
#include "collision.h" #include "collision.h"
#include "tutorial.h"
#define PLAYERNAME_SIZE 20 #define PLAYERNAME_SIZE 20
#define PLAYERNAME_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_" #define PLAYERNAME_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"
#define PLAYER_DEFAULT_CHARDEF "M:10:10:fair:blue:brown:medium:human:green:blue:leather" #define PLAYER_DEFAULT_CHARDEF "M:10:10:fair:blue:brown:medium:human:green:blue:leather"
#define PLAYERANIM_STAND 0 #define PLAYERANIM_STAND 0
#define PLAYERANIM_WALK 1 #define PLAYERANIM_WALK 1
#define PLAYERANIM_DIG 2 #define PLAYERANIM_DIG 2
#define PLAYERANIM_WALKDIG 3 #define PLAYERANIM_WALKDIG 3
#define PLAYERANIM_DIE 4 #define PLAYERANIM_DIE 4
#define PLAYERANIM_SIT 5 #define PLAYERANIM_SIT 5
/* /*
Animation Indices Animation Indices
@ -56,44 +55,44 @@
Dig/Walk 200-219 Dig/Walk 200-219
*/ */
#define PLAYERFLAG_HOME -1 #define PLAYERFLAG_HOME -1
#define PLAYERFLAG_WHITE 0 #define PLAYERFLAG_WHITE 0
#define PLAYERFLAG_BLUE 1 #define PLAYERFLAG_BLUE 1
#define PLAYERFLAG_GREEN 2 #define PLAYERFLAG_GREEN 2
#define PLAYERFLAG_ORANGE 3 #define PLAYERFLAG_ORANGE 3
#define PLAYERFLAG_PURPLE 4 #define PLAYERFLAG_PURPLE 4
#define PLAYERFLAG_RED 5 #define PLAYERFLAG_RED 5
#define PLAYERFLAG_YELLOW 6 #define PLAYERFLAG_YELLOW 6
#define PLAYERFLAG_BLACK 7 #define PLAYERFLAG_BLACK 7
#define PLAYERFLAG_COUNT 8 #define PLAYERFLAG_COUNT 8
#define PLAYERFLAG_JUMP PLAYERFLAG_COUNT #define PLAYERFLAG_JUMP PLAYERFLAG_COUNT
#define PLAYER_FEET 0x01 #define PLAYER_FEET 0x01
#define PLAYER_LLEG 0x02 #define PLAYER_LLEG 0x02
#define PLAYER_RLEG 0x04 #define PLAYER_RLEG 0x04
#define PLAYER_TORSO 0x08 #define PLAYER_TORSO 0x08
#define PLAYER_HANDS 0x10 #define PLAYER_HANDS 0x10
#define PLAYER_LARM 0x20 #define PLAYER_LARM 0x20
#define PLAYER_RARM 0x40 #define PLAYER_RARM 0x40
#define PLAYER_HEAD 0x80 #define PLAYER_HEAD 0x80
#define PLAYER_ALL 0xFF #define PLAYER_ALL 0xFF
#define DAMAGE_NONE 0x00 #define DAMAGE_NONE 0x00
#define DAMAGE_UNKNOWN 0x01 #define DAMAGE_UNKNOWN 0x01
#define DAMAGE_FALL 0x02 #define DAMAGE_FALL 0x02
#define DAMAGE_EXPOSURE 0x03 #define DAMAGE_EXPOSURE 0x03
#define DAMAGE_COLD 0x04 #define DAMAGE_COLD 0x04
#define DAMAGE_ATTACK 0x05 #define DAMAGE_ATTACK 0x05
#define DAMAGE_SPACE 0x06 #define DAMAGE_SPACE 0x06
#define DAMAGE_HUNGER 0x07 #define DAMAGE_HUNGER 0x07
#define DAMAGE_AIR 0x08 #define DAMAGE_AIR 0x08
#define DAMAGE_LAVA 0x09 #define DAMAGE_LAVA 0x09
#define DAMAGE_CACTUS 0x0A #define DAMAGE_CACTUS 0x0A
#define DAMAGE_FIRE 0x0B #define DAMAGE_FIRE 0x0B
#define DAMAGE_TNT 0x0C #define DAMAGE_TNT 0x0C
#define DAMAGE_STEAM 0x0D #define DAMAGE_STEAM 0x0D
#define DAMAGE_POISON 0x0E #define DAMAGE_POISON 0x0E
#define DAMAGE_SHADOW 0x0F #define DAMAGE_SHADOW 0x0F
class Map; class Map;
@ -392,8 +391,6 @@ public:
// the unclothed player skin parts // the unclothed player skin parts
void getSkin(std::vector<std::string> &parts); void getSkin(std::vector<std::string> &parts);
Tutorial *tutorial;
protected: protected:
char m_name[PLAYERNAME_SIZE]; char m_name[PLAYERNAME_SIZE];
u16 m_selected_item; u16 m_selected_item;
@ -686,3 +683,4 @@ private:
#endif // !SERVER #endif // !SERVER
#endif #endif

View File

@ -1,121 +0,0 @@
/************************************************************************
* Minetest-c55
* Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
*
* tutorial.h
* voxelands - 3d voxel world sandbox game
* Copyright (C) Lisa 'darkrose' Milne 2013-2014 <lisa@ltmnet.com>
*
* This program 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.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>
*
* License updated from GPLv2 or later to GPLv3 or later by Lisa Milne
* for Voxelands.
*
* Created by Futuray
************************************************************************/
#include "tutorial.h"
Tutorial::Tutorial():
currentTutorial(0)
{
};
Tutorial::Tutorial(int current):
currentTutorial(current)
{
};
Tutorial::~Tutorial()
{
};
std::string Tutorial::getText(int num)
{
switch(num) // TODO : translations
{
case TUTORIAL_WALK :
return (std::string)"Press the [W] button to walk forward.";
case TUTORIAL_JUMP :
return (std::string)"Press the spacebar to jump.";
/* case TUTORIAL_LOOK :
return (std::string)"Move the mouse to look around you."; */
case TUTORIAL_INVENTORY :
return (std::string)"Press the [I] button to open your inventory\nand the [Q] button to interact with nodes.";
/*case TUTORIAL_DIG_PLACE :
return (std::string)"Use the left click to dig nodes and the right click to place them.";*/
case TUTORIAL_EAT :
return (std::string)"Use the [H] button to eat any food.";
default :
return (std::string)"Tutorial is done!";
};
}
void Tutorial::setCurrentTutorialToNext()
{
this->currentTutorial++;
}
void Tutorial::setCurrentTutorialToNumber(int number)
{
this->currentTutorial = number;
}
int Tutorial::getCurrentTutorialNumber()
{
return this->currentTutorial;
}
int Tutorial::getCurrentTutorialCompletionValue()
{
switch(this->currentTutorial)
{
case TUTORIAL_WALK :
return TUTORIAL_KEY_WALK;
case TUTORIAL_JUMP :
return TUTORIAL_KEY_JUMP;
/* case TUTORIAL_LOOK :
return (std::string)"Move the mouse to look around you."; */
case TUTORIAL_INVENTORY :
return TUTORIAL_KEY_INVENTORY;
/*case TUTORIAL_DIG_PLACE :
return (std::string)"Use the left click to dig nodes and the right click to place them.";*/
case TUTORIAL_EAT :
return TUTORIAL_KEY_EAT;
default :
return 0;
};
}
std::string Tutorial::getCurrentTutorialText()
{
return this->getText(this->currentTutorial);
}
std::string Tutorial::getNumberText(int number)
{
return this->getText(number);
}

View File

@ -1,93 +0,0 @@
/************************************************************************
* Minetest-c55
* Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
*
* tutorial.h
* voxelands - 3d voxel world sandbox game
* Copyright (C) Lisa 'darkrose' Milne 2013-2014 <lisa@ltmnet.com>
*
* This program 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.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>
*
* License updated from GPLv2 or later to GPLv3 or later by Lisa Milne
* for Voxelands.
*
* Created by Futuray
************************************************************************/
/* 2304
{
vlprintf(CN_INFO,"Tuto Begin");
core::dimension2d<u32> screensize = driver->getScreenSize();
s32 x = (screensize.Width/2);
s32 y = (screensize.Height/2);
LocalPlayer* player = client.getLocalPlayer();
Tutorial *tuto = player->tutorial;
std::string tutotext = tuto->getCurrentTutorialText();
std::wstring text = narrow_to_wide(tutotext);
core::dimension2d<u32> textsize = guienv->getSkin()->getFont()->getDimension(text.c_str());
core::rect<s32> rect((x-412)-(textsize.Width/2), y+10, (x-412)+(textsize.Width/2), y+10+textsize.Height);
guienv->addStaticText(text.c_str(),rect);
vlprintf(CN_INFO,"Tuto OK"); //chatline_add(&chat_lines,narrow_to_wide(gettext("HUD shown")),-103.00);
}
*/
// 395 [player.h]
// #include "tutorial.h"
// Tutorial *tutorial;
// 76 [player.cpp]
// tutorial(new Tutorial())
#ifndef TUTORIAL_HEADER
#define TUTORIAL_HEADER
#include "log.h"
#include "common.h"
#include "keycode.h"
#include <string>
#define TUTORIAL_WALK 0
#define TUTORIAL_JUMP 1
// #define TUTORIAL_LOOK 2 # FIXME : find a way to check if the player look around
#define TUTORIAL_INVENTORY 2
// #define TUTORIAL_DIG_PLACE 3 # FIXME : find a way to check if the player push Leftclick
#define TUTORIAL_EAT 3
#define TUTORIAL_KEY_WALK VLKC_FORWARD
#define TUTORIAL_KEY_JUMP VLKC_JUMP
// #define TUTORIAL_KEY_LOOK ???
#define TUTORIAL_KEY_INVENTORY VLKC_INVENTORY
// #define TUTORIAL_KEY_DIG_PLACE VLKC_FORWARD
#define TUTORIAL_KEY_EAT VLKC_USE
class Tutorial
{
public:
Tutorial();
Tutorial(int current);
virtual ~Tutorial();
std::string getText(int num);
void setCurrentTutorialToNext();
void setCurrentTutorialToNumber(int number);
int getCurrentTutorialNumber();
int getCurrentTutorialCompletionValue();
std::string getCurrentTutorialText();
std::string getNumberText(int number);
int currentTutorial;
};
#endif