Compare commits
15 Commits
Author | SHA1 | Date |
---|---|---|
Futuray-pgm | bdfc8e094a | |
Futuray-pgm | 91c624da27 | |
Futuray-pgm | a988191ded | |
Futuray-pgm | 39f4313f1f | |
Futuray-pgm | a779387ef4 | |
Futuray-pgm | 625f2d250a | |
Futuray-pgm | cc6ef1b7c4 | |
Futuray-pgm | 811956a449 | |
Futuray-pgm | 10509e4f00 | |
Futuray-pgm | 8bc17bdba1 | |
Futuray-pgm | cf8ca7ed2f | |
Futuray-pgm | bc7fef25b0 | |
Futuray-pgm | 5ef5235593 | |
Futuray-pgm | 7ca1afdbd0 | |
Futuray-pgm | a0f70edc60 |
31
README.md
31
README.md
|
@ -21,6 +21,7 @@ Voxelands requires:
|
||||||
* g++ (or other C++ compiler)
|
* g++ (or other C++ compiler)
|
||||||
* bzip2
|
* bzip2
|
||||||
* jpeg
|
* jpeg
|
||||||
|
* libxml2
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
|
|
||||||
|
@ -28,7 +29,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
|
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
|
||||||
|
|
||||||
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 don’t want Git, read below on how to get the source without Git.
|
If you don’t want Git, read below on how to get the source without Git.
|
||||||
|
@ -59,6 +60,34 @@ 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.
|
||||||
|
|
|
@ -285,6 +285,7 @@ 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
|
||||||
|
|
19
src/game.cpp
19
src/game.cpp
|
@ -53,6 +53,7 @@
|
||||||
#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"
|
||||||
|
|
||||||
|
@ -2300,6 +2301,24 @@ 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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -72,7 +72,8 @@ 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 +1309,3 @@ video::ITexture* LocalPlayer::getTexture()
|
||||||
return g_texturesource->getTextureRaw(tex);
|
return g_texturesource->getTextureRaw(tex);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#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
|
||||||
|
|
||||||
|
@ -391,6 +392,8 @@ 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;
|
||||||
|
@ -683,4 +686,3 @@ private:
|
||||||
#endif // !SERVER
|
#endif // !SERVER
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,121 @@
|
||||||
|
/************************************************************************
|
||||||
|
* 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);
|
||||||
|
}
|
|
@ -0,0 +1,93 @@
|
||||||
|
/************************************************************************
|
||||||
|
* 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
|
Loading…
Reference in New Issue