Skip to content

Commit 5b00404

Browse files
author
runrevali
committed
[[ Scriptify IDE ]] Add libUrl as a library stack rather than including a button when building a standalone
1 parent 21e8bc4 commit 5b00404

File tree

9 files changed

+41
-25
lines changed

9 files changed

+41
-25
lines changed

engine/src/capsule.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ enum MCCapsuleSectionType
8686
// (e.g. encryption DLLs on Windows).
8787
kMCCapsuleSectionTypeModule,
8888

89-
// Auxillary stack sections contain other mainstacks that should be loaded
89+
// Auxiliary stack sections contain other mainstacks that should be loaded
9090
// alongside the mainstack (but not opened initially).
91-
kMCCapsuleSectionTypeAuxillaryStack,
91+
kMCCapsuleSectionTypeAuxiliaryStack,
9292

9393
// Simulator redirect sections contain mappings from engine relative
9494
// paths to absolute paths on the host system.
@@ -145,8 +145,8 @@ struct MCCapsuleStackSection
145145
// uint8_t data[]
146146
};
147147

148-
// The Stack section contains the stackfile data for an auxillary stack.
149-
struct MCCapsuleAuxillaryStackSection
148+
// The Stack section contains the stackfile data for an auxiliary stack.
149+
struct MCCapsuleAuxiliaryStackSection
150150
{
151151
// uint8_t data[]
152152
};

