Skip to content

Commit 536bda3

Browse files
committed
Load textbox contents from text files instead of having an array of strings
1 parent 48044be commit 536bda3

File tree

5 files changed

+88
-31
lines changed

5 files changed

+88
-31
lines changed

assets.bmx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ Rem
33
EndRem
44

55
'Embed palette file for standalone exe
6-
Incbin "assets/palette.act"
6+
Incbin "assets/palette"
77

88
'Embed logo image for standalone exe
9-
Incbin "assets/logo-image"
9+
Incbin "assets/logo-image"
10+
11+
'Embed textbox contents to later load into strings
12+
Incbin "assets/about-textbox-content"
13+
Incbin "assets/help-textbox-content"

assets/about-textbox-content

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Welcome to the CCCP Bender utility!
2+
3+
It's purpose is to make the life of modders easier by automagically generating bent limb frames.
4+
5+
The CC Bender was originally created by Arne Jansson (AndroidArts), the man behind all the Cortex Command artwork.
6+
The CCCommunityProject Bender, however, is a brand new tool that allows more control and convenience for the modder (hopefully).
7+
8+
Arne's original bend code was used as base for this utility, and has been modified and improved to enable the new features.
9+
10+
Created by MaximDude using BlitzMax 0.105.3.35 and MaxIDE 1.52
11+
Bender logo image by Arne Jansson - Edited by MaximDude

assets/help-textbox-content

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
-------------------------- GUI --------------------------
2+
3+
LOAD:
4+
This loads an image file and starts bending.
5+
Supported formats are bmp, png and jpg.
6+
7+
- Note:
8+
The loaded file is being cut to 24x24px tiles internally.
9+
For best results, use provided template to create correct input files.
10+
11+
12+
SAVE:
13+
This saves the bended limbs into a file or creates a new file with specified name.
14+
15+
- Note:
16+
Files are saved in .png format, typing in the extension is not needed.
17+
Currently loaded file cannot be overwritten.
18+
19+
20+
----------------- ADJUSTING JOINTS ----------------
21+
22+
To adjust the joint positing on a limb part, click the upper joint marker on and drag it up/down, or click at desired point to set it there.
23+
Output will update automatically as you adjust the markers.
24+
25+
- Note:
26+
Joint markers cannot be adjusted on the X axis, and will adjust equally on the Y axis.
27+
For best results, please position the limb parts as close to dead center as possible for each tile in the input file.
28+
29+
30+
---------------------- SETTINGS -----------------------
31+
32+
ZOOM:
33+
This magnifies the source image For easier placement of joint markers.
34+
Zooming does Not magnify the output.
35+
Accepts values from 1 To 4.
36+
37+
- Warning:
38+
Changing zoom level will reset the joint markers to initial positions.
39+
Zoom first, adjust markers later.
40+
41+
42+
FRAMES:
43+
This sets the amount of frames output will generate.
44+
Accepts values from 1 to 20.
45+
46+
- Note :
47+
Limb bending will automatically adjust to number of frames.
48+
49+
50+
BG COLOR R,G,B:
51+
This changes the background color of the output.
52+
Accepts values from 0 to 255.
53+
54+
- Note :
55+
When saving file, the output will automatically set background to magenta, so no manual setting before saving is needed.
56+
57+
58+
SAVE AS INDEXED BITMAP:
59+
When ticked the output will be saved as a BMP file indexed to the CC palette.
60+
When not ticked, output will be saved as a non-indexed PNG.
61+
62+
- Warning :
63+
THE INDEXING PROCESS IS SLOW!
64+
I've done my best to speed it up but it still isn't blazing fast like PNG saving.
65+
When saving indexed, the app may hang and appear unresponsive but in fact it's doing what it's supposed to.
66+
For best results, DO NOT TOUCH ANYTHING until the background color reverts from magenta to whatever it was before!
File renamed without changes.

types/user-interface.bmx

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ Type TAppGUI
4747
Global editHelpPanel:TGadget
4848
Global editHelpTextbox:TGadget
4949
'Textboxes content
50-
Global aboutTextboxContent:String[7]
51-
Global helpTextboxContent:String[17]
52-
50+
Global aboutTextboxContent:String = LoadText("Incbin::assets/about-textbox-content")
51+
Global helpTextboxContent:String = LoadText("Incbin::assets/help-textbox-content")
52+
5353
'Create Main App Window
5454
Function FAppMain()
5555
mainWindow = CreateWindow("CCCP Bender v"+appVersion,DesktopWidth()/2-150,DesktopHeight()/2-180,300,340,Null,WINDOW_TITLEBAR|WINDOW_CLIENTCOORDS)
@@ -60,14 +60,7 @@ Type TAppGUI
6060
mainAboutTextbox = CreateTextArea(7,3,GadgetWidth(mainAboutPanel)-21,GadgetHeight(mainAboutPanel)-30,mainAboutPanel,TEXTAREA_WORDWRAP|TEXTAREA_READONLY)
6161
mainWindowFooterLabel = CreateLabel("CCCP Bender v"+appVersion+" - "+appVersionDate,10,GadgetHeight(mainWindow)-20,GadgetWidth(mainWindow),15,mainWindow,LABEL_LEFT)
6262
'About textbox Content
63-
aboutTextboxContent[0] = "Welcome to the CCCP Bender utility! ~n~n"
64-
aboutTextboxContent[1] = "It's purpose is to make the life of modders easier by automagically generating bent limb frames. ~n~n"
65-
aboutTextboxContent[2] = "The CC Bender was originally created by Arne Jansson (AndroidArts), the man behind all the Cortex Command artwork. ~n"
66-
aboutTextboxContent[3] = "The CCCommunityProject Bender, however, is a brand new tool that allows more control and convenience for the modder (hopefully). ~n~n"
67-
aboutTextboxContent[4] = "Arne's original bend code was used as base for this utility, and has been modified and improved to enable the new features. ~n~n"
68-
aboutTextboxContent[5] = "Created by MaximDude using BlitzMax 0.105.3.35 and MaxIDE 1.52 ~n"
69-
aboutTextboxContent[6] = "Bender logo image by Arne Jansson - Edited by MaximDude ~n"
70-
SetGadgetText(mainAboutTextbox,aboutTextboxContent[0]+aboutTextboxContent[1]+aboutTextboxContent[2]+aboutTextboxContent[3]+aboutTextboxContent[4]+aboutTextboxContent[5]+aboutTextboxContent[6])
63+
SetGadgetText(mainAboutTextbox,aboutTextboxContent)
7164
EndFunction
7265

