1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-12-24 08:18:52 -05:00

Parsing of the XML concept.

Adding the rest of the data is peanuts. Now to figure out a good place to
install the scripts to. The hardest part is probably keeping track of installed
scripts, and updating them when possible.
This commit is contained in:
Merlijn Wajer 2010-06-12 14:29:56 +02:00
parent 903299b580
commit 3c8a311844
3 changed files with 107 additions and 61 deletions

View File

@ -34,12 +34,12 @@
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="9">
<Units Count="10">
<Unit0>
<Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="project1"/>
<UsageCount Value="36"/>
<UsageCount Value="37"/>
</Unit0>
<Unit1>
<Filename Value="scriptmanager.pas"/>
@ -50,9 +50,9 @@
<IsVisibleTab Value="True"/>
<EditorIndex Value="0"/>
<WindowIndex Value="0"/>
<TopLine Value="34"/>
<CursorPos X="6" Y="58"/>
<UsageCount Value="36"/>
<TopLine Value="83"/>
<CursorPos X="15" Y="118"/>
<UsageCount Value="37"/>
<Loaded Value="True"/>
</Unit1>
<Unit2>
@ -76,8 +76,8 @@
<UnitName Value="settings"/>
<EditorIndex Value="1"/>
<WindowIndex Value="0"/>
<TopLine Value="45"/>
<CursorPos X="5" Y="74"/>
<TopLine Value="85"/>
<CursorPos X="29" Y="94"/>
<UsageCount Value="13"/>
<Loaded Value="True"/>
</Unit4>
@ -118,127 +118,136 @@
<UsageCount Value="10"/>
<DefaultSyntaxHighlighter Value="Text"/>
</Unit8>
<Unit9>
<Filename Value="../../../fpc/rtl/inc/objpash.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="183"/>
<CursorPos X="21" Y="201"/>
<SyntaxHighlighter Value="Delphi"/>
<UsageCount Value="10"/>
<DefaultSyntaxHighlighter Value="Text"/>
</Unit9>
</Units>
<JumpHistory Count="30" HistoryIndex="29">
<Position1>
<Filename Value="scriptmanager.pas"/>
<Caret Line="36" Column="29" TopLine="4"/>
<Caret Line="29" Column="62" TopLine="12"/>
</Position1>
<Position2>
<Filename Value="scriptmanager.pas"/>
<Caret Line="37" Column="29" TopLine="4"/>
<Caret Line="31" Column="31" TopLine="12"/>
</Position2>
<Position3>
<Filename Value="scriptmanager.pas"/>
<Caret Line="38" Column="37" TopLine="7"/>
<Caret Line="37" Column="23" TopLine="19"/>
</Position3>
<Position4>
<Filename Value="scriptmanager.pas"/>
<Caret Line="37" Column="37" TopLine="6"/>
<Caret Line="64" Column="25" TopLine="36"/>
</Position4>
<Position5>
<Filename Value="scriptmanager.pas"/>
<Caret Line="36" Column="37" TopLine="5"/>
<Caret Line="55" Column="11" TopLine="45"/>
</Position5>
<Position6>
<Filename Value="scriptmanager.pas"/>
<Caret Line="11" Column="52" TopLine="1"/>
<Caret Line="52" Column="5" TopLine="28"/>
</Position6>
<Position7>
<Filename Value="scriptmanager.pas"/>
<Caret Line="24" Column="86" TopLine="1"/>
<Caret Line="59" Column="13" TopLine="34"/>
</Position7>
<Position8>
<Filename Value="scriptmanager.pas"/>
<Caret Line="19" Column="26" TopLine="6"/>
<Filename Value="../../Units/MMLAddon/settings.pas"/>
<Caret Line="63" Column="24" TopLine="52"/>
</Position8>
<Position9>
<Filename Value="../../Units/MMLAddon/settings.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
<Filename Value="scriptmanager.pas"/>
<Caret Line="53" Column="12" TopLine="34"/>
</Position9>
<Position10>
<Filename Value="../../Units/MMLAddon/settings.pas"/>
<Caret Line="31" Column="54" TopLine="1"/>
<Filename Value="scriptmanager.pas"/>
<Caret Line="57" Column="22" TopLine="35"/>
</Position10>
<Position11>
<Filename Value="../../Units/MMLAddon/settings.pas"/>
<Caret Line="31" Column="71" TopLine="1"/>
<Filename Value="scriptmanager.pas"/>
<Caret Line="55" Column="21" TopLine="38"/>
</Position11>
<Position12>
<Filename Value="scriptmanager.pas"/>
<Caret Line="41" Column="10" TopLine="6"/>
<Caret Line="33" Column="17" TopLine="27"/>
</Position12>
<Position13>
<Filename Value="scriptmanager.pas"/>
<Caret Line="35" Column="82" TopLine="10"/>
<Caret Line="58" Column="34" TopLine="50"/>
</Position13>
<Position14>
<Filename Value="scriptmanager.pas"/>
<Caret Line="21" Column="69" TopLine="10"/>
<Caret Line="54" Column="10" TopLine="36"/>
</Position14>
<Position15>
<Filename Value="scriptmanager.pas"/>
<Caret Line="41" Column="39" TopLine="11"/>
<Filename Value="../../Units/MMLAddon/settings.pas"/>
<Caret Line="77" Column="22" TopLine="59"/>
</Position15>
<Position16>
<Filename Value="scriptmanager.pas"/>
<Caret Line="42" Column="15" TopLine="11"/>
<Caret Line="56" Column="20" TopLine="36"/>
</Position16>
<Position17>
<Filename Value="scriptmanager.pas"/>
<Caret Line="30" Column="62" TopLine="12"/>
<Filename Value="../../Units/MMLAddon/settings.pas"/>
<Caret Line="253" Column="11" TopLine="230"/>
</Position17>
<Position18>
<Filename Value="scriptmanager.pas"/>
<Caret Line="29" Column="62" TopLine="12"/>
<Filename Value="../../Units/MMLAddon/settings.pas"/>
<Caret Line="75" Column="24" TopLine="57"/>
</Position18>
<Position19>
<Filename Value="scriptmanager.pas"/>
<Caret Line="31" Column="31" TopLine="12"/>
<Filename Value="../../Units/MMLAddon/settings.pas"/>
<Caret Line="194" Column="30" TopLine="177"/>
</Position19>
<Position20>
<Filename Value="scriptmanager.pas"/>
<Caret Line="37" Column="23" TopLine="19"/>
<Caret Line="54" Column="17" TopLine="38"/>
</Position20>
<Position21>
<Filename Value="scriptmanager.pas"/>
<Caret Line="64" Column="25" TopLine="36"/>
<Filename Value="../../Units/MMLAddon/settings.pas"/>
<Caret Line="77" Column="22" TopLine="59"/>
</Position21>
<Position22>
<Filename Value="scriptmanager.pas"/>
<Caret Line="55" Column="11" TopLine="45"/>
<Filename Value="../../Units/MMLAddon/settings.pas"/>
<Caret Line="254" Column="14" TopLine="242"/>
</Position22>
<Position23>
<Filename Value="scriptmanager.pas"/>
<Caret Line="52" Column="5" TopLine="28"/>
<Filename Value="../../Units/MMLAddon/settings.pas"/>
<Caret Line="75" Column="24" TopLine="57"/>
</Position23>
<Position24>
<Filename Value="scriptmanager.pas"/>
<Caret Line="59" Column="13" TopLine="34"/>
<Caret Line="71" Column="7" TopLine="49"/>
</Position24>
<Position25>
<Filename Value="../../Units/MMLAddon/settings.pas"/>
<Caret Line="63" Column="24" TopLine="52"/>
<Caret Line="73" Column="23" TopLine="56"/>
</Position25>
<Position26>
<Filename Value="scriptmanager.pas"/>
<Caret Line="53" Column="12" TopLine="34"/>
<Filename Value="../../Units/MMLAddon/settings.pas"/>
<Caret Line="107" Column="32" TopLine="89"/>
</Position26>
<Position27>
<Filename Value="scriptmanager.pas"/>
<Caret Line="57" Column="22" TopLine="35"/>
<Caret Line="60" Column="15" TopLine="38"/>
</Position27>
<Position28>
<Filename Value="scriptmanager.pas"/>
<Caret Line="55" Column="21" TopLine="38"/>
<Caret Line="62" Column="15" TopLine="27"/>
</Position28>
<Position29>
<Filename Value="scriptmanager.pas"/>
<Caret Line="33" Column="17" TopLine="27"/>
<Caret Line="64" Column="7" TopLine="33"/>
</Position29>
<Position30>
<Filename Value="scriptmanager.pas"/>
<Caret Line="58" Column="34" TopLine="50"/>
<Filename Value="../../Units/MMLAddon/settings.pas"/>
<Caret Line="10" Column="27" TopLine="1"/>
</Position30>
</JumpHistory>
</ProjectOptions>

View File

@ -1,9 +1,9 @@
object Form1: TForm1
Left = 1499
Left = 1490
Height = 567
Top = 51
Top = 293
Width = 825
ActiveControl = Button1
ActiveControl = TreeView1
Caption = 'Form1'
ClientHeight = 567
ClientWidth = 825

View File

@ -1,3 +1,26 @@
{
This file is part of the Simba Project
Copyright (c) 2009 by Raymond van Venetië and Merlijn Wajer
Simba is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Simba is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with MML. If not, see <http://www.gnu.org/licenses/>.
See the file COPYING, included in this distribution,
for details about the copyright.
Script Manager for the Simba project.
}
unit scriptmanager;
{$mode objfpc}{$H+}
@ -33,7 +56,7 @@ type
private
public
constructor Create(n: TTreeNode);
constructor Create;
destructor Delete;
end;
@ -48,15 +71,24 @@ implementation
procedure fill(s: TMMLSettings);
var
i:integer;
n, nn: TTreeNode;
ss: TSimbaScript;
LI: TListItem;
strarr: TStringArray;
begin
n := s.WalkToNode('Scripts/ScriptList/');
nn := n.GetFirstChild;
while nn <> nil do
if not s.ListKeys('Scripts/ScriptList', strarr) then
writeln('ListKeys returned false');
writeln('strarr length: ' + inttostr(length(strarr)));
for i := 0 to high(strarr) do
begin
ss := TSimbaScript.Create(nn);
nn := nn.GetNextSibling;
writeln(s.GetKeyValue('Scripts/ScriptList/Script/Name'));
ss := TSimbaScript.Create();
ss.Name := s.GetKeyValue('Scripts/ScriptList/Script/Name');
LI := Form1.ListView1.Items.Add;
LI.Caption := ss.Name;
LI.Data := ss;
LI.ImageIndex:= 0;
s.DeleteKey('Scripts/ScriptList/Script');
end;
end;
@ -72,14 +104,19 @@ end;
{ TSimbaScript }
constructor TSimbaScript.Create(n: TTreeNode);
constructor TSimbaScript.Create;
begin
inherited;
{stuff here}
end;
destructor TSimbaScript.Delete;
begin
{stuff here}
inherited;
end;
end.