Esempio n. 1
0
void Rocket_Rocket_f() {
    Rocket_DocumentAction(Cmd_Argv(1), Cmd_Argv(2));
}
static void CG_ToggleMenu_f()
{
	Rocket_DocumentAction( rocketInfo.menu[ ROCKETMENU_INGAME_MENU ].id, "show" );
}
void CG_BeaconMenu_f()
{
	Rocket_DocumentAction( rocketInfo.menu[ ROCKETMENU_BEACONS ].id, "show" );
}
static void CG_MessageTeam_f()
{
	cg.sayType = SAY_TYPE_TEAM;
	Rocket_DocumentAction( rocketInfo.menu[ ROCKETMENU_CHAT ].id, "show" );
}
static void CG_MessagePublic_f()
{
	cg.sayType = SAY_TYPE_PUBLIC;
	Rocket_DocumentAction( rocketInfo.menu[ ROCKETMENU_CHAT ].id, "show" );
}
static void CG_MessageAdmin_f()
{
	cg.sayType = SAY_TYPE_ADMIN;
	Rocket_DocumentAction( rocketInfo.menu[ ROCKETMENU_CHAT ].id, "show" );
}
static void CG_MessageCommand_f()
{
	cg.sayType = SAY_TYPE_COMMAND;
	Rocket_DocumentAction( rocketInfo.menu[ ROCKETMENU_CHAT ].id, "show" );
}
static void CG_Rocket_EventHide()
{
	Rocket_DocumentAction( CG_Argv( 1 ), "hide" );
}
/*
==============
CG_Menu
==============
*/
void CG_Menu( int menuType, int arg )
{
    int          menu = -1; // Menu to open
    const char   *longMsg = nullptr; // command parameter
    const char   *shortMsg = nullptr; // non-modal version of message

    switch ( menuType )
    {
    case MN_WELCOME:
        break;

    case MN_TEAM:
        menu = ROCKETMENU_TEAMSELECT;
        break;

    case MN_A_CLASS:
        menu = ROCKETMENU_ALIENSPAWN;
        break;

    case MN_H_SPAWN:
        menu = ROCKETMENU_HUMANSPAWN;
        break;

    case MN_A_BUILD:
        menu = ROCKETMENU_ALIENBUILD;
        break;

    case MN_H_BUILD:
        menu = ROCKETMENU_HUMANBUILD;
        break;

    case MN_H_ARMOURY:
        menu = ROCKETMENU_ARMOURYBUY;
        break;

    case MN_H_UNKNOWNITEM:
        shortMsg = "Unknown item";
        break;

    case MN_A_TEAMFULL:
        longMsg = _("The alien team has too many players. Please wait until slots "
                    "become available or join the human team.");
        shortMsg = _("The alien team has too many players");
        break;

    case MN_H_TEAMFULL:
        longMsg = _("The human team has too many players. Please wait until slots "
                    "become available or join the alien team.");
        shortMsg = _("The human team has too many players");
        break;

    case MN_A_TEAMLOCKED:
        longMsg = _("The alien team is locked. You cannot join the aliens "
                    "at this time.");
        shortMsg = _("The alien team is locked");
        break;

    case MN_H_TEAMLOCKED:
        longMsg = _("The human team is locked. You cannot join the humans "
                    "at this time.");
        shortMsg = _("The human team is locked");
        break;

    case MN_PLAYERLIMIT:
        longMsg = _("The maximum number of playing clients has been reached. "
                    "Please wait until slots become available.");
        shortMsg = _("No free player slots");
        break;

    case MN_WARMUP:
        longMsg = _("You must wait until the warmup time is finished "
                    "before joining a team. ");
        shortMsg = _("You cannot join a team during warmup.");
        break;

    //===============================

    case MN_CMD_CHEAT:
        //longMsg   = "This action is considered cheating. It can only be used "
        //            "in cheat mode, which is not enabled on this server.";
        shortMsg = _("Cheats are not enabled on this server");
        break;

    case MN_CMD_CHEAT_TEAM:
        shortMsg = _("Cheats are not enabled on this server, so "
                     "you may not use this command while on a team");
        break;

    case MN_CMD_TEAM:
        //longMsg   = "You must be on a team to perform this action. Join the alien"
        //            "or human team and try again.";
        shortMsg = _("Join a team first");
        break;

    case MN_CMD_SPEC:
        //longMsg   = "You may not perform this action while on a team. Become a "
        //            "spectator before trying again.";
        shortMsg = _("You can only use this command when spectating");
        break;

    case MN_CMD_ALIEN:
        //longMsg   = "You must be on the alien team to perform this action.";
        shortMsg = _("Must be alien to use this command");
        break;

    case MN_CMD_HUMAN:
        //longMsg   = "You must be on the human team to perform this action.";
        shortMsg = _("Must be human to use this command");
        break;

    case MN_CMD_ALIVE:
        //longMsg   = "You must be alive to perform this action.";
        shortMsg = _("Must be alive to use this command");
        break;

    //===============================

    case MN_B_NOROOM:
        longMsg = _("There is no room to build here. Move until the structure turns "
                    "translucent green, indicating a valid build location.");
        shortMsg = _("There is no room to build here");
        break;

    case MN_B_NORMAL:
        longMsg = _("Cannot build on this surface. The surface is too steep or "
                    "unsuitable for building. Please choose another site for this "
                    "structure.");
        shortMsg = _("Cannot build on this surface");
        break;

    case MN_B_CANNOT:
        longMsg = nullptr;
        shortMsg = _("You cannot build that structure");
        break;

    case MN_B_LASTSPAWN:
        longMsg = _("This action would remove your team's last spawn point, "
                    "which often quickly results in a loss. Try building more "
                    "spawns.");
        shortMsg = _("You may not deconstruct the last spawn");
        break;

    case MN_B_MAINSTRUCTURE:
        longMsg = _("The main structure is protected against instant removal. "
                    "When it is marked, you can move it to another place by "
                    "building it there.");
        shortMsg = _("You may not deconstruct this structure");
        break;

    case MN_B_DISABLED:
        longMsg = _("Building has been disabled on the server for your team.");
        shortMsg = _("Building has been disabled for your team");
        break;

    case MN_B_REVOKED:
        longMsg = _("Your teammates have lost faith in your ability to build "
                    "for the team. You will not be allowed to build until your "
                    "team votes to reinstate your building rights.");
        shortMsg = _("Your building rights have been revoked");
        break;

    case MN_B_SURRENDER:
        longMsg = _("Your team has decided to admit defeat and concede the game: "
                    "There's no point in building anything anymore.");
        shortMsg = _("Cannot build after admitting defeat");
        break;

    case MN_H_NOBP:
        longMsg = _("There are no resources remaining. Free up resources by "
                    "marking existing buildables for deconstruction.");
        shortMsg = _("There are no resources remaining");
        break;

    case MN_H_NOTPOWERED:
        longMsg = _("This buildable is not powered. Build a Reactor and/or Repeater "
                    "in order to power it.");
        shortMsg = _("This buildable is not powered");
        break;

    case MN_H_NOPOWERHERE:
        longMsg = _("There is not enough power in this area. Keep a distance to other "
                    "buildables or build a repeater to increase the local capacity.");
        shortMsg = _("There is not enough power here");
        break;

    case MN_H_NOREACTOR:
        longMsg = _("There is no reactor and the local power supply is insufficient. "
                    "Build the reactor or a repeater to increase the local capacity.");
        shortMsg = _("There is no reactor and the local power supply is insufficient");
        break;

    case MN_H_ONEREACTOR:
        longMsg = _("There can only be one Reactor. Mark the existing one if you "
                    "wish to move it.");
        shortMsg = _("There can only be one Reactor");
        break;

    case MN_H_NOSLOTS:
        longMsg = _("You have no room to carry this. Please sell any conflicting "
                    "upgrades before purchasing this item.");
        shortMsg = _("You have no room to carry this");
        break;

    case MN_H_NOFUNDS:
        longMsg = _("Insufficient funds. You do not have enough credits to perform "
                    "this action.");
        shortMsg = _("Insufficient funds");
        break;

    case MN_H_ITEMHELD:
        longMsg = _("You already hold this item. It is not possible to carry multiple "
                    "items of the same type.");
        shortMsg = _("You already hold this item");
        break;

    case MN_H_NOARMOURYHERE:
        longMsg = _("You must be near a powered Armoury in order to purchase "
                    "weapons, upgrades or ammunition.");
        shortMsg = _("You must be near a powered Armoury");
        break;

    case MN_H_NOENERGYAMMOHERE:
        longMsg = _("You must be near a Reactor or a powered Armoury or Repeater "
                    "in order to purchase energy ammunition.");
        shortMsg = _("You must be near a Reactor or a powered Armoury or Repeater");
        break;

    case MN_H_NOROOMARMOURCHANGE:
        longMsg = _("There is not enough room here to change armour.");
        shortMsg = _("Not enough room here to change armour.");
        break;

    case MN_H_ARMOURYBUILDTIMER:
        longMsg = _("You are not allowed to buy or sell weapons until your "
                    "build timer has expired.");
        shortMsg = _("You can not buy or sell weapons until your build timer "
                     "expires");
        break;

    case MN_H_DEADTOCLASS:
        shortMsg = _("You must be dead to use the class command");
        break;

    case MN_H_UNKNOWNSPAWNITEM:
        shortMsg = _("Unknown starting item");
        break;

    //===============================

    case MN_A_NOCREEP:
        longMsg = _("There is no creep here. You must build near existing Eggs or "
                    "the Overmind. Alien structures will not support themselves.");
        shortMsg = _("There is no creep here");
        break;

    case MN_A_NOOVMND:
        longMsg = _("There is no Overmind. An Overmind must be built to control "
                    "the structure you tried to place.");
        shortMsg = _("There is no Overmind");
        break;

    case MN_A_ONEOVERMIND:
        longMsg = _("There can only be one Overmind. Deconstruct the existing one if you "
                    "wish to move it.");
        shortMsg = _("There can only be one Overmind");
        break;

    case MN_A_NOBP:
        longMsg = _("The Overmind cannot control any more structures. Deconstruct existing "
                    "structures to build more.");
        shortMsg = _("The Overmind cannot control any more structures");
        break;

    case MN_A_NOEROOM:
        longMsg = _("There is no room to evolve here. Move away from walls or other "
                    "nearby objects and try again.");
        shortMsg = _("There is no room to evolve here");
        break;

    case MN_A_TOOCLOSE:
        longMsg = _("This location is too close to the enemy to evolve. Move away "
                    "from the enemy's presence and try again.");
        shortMsg = _("This location is too close to the enemy to evolve");
        break;

    case MN_A_NOOVMND_EVOLVE:
        longMsg = _("There is no Overmind. An Overmind must be built to allow "
                    "you to upgrade.");
        shortMsg = _("There is no Overmind");
        break;

    case MN_A_EVOLVEBUILDTIMER:
        longMsg = _("You cannot evolve until your build timer has expired.");
        shortMsg = _("You cannot evolve until your build timer expires");
        break;

    case MN_A_INFEST:
        trap_Cvar_Set( "ui_currentClass",
                       va( "%d %d", cg.snap->ps.stats[ STAT_CLASS ],
                           cg.snap->ps.persistant[ PERS_CREDIT ] ) );

        menu = ROCKETMENU_ALIENEVOLVE;
        break;

    case MN_A_CANTEVOLVE:
        shortMsg = va( _("You cannot evolve into a %s"),
                       _( BG_ClassModelConfig( arg )->humanName ) );
        break;

    case MN_A_EVOLVEWALLWALK:
        shortMsg = _("You cannot evolve while wallwalking");
        break;

    case MN_A_UNKNOWNCLASS:
        shortMsg = _("Unknown class");
        break;

    case MN_A_CLASSNOTSPAWN:
        shortMsg = va( _("You cannot spawn as a %s"),
                       _( BG_ClassModelConfig( arg )->humanName ) );
        break;

    case MN_A_CLASSNOTALLOWED:
        shortMsg = va( _("The %s is not allowed"),
                       _( BG_ClassModelConfig( arg )->humanName ) );
        break;

    case MN_A_CLASSLOCKED:
        shortMsg = va( _("The %s has not been unlocked yet"),
                       _( BG_ClassModelConfig( arg )->humanName ) );
        break;

    default:
        Com_Printf(_( "cgame: debug: no such menu %d\n"), menu );
    }

    if ( menu > 0 )
    {
        Rocket_DocumentAction( rocketInfo.menu[ menu ].id, "show" );
    }
    else if ( longMsg && cg_disableWarningDialogs.integer == 0 )
    {
        CG_CenterPrint( longMsg, SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH );

        if ( shortMsg && cg_disableWarningDialogs.integer < 2 )
        {
            CG_Printf( "%s\n", shortMsg );
        }
    }
    else if ( shortMsg && cg_disableWarningDialogs.integer < 2 )
    {
        CG_Printf( "%s\n", shortMsg );
    }
}
static void CG_Rocket_EventBlur()
{
	Rocket_DocumentAction( CG_Argv( 1 ), "blur" );
}
static void CG_Rocket_EventShow()
{
	Rocket_DocumentAction( CG_Argv( 1 ), "show" );
}
static void CG_Rocket_EventGoto()
{
	Rocket_DocumentAction( CG_Argv( 1 ), "goto" );
}
static void CG_Rocket_EventClose()
{
	Rocket_DocumentAction( CG_Argv( 1 ), "close" );
}
Esempio n. 14
0
void IN_Help() {
    if (cls.state == CA_ACTIVE && !clc.demoplaying) {
        Rocket_DocumentAction("Help", "open");
    }
}