7366
'Create Editor Window
@@ -101,24 +94,7 @@ Type TAppGUI
10194
SetGadgetText(editSettingsColorGTextbox,TAppOutput.BACKGROUND_GREEN)
10295
SetGadgetText(editSettingsColorBTextbox,TAppOutput.BACKGROUND_BLUE)
10396
'Help textbox content
104-
helpTextboxContent[0] = "-------------------------- GUI -------------------------- ~n~n"
105-
helpTextboxContent[1] = "LOAD: ~nThis loads an image file and starts bending. Supported formats are bmp, png and jpg. ~n~n"
106-
helpTextboxContent[2] = "- Note: ~nThe loaded file is being cut to 24x24px tiles internally. For best results, use provided template to create correct input files. ~n~n"
107-
helpTextboxContent[3] = "SAVE: ~nThis saves the bended limbs into a file or creates a new file with specified name. ~n~n"
108-
helpTextboxContent[4] = "- Note: ~nFiles are saved in .png format, typing in the extension is not needed. Currently loaded file cannot be overwritten. ~n~n"
109-
helpTextboxContent[5] = "----------------- ADJUSTING JOINTS ---------------- ~n~n"
110-
helpTextboxContent[6] = "To adjust the joint positing on a limb part, click the upper joint marker on and drag it up/down, or click at desired point to set it there. Output will update automatically as you adjust the markers.~n~n"
111-
helpTextboxContent[7] = "- Note: Joint markers cannot be adjusted on the X axis, and will adjust equally on the Y axis. For best results, please position the limb parts as close to dead center as possible for each tile in the input file. ~n~n"
112-
helpTextboxContent[8] = "---------------------- SETTINGS ----------------------- ~n~n"
113-
helpTextboxContent[9] = "ZOOM : ~nThis magnifies the source image For easier placement of joint markers. Zooming does Not magnify the output. ~n~nAccepts values from 1 To 4. ~n~n"
114-
helpTextboxContent[10] = "- Warning : ~nChanging zoom level will reset the joint markers to initial positions. Zoom first, adjust markers later. ~n~n"
115-
helpTextboxContent[11] = "FRAMES: ~nThis sets the amount of frames output will generate. ~n~nAccepts values from 1 to 20. ~n~n"
116-
helpTextboxContent[12] = "- Note : ~nLimb bending will automatically adjust to number of frames. ~n~n"
117-
helpTextboxContent[13] = "BG COLOR R,G,B: ~nThis changes the background color of the output. ~n~nAccepts values from 0 to 255. ~n~n"
118-
helpTextboxContent[14] = "- Note : ~nWhen saving file, the output will automatically set background to magenta, so no manual setting before saving is needed. ~n~n"
119-
helpTextboxContent[15] = "SAVE AS INDEXED BITMAP : ~nWhen ticked the output will be saved as a BMP file indexed to the CC palette. ~nWhen not ticked, output will be saved as a non-indexed PNG. ~n~n"
120-
helpTextboxContent[16] = "- Warning : ~nTHE INDEXING PROCESS IS SLOW! ~nI've done my best to speed it up but it still isn't blazing fast like PNG saving. ~nWhen saving indexed, the app may hang and appear unresponsive but in fact it's doing what it's supposed to. ~nFor best results, DO NOT TOUCH ANYTHING until the background color reverts from magenta to whatever it was before!"
121-
SetGadgetText(TAppGUI.editHelpTextbox,helpTextboxContent[0]+helpTextboxContent[1]+helpTextboxContent[2]+helpTextboxContent[3]+helpTextboxContent[4]+helpTextboxContent[5]+helpTextboxContent[6]+helpTextboxContent[7]+helpTextboxContent[8]+helpTextboxContent[9]+helpTextboxContent[10]+helpTextboxContent[11]+helpTextboxContent[12]+helpTextboxContent[13]+helpTextboxContent[14]+helpTextboxContent[15]+helpTextboxContent[16]);
97+
SetGadgetText(TAppGUI.editHelpTextbox,helpTextboxContent);
12298
'Delete no longer used MainWindow
12399
FreeGadget(mainWindow)
124100
EndFunction

0 commit comments

Comments
 (0)