示例#1
0
void P_InitPlayerClassInfo(void)
{
    PCLASS_INFO(PCLASS_FIGHTER)->niceName = GET_TXT(TXT_PLAYERCLASS1);
    PCLASS_INFO(PCLASS_CLERIC)->niceName = GET_TXT(TXT_PLAYERCLASS2);
    PCLASS_INFO(PCLASS_MAGE)->niceName = GET_TXT(TXT_PLAYERCLASS3);
    PCLASS_INFO(PCLASS_PIG)->niceName = GET_TXT(TXT_PLAYERCLASS4);
}
void FacebookManager::sync()
{
#if SAVE_FB_CREDENTIALS
	QSettings s;
	s.beginGroup("WebApps");
	s.beginGroup("Facebook");

	QVariant v;
	GET_TXT("ConnectToken", facebook.access_token);
	GET_TXT("UserId", facebook.user_id);
	GET_TXT("AlbumId", facebook.album_id);
#endif
}
示例#3
0
void UIChat_LoadMacros(void)
{
    // Retrieve the chat macro strings if not already set.
    int i;
    for(i = 0; i < 10; ++i)
    {
        if(cfg.chatMacros[i]) continue;
        cfg.chatMacros[i] = GET_TXT(TXT_HUSTR_CHATMACRO0 + i);
    }
}
示例#4
0
static boolean CheckedLockedDoor(mobj_t *mo, byte lock)
{
	extern int TextKeyMessages[11];
	char    LockedBuffer[80];

	if(!mo->player)
	{
		return false;
	}
	if(!lock)
	{
		return true;
	}
	if(!(mo->player->keys & (1 << (lock - 1))))
	{
		sprintf(LockedBuffer, "YOU NEED THE %s\n",
				GET_TXT(TextKeyMessages[lock - 1]));
		P_SetMessage(mo->player, LockedBuffer, true);
		S_StartSound(SFX_DOOR_LOCKED, mo);
		return false;
	}
	return true;
}
示例#5
0
/**
 * @param plr      Player being given item.
 * @param item     Type of item being given.
 * @param dropped  @c true = the item was dropped by some entity.
 *
 * @return  @c true iff the item should be destroyed.
 */
