Skip to content

Commit

Permalink
Revert "Revert "Some speculative work.""
Browse files Browse the repository at this point in the history
This reverts commit d0a2991.
  • Loading branch information
fingerboxes committed Apr 30, 2015
1 parent e368348 commit 61b5ad1
Show file tree
Hide file tree
Showing 8 changed files with 353 additions and 307 deletions.
3 changes: 2 additions & 1 deletion Source/CrewQ.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
<ItemGroup>
<Compile Include="API\CrewQAPI.cs" />
<Compile Include="Main.cs" />
<Compile Include="Data.cs" />
<Compile Include="Roster.cs" />
<Compile Include="Settings.cs" />
<Compile Include="Interface\AppLauncher.cs" />
<Compile Include="Interface\EditorModule.cs" />
<Compile Include="Interface\SettingsWindow.cs" />
Expand Down
253 changes: 0 additions & 253 deletions Source/Data.cs

This file was deleted.

4 changes: 2 additions & 2 deletions Source/Interface/AppLauncher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class AppLauncher : ProtoAppLauncher
{
public override Texture AppLauncherIcon
{
get { return GameDatabase.Instance.GetTexture("Fingerboxes/CrewQ/Icons/appLauncher", false); }
get { return GameDatabase.Instance.GetTexture("Fingerboxes/CrewQueue/Icons/appLauncher", false); }
}

public override ApplicationLauncher.AppScenes Visibility
Expand All @@ -49,7 +49,7 @@ public override ApplicationLauncher.AppScenes Visibility
try
{
bool coalescedCondition = (settingsWindow != null) &&
(Data.Instance.settingHideSettingsIcon == false || settingsWindow.Visible == true);
(Settings.Instance.HideSettingsIcon == false || settingsWindow.Visible == true);

return coalescedCondition ? ApplicationLauncher.AppScenes.SPACECENTER : ApplicationLauncher.AppScenes.NEVER;
}
Expand Down
6 changes: 3 additions & 3 deletions Source/Interface/SceneModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public abstract class SceneModule : MonoBehaviourExtended
{
public void CleanManifest()
{
if (CMAssignmentDialog.Instance != null && (Data.Instance.settingRemoveDefaultCrews || Data.Instance.settingDoCustomAssignment))
if (CMAssignmentDialog.Instance != null && Settings.Instance.AssignCrews)
{
VesselCrewManifest originalVesselManifest = CMAssignmentDialog.Instance.GetManifest();
IList<PartCrewManifest> partCrewManifests = originalVesselManifest.GetCrewableParts();
Expand All @@ -55,7 +55,7 @@ public void CleanManifest()
partManifest.RemoveCrewFromSeat(partManifest.GetCrewSeat(crewMember));
}
}
if (Data.Instance.settingDoCustomAssignment)
if (Settings.Instance.AssignCrews)
{
partManifest.AddCrewToOpenSeats(Main.Instance.GetCrewForPart(partManifest.PartInfo.partPrefab, true));
}
Expand All @@ -77,7 +77,7 @@ public void OnFillButton(ref POINTER_INFO eventPointer)
if (eventPointer.evt == POINTER_INFO.INPUT_EVENT.TAP)
{
Logging.Debug("Fill Button Pressed");
if (Data.Instance.settingDoCustomAssignment)
if (Settings.Instance.AssignCrews)
{
// TODO - make this work.
}
Expand Down
32 changes: 16 additions & 16 deletions Source/Interface/SettingsWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,34 +119,34 @@ protected override void Update()

public void PreSync()
{
Data settings = Data.Instance;
Settings settings = Settings.Instance;

if (settings != null)
{
toggleDoCustomAssignment = settings.settingDoCustomAssignment;
toggleUseCrewCompositions = settings.settingUseCrewCompositions;
toggleVacationHardlock = settings.settingVacationHardlock;
localMinimumVacationDays = settings.settingMinimumVacationDays.ToString();
localMaximumVacationDays = settings.settingMaximumVacationDays.ToString();
localVacationScalar = (settings.settingVacationScalar * 100).ToString();
toggleDoCustomAssignment = settings.AssignCrews;
toggleUseCrewCompositions = settings.StrictCrewCompositions;
toggleVacationHardlock = settings.VacationHardLock;
localMinimumVacationDays = settings.MinimumVacationDays.ToString();
localMaximumVacationDays = settings.MaximumVacationDays.ToString();
localVacationScalar = (settings.VacationScalar * 100).ToString();
}
}

public void Sync()
{
Data settings = Data.Instance;
Settings settings = Settings.Instance;

if (settings != null)
{
settings.settingHideSettingsIcon = toggleRemoveDefaultCrews;
settings.settingDoCustomAssignment = toggleDoCustomAssignment;
settings.settingUseCrewCompositions = toggleUseCrewCompositions;
settings.settingVacationHardlock = toggleVacationHardlock;
settings.settingHideSettingsIcon = toggleHideSettingsIcon;
settings.HideSettingsIcon = toggleRemoveDefaultCrews;
settings.AssignCrews = toggleDoCustomAssignment;
settings.StrictCrewCompositions = toggleUseCrewCompositions;
settings.VacationHardLock = toggleVacationHardlock;
settings.HideSettingsIcon = toggleHideSettingsIcon;

try
{
settings.settingMinimumVacationDays = Int32.Parse(localMinimumVacationDays);
settings.MinimumVacationDays = Int32.Parse(localMinimumVacationDays);
}
catch (Exception)
{
Expand All @@ -155,7 +155,7 @@ public void Sync()

try
{
settings.settingMaximumVacationDays = Int32.Parse(localMaximumVacationDays);
settings.MaximumVacationDays = Int32.Parse(localMaximumVacationDays);
}
catch (Exception)
{
Expand All @@ -164,7 +164,7 @@ public void Sync()

try
{
settings.settingVacationScalar = (Double.Parse(localVacationScalar) / 100);
settings.VacationScalar = (Double.Parse(localVacationScalar) / 100);
}
catch (Exception)
{
Expand Down
Loading

0 comments on commit 61b5ad1

Please sign in to comment.