engine/src/deploy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ bool MCDeployWriteCapsule(const MCDeployParameters& p_params, MCDeployFileRef p_
148148
if (t_success)
149149
t_success = MCDeployCapsuleDefineFromFile(t_capsule, kMCCapsuleSectionTypeStack, t_stackfile);
150150

151-
// Now we add the auxillary stackfiles, if any
151+
// Now we add the auxiliary stackfiles, if any
152152
MCDeployFileRef *t_aux_stackfiles;
153153
t_aux_stackfiles = nil;
154154
if (t_success)
@@ -159,7 +159,7 @@ bool MCDeployWriteCapsule(const MCDeployParameters& p_params, MCDeployFileRef p_
159159
if (t_success && !MCDeployFileOpen(p_params . auxiliary_stackfiles[i], "rb", t_aux_stackfiles[i]))
160160
t_success = MCDeployThrow(kMCDeployErrorNoAuxStackfile);
161161
if (t_success)
162-
t_success = MCDeployCapsuleDefineFromFile(t_capsule, kMCCapsuleSectionTypeAuxillaryStack, t_aux_stackfiles[i]);
162+
t_success = MCDeployCapsuleDefineFromFile(t_capsule, kMCCapsuleSectionTypeAuxiliaryStack, t_aux_stackfiles[i]);
163163
}
164164

165165
// Now add the externals, if any

engine/src/deploy_file.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ const char *MCDeployErrorToString(MCDeployError p_error)
282282
case kMCDeployErrorNoStackfile:
283283
return "could not open stackfile";
284284
case kMCDeployErrorNoAuxStackfile:
285-
return "could not open auxillary stackfile";
285+
return "could not open auxiliary stackfile";
286286
case kMCDeployErrorNoOutput:
287287
return "could not open output file";
288288
case kMCDeployErrorNoSpill:

engine/src/mode_standalone.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ bool MCStandaloneCapsuleCallback(void *p_self, const uint8_t *p_digest, MCCapsul
229229
}
230230
break;
231231

232-
case kMCCapsuleSectionTypeAuxillaryStack:
232+
case kMCCapsuleSectionTypeAuxiliaryStack:
233233
{
234234
MCStack *t_aux_stack;
235235
if (MCdispatcher -> readfile(NULL, NULL, p_stream, t_aux_stack) != IO_NORMAL)

ide

Submodule ide updated from 29b5261 to 5d1bf15

ide-support/libraries/revliburl.livecodescript

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
#
44
on revLoadLibrary
55
# MW-2015-01-28: [[ ScriptifyLibURL ]] Use the scriptified stack.
6-
insert the script of me into back
6+
insert the script of stack "revLibUrl" into back
77
end revLoadLibrary
88

99
on revUnloadLibrary
10-
remove the script of me from back
10+
remove the script of stack "revLibUrl" from back
1111
end revUnloadLibrary
1212
---------------------------------------------------------------------
1313
##shared locals

ide-support/revinitialisationlibrary.livecodescript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ command revInternal__LoadLibrary pLibraryName
4646
try
4747
send "revLoadLibrary" to stack pLibraryName
4848
catch tError
49-
return "Error while loading stack:" && pLibraryName
49+
return "Error" && tError && "while loading stack:" && pLibraryName
5050
end try
5151
end if
5252
end revInternal__LoadLibrary

ide-support/revsaveasstandalone.livecodescript

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2414,10 +2414,16 @@ private command revBuildStandaloneDeploy pPlatform, pStackFilePath, pEnginePath,
24142414

24152415
# AL-2015-01-29: [[ Scriptify IDE ]] Add the library inclusions and startup script to the deploy parameters
24162416
if sStandaloneSettingsA["auxiliary_stackfiles"] is not empty then
2417-
put line 1 of sStandaloneSettingsA["auxiliary_stackfiles"] into tDeployInfo["auxiliary_stackfiles"]
2417+
repeat for each line tStackFile in sStandaloneSettingsA["auxiliary_stackfiles"]
2418+
local tTempStackFile
2419+
put the tempname into tTempStackFile
2420+
revSBResaveScriptOnlyStackAsProperStackFile the short name of stack tStackFile, tStackFile, tTempStackFile
2421+
put tTempStackFile & return after tDeployInfo["auxiliary_stackfiles"]
2422+
end repeat
2423+
delete the last char of tDeployInfo["auxiliary_stackfiles"]
24182424
end if
24192425
if sStandaloneSettingsA["startup_script"] is not empty then
2420-
//put sStandaloneSettingsA["startup_script"] into tDeployInfo["startup_script"]
2426+
put sStandaloneSettingsA["startup_script"] into tDeployInfo["startup_script"]
24212427
end if
24222428

24232429
if pPlatform begins with "MacOSX" then
@@ -2697,10 +2703,10 @@ end revSmartChecking
26972703
private command revAddLibrary pLibrary, pAuxStackFile
26982704
if pLibrary is "Internet" then
26992705
put return & the effective filename of stack "revLibURL" after sStandaloneSettingsA["auxiliary_stackfiles"]
2700-
put "; revInternal__LoadLibrary revLibUrl" after sStandaloneSettingsA["startup_script"]
2706+
put return & "revInternal__LoadLibrary revLibUrl" after sStandaloneSettingsA["startup_script"]
27012707
else if pAuxStackFile then
27022708
put return & the effective filename of stack pLibrary after sStandaloneSettingsA["auxiliary_stackfiles"]
2703-
put "; revInternal__LoadLibrary" && quote & pLibrary & quote after sStandaloneSettingsA["startup_script"]
2709+
put return & "revInternal__LoadLibrary" && quote & pLibrary & quote after sStandaloneSettingsA["startup_script"]
27042710
else
27052711
if sStandaloneSettingsA["scriptLibraries"] is not empty then put return after sStandaloneSettingsA["scriptLibraries"]
27062712
put pLibrary after sStandaloneSettingsA["scriptLibraries"]

ide-support/revsblibrary.livecodescript

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -580,15 +580,7 @@ end revStandaloneAddWarning
580580
----------
581581

582582
command revStandaloneProgress pMessage
583-
put pMessage into field 1 of stack "revStandaloneProgress"
584-
if the mode of stack "revStandaloneProgress" is 0 then
585-
lock messages
586-
modeless "revStandaloneProgress"
587-
set the loc of stack "revStandaloneProgress" to the screenLoc
588-
unlock messages
589-
end if
590-
unlock screen
591-
wait 0 ticks with messages -- allow for progress update
583+
send "revUpdateStandaloneProgress pMessage" to stack "revStandaloneSettings"
592584
end revStandaloneProgress
593585

594586
# This is an event handler, not a command.
@@ -869,3 +861,21 @@ function utilityMakePathRelative pFile, pFolder
869861

870862
return tFile
871863
end utilityMakePathRelative
864+
865+
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
866+
867+
command revSBResaveScriptOnlyStackAsProperStackFile pStackName, pStackFilePath, pOutputStackFilePath
868+
lock messages
869+
if there is a stack pStackName then
870+
set the name of stack pStackName to "__keep_this_around__"
871+
end if
872+
create invisible stack "__temp_real_stack__"
873+
set the script of stack "__temp_real_stack__" to the script of stack pStackFilePath
874+
set the name of stack "__temp_real_stack__" to pStackName
875+
save stack pStackName as pOutputStackFilePath
876+
delete stack pStackName
877+
if there is a stack "__keep_this_around__" then
878+
set the name of stack "__keep_this_around__" to pStackName
879+
end if
880+
unlock messages
881+
end revSBResaveScriptOnlyStackAsProperStackFile

0 commit comments

Comments
 (0)