static dd_bool pickupItem(player_t *plr, itemtype_t item, dd_bool dropped)
{
    if(!plr)
        return false;

    switch(item)
    {
    case IT_ARMOR_GREEN:
        if(!P_GiveArmor(plr, armorClass[0],
                        armorPoints[MINMAX_OF(0, armorClass[0] - 1, 1)]))
            return false;

        P_SetMessage(plr, 0, GOTARMOR);
        if(!mapSetup)
            S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        break;

    case IT_ARMOR_BLUE:
        if(!P_GiveArmor(plr, armorClass[1],
                        armorPoints[MINMAX_OF(0, armorClass[1] - 1, 1)]))
            return false;
        P_SetMessage(plr, 0, GOTMEGA);
        if(!mapSetup)
            S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        break;

    case IT_ARMOR_BONUS:
        if(!plr->armorType)
            P_PlayerSetArmorType(plr, armorClass[0]);
        if(plr->armorPoints < armorPoints[1])
            P_PlayerGiveArmorBonus(plr, 1);

        P_SetMessage(plr, 0, GOTARMBONUS);
        if(!mapSetup)
        {
            S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
            // Maybe unhide the HUD?
            ST_HUDUnHide(plr - players, HUE_ON_PICKUP_ARMOR);
        }
        break;

    case IT_HEALTH_PACK:
        if(!P_GiveHealth(plr, 10))
            return false;
        P_SetMessage(plr, 0, GOTSTIM);
        if(!mapSetup)
            S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        break;

    case IT_HEALTH_KIT: {
        int oldHealth = plr->health;

        /**
         * DOOM bug:
         * The following test was originaly placed AFTER the call to
         * P_GiveHealth thereby making the first outcome impossible as
         * the medikit gives 25 points of health. This resulted that
         * the GOTMEDINEED "Picked up a medikit that you REALLY need"
         * was never used.
         */

        if(!P_GiveHealth(plr, 25)) return false;

        P_SetMessage(plr, 0, GET_TXT((oldHealth < 25)? TXT_GOTMEDINEED : TXT_GOTMEDIKIT));
        if(!mapSetup)
            S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        break; }

    case IT_HEALTH_BONUS:
        plr->health++; // Can go over 100%.
        if(plr->health > healthLimit)
            plr->health = healthLimit;
        plr->plr->mo->health = plr->health;
        plr->update |= PSF_HEALTH;
        P_SetMessage(plr, 0, GOTHTHBONUS);
        if(!mapSetup)
        {
            S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
            // Maybe unhide the HUD?
            ST_HUDUnHide(plr - players, HUE_ON_PICKUP_HEALTH);
        }
        break;

    case IT_HEALTH_SOULSPHERE:
        plr->health += soulSphereHealth;
        if(plr->health > soulSphereLimit)
            plr->health = soulSphereLimit;
        plr->plr->mo->health = plr->health;
        plr->update |= PSF_HEALTH;
        P_SetMessage(plr, 0, GOTSUPER);
        if(!mapSetup)
        {
            S_ConsoleSound(SFX_GETPOW, NULL, plr - players);
            // Maybe unhide the HUD?
            ST_HUDUnHide(plr - players, HUE_ON_PICKUP_HEALTH);
        }
        break;

    case IT_KEY_BLUE:
        if(!plr->keys[KT_BLUECARD])
        {
            P_GiveKey(plr, KT_BLUECARD);
            P_SetMessage(plr, 0, GOTBLUECARD);
            if(!mapSetup)
                S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        }
        if(IS_NETGAME)
            return false;
        break;

    case IT_KEY_YELLOW:
        if(!plr->keys[KT_YELLOWCARD])
        {
            P_GiveKey(plr, KT_YELLOWCARD);
            P_SetMessage(plr, 0, GOTYELWCARD);
            if(!mapSetup)
                S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        }
        if(IS_NETGAME)
            return false;
        break;

    case IT_KEY_RED:
        if(!plr->keys[KT_REDCARD])
        {
            P_GiveKey(plr, KT_REDCARD);
            P_SetMessage(plr, 0, GOTREDCARD);
            if(!mapSetup)
                S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        }
        if(IS_NETGAME)
            return false;
        break;

    case IT_KEY_BLUESKULL:
        if(!plr->keys[KT_BLUESKULL])
        {
            P_GiveKey(plr, KT_BLUESKULL);
            P_SetMessage(plr, 0, GOTBLUESKUL);
            if(!mapSetup)
                S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        }
        if(IS_NETGAME)
            return false;
        break;

    case IT_KEY_YELLOWSKULL:
        if(!plr->keys[KT_YELLOWSKULL])
        {
            P_GiveKey(plr, KT_YELLOWSKULL);
            P_SetMessage(plr, 0,  GOTYELWSKUL);
            if(!mapSetup)
                S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        }
        if(IS_NETGAME)
            return false;
        break;

    case IT_KEY_REDSKULL:
        if(!plr->keys[KT_REDSKULL])
        {
            P_GiveKey(plr, KT_REDSKULL);
            P_SetMessage(plr, 0, GOTREDSKULL);
            if(!mapSetup)
                S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        }
        if(IS_NETGAME)
            return false;
        break;

    case IT_MEGASPHERE:
        if(!(gameModeBits & GM_ANY_DOOM2))
            return false;
        plr->health = megaSphereHealth;
        plr->plr->mo->health = plr->health;
        plr->update |= PSF_HEALTH;
        P_GiveArmor(plr, armorClass[1],
                    armorPoints[MINMAX_OF(0, armorClass[1] - 1, 1)]);
        P_SetMessage(plr, 0, GOTMSPHERE);
        if(!mapSetup)
        {
            S_ConsoleSound(SFX_GETPOW, NULL, plr - players);
            // Maybe unhide the HUD?
            ST_HUDUnHide(plr - players, HUE_ON_PICKUP_HEALTH);
        }
        break;

    case IT_INVUL:
        if(!P_GivePower(plr, PT_INVULNERABILITY))
            return false;

        P_SetMessage(plr, 0, GOTINVUL);
        if(!mapSetup)
            S_ConsoleSound(SFX_GETPOW, NULL, plr - players);
        break;

    case IT_BERSERK:
        if(!P_GivePower(plr, PT_STRENGTH))
            return false;

        P_SetMessage(plr, 0, GOTBERSERK);
        if(plr->readyWeapon != WT_FIRST && cfg.berserkAutoSwitch)
        {
            plr->pendingWeapon = WT_FIRST;
            plr->update |= PSF_PENDING_WEAPON | PSF_READY_WEAPON;
        }
        if(!mapSetup)
            S_ConsoleSound(SFX_GETPOW, NULL, plr - players);
        break;

    case IT_INVIS:
        if(!P_GivePower(plr, PT_INVISIBILITY))
            return false;

        P_SetMessage(plr, 0, GOTINVIS);
        if(!mapSetup)
            S_ConsoleSound(SFX_GETPOW, NULL, plr - players);
        break;

    case IT_SUIT:
        if(!P_GivePower(plr, PT_IRONFEET))
            return false;

        P_SetMessage(plr, 0, GOTSUIT);
        if(!mapSetup)
            S_ConsoleSound(SFX_GETPOW, NULL, plr - players);
        break;

    case IT_ALLMAP:
        if(!P_GivePower(plr, PT_ALLMAP))
            return false;

        P_SetMessage(plr, 0, GOTMAP);
        if(!mapSetup)
            S_ConsoleSound(SFX_GETPOW, NULL, plr - players);
        break;

    case IT_VISOR:
        if(!P_GivePower(plr, PT_INFRARED))
            return false;

        P_SetMessage(plr, 0, GOTVISOR);
        if(!mapSetup)
            S_ConsoleSound(SFX_GETPOW, NULL, plr - players);
        break;

    case IT_BACKPACK:
        P_GiveBackpack(plr);
        if(!mapSetup)
            S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        break;

    case IT_AMMO_CLIP:
        if(!P_GiveAmmo(plr, AT_CLIP, dropped? 0 /*half a clip*/ : 1))
            return false;

        P_SetMessage(plr, 0, GOTCLIP);
        if(!mapSetup)
            S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        break;

    case IT_AMMO_CLIP_BOX:
        if(!P_GiveAmmo(plr, AT_CLIP, 5))
            return false;

        P_SetMessage(plr, 0, GOTCLIPBOX);
        if(!mapSetup)
            S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        break;

    case IT_AMMO_ROCKET:
        if(!P_GiveAmmo(plr, AT_MISSILE, 1))
            return false;

        P_SetMessage(plr, 0, GOTROCKET);
        if(!mapSetup)
            S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        break;

    case IT_AMMO_ROCKET_BOX:
        if(!P_GiveAmmo(plr, AT_MISSILE, 5))
            return false;

        P_SetMessage(plr, 0, GOTROCKBOX);
        if(!mapSetup)
            S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        break;

    case IT_AMMO_CELL:
        if(!P_GiveAmmo(plr, AT_CELL, 1))
            return false;

        P_SetMessage(plr, 0, GOTCELL);
        if(!mapSetup)
            S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        break;

    case IT_AMMO_CELL_BOX:
        if(!P_GiveAmmo(plr, AT_CELL, 5))
            return false;

        P_SetMessage(plr, 0, GOTCELLBOX);
        if(!mapSetup)
            S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        break;

    case IT_AMMO_SHELL:
        if(!P_GiveAmmo(plr, AT_SHELL, 1))
            return false;

        P_SetMessage(plr, 0, GOTSHELLS);
        if(!mapSetup)
            S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        break;

    case IT_AMMO_SHELL_BOX:
        if(!P_GiveAmmo(plr, AT_SHELL, 5))
            return false;

        P_SetMessage(plr, 0, GOTSHELLBOX);
        if(!mapSetup)
            S_ConsoleSound(SFX_ITEMUP, NULL, plr - players);
        break;

    case IT_WEAPON_BFG:
        return pickupWeapon(plr, WT_SEVENTH, dropped, GOTBFG9000);

    case IT_WEAPON_CHAINGUN:
        return pickupWeapon(plr, WT_FOURTH, dropped, GOTCHAINGUN);

    case IT_WEAPON_CHAINSAW:
        return pickupWeapon(plr, WT_EIGHTH, dropped, GOTCHAINSAW);

    case IT_WEAPON_RLAUNCHER:
        return pickupWeapon(plr, WT_FIFTH, dropped, GOTLAUNCHER);

    case IT_WEAPON_PLASMARIFLE:
        return pickupWeapon(plr, WT_SIXTH, dropped, GOTPLASMA);

    case IT_WEAPON_SHOTGUN:
        return pickupWeapon(plr, WT_THIRD, dropped, GOTSHOTGUN);

    case IT_WEAPON_SSHOTGUN:
        return pickupWeapon(plr, WT_NINETH, dropped, GOTSHOTGUN2);

    default:
        Con_Error("pickupItem: Unknown item %i.", (int) item);
    }

    return true;
}
示例#6
0
void PreferencesDialog::loadSettings()
{
    // This code was on the mainwindow, it should belong nowhere, but since we dind't
    // correctly fixed this code yet ( too much stuff on the code calling preferences )
    // force this here.

    QSettings s;
    QVariant v;
    s.beginGroup("Units");
    if (s.value("unit_system").toString() == "metric") {
        prefs.unit_system = METRIC;
        prefs.units = SI_units;
    } else if (s.value("unit_system").toString() == "imperial") {
        prefs.unit_system = IMPERIAL;
        prefs.units = IMPERIAL_units;
    } else {
        prefs.unit_system = PERSONALIZE;
        GET_UNIT("length", length, units::FEET, units::METERS);
        GET_UNIT("pressure", pressure, units::PSI, units::BAR);
        GET_UNIT("volume", volume, units::CUFT, units::LITER);
        GET_UNIT("temperature", temperature, units::FAHRENHEIT, units::CELSIUS);
        GET_UNIT("weight", weight, units::LBS, units::KG);
    }
    GET_UNIT("vertical_speed_time", vertical_speed_time, units::MINUTES, units::SECONDS);
    s.endGroup();
    s.beginGroup("TecDetails");
    GET_BOOL("po2graph", pp_graphs.po2);
    GET_BOOL("pn2graph", pp_graphs.pn2);
    GET_BOOL("phegraph", pp_graphs.phe);
    GET_DOUBLE("po2threshold", pp_graphs.po2_threshold);
    GET_DOUBLE("pn2threshold", pp_graphs.pn2_threshold);
    GET_DOUBLE("phethreshold", pp_graphs.phe_threshold);
    GET_BOOL("mod", mod);
    GET_DOUBLE("modppO2", mod_ppO2);
    GET_BOOL("ead", ead);
    GET_BOOL("redceiling", profile_red_ceiling);
    GET_BOOL("dcceiling", profile_dc_ceiling);
    GET_BOOL("calcceiling", profile_calc_ceiling);
    GET_BOOL("calcceiling3m", calc_ceiling_3m_incr);
    GET_BOOL("calcndltts", calc_ndl_tts);
    GET_BOOL("calcalltissues", calc_all_tissues);
    GET_INT("gflow", gflow);
    GET_INT("gfhigh", gfhigh);
    GET_BOOL("gf_low_at_maxdepth", gf_low_at_maxdepth);
    GET_BOOL("zoomed_plot", zoomed_plot);
    set_gf(prefs.gflow, prefs.gfhigh, prefs.gf_low_at_maxdepth);
    GET_BOOL("show_sac", show_sac);
    GET_BOOL("display_unused_tanks", display_unused_tanks);
    s.endGroup();

    s.beginGroup("GeneralSettings");
    GET_TXT("default_filename", default_filename);
    GET_TXT("default_cylinder", default_cylinder);
    s.endGroup();

    s.beginGroup("Display");
    QFont defaultFont = s.value("divelist_font", qApp->font()).value<QFont>();
    defaultFont.setPointSizeF(s.value("font_size", qApp->font().pointSizeF()).toFloat());
    qApp->setFont(defaultFont);

    GET_TXT("divelist_font", divelist_font);
    GET_INT("font_size", font_size);
    if (prefs.font_size < 0)
        prefs.font_size = defaultFont.pointSizeF();
    GET_INT("displayinvalid", display_invalid_dives);
    s.endGroup();
}