mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Editor Improvements
Added possibility to write separate explanations for different entities and fixed a bug.
This commit is contained in:
parent
a8c36540e5
commit
8dbefa734f
|
@ -2392,7 +2392,12 @@ void CEditor::DoMapEditor(CUIRect View)
|
|||
Layer = LAYER_TUNE;
|
||||
}
|
||||
if(m_ShowPicker && Layer != NUM_LAYERS)
|
||||
m_pTooltip = Explain((int)wx / 32 + (int)wy / 32 * 16, Layer);
|
||||
{
|
||||
if(m_SelectEntitiesImage == "DDNet")
|
||||
m_pTooltip = Explain(EXPLANATION_DDNET, (int)wx / 32 + (int)wy / 32 * 16, Layer);
|
||||
else if(m_SelectEntitiesImage == "FNG")
|
||||
m_pTooltip = Explain(EXPLANATION_FNG, (int)wx / 32 + (int)wy / 32 * 16, Layer);
|
||||
}
|
||||
else if(m_Brush.IsEmpty())
|
||||
m_pTooltip = "Use left mouse button to drag and create a brush. Hold shift to select multiple quads.";
|
||||
else
|
||||
|
|
|
@ -1060,7 +1060,34 @@ public:
|
|||
void AddFileDialogEntry(int Index, CUIRect *pView);
|
||||
void SelectGameLayer();
|
||||
void SortImages();
|
||||
static const char *Explain(int Tile, int Layer);
|
||||
|
||||
//Tile Numbers For Explanations - TODO: Add/Improve tiles and explanations
|
||||
enum
|
||||
{
|
||||
TILE_FNG_AIR,
|
||||
TILE_FNG_HOOKABLE,
|
||||
TILE_FNG_DEATH,
|
||||
TILE_FNG_UNHOOKABLE,
|
||||
|
||||
TILE_FNG_SPIKE_GOLD = 7,
|
||||
TILE_FNG_SPIKE_NORMAL,
|
||||
TILE_FNG_SPIKE_RED,
|
||||
TILE_FNG_SPIKE_BLUE,
|
||||
|
||||
TILE_FNG_SPIKE_GREEN = 14,
|
||||
TILE_FNG_SPIKE_PURPLE
|
||||
};
|
||||
|
||||
//Explanations
|
||||
enum
|
||||
{
|
||||
EXPLANATION_DDNET,
|
||||
EXPLANATION_FNG,
|
||||
EXPLANATION_RACE,
|
||||
EXPLANATION_VANILLA,
|
||||
EXPLANATION_BLOCKWORLDS
|
||||
};
|
||||
static const char *Explain(int ExplanationID, int Tile, int Layer);
|
||||
|
||||
int GetLineDistance() const;
|
||||
void ZoomMouseTarget(float ZoomFactor);
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
#include "editor.h"
|
||||
|
||||
// Explanations by Lady Saavik
|
||||
const char *CEditor::Explain(int Tile, int Layer)
|
||||
// DDNet entity explanations by Lady Saavik
|
||||
const char *CEditor::Explain(int ExplanationID, int Tile, int Layer) //TODO: Add other entities' tiles' explanations and improve new ones
|
||||
{
|
||||
if(ExplanationID == EXPLANATION_DDNET)
|
||||
{
|
||||
switch(Tile)
|
||||
{
|
||||
case TILE_AIR:
|
||||
|
@ -460,4 +462,50 @@ const char *CEditor::Explain(int Tile, int Layer)
|
|||
if(Tile >= TILE_CHECKPOINT_FIRST && Tile <= TILE_CHECKPOINT_LAST && (Layer == LAYER_GAME || Layer == LAYER_FRONT))
|
||||
return "TIME CHECKPOINT: Compares your current race time with your record to show you whether you are running faster or slower.";
|
||||
return "";
|
||||
}
|
||||
else if(ExplanationID == EXPLANATION_FNG)
|
||||
{
|
||||
switch(Tile)
|
||||
{
|
||||
case TILE_FNG_AIR:
|
||||
return "EMPTY: Can be used as an eraser.";
|
||||
case TILE_FNG_HOOKABLE:
|
||||
if(Layer == LAYER_GAME)
|
||||
return "HOOKABLE: It's possible to hook and collide with it.";
|
||||
break;
|
||||
case TILE_FNG_DEATH:
|
||||
if(Layer == LAYER_GAME)
|
||||
return "DEATH: Kills the tee.";
|
||||
break;
|
||||
case TILE_FNG_UNHOOKABLE:
|
||||
if(Layer == LAYER_GAME)
|
||||
return "UNHOOKABLE: It's not possible to hook it, but can collide with it.";
|
||||
break;
|
||||
case TILE_FNG_SPIKE_GOLD:
|
||||
if(Layer == LAYER_GAME)
|
||||
return "GOLDEN SPIKE: Kills the tee and gives points to the killer. (Amount of points given is set inside the server)";
|
||||
break;
|
||||
case TILE_FNG_SPIKE_NORMAL:
|
||||
if(Layer == LAYER_GAME)
|
||||
return "NORMAL SPIKE: Kills the tee and gives points to the killer. (Amount of points given is set inside the server)";
|
||||
break;
|
||||
case TILE_FNG_SPIKE_RED:
|
||||
if(Layer == LAYER_GAME)
|
||||
return "RED SPIKE: Red team spikes. Gives negative points when killer is in blue team (Amount of points given is set inside the server)";
|
||||
break;
|
||||
case TILE_FNG_SPIKE_BLUE:
|
||||
if(Layer == LAYER_GAME)
|
||||
return "BLUE SPIKE: Blue team spikes. Gives negative points when killer is in red team (Amount of points given is set inside the server)";
|
||||
break;
|
||||
case TILE_FNG_SPIKE_GREEN:
|
||||
if(Layer == LAYER_GAME)
|
||||
return "GREEN SPIKE: Kills the tee and gives points to the killer. (Amount of points given is set inside the server)";
|
||||
break;
|
||||
case TILE_FNG_SPIKE_PURPLE:
|
||||
if(Layer == LAYER_GAME)
|
||||
return "PURPLE SPIKE: Kills the tee and gives points to the killer. (Amount of points given is set inside the server)";
|
||||
break;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue