Skip to content

Commit

Permalink
Merge pull request #2 from Tehq/patch-3
Browse files Browse the repository at this point in the history
FORM. Added heatslots.  May take out and use TMaterials
  • Loading branch information
Mega284 committed Mar 13, 2012
2 parents da0ec95 + 63362bc commit 7a5d0bc
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions MSI/Form/MSI_Form.simba
Expand Up @@ -487,13 +487,14 @@ const
LIST_COOKSPOTS = 7;
LIST_OBJECTS = 8;

EDIT_COUNT = 6;
EDIT_COUNT = 7;
EDIT_LOADS = 0;
EDIT_TIME = 1;
EDIT_LEVEL = 2;
EDIT_EXCEPTIONS = 3;
EDIT_ALCH_SLOTS = 4;
EDIT_PRIORITY = 5;
EDIT_PRIORITY = 6;
EDIT_HEAT_SLOTS = 5;

COMBO_COUNT = 1;
COMBO_COALBAG = 0;
Expand Down Expand Up @@ -649,6 +650,12 @@ begin
edits := [EDIT_TIME, EDIT_LEVEL, EDIT_ALCH_SLOTS]
else
Edits := [EDIT_TIME, EDIT_LEVEL];

if (MSI_Scripts[i].Constant = SCRIPT_SUPERHEATER) then
edits := [EDIT_TIME, EDIT_LEVEL, EDIT_HEAT_SLOTS]
else
Edits := [EDIT_TIME, EDIT_LEVEL];

end;

SKILL_RUNECRAFTING:
Expand Down Expand Up @@ -794,6 +801,9 @@ begin

// Fill the AlchSlots edit
script_Edits[EDIT_ALCH_SLOTS].Text := IntArrToStr(MSI_Players[pIndex].Scripts[sIndex].AlchSlots);

// Fill the HeatSlots edit
script_Edits[EDIT_HEAT_SLOTS].Text := IntArrToStr(MSI_Players[pIndex].Scripts[sIndex].HeatSlots);
end;
end;
end;
Expand Down Expand Up @@ -945,7 +955,7 @@ begin
ShowMessage('Invalid max level! Please enter a number.')
else
MaxLevel := StrToInt(script_Edits[EDIT_LEVEL].Text);

try
CoalBag := StrToBool(script_combos[COMBO_COALBAG].text);
except
Expand Down Expand Up @@ -1050,6 +1060,9 @@ begin
// Set the Alching Slots
MSI_Players[pIndex].Scripts[sIndex].AlchSlots := StrToIntArr(script_Edits[EDIT_ALCH_SLOTS].Text);

// Set the Heating Slots
MSI_Players[pIndex].Scripts[sIndex].HeatSlots := StrToIntArr(script_Edits[EDIT_HEAT_SLOTS].Text);

if (StrToIntDef(script_Edits[EDIT_LEVEL].Text, -1) = -1) then
ShowMessage('Invalid max level! Please enter a number.')
else
Expand Down Expand Up @@ -1236,6 +1249,11 @@ begin
Hint := 'All the inventory slots that contain items you want to Alch (i.e. 1,2,3,4)';
end;

EDIT_HEAT_SLOTS:
begin
Hint := 'All the inventory slots that contain items you want to Heat (i.e. 1,2,3,4)';
end;

EDIT_PRIORITY:
begin
Hint := 'You can set MSI to search for one object more than another. '+#10+
Expand All @@ -1251,7 +1269,7 @@ begin
end;

// Edit TLabels
script_EditTexts := ['Loads', 'Time', 'Level', 'Exceptions', 'Alching Slots', 'Priority'];
script_EditTexts := ['Loads', 'Time', 'Level', 'Exceptions', 'Alching Slots', 'Heating Slots', 'Priority'];
for i := 0 to High(script_EditLabels) do
begin
script_EditLabels[i] := TLabel.Create(script_Form);
Expand Down Expand Up @@ -1588,6 +1606,10 @@ begin
// AlchSlots
if (Length(Scripts[j].AlchSlots) > 0) then
WriteINI(IntToStr(i), 'Script'+IntToStr(j)+'.AlchSlots', IntArrToStr(Scripts[j].AlchSlots), PATH_PLAYER);

// HeatSlots
if (Length(Scripts[j].HeatSlots) > 0) then
WriteINI(IntToStr(i), 'Script'+IntToStr(j)+'.HeatSlots', IntArrToStr(Scripts[j].HeatSlots), PATH_PLAYER);
end;
end;
end;
Expand Down Expand Up @@ -2803,4 +2825,3 @@ begin
script_Form.Free;
MainForm.Free;
end;

0 comments on commit 7a5d0bc

Please sign in to comment.