_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

Classes
mainscr.cpp File Reference
#include "stratagus.h"
#include "action/action_built.h"
#include "action/action_research.h"
#include "action/action_train.h"
#include "action/action_upgradeto.h"
#include "font.h"
#include "icons.h"
#include "interface.h"
#include "map.h"
#include "menus.h"
#include "network.h"
#include "player.h"
#include "settings.h"
#include "sound.h"
#include "spells.h"
#include "translate.h"
#include "trigger.h"
#include "ui/contenttype.h"
#include "ui.h"
#include "unit.h"
#include "unitsound.h"
#include "unittype.h"
#include "upgrade.h"
#include "video.h"
#include <sstream>

Classes

struct  UStrInt
 
class  MessagesDisplay
 

mainscr.cpp - The main screen.

#define MESSAGES_MAX   10
 
enum  UStrIntType {
  USTRINT_STR, USTRINT_INT, USTRINT_STR, USTRINT_INT,
  USTRINT_STR, USTRINT_INT
}
 
static char MessagesEvent [MESSAGES_MAX][256]
 
static Vec2i MessagesEventPos [MESSAGES_MAX]
 Array of event messages. More...
 
static int MessagesEventCount
 coordinate of event More...
 
static int MessagesEventIndex
 Number of event messages. More...
 
static int MaxMessagesCount = MESSAGES_MAX
 FIXME: docu. More...
 
static MessagesDisplay allmessages
 
static void DrawMenuButtonArea_noNetwork ()
 
static void DrawMenuButtonArea_Network ()
 
void DrawMenuButtonArea ()
 Draw menu button area. More...
 
void DrawUserDefinedButtons ()
 Draw user defined buttons. More...
 
static void UiDrawLifeBar (const CUnit &unit, int x, int y)
 
static void UiDrawManaBar (const CUnit &unit, int x, int y)
 
static bool CanShowContent (const ConditionPanel *condition, const CUnit &unit)
 
UStrInt GetComponent (const CUnit &unit, int index, EnumVariable e, int t)
 Get component for unit variable. More...
 
UStrInt GetComponent (const CUnitType &type, int index, EnumVariable e, int t)
 Get component for unit type variable. More...
 
static void DrawUnitInfo_Training (const CUnit &unit)
 
static bool DrawTypePortrait (const CUnitType &type)
 
static void DrawUnitInfo_portrait (const CUnit &unit)
 
static bool DrawUnitInfo_single_selection (const CUnit &unit)
 
static void DrawUnitInfo_transporter (CUnit &unit)
 
static void DrawUnitInfo (CUnit &unit)
 
void DrawResources ()
 Draw the player resource in resource line. More...
 
void UpdateMessages ()
 Update messages. More...
 
void CleanMessages ()
 Cleanup all messages. More...
 
void DrawMessages ()
 Draw messages as overlay over of the map. More...
 
void SetMessage (const char *fmt,...)
 
void ShiftMessagesEvent ()
 
void SetMessageEvent (const Vec2i &pos, const char *fmt,...)
 
void CenterOnMessage ()
 Center view-point on last event message. More...
 
void ToggleShowMessages ()
 show/hide messages More...
 
void SetMaxMessageCount (int newMax)
 max message count More...
 
static void DrawInfoPanelBackground (unsigned frame)
 
static void InfoPanel_draw_no_selection ()
 
static void InfoPanel_draw_single_selection (CUnit *selUnit)
 
static void InfoPanel_draw_multiple_selection ()
 
void DrawTimer ()
 Draw the timer. More...
 
void UpdateTimer ()
 Update the timer. More...
 

Macro Definition Documentation

◆ MESSAGES_MAX

#define MESSAGES_MAX   10

Enumeration Type Documentation

◆ UStrIntType

Enumerator
USTRINT_STR 
USTRINT_INT 
USTRINT_STR 
USTRINT_INT 
USTRINT_STR 
USTRINT_INT 

Function Documentation

◆ CanShowContent()

static bool CanShowContent ( const ConditionPanel condition,
const CUnit unit 
)
static

Tell if we can show the content. verify each sub condition for that.

Parameters
conditioncondition to verify.
unitunit that certain condition can refer.
Returns
0 if we can't show the content, else 1.

◆ CenterOnMessage()

void CenterOnMessage ( )

Center view-point on last event message.

Goto message origin.

◆ CleanMessages()

void CleanMessages ( )

Cleanup all messages.

Clean messages

◆ DrawInfoPanelBackground()

static void DrawInfoPanelBackground ( unsigned  frame)
static

Draw info panel background.

Parameters
frameframe nr. of the info panel background.

