I am writing Insanity 1.1 on a different computer than I wrote Insanity 1.0, and it would take a while to find the ScratchSkin folder I used.
Does anyone know how I can extract the folder from the mod?
Offline
Look at the ScratchFrameMorph class, there's the method that gets the skin from a folder. You can copy it a rewrite it to do the inverse, it's not hard
Offline
jvvg wrote:
I found the method, but I don't understand it much.
Oh, I see. Could you post it here so I don't have to open Bingo to find it to help?
Offline
readSkinFrom: t1 | t2 t3 t4 t5 | t2 _ Dictionary new. t5 _ Dictionary new. t1 fileNames do: [:t6 | Cursor read showWhile: [t3 _ [Form fromFileNamed: (t1 fullNameFor: t6)] ifError: []]. t3 ifNotNil: [t4 _ t6 findLast: [:t7 | t7 = $.]. t4 = 0 ifFalse: [t6 _ t6 copyFrom: 1 to: t4 - 1]. (t6 asLowercase endsWith: '_xo') ifTrue: [t5 at: (t6 copyFrom: 1 to: t6 size - 3) asSymbol put: t3] ifFalse: [t2 at: t6 asSymbol put: t3]]]. ScratchSkin _ t2. ScratchSkinXO _ t5. t3 _ ScratchSkin at: #scriptsPaneTexture ifAbsent: []. (t3 notNil and: [t3 depth ~= 32]) ifTrue: [ScratchSkin at: #scriptsPaneTexture put: (t3 asFormOfDepth: 32)]
Offline
OK, maybe rewriting that could be a bit confusing. Why don't you just try a...
ScratchSkin do [thatForm write to png at path t1 , 'png']
ScratchSkinXO do [thatForm write to png at path t1 , 'XO.png']
Or something
Offline
jvvg wrote:
Code:
readSkinFrom: t1 | t2 t3 t4 t5 | t2 _ Dictionary new. t5 _ Dictionary new. t1 fileNames do: [:t6 | Cursor read showWhile: [t3 _ [Form fromFileNamed: (t1 fullNameFor: t6)] ifError: []]. t3 ifNotNil: [t4 _ t6 findLast: [:t7 | t7 = $.]. t4 = 0 ifFalse: [t6 _ t6 copyFrom: 1 to: t4 - 1]. (t6 asLowercase endsWith: '_xo') ifTrue: [t5 at: (t6 copyFrom: 1 to: t6 size - 3) asSymbol put: t3] ifFalse: [t2 at: t6 asSymbol put: t3]]]. ScratchSkin _ t2. ScratchSkinXO _ t5. t3 _ ScratchSkin at: #scriptsPaneTexture ifAbsent: []. (t3 notNil and: [t3 depth ~= 32]) ifTrue: [ScratchSkin at: #scriptsPaneTexture put: (t3 asFormOfDepth: 32)]
t1 is a Folder
Offline