Instalar Steam
iniciar sesión
|
idioma
简体中文 (chino simplificado)
繁體中文 (chino tradicional)
日本語 (japonés)
한국어 (coreano)
ไทย (tailandés)
Български (búlgaro)
Čeština (checo)
Dansk (danés)
Deutsch (alemán)
English (inglés)
Español de Hispanoamérica
Ελληνικά (griego)
Français (francés)
Italiano
Bahasa Indonesia (indonesio)
Magyar (húngaro)
Nederlands (holandés)
Norsk (noruego)
Polski (polaco)
Português (Portugués de Portugal)
Português-Brasil (portugués de Brasil)
Română (rumano)
Русский (ruso)
Suomi (finés)
Svenska (sueco)
Türkçe (turco)
Tiếng Việt (vietnamita)
Українська (ucraniano)
Comunicar un error de traducción
============
Hi :),
I am French, so I will do a slightly improved "translate.google".
I tested your code. Seeing that my game is in French, with my little test, I have this return on this line of code:
----
Code :
GridTerminalSystem.GetBlocksOfType<IMyProjector>(list);
if (list.Count > 0)
monImprimante.debugTextSurface.WriteText(((IMyProjector)list[0]).DetailedInfo);
----
Back :
Modèle: Projecteur
Apport Max requis: 100 W
WARNING! Projection out of bounds!
Build progress: 0/318
Blocks remaining:
Armor blocks: 276
Propulseurs Atmosphérique: 18
Conteneur de Marchandises Moyen: 2
Connecteur: 1
Batterie: 4
Balise: 1
Coin léger: 8
Train d'atterrissage: 1
Gyroscope: 3
Cockpit de chasseur: 1
Projecteur: 2
Foreuse: 1
----
Of course, your code does not work.
But I have a solution, these lines on the other hand return a dictionary of type of block and a quantity (one can like your "parse"):
----
Code :
GridTerminalSystem.GetBlocksOfType<IMyProjector>(list);
if (list.Count > 0)
{
monImprimante.debugTextSurface.WriteText("RemainingArmorBlocks : " + ((IMyProjector)list[0]).RemainingArmorBlocks.ToString() + "\n", false);
var dicRB_PerType = ((IMyProjector)list[0]).RemainingBlocksPerType;
foreach (var itemToPrint in dicRB_PerType)
{
monImprimante.debugTextSurface.WriteText(itemToPrint.Key.ToString() + "/" + itemToPrint.Value.ToString() + "\n", true);
}
}
Back :
RemainingArmorBlocks : 276
MyObjectBuilder_Thrust/SmallBlockSmallAtmosphericThrust/18
MyObjectBuilder_CargoContainer/SmallBlockMediumContainer/2
MyObjectBuilder_ShipConnector/ConnectorMedium/1
MyObjectBuilder_BatteryBlock/SmallBlockBatteryBlock/4
MyObjectBuilder_Beacon/SmallBlockBeacon/1
MyObjectBuilder_InteriorLight/SmallBlockLight_1corner/8
MyObjectBuilder_LandingGear/SmallBlockLandingGear/1
MyObjectBuilder_Gyro/SmallBlockGyro/3
MyObjectBuilder_Cockpit/DBSmallBlockFighterCockpit/1
MyObjectBuilder_ReflectorLight/SmallBlockFrontLight/2
MyObjectBuilder_Drill/SmallBlockDrill/1
----
On the other hand, except for "ToString" I did not get much from the "VRage.Game.MyDefinitionBase" class, and I also did not find how to differentiate heavy armor blocks from light armor blocks (or even sides of the sides).
So I have two questions:
1) I'm looking for a "ship printer". Can I reuse your code to develop my printer ?
2) Do you think you are changing your code to make it internationalizable ?
thank you in advance :)
====
Fr version :
============
Salut :),
Je suis français, donc je vais faire un "translate.google" légèrement amélioré.
J'ai tester ton code, je cherche de mon coté à faire une "imprimante à vaisseau". Vue que mon jeu est en français, avec mon petit test, j'ai ce retour sur cette ligne de code :
----
Code :
GridTerminalSystem.GetBlocksOfType<IMyProjector>(list);
if (list.Count > 0)
monImprimante.debugTextSurface.WriteText(((IMyProjector)list[0]).DetailedInfo);
----
Retour :
Modèle: Projecteur
Apport Max requis: 100 W
WARNING! Projection out of bounds!
Build progress: 0/318
Blocks remaining:
Armor blocks: 276
Propulseurs Atmosphérique: 18
Conteneur de Marchandises Moyen: 2
Connecteur: 1
Batterie: 4
Balise: 1
Coin léger: 8
Train d'atterrissage: 1
Gyroscope: 3
Cockpit de chasseur: 1
Projecteur: 2
Foreuse: 1
----
Forcément, ton code ne fonctionne pas.
Mais j'ai une solution, cette ligne par contre retourne un dictionnaire de type de bloc et une quantité (un peut comme ton "parse") :
----
Code :
GridTerminalSystem.GetBlocksOfType<IMyProjector>(list);
if (list.Count > 0)
{
monImprimante.debugTextSurface.WriteText("RemainingArmorBlocks : " + ((IMyProjector)list[0]).RemainingArmorBlocks.ToString() + "\n", false);
var dicRB_PerType = ((IMyProjector)list[0]).RemainingBlocksPerType;
foreach (var itemToPrint in dicRB_PerType)
{
monImprimante.debugTextSurface.WriteText(itemToPrint.Key.ToString() + "/" + itemToPrint.Value.ToString() + "\n", true);
}
}
RemainingArmorBlocks : 276
MyObjectBuilder_Thrust/SmallBlockSmallAtmosphericThrust/18
MyObjectBuilder_CargoContainer/SmallBlockMediumContainer/2
MyObjectBuilder_ShipConnector/ConnectorMedium/1
MyObjectBuilder_BatteryBlock/SmallBlockBatteryBlock/4
MyObjectBuilder_Beacon/SmallBlockBeacon/1
MyObjectBuilder_InteriorLight/SmallBlockLight_1corner/8
MyObjectBuilder_LandingGear/SmallBlockLandingGear/1
MyObjectBuilder_Gyro/SmallBlockGyro/3
MyObjectBuilder_Cockpit/DBSmallBlockFighterCockpit/1
MyObjectBuilder_ReflectorLight/SmallBlockFrontLight/2
MyObjectBuilder_Drill/SmallBlockDrill/1
----
Retour :
RemainingArmorBlocks : 276
MyObjectBuilder_Thrust/SmallBlockSmallAtmosphericThrust/18
MyObjectBuilder_CargoContainer/SmallBlockMediumContainer/2
MyObjectBuilder_ShipConnector/ConnectorMedium/1
MyObjectBuilder_BatteryBlock/SmallBlockBatteryBlock/4
MyObjectBuilder_Beacon/SmallBlockBeacon/1
MyObjectBuilder_InteriorLight/SmallBlockLight_1corner/8
MyObjectBuilder_LandingGear/SmallBlockLandingGear/1
MyObjectBuilder_Gyro/SmallBlockGyro/3
MyObjectBuilder_Cockpit/DBSmallBlockFighterCockpit/1
MyObjectBuilder_ReflectorLight/SmallBlockFrontLight/2
MyObjectBuilder_Drill/SmallBlockDrill/1
----
Du coup j'ai deux questions :
Puis-je réutilisé ton code pour développer mon imprimante ?
Pense tu modifier ton code pour le rendre internationalisable ?
Merci d'avance :)
============