____                _       __
    / __ )____  _____   | |     / /___ ___________
   / __  / __ \/ ___/   | | /| / / __ `/ ___/ ___/
  / /_/ / /_/ (__  )    | |/ |/ / /_/ / /  (__  )
 /_____/\____/____/     |__/|__/\__,_/_/  /____/

       A futuristic real-time strategy game.
          This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project. Distributed under the "GNU General Public License"

patch_editor.cpp File Reference

The patch editor. More...

#include "stratagus.h"
#include <sstream>
#include "sound.h"
#include "iolib.h"
#include "network.h"
#include "interface.h"
#include "cursor.h"
#include "map.h"
#include "guichan.h"
#include "patch_type.h"
#include "patch.h"
#include "patch_manager.h"
#include "ui.h"
#include "font.h"

Go to the source code of this file.

Classes

struct  PatchIcon
class  PatchSaveButtonListener
class  PatchExitButtonListener

Defines

#define NumSpeeds   7

Enumerations

enum  PatchButton {
  ButtonNone, ButtonImpassable, ButtonWater, ButtonSpeed0,
  ButtonSpeed1, ButtonSpeed2, ButtonSpeed3, ButtonSpeed4,
  ButtonSpeed5, ButtonSpeed6, ButtonSpeed7, ButtonTransparent
}

Functions

void DrawGuichanWidgets ()
static void DoScroll ()
static void PatchEditorCallbackButtonDown (unsigned button)
static void PatchEditorCallbackButtonUp (unsigned button)
static void PatchEditorCallbackKeyDown (unsigned key, unsigned keychar)
static void PatchEditorCallbackKeyUp (unsigned key, unsigned keychar)
static void PatchEditorCallbackKeyRepeated (unsigned dummy1, unsigned dummy2)
static void PatchEditorCallbackMouse (int x, int y)
static void PatchEditorCallbackExit (void)
static void DrawPatch ()
static void DrawPatchTileIcons ()
static void DrawGrids ()
static void DrawIcons ()
static void DrawCoordinates ()
static void PatchEditorUpdateDisplay ()
static gcn::ButtonPatchNewButton (const std::string &caption)
static void InitCallbacks (EventCallback *callbacks)
static void PatchEditorMainLoop ()
static void PatchAddIcon (int x, int y, CGraphic *g, PatchButton b)
static void PatchLoadIcons ()
static void PatchFreeIcons ()
void StartPatchEditor (const std::string &patchName)

Variables

bool PatchEditorRunning
gcn::GuiGui
 A Gui object - binds it all together.
static gcn::ContainerPatchEditorContainer
static CPatchPatch
static const int PatchMenuWidth = 150
static float ScrollX
static float ScrollY
static CGraphicTransparentG
static CGraphicTransparentSmallG
static CGraphicImpassableG
static CGraphicImpassableSmallG
static CGraphicWaterG
static CGraphicWaterSmallG
static CGraphicSpeedG [NumSpeeds+1]
static CGraphicSpeedSmallG [NumSpeeds+1]
static std::vector< PatchIconPatchIcons
static std::map< int, unsigned
short > 
FlagMap
static PatchButton CurrentButton
static PatchButton MouseOverButton
static int MouseOverTileX
static int MouseOverTileY
static bool DraggingFlag
static bool SetFlagWhileDragging


Detailed Description

The patch editor.

Definition in file patch_editor.cpp.


Define Documentation

#define NumSpeeds   7

Definition at line 69 of file patch_editor.cpp.

Referenced by PatchLoadIcons().


Enumeration Type Documentation

Enumerator:
ButtonNone 
ButtonImpassable 
ButtonWater 
ButtonSpeed0 
ButtonSpeed1 
ButtonSpeed2 
ButtonSpeed3 
ButtonSpeed4 
ButtonSpeed5 
ButtonSpeed6 
ButtonSpeed7 
ButtonTransparent 

Definition at line 73 of file patch_editor.cpp.


Function Documentation

static void DoScroll (  )  [static]

static void DrawCoordinates (  )  [static]

static void DrawGrids (  )  [static]

void DrawGuichanWidgets (  ) 

Definition at line 160 of file widgets.cpp.

static void DrawIcons (  )  [static]

static void DrawPatch (  )  [static]

static void DrawPatchTileIcons (  )  [static]

static void InitCallbacks ( EventCallback callbacks  )  [static]

static void PatchAddIcon ( int  x,
int  y,
CGraphic g,
PatchButton  b 
) [static]

Definition at line 536 of file patch_editor.cpp.

References PatchIcon::Button, PatchIcon::G, PatchIcons, PatchIcon::X, and PatchIcon::Y.

Referenced by PatchLoadIcons().

static void PatchEditorCallbackButtonDown ( unsigned  button  )  [static]

static void PatchEditorCallbackButtonUp ( unsigned  button  )  [static]

Definition at line 181 of file patch_editor.cpp.

References DraggingFlag.

Referenced by InitCallbacks().

static void PatchEditorCallbackExit ( void   )  [static]

Definition at line 319 of file patch_editor.cpp.

Referenced by InitCallbacks().

static void PatchEditorCallbackKeyDown ( unsigned  key,
unsigned  keychar 
) [static]

static void PatchEditorCallbackKeyRepeated ( unsigned  dummy1,
unsigned  dummy2 
) [static]

Definition at line 257 of file patch_editor.cpp.

Referenced by InitCallbacks().

static void PatchEditorCallbackKeyUp ( unsigned  key,
unsigned  keychar 
) [static]

Definition at line 229 of file patch_editor.cpp.

References HandleKeyModifiersUp(), KeyScrollState, ScrollDown, ScrollLeft, ScrollRight, and ScrollUp.

Referenced by InitCallbacks().

static void PatchEditorCallbackMouse ( int  x,
int  y 
) [static]

static void PatchEditorMainLoop (  )  [static]

static void PatchEditorUpdateDisplay (  )  [static]

static void PatchFreeIcons (  )  [static]

Definition at line 590 of file patch_editor.cpp.

References FlagMap, CGraphic::Free(), and PatchIcons.

Referenced by StartPatchEditor().

static void PatchLoadIcons (  )  [static]

static gcn::Button* PatchNewButton ( const std::string &  caption  )  [static]

void StartPatchEditor ( const std::string &  patchName  ) 


Variable Documentation

bool DraggingFlag [static]

std::map<int, unsigned short> FlagMap [static]

A Gui object - binds it all together.

Definition at line 51 of file widgets.cpp.

CGraphic* ImpassableG [static]

Definition at line 65 of file patch_editor.cpp.

Definition at line 66 of file patch_editor.cpp.

int MouseOverTileX [static]

int MouseOverTileY [static]

CPatch* Patch [static]

Definition at line 56 of file patch_editor.cpp.

Definition at line 54 of file patch_editor.cpp.

std::vector<PatchIcon> PatchIcons [static]

Definition at line 96 of file patch_editor.cpp.

Referenced by DrawIcons(), PatchAddIcon(), PatchEditorCallbackMouse(), and PatchFreeIcons().

const int PatchMenuWidth = 150 [static]

float ScrollX [static]

float ScrollY [static]

bool SetFlagWhileDragging [static]

Definition at line 105 of file patch_editor.cpp.

Referenced by PatchEditorCallbackButtonDown(), and PatchEditorCallbackMouse().

CGraphic* SpeedG[NumSpeeds+1] [static]

Definition at line 70 of file patch_editor.cpp.

CGraphic* SpeedSmallG[NumSpeeds+1] [static]

Definition at line 71 of file patch_editor.cpp.

Definition at line 63 of file patch_editor.cpp.

Definition at line 64 of file patch_editor.cpp.

CGraphic* WaterG [static]

Definition at line 67 of file patch_editor.cpp.

CGraphic* WaterSmallG [static]

Definition at line 68 of file patch_editor.cpp.


Generated on Sat Feb 21 00:28:18 2009 for Bos Wars by  doxygen 1.5.6