◆ DrawMenuButtonArea()

void DrawMenuButtonArea ( )

Draw menu button area.

Draw menu button area.

◆ DrawMenuButtonArea_Network()

static void DrawMenuButtonArea_Network ( )
static

◆ DrawMenuButtonArea_noNetwork()

static void DrawMenuButtonArea_noNetwork ( )
static

◆ DrawMessages()

void DrawMessages ( )

Draw messages as overlay over of the map.

Draw messages

◆ DrawResources()

void DrawResources ( )

Draw the player resource in resource line.

Draw the player resource in top line.

Todo:
FIXME : make DrawResources more configurable (format, font).

◆ DrawTimer()

void DrawTimer ( )

Draw the timer.

Draw the timer

Todo:
FIXME : make DrawTimer more configurable (Pos, format).

◆ DrawTypePortrait()

static bool DrawTypePortrait ( const CUnitType type)
static

◆ DrawUnitInfo()

static void DrawUnitInfo ( CUnit unit)
static

Draw the unit info into top-panel.

Parameters
unitPointer to unit.

◆ DrawUnitInfo_portrait()

static void DrawUnitInfo_portrait ( const CUnit unit)
static

◆ DrawUnitInfo_single_selection()

static bool DrawUnitInfo_single_selection ( const CUnit unit)
static

◆ DrawUnitInfo_Training()

static void DrawUnitInfo_Training ( const CUnit unit)
static

◆ DrawUnitInfo_transporter()

static void DrawUnitInfo_transporter ( CUnit unit)
static

◆ DrawUserDefinedButtons()

void DrawUserDefinedButtons ( )

Draw user defined buttons.

◆ GetComponent() [1/2]

UStrInt GetComponent ( const CUnit unit,
int  index,
EnumVariable  e,
int  t 
)

Get component for unit variable.

Return the value corresponding.

Parameters
unitUnit.
indexIndex of the variable.
eComponent of the variable.
tWhich var use (0:unit, 1:Type, 2:Stats)
Returns
Value corresponding

◆ GetComponent() [2/2]

UStrInt GetComponent ( const CUnitType type,
int  index,
EnumVariable  e,
int  t 
)

Get component for unit type variable.

◆ InfoPanel_draw_multiple_selection()

static void InfoPanel_draw_multiple_selection ( )
static

◆ InfoPanel_draw_no_selection()

static void InfoPanel_draw_no_selection ( )
static

◆ InfoPanel_draw_single_selection()

static void InfoPanel_draw_single_selection ( CUnit selUnit)
static

◆ SetMaxMessageCount()

void SetMaxMessageCount ( int  newMax)

max message count

◆ SetMessage()

void SetMessage ( const char *  fmt,
  ... 
)

Set message to display.

Parameters
fmtTo be displayed in text overlay.

◆ SetMessageEvent()

void SetMessageEvent ( const Vec2i pos,
const char *  fmt,
  ... 
)

Set message to display.

Parameters
posMessage pos map origin.
fmtTo be displayed in text overlay.
Note
FIXME: vladi: I know this can be just separated func w/o msg but it is handy to stick all in one call, someone?

◆ ShiftMessagesEvent()

void ShiftMessagesEvent ( )

Shift messages events array by one.

◆ ToggleShowMessages()

void ToggleShowMessages ( )

show/hide messages

◆ UiDrawLifeBar()

static void UiDrawLifeBar ( const CUnit unit,
int  x,
int  y 
)
static

Draw life bar of a unit at x,y. Placed under icons on top-panel.

Parameters
unitPointer to unit.
xScreen X position of icon
yScreen Y position of icon

◆ UiDrawManaBar()

static void UiDrawManaBar ( const CUnit unit,
int  x,
int  y 
)
static

Draw mana bar of a unit at x,y. Placed under icons on top-panel.

Parameters
unitPointer to unit.
xScreen X position of icon
yScreen Y position of icon

◆ UpdateMessages()

void UpdateMessages ( )

Update messages.

Update messages

◆ UpdateTimer()

void UpdateTimer ( )

Update the timer.

Update the timer

Variable Documentation

◆ allmessages

MessagesDisplay allmessages
static

◆ MaxMessagesCount

int MaxMessagesCount = MESSAGES_MAX
static

FIXME: docu.

◆ MessagesEvent

char MessagesEvent[MESSAGES_MAX][256]
static

◆ MessagesEventCount

int MessagesEventCount
static

coordinate of event

◆ MessagesEventIndex

int MessagesEventIndex
static

Number of event messages.

◆ MessagesEventPos

Vec2i MessagesEventPos[MESSAGES_MAX]
static

Array of event messages.

(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.