2009-05-08 13:28:41 +00:00
|
|
|
/*
|
|
|
|
* OpenClonk, http://www.openclonk.org
|
|
|
|
*
|
2009-06-05 13:41:20 +00:00
|
|
|
* Copyright (c) 1998-2000 Matthes Bender
|
|
|
|
* Copyright (c) 2001, 2005, 2007 Sven Eberhardt
|
2010-12-23 00:01:24 +00:00
|
|
|
* Copyright (c) 2005, 2009 Günther Brammer
|
2009-06-05 13:41:20 +00:00
|
|
|
* Copyright (c) 2006-2007 Armin Burgmeier
|
2011-09-01 10:47:54 +00:00
|
|
|
* Copyright (c) 2010 Martin Plicht
|
2009-05-08 13:28:41 +00:00
|
|
|
* Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de
|
|
|
|
*
|
|
|
|
* Portions might be copyrighted by other authors who have contributed
|
|
|
|
* to OpenClonk.
|
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
* See isc_license.txt for full license and disclaimer.
|
|
|
|
*
|
|
|
|
* "Clonk" is a registered trademark of Matthes Bender.
|
|
|
|
* See clonk_trademark_license.txt for full license.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Drawing tools dialog for landscape editing in console mode */
|
|
|
|
|
|
|
|
#ifndef INC_C4ToolsDlg
|
|
|
|
#define INC_C4ToolsDlg
|
|
|
|
|
|
|
|
#ifdef WITH_DEVELOPER_MODE
|
2010-09-22 15:11:19 +00:00
|
|
|
#include <gtk/gtk.h>
|
2009-05-08 13:28:41 +00:00
|
|
|
#endif
|
|
|
|
|
2009-08-12 20:03:50 +00:00
|
|
|
#include "C4Constants.h"
|
2010-12-11 18:50:38 +00:00
|
|
|
#include "C4ConsoleGUI.h"
|
2009-08-12 20:03:50 +00:00
|
|
|
|
2010-12-11 18:50:38 +00:00
|
|
|
const int32_t
|
|
|
|
C4TLS_Brush = 0,
|
|
|
|
C4TLS_Line = 1,
|
|
|
|
C4TLS_Rect = 2,
|
|
|
|
C4TLS_Fill = 3,
|
|
|
|
C4TLS_Picker = 4;
|
2009-05-08 13:28:41 +00:00
|
|
|
|
2010-12-11 18:50:38 +00:00
|
|
|
const int32_t
|
|
|
|
C4TLS_GradeMax = 50,
|
|
|
|
C4TLS_GradeMin = 1,
|
|
|
|
C4TLS_GradeDefault = 5;
|
2009-05-08 13:28:41 +00:00
|
|
|
|
|
|
|
#define C4TLS_MatSky "Sky"
|
|
|
|
|
|
|
|
class C4ToolsDlg
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2010-12-11 18:50:38 +00:00
|
|
|
friend class C4ConsoleGUI;
|
|
|
|
private:
|
|
|
|
class State;
|
|
|
|
State *state;
|
2010-03-28 17:58:21 +00:00
|
|
|
public:
|
|
|
|
C4ToolsDlg();
|
|
|
|
~C4ToolsDlg();
|
|
|
|
public:
|
|
|
|
bool Active;
|
|
|
|
int32_t Tool, SelectedTool;
|
|
|
|
int32_t Grade;
|
|
|
|
bool ModeIFT;
|
|
|
|
char Material[C4M_MaxName+1];
|
|
|
|
char Texture[C4M_MaxName+1];
|
|
|
|
public:
|
|
|
|
void Default();
|
|
|
|
void Clear();
|
|
|
|
bool PopTextures();
|
|
|
|
bool PopMaterial();
|
|
|
|
bool ChangeGrade(int32_t iChange);
|
2010-12-11 18:50:38 +00:00
|
|
|
void NeedPreviewUpdate();
|
2010-03-28 17:58:21 +00:00
|
|
|
bool Open();
|
|
|
|
bool SetGrade(int32_t iGrade);
|
|
|
|
bool SetTool(int32_t iTool, bool fTemp);
|
|
|
|
bool ToggleTool() { return !!SetTool((Tool+1)%4, false); }
|
|
|
|
bool SetLandscapeMode(int32_t iMode, bool fThroughControl=false);
|
|
|
|
bool SetIFT(bool fIFT);
|
|
|
|
bool ToggleIFT() { return !!SetIFT(!ModeIFT); }
|
|
|
|
bool SelectTexture(const char *szTexture);
|
|
|
|
bool SelectMaterial(const char *szMaterial);
|
|
|
|
void SetAlternateTool();
|
|
|
|
void ResetAlternateTool();
|
|
|
|
protected:
|
|
|
|
void AssertValidTexture();
|
|
|
|
void LoadBitmaps();
|
|
|
|
void EnableControls();
|
|
|
|
void UpdateIFTControls();
|
|
|
|
void InitGradeCtrl();
|
|
|
|
void InitMaterialCtrls();
|
|
|
|
void UpdateToolCtrls();
|
|
|
|
void UpdateTextures();
|
|
|
|
void SetColorPattern(const char *szMaterial, const char *szTexture);
|
|
|
|
public:
|
|
|
|
void UpdateLandscapeModeCtrls();
|
2010-12-12 12:53:51 +00:00
|
|
|
void SetTexture(const char *szTexture);
|
|
|
|
void SetMaterial(const char *szMaterial);
|
2010-03-28 17:58:21 +00:00
|
|
|
};
|
2009-05-08 13:28:41 +00:00
|
|
|
|
|
|
|
#endif //INC_C4ToolsDlg
|