Convert research message data to ini file format.

master
Per Inge Mathisen 2012-01-07 18:33:15 +01:00
parent 2255251e06
commit 545eb5c272
17 changed files with 3250 additions and 4444 deletions

View File

@ -1,81 +1,73 @@
MSG1
{
{
_("Structure Research Completed"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_pow.ogg",
.audioName = "Structure Research Completed.ogg",
};
text = \
_("Structure Research Completed"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_pow.ogg"
audioName = "Structure Research Completed.ogg"
MSG2
{
{
_("Power Research Completed"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_pow.ogg",
.audioName = "Power Research Completed.ogg",
};
text = \
_("Power Research Completed"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_pow.ogg"
audioName = "Power Research Completed.ogg"
MSG3
{
{
_("Computer Research Completed"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_pow.ogg",
.audioName = "Computer Research Completed.ogg",
};
text = \
_("Computer Research Completed"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_pow.ogg"
audioName = "Computer Research Completed.ogg"
MSG4
{
{
_("Unit Research Completed"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_pow.ogg",
.audioName = "Droid Research Completed.ogg",
};
text = \
_("Unit Research Completed"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_pow.ogg"
audioName = "Droid Research Completed.ogg"
MSG5
{
{
_("Systems Research Completed"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_pow.ogg",
.audioName = "Systems Research Completed.ogg",
};
text = \
_("Systems Research Completed"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_pow.ogg"
audioName = "Systems Research Completed.ogg"
MSG6
{
{
_("Weapon Research Completed"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_pow.ogg",
.audioName = "Weapon Research Completed.ogg",
};
text = \
_("Weapon Research Completed"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_pow.ogg"
audioName = "Weapon Research Completed.ogg"
/*
MSG7
{
{
_("Cyborg Research Completed"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_pow.ogg",
.audioName = "Cyborg Research Completed.ogg",
};
text = \
_("Cyborg Research Completed"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_pow.ogg"
audioName = "Cyborg Research Completed.ogg"
MSG8
{
{
_("Defensive Research Completed"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_pow.ogg",
.audioName = "Defensive Research Completed.ogg",
};*/
text = \
_("Defensive Research Completed"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_pow.ogg"
audioName = "Defensive Research Completed.ogg"
*/

File diff suppressed because it is too large Load Diff

View File

@ -1,273 +1,231 @@
RES_EMP_Mpit
{
{
_("New Defensive Structure Available"),
_("Armored Mortar battery pit"),
_("Assigned automatically to nearest sensor or CB tower"),
_("Defensive Strength: Medium"),
},
.imdName = "MICAPSUL.pie",
.imdName2 = NULL,
.sequenceName = "res_struttech.ogg",
.audioName = NULL,
};
RES_EMP_MRL
{
{
_("New Defensive Structure Available"),
_("Mini-rocket armored strongpoint"),
_("Assigned automatically to nearest sensor or CB tower"),
_("Defensive Strength: Medium"),
},
.imdName = "MICAPSUL.pie",
.imdName2 = NULL,
.sequenceName = "res_struttech.ogg",
.audioName = NULL,
};
RES_DF_WT1
{
{
_("New Defensive Structure Available"),
_("Armored hardpoint with Heavy Machinegun"),
_("Automatically targets enemies within sensor range"),
_("Defensive Strength: High"),
},
.imdName = "MICAPSUL.pie",
.imdName2 = NULL,
.sequenceName = "res_struttech.ogg",
.audioName = NULL,
};
RES_WT6_ATR
{
{
_("New Defensive Structure Available"),
_("Armored hardpoint with Lancer AT missile"),
_("Automatically targets enemies within sensor range"),
_("Defensive Strength: High"),
},
.imdName = "MICAPSUL.pie",
.imdName2 = NULL,
.sequenceName = "res_struttech.ogg",
.audioName = NULL,
};
RES_ENGIN1
{
{
_("Research Breakthrough Improves Construction Rates"),
_("Improved Engineering Techniques"),
_("Increases construction speed"),
_("All trucks upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_systech.ogg",
.audioName = NULL,
};
RES_SY_CBSTU1
{
{
_("New Systems Turret Available for Design"),
_("Counter-battery turret detects enemy indirect fire batteries"),
_("Orders assigned indirect fire units to fire at the enemy batteries"),
_("Counter-battery fire continues until enemy battery is suppressed"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_systech.ogg",
.audioName = NULL,
};
RES_SY_CBSU1
{
{
_("CB Sensor Improved"),
_("New fire detection systems"),
_("Extends CB Range"),
_("All CB sensors upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_systech.ogg",
.audioName = NULL,
};
RES_W_CNAC1
{
{
_("Cannon Upgrade"),
_("Determines range to target"),
_("Increases Cannon accuracy"),
_("All cannons upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_FL_ROF1
{
{
_("Flamer Upgrade"),
_("Automatic loading mechanism replaces manual loader"),
_("Increases Flamer ROF"),
_("All flamers upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_MG3MK1
{
{
_("New Weapon Turret Available"),
_(".50-calibre heavy machinegun"),
_("Best Targets: Infantry, base structures, wheeled vehicles"),
_("Body Points: Medium"),
},
.imdName = "MICAPSUL.pie",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_MG_ROF1
{
{
_("Machinegun Upgrade"),
_("Chaingun mechanism replaces belt-feed"),
_("Increases Machinegun ROF"),
_("All machineguns upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_M2
{
{
_("New Indirect Fire Weapon Available"),
_("May be assigned to a sensor"),
_("Best Targets: Base structures, infantry, wheeled vehicles"),
_("Body Points: Very Low"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_M_AC1
{
{
_("Mortar Upgrade"),
_("Targeting systems compensate for distance and weather conditions"),
_("Increases Mortar accuracy"),
_("All mortars upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_M_ROF1
{
{
_("Mortar Upgrade"),
_("Automatic loader replaces manual feed"),
_("Increases Mortar ROF"),
_("All mortars upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_RK_IDF
{
{
_("New Rocket Available"),
_("Rocket artillery; can be assigned to a sensor"),
_("Best Targets: Vehicles and Emplacements"),
_("Body Points: Very Low"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_SRK_ROF1
{
{
_("Rocket Upgrade"),
_("Autoloader increases reload rate"),
_("Increases Rocket ROF"),
_("All rockets upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_CN_ROF1
{
{
_("Cannon Upgrade"),
_("Automatic loading mechanism replaces manual loader"),
_("Increases Cannon ROF"),
_("All cannons upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_CN_D4
{
{
_("Cannon Upgrade"),
_("Armor-Piercing Fin-Stabilized Discarding Sabot"),
_("Increases Cannon damage"),
_("All cannons upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_SRK_AC2
{
{
_("Rocket Upgrade"),
_("Rocket tracks the laser designator to the target"),
_("Increases Rocket accuracy"),
_("All rockets upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_RK_HvAT
{
{
_("New Rocket Available"),
_("Heavy anti-tank rocket"),
_("Best Targets: Vehicles"),
_("Body Points: Very Low"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_RK_MRL1
{
{
_("New Rocket Available"),
_("Fires salvoes of mini-rockets"),
_("Best Targets: Base structures"),
_("Body Points: Very Low"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
[RES_EMP_Mpit]
text = \
_("New Defensive Structure Available"),\
_("Armored Mortar battery pit"),\
_("Assigned automatically to nearest sensor or CB tower"),\
_("Defensive Strength: Medium"),\
imdName = "MICAPSUL.pie"
sequenceName = "res_struttech.ogg"
[RES_EMP_MRL]
text = \
_("New Defensive Structure Available"),\
_("Mini-rocket armored strongpoint"),\
_("Assigned automatically to nearest sensor or CB tower"),\
_("Defensive Strength: Medium"),\
imdName = "MICAPSUL.pie"
sequenceName = "res_struttech.ogg"
[RES_DF_WT1]
text = \
_("New Defensive Structure Available"),\
_("Armored hardpoint with Heavy Machinegun"),\
_("Automatically targets enemies within sensor range"),\
_("Defensive Strength: High"),\
imdName = "MICAPSUL.pie"
sequenceName = "res_struttech.ogg"
[RES_WT6_ATR]
text = \
_("New Defensive Structure Available"),\
_("Armored hardpoint with Lancer AT missile"),\
_("Automatically targets enemies within sensor range"),\
_("Defensive Strength: High"),\
imdName = "MICAPSUL.pie"
sequenceName = "res_struttech.ogg"
[RES_ENGIN1]
text = \
_("Research Breakthrough Improves Construction Rates"),\
_("Improved Engineering Techniques"),\
_("Increases construction speed"),\
_("All trucks upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_systech.ogg"
[RES_SY_CBSTU1]
text = \
_("New Systems Turret Available for Design"),\
_("Counter-battery turret detects enemy indirect fire batteries"),\
_("Orders assigned indirect fire units to fire at the enemy batteries"),\
_("Counter-battery fire continues until enemy battery is suppressed"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_systech.ogg"
[RES_SY_CBSU1]
text = \
_("CB Sensor Improved"),\
_("New fire detection systems"),\
_("Extends CB Range"),\
_("All CB sensors upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_systech.ogg"
[RES_W_CNAC1]
text = \
_("Cannon Upgrade"),\
_("Determines range to target"),\
_("Increases Cannon accuracy"),\
_("All cannons upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_FL_ROF1]
text = \
_("Flamer Upgrade"),\
_("Automatic loading mechanism replaces manual loader"),\
_("Increases Flamer ROF"),\
_("All flamers upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_MG3MK1]
text = \
_("New Weapon Turret Available"),\
_(".50-calibre heavy machinegun"),\
_("Best Targets: Infantry, base structures, wheeled vehicles"),\
_("Body Points: Medium"),\
imdName = "MICAPSUL.pie"
sequenceName = "res_weapons.ogg"
[RES_W_MG_ROF1]
text = \
_("Machinegun Upgrade"),\
_("Chaingun mechanism replaces belt-feed"),\
_("Increases Machinegun ROF"),\
_("All machineguns upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_M2]
text = \
_("New Indirect Fire Weapon Available"),\
_("May be assigned to a sensor"),\
_("Best Targets: Base structures, infantry, wheeled vehicles"),\
_("Body Points: Very Low"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_M_AC1]
text = \
_("Mortar Upgrade"),\
_("Targeting systems compensate for distance and weather conditions"),\
_("Increases Mortar accuracy"),\
_("All mortars upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_M_ROF1]
text = \
_("Mortar Upgrade"),\
_("Automatic loader replaces manual feed"),\
_("Increases Mortar ROF"),\
_("All mortars upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_RK_IDF]
text = \
_("New Rocket Available"),\
_("Rocket artillery; can be assigned to a sensor"),\
_("Best Targets: Vehicles and Emplacements"),\
_("Body Points: Very Low"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_SRK_ROF1]
text = \
_("Rocket Upgrade"),\
_("Autoloader increases reload rate"),\
_("Increases Rocket ROF"),\
_("All rockets upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_CN_ROF1]
text = \
_("Cannon Upgrade"),\
_("Automatic loading mechanism replaces manual loader"),\
_("Increases Cannon ROF"),\
_("All cannons upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_CN_D4]
text = \
_("Cannon Upgrade"),\
_("Armor-Piercing Fin-Stabilized Discarding Sabot"),\
_("Increases Cannon damage"),\
_("All cannons upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_SRK_AC2]
text = \
_("Rocket Upgrade"),\
_("Rocket tracks the laser designator to the target"),\
_("Increases Rocket accuracy"),\
_("All rockets upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_RK_HvAT]
text = \
_("New Rocket Available"),\
_("Heavy anti-tank rocket"),\
_("Best Targets: Vehicles"),\
_("Body Points: Very Low"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_RK_MRL1]
text = \
_("New Rocket Available"),\
_("Fires salvoes of mini-rockets"),\
_("Best Targets: Base structures"),\
_("Body Points: Very Low"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"

File diff suppressed because it is too large Load Diff

View File

@ -1,221 +1,187 @@
RES_CY_LG2
{
{
_("Cyborg Propulsion Improved"),
_("New armored construction"),
_("Increases Body Points"),
_("All Cyborgs upgraded automatically"),
},
.imdName = "MICAPSUL.pie",
.imdName2 = NULL,
.sequenceName = "res_droid.ogg",
.audioName = NULL,
};
RES_WT13_HPV
{
{
_("New Defensive Structure Available"),
_("Armored hardpoint with Hyper-Velocity Cannon"),
_("Automatically targets enemies within sensor range"),
_("Defensive Strength: High"),
},
.imdName = "MICAPSUL.pie",
.imdName2 = NULL,
.sequenceName = "res_struttech.ogg",
.audioName = NULL,
};
RES_POWU1
{
{
_("Improved Power Generator Performance"),
_("New Power Generation Technology"),
_("Gas turbine boosts power output"),
_("All power generators upgraded automatically"),
},
.imdName = "MICAPSUL.pie",
.imdName2 = NULL,
.sequenceName = "res_pow.ogg",
.audioName = NULL,
};
RES_ENGIN2
{
{
_("Research Breakthrough Improves Construction Rates"),
_("Improved Engineering Techniques"),
_("Increases construction speed"),
_("All trucks upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_systech.ogg",
.audioName = NULL,
};
RES_SY_CBSU2
{
{
_("CB Sensor Improved"),
_("Improved fire detection systems"),
_("Extends CB Range"),
_("All CB sensors upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_systech.ogg",
.audioName = NULL,
};
RES_SY_VCBSTW1
{
{
_("New Systems Tower Available"),
_("VTOL CB Tower detects enemy indirect fire batteries"),
_("Orders assigned VTOLs to attack the enemy batteries"),
_("VTOLs attack until enemy battery is suppressed"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_systech.ogg",
.audioName = NULL,
};
RES_SY_VCBSU2
{
{
_("VTOL CB Improved"),
_("Improved fire detection systems"),
_("Extends VTOL CB Range"),
_("All VTOL CB sensors upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_systech.ogg",
.audioName = NULL,
};
RES_SY_VSTW1
{
{
_("New Systems Tower Available"),
_("VTOL Strike Tower detects approaching enemies"),
_("Assigned VTOLs attack the enemy units"),
_("Strike mission continues until enemy destroyed or they retreat"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_systech.ogg",
.audioName = NULL,
};
RES_SY_VSTU1
{
{
_("New Systems Turret Available"),
_("VTOL Strike turret used to spot targets"),
_("Assigned VTOLs attack the designated targets"),
_("Select new targets to continue the VTOL strikes"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_systech.ogg",
.audioName = NULL,
};
RES_SY_VS2
{
{
_("VTOL Strike Improved"),
_("Improved target recognition systems"),
_("Extends VTOL Strike Range"),
_("All VTOL Strike sensors upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_systech.ogg",
.audioName = NULL,
};
RES_W_AAAC2
{
{
_("AA Upgrade"),
_("Self-guided rocket powered shells"),
_("Increases AA accuracy"),
_("All AA weapons upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_BMB3
{
{
_("New Bomb Bay Available"),
_("Drops incendiary bombs"),
_("Best Targets: Bunkers and Hardpoints"),
_("Body Points: Low"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_BAC2
{
{
_("Bombsight Upgrade"),
_("Laser designator paints and guides bombs to the target"),
_("Increases Bombing accuracy"),
_("All bomb bays upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_MG_ROF3
{
{
_("Machinegun Upgrade"),
_("Robotic advances make new chaingun upgrade available"),
_("Increases Machinegun ROF"),
_("All machineguns upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_M_AC2
{
{
_("Mortar Upgrade"),
_("Shells detect and home to thermal heat signatures"),
_("Increases Mortar accuracy"),
_("All mortars upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_RHOW
{
{
_("New Indirect Fire Weapon Available"),
_("105mm multi-barrel Howitzer may be assigned to a sensor"),
_("Best Targets: Base Structures, infantry, wheeled vehicles"),
_("Body Points: Low"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_MG4
{
{
_("New Weapon Turret Available"),
_("Multi-barrel, rapid-fire machinegun"),
_("Best Targets: Infantry, base structures, wheeled vehicles"),
_("Replaces all machineguns"),
},
.imdName = "MICAPSUL.pie",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
[RES_CY_LG2]
text = \
_("Cyborg Propulsion Improved"),\
_("New armored construction"),\
_("Increases Body Points"),\
_("All Cyborgs upgraded automatically"),\
imdName = "MICAPSUL.pie"
sequenceName = "res_droid.ogg"
[RES_WT13_HPV]
text = \
_("New Defensive Structure Available"),\
_("Armored hardpoint with Hyper-Velocity Cannon"),\
_("Automatically targets enemies within sensor range"),\
_("Defensive Strength: High"),\
imdName = "MICAPSUL.pie"
sequenceName = "res_struttech.ogg"
[RES_POWU1]
text = \
_("Improved Power Generator Performance"),\
_("New Power Generation Technology"),\
_("Gas turbine boosts power output"),\
_("All power generators upgraded automatically"),\
imdName = "MICAPSUL.pie"
sequenceName = "res_pow.ogg"
[RES_ENGIN2]
text = \
_("Research Breakthrough Improves Construction Rates"),\
_("Improved Engineering Techniques"),\
_("Increases construction speed"),\
_("All trucks upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_systech.ogg"
[RES_SY_CBSU2]
text = \
_("CB Sensor Improved"),\
_("Improved fire detection systems"),\
_("Extends CB Range"),\
_("All CB sensors upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_systech.ogg"
[RES_SY_VCBSTW1]
text = \
_("New Systems Tower Available"),\
_("VTOL CB Tower detects enemy indirect fire batteries"),\
_("Orders assigned VTOLs to attack the enemy batteries"),\
_("VTOLs attack until enemy battery is suppressed"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_systech.ogg"
[RES_SY_VCBSU2]
text = \
_("VTOL CB Improved"),\
_("Improved fire detection systems"),\
_("Extends VTOL CB Range"),\
_("All VTOL CB sensors upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_systech.ogg"
[RES_SY_VSTW1]
text = \
_("New Systems Tower Available"),\
_("VTOL Strike Tower detects approaching enemies"),\
_("Assigned VTOLs attack the enemy units"),\
_("Strike mission continues until enemy destroyed or they retreat"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_systech.ogg"
[RES_SY_VSTU1]
text = \
_("New Systems Turret Available"),\
_("VTOL Strike turret used to spot targets"),\
_("Assigned VTOLs attack the designated targets"),\
_("Select new targets to continue the VTOL strikes"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_systech.ogg"
[RES_SY_VS2]
text = \
_("VTOL Strike Improved"),\
_("Improved target recognition systems"),\
_("Extends VTOL Strike Range"),\
_("All VTOL Strike sensors upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_systech.ogg"
[RES_W_AAAC2]
text = \
_("AA Upgrade"),\
_("Self-guided rocket powered shells"),\
_("Increases AA accuracy"),\
_("All AA weapons upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_BMB3]
text = \
_("New Bomb Bay Available"),\
_("Drops incendiary bombs"),\
_("Best Targets: Bunkers and Hardpoints"),\
_("Body Points: Low"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_BAC2]
text = \
_("Bombsight Upgrade"),\
_("Laser designator paints and guides bombs to the target"),\
_("Increases Bombing accuracy"),\
_("All bomb bays upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_MG_ROF3]
text = \
_("Machinegun Upgrade"),\
_("Robotic advances make new chaingun upgrade available"),\
_("Increases Machinegun ROF"),\
_("All machineguns upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_M_AC2]
text = \
_("Mortar Upgrade"),\
_("Shells detect and home to thermal heat signatures"),\
_("Increases Mortar accuracy"),\
_("All mortars upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_RHOW]
text = \
_("New Indirect Fire Weapon Available"),\
_("105mm multi-barrel Howitzer may be assigned to a sensor"),\
_("Best Targets: Base Structures, infantry, wheeled vehicles"),\
_("Body Points: Low"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_MG4]
text = \
_("New Weapon Turret Available"),\
_("Multi-barrel, rapid-fire machinegun"),\
_("Best Targets: Infantry, base structures, wheeled vehicles"),\
_("Replaces all machineguns"),\
imdName = "MICAPSUL.pie"
sequenceName = "res_weapons.ogg"

File diff suppressed because it is too large Load Diff

View File

@ -1,182 +1,154 @@
RES_DF_HCW1
{
{
_("New Construction Options Available"),
_("Titanium-reinforced concrete"),
_("Enables Hardcrete walls"),
_("Defensive Strength: Medium"),
},
.imdName = "MICAPSUL.pie",
.imdName2 = NULL,
.sequenceName = "res_struttech.ogg",
.audioName = NULL,
};
RES_ST_VF
{
{
_("New Base Structure Available"),
_("VTOL factory enables VTOL production"),
_("VTOL rearming pads required to keep VTOLs flying"),
_("May be upgraded using factory modules"),
},
.imdName = "MICAPSUL.pie",
.imdName2 = NULL,
.sequenceName = "res_struttech.ogg",
.audioName = NULL,
};
RES_ST_VP
{
{
_("New Base Structure Available"),
_("Refuels, rearms and repairs VTOLs"),
_("Assign a VTOL by selecting the rearming pad as its target"),
_("The VTOL returns to the selected pad for rearming"),
},
.imdName = "MICAPSUL.pie",
.imdName2 = NULL,
.sequenceName = "res_struttech.ogg",
.audioName = NULL,
};
RES_REPTU1
{
{
_("New Systems Turret Available"),
_("Battlefield repair unit"),
_("Automatically Repairs Damaged Units"),
_("Or damaged units may be selected as target"),
},
.imdName = "MICAPSUL.pie",
.imdName2 = NULL,
.sequenceName = "res_systech.ogg",
.audioName = NULL,
};
RES_SENSO1
{
{
_("New Systems Turret Available For Design"),
_("Improved sensor range"),
_("Makes excellent scout vehicle"),
_("May be assigned as spotter for indirect fire weapons"),
},
.imdName = "MICAPSUL.pie",
.imdName2 = NULL,
.sequenceName = "res_systech.ogg",
.audioName = NULL,
};
RES_SY_STW1
{
{
_("New Systems Tower Available"),
_("Extended sensor range"),
_("Keeps map areas under constant surveillance"),
_("May be assigned as spotter for indirect fire weapons"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_systech.ogg",
.audioName = NULL,
};
RES_SY_SU1
{
{
_("Sensors Improved"),
_("New Thermal Emissions detection"),
_("Extends Sensor Range"),
_("All sensors upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_systech.ogg",
.audioName = NULL,
};
RES_SY_CBSTW1
{
{
_("New Systems Tower Available"),
_("Counter-battery tower detects enemy indirect fire batteries"),
_("Orders assigned indirect fire units to fire at the enemy batteries"),
_("Counter-battery fire continues until enemy battery is suppressed"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_systech.ogg",
.audioName = NULL,
};
RES_V_B09
{
{
_("Collective Heavy Body"),
_("More armor and body points than Python"),
_("Slower than Python"),
_("High power costs and slow to produce"),
},
.imdName = "MICAPSUL.pie",
.imdName2 = NULL,
.sequenceName = "res_droid.ogg",
.audioName = NULL,
};
RES_V_P_V1
{
{
_("New Propulsion Available for Design"),
_("Vertical Take Off and Landing Propulsion"),
_("Speed: VTOL"),
_("Body Points: Low"),
},
.imdName = "MICAPSUL.pie",
.imdName2 = NULL,
.sequenceName = "res_droid.ogg",
.audioName = NULL,
};
RES_W_SRK_AC3
{
{
_("Rocket Upgrade"),
_("Rocket detects and locks on to engine emissions"),
_("Increases Rocket accuracy"),
_("All rockets upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_RK_LTAT1
{
{
_("New Rocket Available"),
_("Anti-tank rocket"),
_("Best Targets: Vehicles"),
_("Body Points: Very Low"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_RK_HVAT1
{
{
_("New Rocket Available"),
_("High explosive shaped charge missile"),
_("Best Targets: Bunkers and hardpoints"),
_("Body Points: Very Low"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
RES_W_CNAC2
{
{
_("Cannon Upgrade"),
_("Laser designator paints and guides rounds to the target"),
_("Increases Cannon accuracy"),
_("All cannons upgraded automatically"),
},
.imdName = "MICAPSUL.PIE",
.imdName2 = NULL,
.sequenceName = "res_weapons.ogg",
.audioName = NULL,
};
[RES_DF_HCW1]
text = \
_("New Construction Options Available"),\
_("Titanium-reinforced concrete"),\
_("Enables Hardcrete walls"),\
_("Defensive Strength: Medium"),\
imdName = "MICAPSUL.pie"
sequenceName = "res_struttech.ogg"
[RES_ST_VF]
text = \
_("New Base Structure Available"),\
_("VTOL factory enables VTOL production"),\
_("VTOL rearming pads required to keep VTOLs flying"),\
_("May be upgraded using factory modules"),\
imdName = "MICAPSUL.pie"
sequenceName = "res_struttech.ogg"
[RES_ST_VP]
text = \
_("New Base Structure Available"),\
_("Refuels, rearms and repairs VTOLs"),\
_("Assign a VTOL by selecting the rearming pad as its target"),\
_("The VTOL returns to the selected pad for rearming"),\
imdName = "MICAPSUL.pie"
sequenceName = "res_struttech.ogg"
[RES_REPTU1]
text = \
_("New Systems Turret Available"),\
_("Battlefield repair unit"),\
_("Automatically Repairs Damaged Units"),\
_("Or damaged units may be selected as target"),\
imdName = "MICAPSUL.pie"
sequenceName = "res_systech.ogg"
[RES_SENSO1]
text = \
_("New Systems Turret Available For Design"),\
_("Improved sensor range"),\
_("Makes excellent scout vehicle"),\
_("May be assigned as spotter for indirect fire weapons"),\
imdName = "MICAPSUL.pie"
sequenceName = "res_systech.ogg"
[RES_SY_STW1]
text = \
_("New Systems Tower Available"),\
_("Extended sensor range"),\
_("Keeps map areas under constant surveillance"),\
_("May be assigned as spotter for indirect fire weapons"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_systech.ogg"
[RES_SY_SU1]
text = \
_("Sensors Improved"),\
_("New Thermal Emissions detection"),\
_("Extends Sensor Range"),\
_("All sensors upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_systech.ogg"
[RES_SY_CBSTW1]
text = \
_("New Systems Tower Available"),\
_("Counter-battery tower detects enemy indirect fire batteries"),\
_("Orders assigned indirect fire units to fire at the enemy batteries"),\
_("Counter-battery fire continues until enemy battery is suppressed"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_systech.ogg"
[RES_V_B09]
text = \
_("Collective Heavy Body"),\
_("More armor and body points than Python"),\
_("Slower than Python"),\
_("High power costs and slow to produce"),\
imdName = "MICAPSUL.pie"
sequenceName = "res_droid.ogg"
[RES_V_P_V1]
text = \
_("New Propulsion Available for Design"),\
_("Vertical Take Off and Landing Propulsion"),\
_("Speed: VTOL"),\
_("Body Points: Low"),\
imdName = "MICAPSUL.pie"
sequenceName = "res_droid.ogg"
[RES_W_SRK_AC3]
text = \
_("Rocket Upgrade"),\
_("Rocket detects and locks on to engine emissions"),\
_("Increases Rocket accuracy"),\
_("All rockets upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_RK_LTAT1]
text = \
_("New Rocket Available"),\
_("Anti-tank rocket"),\
_("Best Targets: Vehicles"),\
_("Body Points: Very Low"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_RK_HVAT1]
text = \
_("New Rocket Available"),\
_("High explosive shaped charge missile"),\
_("Best Targets: Bunkers and hardpoints"),\
_("Body Points: Very Low"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"
[RES_W_CNAC2]
text = \
_("Cannon Upgrade"),\
_("Laser designator paints and guides rounds to the target"),\
_("Increases Cannon accuracy"),\
_("All cannons upgraded automatically"),\
imdName = "MICAPSUL.PIE"
sequenceName = "res_weapons.ogg"

View File

@ -294,6 +294,8 @@ void gameTimeStop(void)
/* Call this to restart the game timer after a call to gameTimeStop */
void gameTimeStart(void)
{
// ASSERT(stopCount > 0, "Game started too many times.");
prevRealTime = wzGetTicks();
stopCount = std::max<int>(stopCount - 1, 0);
}

View File

@ -13,7 +13,6 @@ autorevision.h:
BUILT_SOURCES = \
autorevision.h \
message_parser.h \
scriptvals_parser.h
CLEANFILES = $(BUILT_SOURCES)
@ -91,7 +90,6 @@ noinst_HEADERS = \
mechanics.h \
messagedef.h \
message.h \
messagely.h \
miscimd.h \
missiondef.h \
mission.h \
@ -211,8 +209,6 @@ warzone2100_SOURCES = \
mapgrid.cpp \
mechanics.cpp \
message.cpp \
message_lexer.lpp \
message_parser.ypp \
miscimd.cpp \
mission.cpp \
move.cpp \

View File

@ -739,11 +739,11 @@ static bool intDisplaySeqTextViewPage(VIEW_REPLAY *psViewReplay,
for (sequence = *cur_seq, i = *cur_seqpage; sequence < psViewReplay->numSeq; sequence++)
{
SEQ_DISPLAY *psSeqDisplay = &psViewReplay->pSeqList[sequence];
for (; i < psSeqDisplay->numText; i++)
for (; i < psSeqDisplay->textMsg.size(); i++)
{
if (render)
{
cur_y = iV_DrawFormattedText(psSeqDisplay->ppTextMsg[i],
cur_y = iV_DrawFormattedText(psSeqDisplay->textMsg[i].toAscii().constData(),
x0 + TEXT_XINDENT,
cur_y, width, false);
}
@ -1385,7 +1385,7 @@ void intDisplayTEXTView(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, WZ_DEC
iV_SetTextColour(WZCOL_TEXT_BRIGHT);
//add each message
for (i = 0; i < ((VIEWDATA *)psMessage->pViewData)->numText; i++)
for (i = 0; i < ((VIEWDATA *)psMessage->pViewData)->textMsg.size(); i++)
{
//check haven't run out of room first!
if (i * linePitch > Form->height)
@ -1394,7 +1394,7 @@ void intDisplayTEXTView(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, WZ_DEC
return;
}
//need to check the string will fit!
iV_DrawText(_(((VIEWDATA *)psMessage->pViewData)->ppTextMsg[i]), x0 + TEXT_XINDENT,
iV_DrawText(_(((VIEWDATA *)psMessage->pViewData)->textMsg[i].toAscii().constData()), x0 + TEXT_XINDENT,
(ty + TEXT_YINDENT*3) + (i * linePitch));
}
}
@ -1406,25 +1406,23 @@ void addVideoText(SEQ_DISPLAY *psSeqDisplay, UDWORD sequence)
{
UDWORD i, x, y;
if (psSeqDisplay->numText > 0)
if (psSeqDisplay->textMsg.size() > 0)
{
debug( LOG_NEVER, "avt seq=%d [%s]\n", sequence, psSeqDisplay->ppTextMsg[0] );
//add each message, first at the top
// FIXME We should perhaps get font size, and use that to calculate offset(s) ?
x = VIDEO_TEXT_TOP_X;
y = VIDEO_TEXT_TOP_Y;
seq_AddTextForVideo(psSeqDisplay->ppTextMsg[0], x, y, TEXT_START_FRAME, TEXT_END_FRAME, SEQ_TEXT_POSITION); //startframe endFrame
seq_AddTextForVideo(psSeqDisplay->textMsg[0].toAscii().constData(), x, y, TEXT_START_FRAME, TEXT_END_FRAME, SEQ_TEXT_POSITION); //startframe endFrame
//add each message, the rest at the bottom
x = VIDEO_TEXT_BOTTOM_X;
// calculate the real bottom... NOTE, game assumes all videos to be 640x480
y = (double)pie_GetVideoBufferHeight() / 480. * (double)VIDEO_TEXT_BOTTOM_Y;
i = 1;
while (i < psSeqDisplay->numText)
while (i < psSeqDisplay->textMsg.size())
{
seq_AddTextForVideo(psSeqDisplay->ppTextMsg[i], x, y, TEXT_START_FRAME, TEXT_END_FRAME, SEQ_TEXT_POSITION); //startframe endFrame
seq_AddTextForVideo(psSeqDisplay->textMsg[i].toAscii().constData(), x, y, TEXT_START_FRAME, TEXT_END_FRAME, SEQ_TEXT_POSITION); //startframe endFrame
//initialise after the first setting
x = y = 0;
i++;

View File

@ -25,6 +25,7 @@
*/
#include "lib/framework/frame.h"
#include "lib/framework/wzconfig.h"
#include "lib/framework/frameresource.h"
#include "lib/framework/strres.h"
#include "lib/sound/audio.h"
@ -32,7 +33,6 @@
#include "console.h"
#include "hci.h"
#include "messagely.h"
#include "stats.h"
#include "text.h"
@ -486,12 +486,7 @@ VIEWDATA *loadViewData(const char *pViewMsgData, UDWORD bufferSize)
}
//allocate space for the data
psViewData = (VIEWDATA *)malloc(numData * sizeof(VIEWDATA));
if (psViewData == NULL)
{
ASSERT(false, "Unable to allocate memory for viewdata");
return NULL;
}
psViewData = new VIEWDATA[numData];
//add to array list
addToViewDataList(psViewData, (UBYTE)numData);
@ -504,8 +499,9 @@ VIEWDATA *loadViewData(const char *pViewMsgData, UDWORD bufferSize)
UDWORD numText;
int readint;
memset(psViewData, 0, sizeof(VIEWDATA));
psViewData->pData = NULL;
psViewData->pName = NULL;
psViewData->type = VIEW_SIZE;
name[0] = '\0';
//read the data into the storage - the data is delimeted using comma's
@ -518,7 +514,6 @@ VIEWDATA *loadViewData(const char *pViewMsgData, UDWORD bufferSize)
ASSERT(false, "too many text strings");
return NULL;
}
psViewData->numText=(UBYTE)numText;
//allocate storage for the name
psViewData->pName = strdup(name);
@ -529,26 +524,18 @@ VIEWDATA *loadViewData(const char *pViewMsgData, UDWORD bufferSize)
}
debug(LOG_MSG, "Loaded %s", psViewData->pName);
//allocate space for text strings
if (psViewData->numText)
{
psViewData->ppTextMsg = (char const **)malloc(psViewData->numText * sizeof(char *));
}
//read in the data for the text strings
for (dataInc = 0; dataInc < psViewData->numText; dataInc++)
for (dataInc = 0; dataInc < numText; dataInc++)
{
name[0] = '\0';
sscanf(pViewMsgData,",%255[^,'\r\n]%n",name,&cnt);
pViewMsgData += cnt;
// Get the string from the ID string
psViewData->ppTextMsg[dataInc] = strresGetString(psStringRes, name);
if (!psViewData->ppTextMsg[dataInc])
{
ASSERT(!"Cannot find string resource", "Cannot find the view data string with id \"%s\"", name);
return NULL;
}
const char *str = strresGetString(psStringRes, name);
ASSERT(str, "Cannot find the view data string with id \"%s\"", name);
QString qstr = QString::fromUtf8(str);
psViewData->textMsg.push_back(qstr);
}
sscanf(pViewMsgData, ",%d%n", &readint, &cnt);
@ -635,12 +622,13 @@ VIEWDATA *loadViewData(const char *pViewMsgData, UDWORD bufferSize)
psViewReplay->numSeq = (UBYTE)count;
//allocate space for the sequences
psViewReplay->pSeqList = (SEQ_DISPLAY*) malloc(psViewReplay->numSeq *
sizeof(SEQ_DISPLAY));
psViewReplay->pSeqList = new SEQ_DISPLAY[psViewReplay->numSeq];
//read in the data for the sequences
for (dataInc = 0; dataInc < psViewReplay->numSeq; dataInc++)
{
int numText = 0;
name[0] = '\0';
//load extradat for extended type only
if (psViewData->type == VIEW_RPL)
@ -652,9 +640,9 @@ VIEWDATA *loadViewData(const char *pViewMsgData, UDWORD bufferSize)
ASSERT(false, "too many strings for %s", psViewData->pName);
return NULL;
}
psViewReplay->pSeqList[dataInc].numText = (UBYTE)count;
//set the flag to default
psViewReplay->pSeqList[dataInc].flag = 0;
numText = count;
}
else //extended type
{
@ -672,32 +660,22 @@ VIEWDATA *loadViewData(const char *pViewMsgData, UDWORD bufferSize)
ASSERT(false, "too many text strings for seq for %s", psViewData->pName);
return NULL;
}
psViewReplay->pSeqList[dataInc].numText = (UBYTE)count2;
numText = count2;
}
strcpy(psViewReplay->pSeqList[dataInc].sequenceName,name);
//get the text strings for this sequence - if any
//allocate space for text strings
if (psViewReplay->pSeqList[dataInc].numText)
{
psViewReplay->pSeqList[dataInc].ppTextMsg = (const char **) malloc(
psViewReplay->pSeqList[dataInc].numText * sizeof(char *));
}
//read in the data for the text strings
for (seqInc = 0; seqInc < psViewReplay->pSeqList[dataInc].numText;
seqInc++)
for (seqInc = 0; seqInc < numText; seqInc++)
{
name[0] = '\0';
sscanf(pViewMsgData,",%255[^,'\r\n]%n", name,&cnt);
pViewMsgData += cnt;
// Get the string from the ID string
psViewReplay->pSeqList[dataInc].ppTextMsg[seqInc] = strresGetString(psStringRes, name);
if (!psViewReplay->pSeqList[dataInc].ppTextMsg[seqInc])
{
ASSERT(!"Cannot find string resource", "Cannot find the view data string with id \"%s\"", name);
return NULL;
}
const char *str = strresGetString(psStringRes, name);
ASSERT(str, "Cannot find the view data string with id \"%s\"", name);
QString qstr = QString::fromUtf8(str);
psViewReplay->pSeqList[dataInc].textMsg.push_back(qstr);
}
//get the audio text string
sscanf(pViewMsgData,",%255[^,'\r\n],%d%n", audioName, &dummy, &cnt);
@ -805,26 +783,53 @@ VIEWDATA *loadViewData(const char *pViewMsgData, UDWORD bufferSize)
VIEWDATA* loadResearchViewData(const char* fileName)
{
bool retval;
lexerinput_t input;
VIEWDATA* psViewData;
ASSERT_OR_RETURN(NULL, PHYSFS_exists(fileName), "%s not found", fileName);
WzConfig ini(fileName);
ASSERT_OR_RETURN(NULL, ini.status() == QSettings::NoError, "%s not loaded", fileName);
input.type = LEXINPUT_PHYSFS;
input.input.physfsfile = PHYSFS_openRead(fileName);
debug(LOG_WZ, "Reading...[directory: %s] %s", PHYSFS_getRealDir(fileName), fileName);
if (!input.input.physfsfile)
QStringList list = ini.childGroups();
VIEWDATA *psViewData = new VIEWDATA[list.size()];
for (int i = 0; i < list.size(); ++i)
{
debug(LOG_ERROR, "PHYSFS_openRead(\"%s\") failed with error: %s\n", fileName, PHYSFS_getLastError());
return NULL;
VIEWDATA *v = &psViewData[i];
VIEW_RESEARCH *r = (VIEW_RESEARCH *)malloc(sizeof(*r));
v->pData = NULL;
v->pName = strdup(list[i].toUtf8().constData());
memset(r, 0, sizeof(*r));
ini.beginGroup(list[i]);
v->textMsg = ini.value("text").toStringList();
for (int j = 0; j < v->textMsg.size(); j++)
{
v->textMsg[j].remove('\t');
v->textMsg[j].remove(0, 2); // initial _(
v->textMsg[j].remove(v->textMsg[j].length() - 1, 1); // final )
}
v->type = VIEW_RES;
v->pData = r;
if (ini.contains("imdName"))
{
r->pIMD = (iIMDShape *) resGetData("IMD", ini.value("imdName").toString().toUtf8().constData());
}
if (ini.contains("imdName2"))
{
r->pIMD2 = (iIMDShape *) resGetData("IMD", ini.value("imdName2").toString().toUtf8().constData());
}
if (ini.contains("sequenceName"))
{
sstrcpy(r->sequenceName, ini.value("sequenceName").toString().toUtf8().constData());
}
if (ini.contains("audioName"))
{
r->pAudio = strdup(ini.value("audioName").toString().toUtf8().constData());
}
ini.endGroup();
}
message_set_extra(&input);
retval = (message_parse(&psViewData) == 0);
message_lex_destroy();
PHYSFS_close(input.input.physfsfile);
return retval ? psViewData : NULL;
addToViewDataList(psViewData, list.size());
return psViewData;
}
/*get the view data identified by the name */
@ -912,12 +917,6 @@ void viewDataShutDown(VIEWDATA *psViewData)
free(psViewData->pName);
//free the space allocated for the text messages
if (psViewData->numText)
{
free(psViewData->ppTextMsg);
}
//free the space allocated for multiple sequences
if (psViewData->type == VIEW_RPL)
{
@ -927,17 +926,12 @@ void viewDataShutDown(VIEWDATA *psViewData)
unsigned int seqInc;
for (seqInc = 0; seqInc < psViewReplay->numSeq; ++seqInc)
{
//free the space allocated for the text messages
if (psViewReplay->pSeqList[seqInc].numText)
{
free(psViewReplay->pSeqList[seqInc].ppTextMsg);
}
if (psViewReplay->pSeqList[seqInc].pAudio)
{
free(psViewReplay->pSeqList[seqInc].pAudio);
}
}
free(psViewReplay->pSeqList);
delete[] psViewReplay->pSeqList;
}
}
else if (psViewData->type == VIEW_RES)
@ -950,7 +944,7 @@ void viewDataShutDown(VIEWDATA *psViewData)
}
free(psViewData->pData);
}
free(psList->psViewData);
delete[] psList->psViewData;
// remove viewData list from the list
*psPrev = psList->psNext;
@ -993,12 +987,9 @@ void displayProximityMessage(PROXIMITY_DISPLAY *psProxDisp)
VIEW_PROXIMITY *psViewProx = (VIEW_PROXIMITY *)psViewData->pData;
//display text - if any
if (psViewData->ppTextMsg)
if (psViewData->textMsg.size() > 0 && psViewData->type != VIEW_BEACON)
{
if (psViewData->type != VIEW_BEACON)
{
addConsoleMessage(psViewData->ppTextMsg[0], DEFAULT_JUSTIFY, SYSTEM_MESSAGE);
}
addConsoleMessage(psViewData->textMsg[0].toAscii().constData(), DEFAULT_JUSTIFY, SYSTEM_MESSAGE);
}
//play message - if any

View File

@ -1,159 +0,0 @@
/*
This file is part of Warzone 2100.
Copyright (C) 1999-2004 Eidos Interactive
Copyright (C) 2008 Giel van Schijndel
Copyright (C) 2005-2011 Warzone 2100 Project
Warzone 2100 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Warzone 2100 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Warzone 2100; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
%{
/** @file
*
* Lexical analyser for message data
*/
#include "lib/framework/frame.h"
#include "src/messagedef.h"
/* Get the Yacc definitions */
#if defined (WZ_CC_MSVC)
#include "message_parser.hpp"
#else
#include "message_parser.h"
#endif
#include "lib/framework/lexer_input.h"
#include "src/messagely.h"
// fwrite declared with warn_unused_result, resulting in mysterious errors in "%%" on some distros.
static inline bool no_warn_unused_result(int ignore) { if (ignore) {} return true; }
#define fwrite(a, b, c, d) no_warn_unused_result(fwrite(a, b, c, d))
#ifndef yyextra
# define yyextra yyget_extra()
#endif
/* Older GNU Flex versions don't define yyget_extra(), yyset_extra(),
* yyget_text() and yyget_lineno().
* (and neither define a subminor version)
*/
#if !defined(YY_FLEX_SUBMINOR_VERSION) || (YY_FLEX_SUBMINOR_VERSION < 9)
# define yyget_extra message_get_extra
# define yyset_extra message_set_extra
# define yyget_lineno message_get_lineno
# define yyget_text message_get_text
extern void yyset_extra(YY_EXTRA_TYPE user_defined);
extern YY_EXTRA_TYPE yyget_extra(void);
extern int yyget_lineno(void);
int yyget_lineno()
{
return yylineno;
}
extern char* yyget_text(void);
char* yyget_text()
{
return yytext;
}
#elif defined(YY_FLEX_SUBMINOR_VERSION) && YY_FLEX_SUBMINOR_VERSION == 33
extern YY_EXTRA_TYPE yyget_extra(void);
extern int message_get_lineno(void);
extern FILE *message_get_in(void);
extern FILE *message_get_out(void);
extern int message_get_leng(void);
extern char *message_get_text(void);
extern void message_set_lineno(int line_number);
extern void message_set_in(FILE* in_str);
extern void message_set_out(FILE* out_str);
extern int message_get_debug(void);
extern void message_set_debug(int bdebug);
#endif
%}
%option yylineno noyywrap nounput never-interactive
%option prefix="message_"
%x COMMENT
%x QUOTE
%x SLCOMMENT
%%
NULL { message_lval.sval = NULL; return NULL_T; }
\.audioName { return AUDIO_NAME_T; }
\.imdName2 { return IMD_NAME2_T; }
\.imdName { return IMD_NAME_T; }
\.sequenceName { return SEQUENCE_NAME_T; }
/* Match text values */
[a-zA-Z][-0-9_a-zA-Z]* {
message_lval.sval = strdup(yytext);
return TEXT_T;
}
/* Match quoted text */
\" { BEGIN QUOTE; }
<QUOTE>\" { BEGIN 0; }
<QUOTE>\n { message_error("Unexpected end of line in string"); }
<QUOTE>[^\"\n]* {
message_lval.sval = strdup(yytext);
return QTEXT_T;
}
/* Skip white space */
[ \t\n\x0d\x0a] ;
/* Strip comments */
"/*" { BEGIN COMMENT; }
<COMMENT>"*/" |
<COMMENT>"*/"\n { BEGIN 0; }
<COMMENT>. |
<COMMENT>\n ;
/* Strip single line comments */
"//" { BEGIN SLCOMMENT; }
<SLCOMMENT>\n { BEGIN 0; }
<SLCOMMENT>[^\n]* ;
/* Match anything that's been missed and pass it as a char */
. return yytext[0];
%%
static YY_EXTRA_TYPE pBuffer = NULL;
void yyset_extra(YY_EXTRA_TYPE user_defined)
{
pBuffer = user_defined;
}
YY_EXTRA_TYPE yyget_extra()
{
return pBuffer;
}
/* Older GNU Flex versions don't define yylex_destroy()
* (and neither define a subminor version)
*/
#if !defined(YY_FLEX_SUBMINOR_VERSION) || (YY_FLEX_SUBMINOR_VERSION < 9)
int message_lex_destroy(void)
{
/* For non-reentrant C scanner only. */
yy_delete_buffer(YY_CURRENT_BUFFER);
yy_init = 1;
return 0;
}
#endif

View File

@ -1,408 +0,0 @@
/*
This file is part of Warzone 2100.
Copyright (C) 2008 Giel van Schijndel
Copyright (C) 2008-2011 Warzone 2100 Project
Warzone 2100 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Warzone 2100 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Warzone 2100; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
%defines
%{
/** @file
*
* Parser for message data
*/
#include "lib/framework/frame.h"
#include "lib/framework/strres.h"
#include "lib/framework/frameresource.h"
#include "src/message.h"
#include "src/messagedef.h"
#include "src/messagely.h"
#include "src/text.h"
extern void yyerror(const char* msg);
void yyerror(const char* msg)
{
debug(LOG_ERROR, "SMSG file parse error:\n%s at line %d\nText: '%s'", msg, message_get_lineno(), message_get_text());
}
struct TEXT_MESSAGE
{
char * str;
TEXT_MESSAGE *psNext;
};
static void freeTextMessageList(TEXT_MESSAGE* list)
{
while (list)
{
TEXT_MESSAGE* const toDelete = list;
list = list->psNext;
free(toDelete->str);
free(toDelete);
}
}
struct VIEWDATAMESSAGE
{
VIEWDATA view;
struct VIEWDATAMESSAGE* psNext;
};
static void freeViewDataMessageList(VIEWDATAMESSAGE* list)
{
while (list)
{
VIEWDATAMESSAGE* const toDelete = list;
list = list->psNext;
free(toDelete->view.pName);
free(toDelete->view.ppTextMsg);
switch (toDelete->view.type)
{
case VIEW_RES:
{
VIEW_RESEARCH* const psViewRes = (VIEW_RESEARCH *)toDelete->view.pData;
if (psViewRes->pAudio)
free(psViewRes->pAudio);
free(psViewRes);
break;
}
default:
ASSERT(!"Unhandled view data type", "Unhandled view data type %u", toDelete->view.type);
}
free(toDelete);
}
}
#define YYPARSE_PARAM ppsViewData
%}
%name-prefix="message_"
%union {
char* sval;
struct VIEWDATAMESSAGE* viewdatamsg;
struct TEXT_MESSAGE* txtmsg;
VIEW_TYPE viewtype;
VIEW_RESEARCH* researchdata;
struct
{
const char** stringArray;
unsigned int count;
} msg_list;
}
/* value tokens */
%token <sval> TEXT_T
%token <sval> QTEXT_T NULL_T /* Text with double quotes surrounding it */
%token <viewtype> VIEW_T_RES VIEW_T_RPL VIEW_T_PROX VIEW_T_RPLX VIEW_T_BEACON
%token IMD_NAME_T IMD_NAME2_T SEQUENCE_NAME_T AUDIO_NAME_T
// Rule types
%type <txtmsg> text_message text_messages
%type <msg_list> message_list
%type <sval> optional_string imd_name imd_name2 sequence_name audio_name
%type <researchdata> research_message
%type <viewdatamsg> all_messages message
%destructor {
#ifndef WZ_OS_WIN
// Force type checking by the compiler
char * const s = $$;
if (s)
free(s);
#endif
} TEXT_T QTEXT_T optional_string imd_name imd_name2 sequence_name audio_name
%destructor {
freeTextMessageList($$);
} text_message text_messages;
%destructor {
// Force type checking by the compiler
VIEW_RESEARCH* const r = $$;
if (r)
{
if (r->pAudio)
free(r->pAudio);
free(r);
}
} research_message
%destructor {
freeViewDataMessageList($$);
} all_messages message
%%
file: all_messages
{
unsigned int numData = 0, i;
VIEWDATAMESSAGE* curMsg;
VIEWDATA* psViewData;
for (curMsg = $1; curMsg != NULL; curMsg = curMsg->psNext)
{
++numData;
}
ASSERT(numData <= UBYTE_MAX, "loadViewData: Didn't expect %d (or more) viewData messages (got %u)!", UBYTE_MAX, numData);
if (numData > UBYTE_MAX)
{
freeViewDataMessageList($1);
YYABORT;
}
psViewData = (VIEWDATA *)malloc(numData * sizeof(*psViewData));
if (psViewData == NULL)
{
debug(LOG_ERROR, "Out of memory");
abort();
freeViewDataMessageList($1);
YYABORT;
}
curMsg = $1;
for (i = 0; i < numData; ++i)
{
VIEWDATAMESSAGE* const toMove = curMsg;
assert(toMove != NULL);
curMsg = curMsg->psNext;
memcpy(&psViewData[i], &toMove->view, sizeof(psViewData[i]));
free(toMove);
}
addToViewDataList(psViewData, numData);
*(VIEWDATA**)ppsViewData = psViewData;
}
;
all_messages: message
| message all_messages
{
$1->psNext = $2;
$$ = $1;
}
;
message: TEXT_T '{' message_list ',' research_message '}' ';'
{
$$ = (VIEWDATAMESSAGE *)malloc(sizeof(*$$));
if ($$ == NULL)
{
debug(LOG_ERROR, "Out of memory");
abort();
free($1);
free($3.stringArray);
if ($5)
free($5->pAudio);
free($5);
YYABORT;
}
$$->view.pName = $1;
$$->view.numText = $3.count;
$$->view.ppTextMsg = $3.stringArray;
$$->view.type = VIEW_RES;
$$->view.pData = $5;
$$->psNext = NULL;
}
;
research_message: imd_name ',' imd_name2 ',' sequence_name ',' audio_name ','
{
$$ = (VIEW_RESEARCH *)malloc(sizeof(*$$));
if ($$ == NULL)
{
debug(LOG_ERROR, "Out of memory");
abort();
free($1);
free($3);
free($5);
free($7);
YYABORT;
}
$$->pAudio = $7;
sstrcpy($$->sequenceName, $5);
// Get rid of our tokens ASAP (so that the free() lists on errors become shorter)
free($5);
$$->pIMD = (iIMDShape *) resGetData("IMD", $1);
if ($$->pIMD == NULL)
{
ASSERT(LOG_ERROR, "Cannot find PIE \"%s\"", $1);
free($1);
free($3);
YYABORT;
}
free($1);
if ($3)
{
$$->pIMD2 = (iIMDShape *) resGetData("IMD", $3);
if ($$->pIMD2 == NULL)
{
ASSERT(false, "Cannot find 2nd PIE \"%s\"", $3);
free($3);
YYABORT;
}
free($3);
}
else
{
$$->pIMD2 = NULL;
}
}
;
imd_name: IMD_NAME_T '=' QTEXT_T { $$ = $3; }
| QTEXT_T
;
imd_name2: IMD_NAME2_T '=' optional_string { $$ = $3; }
| optional_string
;
sequence_name: SEQUENCE_NAME_T '=' QTEXT_T { $$ = $3; }
| QTEXT_T
;
audio_name: AUDIO_NAME_T '=' optional_string { $$ = $3; }
| optional_string
;
optional_string: QTEXT_T
| NULL_T
;
message_list: '{' text_messages '}'
{
size_t bytes = 0;
unsigned int i;
TEXT_MESSAGE* psCur;
char* stringStart;
$$.count = 0;
// Compute the required space for all strings and an array of pointers to hold it
for (psCur = $2; psCur != NULL; psCur = psCur->psNext)
{
++$$.count;
bytes += sizeof(char*) + strlen(psCur->str) + 1;
}
ASSERT($$.count <= MAX_DATA, "Too many text strings (%u) provided, with %u as maximum", $$.count, (unsigned int)MAX_DATA);
if ($$.count > MAX_DATA)
{
YYABORT;
}
if ($$.count)
{
$$.stringArray = (char const **)malloc(bytes);
if ($$.stringArray == NULL)
{
debug(LOG_ERROR, "Out of memory");
abort();
freeTextMessageList($2);
YYABORT;
}
stringStart = (char*)&$$.stringArray[$$.count];
for (psCur = $2, i = 0;
stringStart && psCur != NULL && i < $$.count;
psCur = psCur->psNext, ++i)
{
assert(&stringStart[strlen(psCur->str)] - (char*)$$.stringArray < bytes);
$$.stringArray[i] = strcpy(stringStart, psCur->str);
stringStart = &stringStart[strlen(psCur->str) + 1];
}
}
else
{
$$.stringArray = NULL;
}
// Clean up our tokens
freeTextMessageList($2);
}
;
text_messages: text_message
/* Allow trailing commas */
| text_message ','
| text_message ',' text_messages
{
$1->psNext = $3;
$$ = $1;
}
;
text_message: TEXT_T
{
const char * const msg = strresGetString(psStringRes, $1);
if (!msg)
{
ASSERT(!"Cannot find string resource", "Cannot find the view data string with id \"%s\"", $1);
free($1);
YYABORT;
}
$$ = (TEXT_MESSAGE *)malloc(sizeof(*$$));
if ($$ == NULL)
{
debug(LOG_ERROR, "Out of memory");
abort();
free($1);
YYABORT;
}
$$->str = $1;
$$->psNext = NULL;
}
| QTEXT_T
{
$$ = (TEXT_MESSAGE *)malloc(sizeof(*$$));
if ($$ == NULL)
{
debug(LOG_ERROR, "Out of memory");
abort();
free($1);
YYABORT;
}
$$->str = $1;
$$->psNext = NULL;
}
| '_' '(' QTEXT_T ')'
{
$$ = (TEXT_MESSAGE *)malloc(sizeof(*$$));
if ($$ == NULL)
{
debug(LOG_ERROR, "Out of memory");
abort();
free($3);
YYABORT;
}
$$->str = $3;
$$->psNext = NULL;
}
;

View File

@ -24,6 +24,7 @@
#ifndef __INCLUDED_MESSAGEDEF_H__
#define __INCLUDED_MESSAGEDEF_H__
#include <QtCore/QStringList>
#include "lib/ivis_opengl/pietypes.h"
#include "lib/ivis_opengl/ivisdef.h"
#include "positiondef.h"
@ -50,6 +51,7 @@ enum VIEW_TYPE
VIEW_RPLX, // full screen view sequence - flic. extended format
VIEW_BEACON, // Beacon message
VIEW_SIZE
};
enum PROX_TYPE
@ -75,9 +77,7 @@ struct SEQ_DISPLAY
char sequenceName[MAX_STR_LENGTH];
UBYTE flag; //flag data to control video playback 1 = loop till audio finish
UBYTE numText; //the number of textmessages associated with
//this sequence
const char** ppTextMsg; //Pointer to text messages - if any
QStringList textMsg; //Text messages - if any
char *pAudio; /*name of audio track to play (for this seq)*/
};
@ -104,8 +104,7 @@ struct VIEWDATA
{
char *pName; //name ID of the message - used for loading in and identifying
VIEW_TYPE type; //the type of view
UBYTE numText; //the number of textmessages associated with this data
const char** ppTextMsg; //Pointer to text messages - if any
QStringList textMsg; //Text messages, if any
void* pData; /*the data required to view - either a
VIEW_RESEARCH, VIEW_PROXIMITY or VIEW_REPLAY*/
};

View File

@ -1,36 +0,0 @@
/*
This file is part of Warzone 2100.
Copyright (C) 2008 Giel van Schijndel
Copyright (C) 2008-2011 Warzone 2100 Project
Warzone 2100 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Warzone 2100 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Warzone 2100; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __INCLUDED_SRC_MESSAGELY_H__
#define __INCLUDED_SRC_MESSAGELY_H__
#include "lib/framework/lexer_input.h"
extern int message_parse(void* ppsViewData);
extern void message_set_extra(YY_EXTRA_TYPE user_defined);
extern int message_lex_destroy(void);
extern int message_lex(void);
extern int message_get_lineno(void);
extern char* message_get_text(void);
extern void message_error(const char* msg);
#endif // __INCLUDED_SRC_MESSAGELY_H__

View File

@ -1153,7 +1153,7 @@ void researchResult(UDWORD researchIndex, UBYTE player, bool bDisplay, STRUCTURE
//add console text message
if (pResearch->pViewData != NULL)
{
snprintf(consoleMsg, MAX_RESEARCH_MSG_SIZE, _("Research completed: %s"), _(*pResearch->pViewData->ppTextMsg));
snprintf(consoleMsg, MAX_RESEARCH_MSG_SIZE, _("Research completed: %s"), _(pResearch->pViewData->textMsg[0].toUtf8().constData()));
addConsoleMessage(consoleMsg, LEFT_JUSTIFY, SYSTEM_MESSAGE);
}
else

View File

@ -9422,17 +9422,12 @@ VIEWDATA *CreateBeaconViewData(SDWORD sender, UDWORD LocX, UDWORD LocY)
memset(psViewData, 0, sizeof(VIEWDATA));
psViewData->numText = 1;
//store name
sprintf(name, _("Beacon %d"), sender);
psViewData->pName = name;
//allocate space for text strings
psViewData->ppTextMsg = (const char **) malloc(sizeof(char *));
//store text message, hardcoded for now
psViewData->ppTextMsg[0] = strdup(getPlayerName(sender));
psViewData->textMsg.push_back(getPlayerName(sender));
//store message type
psViewData->type = VIEW_BEACON;