Instal Steam
login
|
bahasa
简体中文 (Tionghoa Sederhana)
繁體中文 (Tionghoa Tradisional)
日本語 (Bahasa Jepang)
한국어 (Bahasa Korea)
ไทย (Bahasa Thai)
Български (Bahasa Bulgaria)
Čeština (Bahasa Ceko)
Dansk (Bahasa Denmark)
Deutsch (Bahasa Jerman)
English (Bahasa Inggris)
Español - España (Bahasa Spanyol - Spanyol)
Español - Latinoamérica (Bahasa Spanyol - Amerika Latin)
Ελληνικά (Bahasa Yunani)
Français (Bahasa Prancis)
Italiano (Bahasa Italia)
Magyar (Bahasa Hungaria)
Nederlands (Bahasa Belanda)
Norsk (Bahasa Norwegia)
Polski (Bahasa Polandia)
Português (Portugis - Portugal)
Português-Brasil (Bahasa Portugis-Brasil)
Română (Bahasa Rumania)
Русский (Bahasa Rusia)
Suomi (Bahasa Finlandia)
Svenska (Bahasa Swedia)
Türkçe (Bahasa Turki)
Tiếng Việt (Bahasa Vietnam)
Українська (Bahasa Ukraina)
Laporkan kesalahan penerjemahan
============
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 :)
============