Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed engineer check not working on languages different that English #101

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@ Localization
#LOC_USI_Konstruction_Shipyard_250_Description = An orbital shipyard for building small to medium ships... in orbit!
#LOC_USI_Konstruction_Shipyard_500_Title = KS-500-O KonStructor - Orbital Shipyard
#LOC_USI_Konstruction_Shipyard_500_Description = An orbital shipyard for building any size ship... in orbit!

//Localized engineer name
#LOC_USI_Konstruction_Engineer_Name = Engineer
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Localization
{
ru
{
// UI values
#LOC_USI_Konstructor_AvailableAmountHeaderText = Available
#LOC_USI_Konstructor_BuildShipButtonText = BUILD!
#LOC_USI_Konstructor_Column1HeaderText = STEP 1
#LOC_USI_Konstructor_Column2HeaderText = STEP 2
#LOC_USI_Konstructor_Column3HeaderText = STEP 3
#LOC_USI_Konstructor_Column1Instructions = Select a ship to build.
#LOC_USI_Konstructor_Column2Instructions = Review build requirements.
#LOC_USI_Konstructor_Column3Instructions = Build your ship!
#LOC_USI_Konstructor_DryCostText = Dry cost
#LOC_USI_Konstructor_DryMassText = Dry mass
#LOC_USI_Konstructor_InsufficientResourcesErrorText = Missing one or more required resources.
#LOC_USI_Konstructor_InvalidVesselErrorText = Selected vessel is invalid.
#LOC_USI_Konstructor_LaunchClampErrorText = Selected vessel has launch clamps!
#LOC_USI_Konstructor_NearbyVesselsErrorText = There are other vessels nearby! (200m)
#LOC_USI_Konstructor_NotInOrbitErrorText = Konstructor must be in orbit to spawn new vessels.
#LOC_USI_Konstructor_NoVesselSelectedErrorText = Select a vessel first!
#LOC_USI_Konstructor_RequiredAmountHeaderText = Needed
#LOC_USI_Konstructor_ResourceHeaderText = Resource
#LOC_USI_Konstructor_SelectShipButtonText = Select a ship
#LOC_USI_Konstructor_SelectedShipHeaderText = SELECTED SHIP
#LOC_USI_Konstructor_ShowUIButtonText = Open Konstructor
#LOC_USI_Konstructor_TitleBarText = KONSTRUCTOR
#LOC_USI_Konstructor_UnavailablePartsErrorText = One or more parts from this vessel are unavailable.

// Parts
#LOC_USI_Konstruction_Shipyard_DeployPAWGroup_Title = Shipyard Deployment
#LOC_USI_Konstruction_Shipyard_250_Title = KS-250-O KonStructor - Orbital Shipyard
#LOC_USI_Konstruction_Shipyard_250_Description = An orbital shipyard for building small to medium ships... in orbit!
#LOC_USI_Konstruction_Shipyard_500_Title = KS-500-O KonStructor - Orbital Shipyard
#LOC_USI_Konstruction_Shipyard_500_Description = An orbital shipyard for building any size ship... in orbit!

//Localized engineer name
#LOC_USI_Konstruction_Engineer_Name = Инженер
}
}
5 changes: 4 additions & 1 deletion Source/Konstruction/EVA/ModuleKonstructionForeman.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ public int CalculateKonstruction()
public bool DoesPartHaveEngineer()
{
var cCount = part.protoModuleCrew.Count;
string _engineerName = "Engineer";
if(KSP.Localization.Localizer.TryGetStringByTag("#LOC_USI_Konstruction_Engineer_Name", out string engineerName))
_engineerName = engineerName;
for (int i = 0; i < cCount; ++i)
{
if (part.protoModuleCrew[i].experienceTrait.TypeName == "Engineer")
if (part.protoModuleCrew[i].experienceTrait.TypeName == _engineerName)
return true;
}
return false;
Expand Down
5 changes: 4 additions & 1 deletion Source/Konstruction/Fabrication/FabricationGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ protected override void DrawWindowContents(int windowId)
//*********************
valMVOut = IsSlotAvailable(currentPart);
valMVIn = IsPrinterAvailable(currentPart, printMass, printVolume);
valE = CrewUtilities.DoesVesselHaveCrewType("Engineer");
string _engineerName = "Engineer";
if (KSP.Localization.Localizer.TryGetStringByTag("#LOC_USI_Konstruction_Engineer_Name", out string engineerName))
_engineerName = engineerName;
valE = CrewUtilities.DoesVesselHaveCrewType(_engineerName);

if (!(valMVIn || valMVOut))
mvColor = "ff6e69";
Expand Down