CodeStatsView::CodeStatsView() : GameTemplateView()
{
    setSearchName("CodeStatsView");
    setTitle("CodeStatsView");
    setSubTitle(" - F4");

    setAllowResize(false);
    setAllowMove(true);
    setDisplayStatusBar(true);
    setVisible(false);

    moveTo(iXY(0, 0));

    iXY  area_size = iXY(280, 280) ;
    long bXOffset;
    INFO_AREA_Y_OFFSET = 2;

    resizeClientArea(area_size);

    bXOffset = area_size.x / 3;
    addButtonCenterText(iXY(0, INFO_AREA_Y_OFFSET), bXOffset,  "Net", "", buttonNetwork);
    addButtonCenterText(iXY(bXOffset, INFO_AREA_Y_OFFSET), bXOffset, "Sprite", "", buttonSorter);
    addButtonCenterText(iXY(bXOffset*2, INFO_AREA_Y_OFFSET), bXOffset, "Unit", "", buttonUnit);

    INFO_AREA_Y_OFFSET += 18;
    addButtonCenterText(iXY(0, INFO_AREA_Y_OFFSET), area_size.x, "Path", "", buttonPathing);

    INFO_AREA_Y_OFFSET += 18;
    bXOffset = area_size.x / 3;
    addButtonCenterText(iXY(0, INFO_AREA_Y_OFFSET), bXOffset,  "Debug", "", buttonDebug);
    addButtonCenterText(iXY(bXOffset, INFO_AREA_Y_OFFSET), bXOffset, "Sample", "", buttonSample);
    addButtonCenterText(iXY(bXOffset*2, INFO_AREA_Y_OFFSET), bXOffset, "NetLog", "", bNetLog );

    INFO_AREA_Y_OFFSET += 18;
    /*
       addButtonCenterText(iXY(0, INFO_AREA_Y_OFFSET), 20, "+", "", bPlusPacketSize );
    addButtonCenterText(iXY(25, INFO_AREA_Y_OFFSET), 20, "-", "", bMinusPacketSize );
    addButtonCenterText(iXY(50, INFO_AREA_Y_OFFSET), 20, "0", "", bMinusPacketSize );
    addButtonCenterText(iXY(65, INFO_AREA_Y_OFFSET), 20, "1", "", bMinusPacketSize );

    addButtonCenterText(iXY(45, INFO_AREA_Y_OFFSET), 40, "Send", "", bSend );

       INFO_AREA_Y_OFFSET += 18;
       INFO_AREA_Y_OFFSET += 18;
       */

    display_mode = _display_mode_network_stats;

} // end CodeStatsView::CodeStatsView
Exemplo n.º 2
0
void Snake::setHeadMoveDirection(const glm::vec3& direction)
{
	if (_isAlive)
	{

		if (((direction == Settings::UP && _snakeBody[0].getMoveDirection() != Settings::DOWN) ||
			(direction == Settings::DOWN && _snakeBody[0].getMoveDirection() != Settings::UP) ||
			(direction == Settings::RIGHT && _snakeBody[0].getMoveDirection() != Settings::LEFT) ||
			(direction == Settings::LEFT && _snakeBody[0].getMoveDirection() != Settings::RIGHT)) && _allowMove)
		{
			_snakeBody[0].setMoveDirection(direction);
		}

		setAllowMove(false);
	}
}
Exemplo n.º 3
0
// HostOptionsView
//---------------------------------------------------------------------------
HostOptionsView::HostOptionsView() : RMouseHackView()
{
    setSearchName("HostOptionsView");
    setTitle("Host Options");
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setVisible(false);

    moveTo(bodyTextRect.min.x, bodyTextRect.min.y + 205);
    resizeClientArea(bodyTextRect.getSizeX()-5, 168);

    addMeterButtons(iXY(BORDER_SPACE, BORDER_SPACE));

} // end HostOptionsView::HostOptionsView
// MiniMapView
//---------------------------------------------------------------------------
MiniMapView::MiniMapView() : GameTemplateView()
{
    assert(this != 0);

    setSearchName("MiniMapView");
    setTitle("MiniMapView");
    setSubTitle("");
    setAllowResize(false);
    setDisplayStatusBar(false);
    setVisible(false);
    setAllowMove(true);

    setBordered(false);
    
    resize(160, 160);
    add(new MiniMap(1,1,158,158));
} // end MiniMapView::MiniMapView
// GetSessionHostView
//---------------------------------------------------------------------------
GetSessionHostView::GetSessionHostView() : View()
{
	setSearchName("GetSessionHostView");
	setTitle("Select Session Host");
	setSubTitle("");

	setAllowResize(false);
	setAllowMove(false);
	//setDisplayStatusBar(true);
	setVisible(false);

	moveTo(bodyTextRect.min.x, bodyTextRect.min.y + 190);
	resizeClientArea(bodyTextRect.getSizeX(), 158);
	//moveTo(68, 204);
	//resize(610 - 68, 161);

	//setScrollBar(true);

	viewableItemCount =  0;
	highlightedItem   = -1;
	selectedItem      = -1;

	maxYOffset = 0;

	// Define the scrollBar fot this view.
	//scrollBar = new ScrollBar(VERTICAL, 0, 1, 0, 100);

	//add(scrollBar);

	maxViewableItems = getClientRect().getSizeY() / (TEXT_GAP_SPACE + CHAR_YPIX) - 1;
	topViewableItem  = 0;

	iXY size(20, 20);
	iXY pos(getClientRect().getSizeX() - size.x, 0);

	//upButton.setLabel("+");
	//upButton.setBounds(iRect(pos, pos + size));
	//add(&upButton);
	//
	//pos = iXY(getClientRect().getSizeX() - size.x, getClientRect().getSizeY() - size.y);
	//downButton.setLabel("-");
	//downButton.setBounds(iRect(pos, pos + size));
	//add(&downButton);

} // end GetSessionHostView constructor
void
LoadingView::init()
{
    setSearchName("LoadingView");
    setTitle("Loading Progress");
    setSubTitle("");
    
    setAllowResize(false);
    setAllowMove(false);
    setDisplayStatusBar(false);
    setVisible(false);
    setBordered(false);

    resize(640, 480);
    
    addButtonCenterText(iXY(628 - 60, 302 - 15), 60, "Abort", "Cancel the joining of this game.", bAbort);
    
}
// PlayerNameView
//---------------------------------------------------------------------------
PlayerNameView::PlayerNameView() : View()
{
    setSearchName("PlayerNameView");
    setTitle("Player Name");
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setVisible(false);

    moveTo(bodyTextRect.min);

    // The plus 8 for x and 4 for y are what I put in input field.  Add function to find out,
    // inpit field dimension.
    resizeClientArea(INPUT_FIELD_CHARACTERS * CHAR_XPIX + 8 + BORDER_SPACE * 2, CHAR_YPIX + 4 + BORDER_SPACE * 2);

    init();

} // end PlayerNameView::PlayerNameView
Exemplo n.º 8
0
// MapSelectionView
//---------------------------------------------------------------------------
MapSelectionView::MapSelectionView() : RMouseHackView()
{
    setSearchName("MapSelectionView");
    setTitle(_("Map Selection"));
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setVisible(false);

    moveTo(bodyTextRect.min.x, bodyTextRect.min.y + 50);

    resizeClientArea(bodyTextRect.getSizeX() / 2 - 10 + 30, MAP_SIZE + BORDER_SPACE * 2);

    curMap = -1;
    
    init();

} // end MapSelectionView::MapSelectionView
// IPAddressView
//---------------------------------------------------------------------------
IPAddressView::IPAddressView() : View()
{
    setSearchName("IPAddressView");
    setTitle("Server IP Address");
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setVisible(false);

    moveTo(iXY(bodyTextRect.min.x, bodyTextRect.min.y + 50));

    iXY  area_size = iXY(
            30 * 8 + 16,
            Surface::getFontHeight() + 4 + 8);
    resizeClientArea(area_size);

    Init();
} // end IPAddressView constructor
Exemplo n.º 10
0
// PlayerNameView
//---------------------------------------------------------------------------
PlayerNameView::PlayerNameView() : View()
{
    setSearchName("PlayerNameView");
    setTitle("Player Name");
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setVisible(false);

    moveTo(bodyTextRect.min);

    // The plus 8 for x and 4 for y are what I put in input field.  Add function to find out,
    // inpit field dimension.
    int CHAR_XPIX = 8; // XXX hardcoded :-/
    resizeClientArea((INPUT_FIELD_CHARACTERS+1) * CHAR_XPIX + 8 + BORDER_SPACE * 2, Surface::getFontHeight() + 4 + BORDER_SPACE * 2);

    init();
} // end PlayerNameView::PlayerNameView
Exemplo n.º 11
0
// GameInfoView
//--------------------------------------------------------------------------
GameInfoView::GameInfoView() : GameTemplateView()
{
    setSearchName("GameInfoView");
    setTitle("Information");
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setDisplayStatusBar(false);
    setVisible(false);
    setBordered(true);

    moveTo(iXY(0, 0));
    //resizeClientArea(iXY(100, 2 * 2 + 12 * 3 + 8));
    resizeClientArea(iXY(140, 2 * 2 + 12 * 5 + 8));

    // Start it in the top-left corner.
    moveTo(iXY(10000, 0));

} // end GameInfoView::GameInfoView
// MenuTemplateView
//---------------------------------------------------------------------------
MenuTemplateView::MenuTemplateView() : SpecialButtonView()
{
    setSearchName("MenuTemplateView");
    setTitle("MenuTemplate");
    setSubTitle("");

    setAllowResize(false);
    setVisible(false);
    setAllowMove(false);
    setDisplayStatusBar(false);
    setBordered(false);
    setAlwaysOnBottom(true);

    moveTo(iXY(0, 0));
    resize(iXY(640, 480));

    initButtons();

    curTitleFlashTime  = 0.0f;
    titleFlashTimeHalf = 0.5;
} // end MenuTemplateView constructor
Exemplo n.º 13
0
// init
//---------------------------------------------------------------------------
void ProgressView::init()
{
	setSearchName("ProgressView");
	setTitle("Progress Update");
	setSubTitle("");

	setAllowResize(false);
    setAllowMove(false);
	setDisplayStatusBar(false);
	setVisible(false);
	setBordered(false);

	background.create(628 - 179, 302 - 153, 628 - 179, 1);
	background.fill(0);

	moveTo(0, 0);
	resize(640, 480);

	iXY size(getClientRect().getSize());

} // end ProgressView::init
Exemplo n.º 14
0
// init
//---------------------------------------------------------------------------
void LobbyView::init()
{
    setSearchName("LobbyView");
    setTitle("Join Lobby");
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setDisplayStatusBar(false);
    setVisible(false);
    setBordered(false);

    background.create(628 - 179, 302 - 153, 1);
    background.fill(0);

    moveTo(0, 0);
    resize(640, 480);

    addButtonCenterText(iXY(628 - 60, 302 - 15), 60, "Abort", "Cancel the joining of this game.", bAbort);

    currentline = 0;
} // end LobbyView::init
Exemplo n.º 15
0
void
LoadingView::init()
{
    setSearchName("LoadingView");
    setTitle("Loading Progress");
    setSubTitle("");

    setAllowResize(false);
    setAllowMove(false);
    setDisplayStatusBar(false);
    setVisible(false);
    setBordered(false);
    need_password = false;
    password_str.init("", 31,31);

    resize(800, 600);

    addButtonCenterText(iXY(340, 15), 100, "Abort", "Cancel the joining of this game.", bAbort);


    okButton = Button::createTextButton("OK", "Enter", iXY(340,100), 100);
    passwordLabel = new Label(340, 68, "Game Password", Color::white);

}
Exemplo n.º 16
0
CodeStatsView::CodeStatsView() : GameTemplateView()
{
    setSearchName("CodeStatsView");
    setTitle("CodeStatsView");
    setSubTitle(" - F4");

    setAllowResize(false);
    setAllowMove(true);
    setDisplayStatusBar(true);
    setVisible(false);

    moveTo(iXY(0, 0));

    iXY  area_size = iXY(280, 280) ;
    long bXOffset;
    INFO_AREA_Y_OFFSET = 2;

    resizeClientArea(area_size);

    bXOffset = area_size.x / 3;
    add( Button::createTextButton("Net",    iXY(0, INFO_AREA_Y_OFFSET),              bXOffset-3,    new SetDisplayModeAction(_display_mode_network_stats)));
    add( Button::createTextButton("Sprite", iXY(bXOffset+1, INFO_AREA_Y_OFFSET),     bXOffset-4,    new SetDisplayModeAction(_display_mode_sorter_stats)));
    add( Button::createTextButton("Unit",   iXY((bXOffset*2)+1, INFO_AREA_Y_OFFSET), bXOffset-2,    new SetDisplayModeAction(_display_mode_unit_stats)));

    INFO_AREA_Y_OFFSET += 18;
    add( Button::createTextButton("Path",   iXY(0, INFO_AREA_Y_OFFSET),              area_size.x-2, new SetDisplayModeAction(_display_mode_pathing_stats)));

    INFO_AREA_Y_OFFSET += 18;
    bXOffset = area_size.x / 3;
    add( Button::createTextButton("NetLog", iXY((bXOffset*2)+1, INFO_AREA_Y_OFFSET), bXOffset-2,    new UpdateNetworkStatsAction()));

    INFO_AREA_Y_OFFSET += 18;

    display_mode = _display_mode_network_stats;

} // end CodeStatsView::CodeStatsView
Exemplo n.º 17
0
void Snake::move()
{
	if (_isAlive)
	{
		// move
		glm::vec3 moveDirectionHead = _snakeBody[0].getMoveDirection();
		glm::vec3 moveDirectionCurrent = _snakeBody[0].getMoveDirection();

		_tailPosition = _snakeBody.back().getPosition();
		_tailMoveDirection = _snakeBody.back().getMoveDirection();
		_tailRotation = _snakeBody.back().getRotation();

		glm::vec3 position;
		glm::vec3 translate;

		for (std::vector<Quad>::iterator it = _snakeBody.begin(); it != _snakeBody.end(); ++it)
		{
			translate = glm::vec3(0.0f);
			position = it->getPosition();

			if (it->getMoveDirection() == Settings::UP && fabs(it->getPosition().y - Settings::TopLeftSquare.y) < Settings::epsilion)
			{
				position.y = Settings::TopLeftSquare.y;

				translate = Settings::DOWN;
				translate *= (glm::length(Settings::Distance) * (Settings::PlaygroundHeight - 1));
			}
			else if (it->getMoveDirection() == Settings::DOWN && fabs(it->getPosition().y - Settings::BottomRightSquare.y) < Settings::epsilion)
			{
				position.y = Settings::BottomRightSquare.y;

				translate = Settings::UP;
				translate *= (glm::length(Settings::Distance) * (Settings::PlaygroundHeight - 1));
			}
			else if (it->getMoveDirection() == Settings::LEFT && fabs(it->getPosition().x - Settings::TopLeftSquare.x) < Settings::epsilion)
			{
				position.x = Settings::TopLeftSquare.x;

				translate = Settings::RIGHT;
				translate *= (glm::length(Settings::Distance) * (Settings::PlaygroundWidth - 1));
			}
			else if (it->getMoveDirection() == Settings::RIGHT && fabs(it->getPosition().x - Settings::BottomRightSquare.x) < Settings::epsilion)
			{
				position.x = Settings::BottomRightSquare.x;

				translate = Settings::LEFT;
				translate *= (glm::length(Settings::Distance) * (Settings::PlaygroundWidth - 1));
			}

			position += translate;

			if (translate != glm::vec3(0.0f))
			{
				it->setPosition(position);
			}
			else
			{
				it->move();
			}

			if (it->getMoveDirection() != moveDirectionCurrent)
			{
				// rotate the node
				moveDirectionHead = moveDirectionCurrent;
				moveDirectionCurrent = it->getMoveDirection();
				if (it != _snakeBody.begin())
				{
					it->setMoveDirection(moveDirectionHead);
				}
			}
		}

		setAllowMove(true);

	}
}
HelpScrollView::HelpScrollView() : View()
{
    setSearchName("HelpScrollView");
//    setTitle(_("Help Information"));
    setAllowMove(false);
    
    moveTo(bodyTextRect.getLocation());
    resize(bodyTextRect.getSize());
    iRect r(0, 0, bodyTextRect.getWidth()-20, bodyTextRect.getHeight()-33);
    HelpBox = new tStringListBox(r);
    add(HelpBox);

    HelpBox->Add(_("Key"));
    HelpBox->Add("");
    addhelpcmd(_("LMC ="), _("Left Mouse Click"));
    addhelpcmd(_("RMC ="), _("Right Mouse Click"));
    addhelpcmd(_("RMH ="), _("Right Mouse Hold"));
    addhelpcmd(_("LMH ="), _("Left Mouse Hold"));
    HelpBox->Add("");
    HelpBox->Add("");
    HelpBox->Add(_("Unit Related"));
    HelpBox->Add("");
    addhelpcmd(_("LMC"), _("Selects a unit"));
    addhelpcmd(_("LMH"), _("Makes a bouding box for unit selection"));
    addhelpcmd(_("RMC"), _("De-selects all selected units"));
    addhelpcmd(_("LMC + Ctrl"), _("Directs (force/manual) fire of a unit"));
    addhelpcmd(_("LMC + Shift, LMC + Ctrl"), _("Add unit to selection"));
    addhelpcmd(_("Ctrl + [0..9]"), _("Define a group of units"));
    addhelpcmd(_("[0..9]"), _("Recall a group of units"));
    addhelpcmd(_("[0..9] (2 times)"), _("Center view on a group of units"));
    addhelpcmd(_("RMH"), _("Fast map scroll"));
    HelpBox->Add("");
    HelpBox->Add("");
    HelpBox->Add(_("Game Related"));
    HelpBox->Add("");
    addhelpcmd(_("LMC + 'A'"), _("Allies with the clicked unit's team"));
    addhelpcmd(_("ESC"), _("In game menus"));
    HelpBox->Add("");
    HelpBox->Add("");
    HelpBox->Add(_("Outpost Related"));
    HelpBox->Add("");
    addhelpcmd(_("'O'"), _("Toggle outpost names"));
    addhelpcmd(_("LMC on captured outpost"), _("Displays the outpost view"));
    addhelpcmd(_("mouse drag on captured outpost"), _("Select unit spawn point"));
    HelpBox->Add("");
    HelpBox->Add("");
    HelpBox->Add(_("Chat Related"));
    HelpBox->Add("");
    addhelpcmd(_("Enter"), _("Send message to all"));
    addhelpcmd(_("Ctrl + 'A'"), _("Send message to allies"));
    addhelpcmd(_("'C'"), _("Send count down message"));
    HelpBox->Add("");
    HelpBox->Add("");
    HelpBox->Add(_("View Related"));
    HelpBox->Add("");
    addhelpcmd(_("F1"), _("Help View"));
    addhelpcmd(_("'B'"), _("Toggle flag selection window"));
    addhelpcmd(_("'D'"), _("Damage View"));
    addhelpcmd(_("'F'"), _("Flag View"));
    addhelpcmd(_("'M'"), _("Mini Map View"));
    addhelpcmd(_("'N'"), _("Name View"));
    addhelpcmd(_("TAB"), _("Rank View"));
    addhelpcmd(_("RMH + mouse movement"), _("Moves any view on the screen"));
    addhelpcmd(_("RMH + [1 - 5]"), _("Sets the background drawing mode"));
    HelpBox->Add(" ");
    HelpBox->Add(" ");
    HelpBox->Add(_("Mini Map View Related"));
    HelpBox->Add("");
    addhelpcmd(_("RMH + [1 - 7]"), _("Sets the blending level of the minimap"));
    addhelpcmd(_("RMH + [+ or -]"), _("Scales the size of the minimap"));
    HelpBox->Add(" ");
    HelpBox->Add(" ");
    HelpBox->Add(_("System Related"));
    HelpBox->Add("");
    addhelpcmd(_("ALT + Enter"), _("Toggle Fullscreen/Windowed mode"));
    addhelpcmd(_("F9"), _("BMP screen shot"));
    HelpBox->Add(" ");
    HelpBox->Add(" ");
    HelpBox->Add(_("Scripting"));
//    HelpBox->Add("");
//    HelpBox->Add("");
//    HelpBox->Add(_("Client Related"));
//    HelpBox->Add("");
//    HelpBox->Add(_("  /listcommands                     List of available commands"));
//    HelpBox->Add(_("  /countdown [timeout in seconds]   Generate a countdown"));
//    HelpBox->Add(_("  /quit                             Quit the game"));
//    HelpBox->Add(_("  /help                             Show Help window (same 'F1')"));
//    HelpBox->Add(_("  /say [your talk]                  Send message to all (same 'Enter'"));
//    HelpBox->Add(_("  /teamsay [your talk]              Send message to allies (same Ctrl + 'A')"));
    HelpBox->Add("");
    HelpBox->Add(_("Server Related"));
    HelpBox->Add("");
    addhelpcmd("/server listcommands", _("List of Gameserver available commands"));
    addhelpcmd(_("/server adminlogin [password]"), _("Gameserver admin login"));
    addhelpcmd(_("/server unitspawnlist [list]"), _("List/set spawn units (number)"));
    addhelpcmd(_("/server unitprofiles [list]"), _("List/set spawn units (types)"));
    addhelpcmd(_("/server map [map name]"), _("Restart game with the given map"));
    addhelpcmd(_("/server autokick [timeout]"), _("Show/set autokick for inactive players"));

    addhelpcmd(_("/server flagtimer [timeout]"), _("Show/set flag change timer"));
    addhelpcmd(_("/server say [your talk]"), _("Server say something in chat"));
    addhelpcmd("/server listplayers", _("List players with the assigned number"));
    addhelpcmd("/server listprofiles", _("List available profiles"));
    addhelpcmd(_("/server kick [player number]"), _("Kick a given player"));
    addhelpcmd(_("/server baselimit [max bases]"), _("Show/set the max bases number per player"));
    addhelpcmd(_("/server gamepass [password]"), _("Show/set game connection password"));
    HelpBox->Add(" ");
}
// GameToolbarView
//--------------------------------------------------------------------------
GameToolbarView::GameToolbarView() : GameTemplateView()
{
	setSearchName("GameToolbarView");
	setTitle("Toolbar - TAB");
	setSubTitle("");

	setAllowResize(false);
	setAllowMove(false);
	setDisplayStatusBar(false);
	setVisible(false);

	moveTo(iXY(0, 0));
	resizeClientArea(117, 100);

	iXY       pos(0, 0);
	const int yOffset     = 15;
	int       buttonSizeX = getClientRect().getSizeX();

	addButtonCenterText(pos, buttonSizeX - (15 + 1) * 2 - 1, "Mini Map", "Toggle the visibility of the mini map", bToggleMiniMap);
	pos.x = buttonSizeX - (15 + 1) * 2;
	addButton(pos, "-", "", bDecreaseMiniMapSize);
	pos.x += 15 + 1;
	addButton(pos, "+", "", bIncreaseMiniMapSize);
	pos.x += 15 + 1;

	pos.x = 0;
	pos.y += yOffset;
	buttonSizeX = getClientRect().getSizeX() / 2;
	addButtonCenterText(pos, buttonSizeX, "Info", "Toggle the visibility of the mini map", bToggleInfo);
	pos.x += buttonSizeX + 1;
	addButtonCenterText(pos, buttonSizeX, "Rank", "Toggle the visibility of the rank view", bToggleRankView);
	pos.y += yOffset;
	pos.x = 0;
	buttonSizeX = getClientRect().getSizeX();
	addButtonCenterText(pos, buttonSizeX, "MSG All", "", bSendMessageAll);
	pos.y += yOffset;
	addButtonCenterText(pos, buttonSizeX, "MSG Allies", "", bSendMessageAllies);
	pos.y += yOffset;
	addButtonCenterText(pos, buttonSizeX, "MSG Enemies", "", bSendMessageEnemies);
	pos.y += yOffset;

	pos.x = 0;
	addLabel(iXY(pos.x + 2, pos.y + 3), "Group", Color::white);
	pos.x += 48 + 1 + 4;

	addButton(pos, "1", "", bSetGroup1);
	pos.x += 15 + 1;
	addButton(pos, "2", "", bSetGroup2);
	pos.x += 15 + 1;
	addButton(pos, "3", "", bSetGroup3);
	pos.x += 15 + 1;
	addButton(pos, "4", "", bSetGroup4);
	pos.x += 15 + 1;

	pos.x = 0;
	pos.y += yOffset;
	addLabel(iXY(pos.x + 2, pos.y + 3), "Recall", Color::white);
	pos.x += 48 + 1 + 4;

	addButton(pos, "1", "", bRecallGroup1);
	pos.x += 15 + 1;
	addButton(pos, "2", "", bRecallGroup2);
	pos.x += 15 + 1;
	addButton(pos, "3", "", bRecallGroup3);
	pos.x += 15 + 1;
	addButton(pos, "4", "", bRecallGroup4);
	pos.x += 15 + 1;
	pos.y += yOffset;

	buttonSizeX = getClientRect().getSizeX() / 2;

	pos.x = 0;
	addButtonCenterText(pos, buttonSizeX, "Damage", "", bToggleDrawUnitDamage);
	pos.x += buttonSizeX + 1;
	addButtonCenterText(pos, buttonSizeX, "Flags", "", bToggleDrawUnitFlags);
	//pos.x += buttonSizeX + 1;
	//addButtonCenterText(pos, buttonSizeX, "RL", "", bToggleDrawUnitReload);

	pos.y += yOffset;

	resizeClientArea(iXY(117, pos.y));
	
	// Start it in the bottom-left corner.
	moveTo(iXY(10000, 10000));

} // end GameToolbarView::GameToolbarView
// HelpScrollView
//---------------------------------------------------------------------------
HelpScrollView::HelpScrollView() : SpecialButtonView()
{
	setSearchName("HelpScrollView");
	setTitle("Help Information");
	setSubTitle("");

	setAllowResize(false);
	setAllowMove(false);

	moveTo(bodyTextRect.min);
	resize(bodyTextRect.getSize());

	insert("Key");
	insert("");
	insert("  LMC = Left Mouse Click");
	insert("  RMC = Right Mouse Click");
	insert("  RMH = Right Mouse Hold");
	insert("");
	insert("");
	insert("Unit Related");
	insert("");
	insert("  LMC                              Selects a unit");
	insert("  LMH                              Makes a bouding box for unit selection");
	insert("  RMC                              De-selects all selected units");
	insert("  LMC + Ctrl                       Directs (force/manual) fire of a unit");
	insert("  LMC + Shift, LMC + Ctrl          Add unit to selected set");
	//insert("  Ctrl + [0..9], Shift + [0..9]    Define a group of units");
	insert("  Shift + [0..9]                   Define a group of units");
	insert("  Alt + [1..0]                     Recall a group of units");
	insert("  [1..0]                           Cycles through the corresponding group of units");
	//insert("  'E'                              Select all units on screen");

	//insert("  LMC + 'T'............................Track the selected unit");
	//insert("  LMC + 'W'............................Set the selected objective's way point");
	//insert("  RMH..................................Fast map scroll");
	//insert("  X....................................Scatter units");
	//insert("  S....................................Stop units");
	//insert("  LMC + Ctrl + Alt.....................Escort unit");
	insert("");
	insert("");
	insert("Game Related");
	insert("");
	insert("  LMC + 'A'                        Allies with the clicked unit's team");
	//insert("  Ctrl + [F1..F5]                  Bookmark world locations");
	//insert("  Alt + [F1..F5]                   Recall bookmarked world locations");
	insert("  F2                               In game menus");
	insert("");
	insert("");
	insert("Outpost Related");
	insert("");
	insert("  'O'                              Cycle through your outposts");
	insert("  Ctrl + RMC on captured outpost   Displays the outpost view");
	insert("  Double RMC on captured outpost   Displays the outpost view");
	//insert("  Alt + RMC on captured outpost........Sets selected outpost's delivery location");
	insert("");
	insert("");
	insert("Chat Related");
	insert("");
	insert("  Enter                            Send message to all");
	insert("  Ctrl + 'A'                       Send message to allies");
	insert("  Ctrl + 'E'                       Send message to enemies");
	insert("");
	insert("");
	insert("View Related");
	insert("");
	insert("  F1                               Help View");
	insert("  F6                               Rank View");
	insert("  F7                               Chat View");
	insert("  F8                               Mini Map View");
	insert("  TAB                              Toolbar");
	insert("  RMH + mouse movement             Moves any view on the screen");
	insert("  RMH + [1 - 5]                    Sets the background drawing mode");
	insert(" ");
	insert(" ");
	insert("Mini Map View Related");
	insert("");
	insert("  RMH + [1 - 7]                    Sets the blending level of the minimap");
	insert("  RMH + [+ or -]                   Scales the size of the minimap");
	//insert("  RMH + 'O'                        Toggles outposts");
	insert(" ");
	insert(" ");
	insert("System Related");
	insert("");
	insert("  F9                               BMP screen shot");
	insert("  Alt + '-'                        Decrease brightness");
	insert("  Alt + '='                        Increase brightness");
	insert("  Alt + Keypad plus                Increase game resolution");
	insert("  Alt + Keypad minus               Decrease game resolution");

	// Define the scrollBar fot this view.
	//scrollBar = new ScrollBar(VERTICAL, 0, 1, 0, text.getCount());
	//if (scrollBar == 0)
	//{
	//	throw Exception("ERROR: Unable to allocate the scrollBar.");
	//}
	//
	//iRect clientRect(getClientRect());
	//scrollBar->setViewableAmount(clientRect.getSizeY() / (TEXT_GAP_SPACE + CHAR_YPIX) - 1);
	//scrollBar->setBlockIncrement(1);
	
	//add(scrollBar);

	maxViewableItems = (getClientRect().getSizeY() - (TEXT_GAP_SPACE + CHAR_YPIX)) / (TEXT_GAP_SPACE + CHAR_YPIX) - 1;
	topViewableItem  = 0;

	iXY size(20, 20);
	iXY pos(getClientRect().getSizeX() - size.x, 0);

	upButton.setLabel("+");
	upButton.setBounds(iRect(pos, pos + size));
	add(&upButton);
	
	pos = iXY(getClientRect().getSizeX() - size.x, getClientRect().getSizeY() - size.y);
	downButton.setLabel("-");
	downButton.setBounds(iRect(pos, pos + size));
	add(&downButton);

} // end HelpScrollView::HelpScrollView
Exemplo n.º 21
0
// LibView
//---------------------------------------------------------------------------
LibView::LibView() : GameTemplateView()
{
    setSearchName("LibView");
    setTitle("Lib Stats");
    setSubTitle(" - F5");

    setAllowResize(false);
    setAllowMove(true);
    setDisplayStatusBar(false);
    setVisible(false);

    moveTo(0, 0);
    resize(325, 375);

    addButtonCenterText(iXY((getClientRect().getSize().x / 3) * 0, 0), getClientRect().getSize().x / 3, "Surface", "", bSurfaceInfo);
    addButtonCenterText(iXY((getClientRect().getSize().x / 3) * 1, 0), getClientRect().getSize().x / 3, "Particles", "", bParticleInfo);
    addButtonCenterText(iXY((getClientRect().getSize().x / 3) * 2, 0), getClientRect().getSize().x / 3, "Environment", "", bEnvironmentInfo);

    checkBoxAllowParticleGeneration = new CheckBox();
    checkBoxAllowParticleGeneration->setLabel("Allow Particle Generation");
    checkBoxAllowParticleGeneration->setLocation(0, 15);
    checkBoxAllowParticleGeneration->setState(Particle2D::getCreateParticles());
    add(checkBoxAllowParticleGeneration);

    checkBoxAllowTimeSlice = new CheckBox();
    checkBoxAllowTimeSlice->setLabel("Allow Time Slice");
    checkBoxAllowTimeSlice->setLocation(0, 30);
    checkBoxAllowTimeSlice->setState(gTimeSliceFlag);
    add(checkBoxAllowTimeSlice);

    checkBoxAllowSpanBlitting = new CheckBox();
    checkBoxAllowSpanBlitting->setLabel("Allow Blended Span Blitting");
    checkBoxAllowSpanBlitting->setLocation(0, 45);
    checkBoxAllowSpanBlitting->setState(allowSpanBlitting);
    add(checkBoxAllowSpanBlitting);

    checkBoxParticlesCanHaveSmoke = new CheckBox();
    checkBoxParticlesCanHaveSmoke->setLabel("Allow Explosion Particle Smoke");
    checkBoxParticlesCanHaveSmoke->setLocation(0, 60);
    checkBoxParticlesCanHaveSmoke->setState(ParticleInterface::gParticlesCanHaveSmoke);
    add(checkBoxParticlesCanHaveSmoke);

    checkBoxSolidColorExplosionParticles = new CheckBox();
    checkBoxSolidColorExplosionParticles->setLabel("Solid Color Explosion Particles");
    checkBoxSolidColorExplosionParticles->setLocation(0, 75);
    checkBoxSolidColorExplosionParticles->setState(ParticleInterface::gSolidColorExplosionParticles);
    add(checkBoxSolidColorExplosionParticles);

    checkBoxParticleInterfaceSim = new CheckBox();
    checkBoxParticleInterfaceSim->setLabel("Particle Interface Sim");
    checkBoxParticleInterfaceSim->setLocation(0, 90);
    checkBoxParticleInterfaceSim->setState(ParticleInterface::gTestSim);
    add(checkBoxParticleInterfaceSim);

    checkBoxSolidBackground = new CheckBox();
    checkBoxSolidBackground->setLabel("Solid Background");
    checkBoxSolidBackground->setLocation(0, 105);
    checkBoxSolidBackground->setState(GameView::gDrawSolidBackground);
    add(checkBoxSolidBackground);

    checkBoxDrawExplosionParticleCount = new CheckBox();
    checkBoxDrawExplosionParticleCount->setLabel("Draw Explosion Particle Count");
    checkBoxDrawExplosionParticleCount->setLocation(0, 120);
    checkBoxDrawExplosionParticleCount->setState(ParticleInterface::gDrawExplosionParticleCount);
    add(checkBoxDrawExplosionParticleCount);

} // end LibView::LibView