/* Authors: Arkeon */ /* Last update: 30.12.02 */ /* Version: 1.0 */ typeof plugin = S;; typeof class = S;; typeof ed = PluginEditor;; typeof posx_e = ObjText;; typeof posy_e = ObjText;; typeof posz_e = ObjText;; typeof MaxDist_e = ObjText;; typeof MaxScale_e = ObjText;; typeof MaxOpacity_e = ObjText;; typeof MinOpacity_e = ObjText;; typeof Texture_b = ObjButton;; typeof SavedType = S;; var posx = 0;; var posy = 0;; var posz = 0;; var MaxDist = 1000;; var MaxScale = 200;; var MinOpacity = 255;; var MaxOpacity = 0;; var Texture = "dms/3d/plugins/flare/flare.png";; proto save=fun [ [Inst r1] ] [[S r1] [S r1] [[S r1]r1] [[S r1]r1]];; fun _OpenNPGfile (d, i, s)= if s==nil then nil else ( let _PtoScol s -> scolfilename in set Texture = scolfilename; ); 0;; fun cbPNGfile (but, a)= _DLGrflopen (_DLGOpenFile _channel ed.PluginEditorEditWin nil nil "PNG\0*.png\0all\0*.*\0\0") @_OpenNPGfile 1; 0;; fun openedit(win, param) = let strextr param -> l in let _GETwindowSizePosition win -> [w h x y] in { set ed = startPluginEditor _channel win 0 0 w h WN_CHILDINSIDE|WN_NOBORDER class; set posx = let getInfo l "posx" -> tmp in if tmp == nil then 0 else atoi tmp; set posy = let getInfo l "posy" -> tmp in if tmp == nil then 0 else atoi tmp; set posz = let getInfo l "posz" -> tmp in if tmp == nil then 0 else atoi tmp; set MaxDist = let getInfo l "MaxDist" -> tmp in if tmp == nil then 1000 else atoi tmp; set MaxScale = let getInfo l "MaxScale" -> tmp in if tmp == nil then 200 else atoi tmp; set MinOpacity = let getInfo l "MinOpacity" -> tmp in if tmp == nil then 255 else atoi tmp; set MaxOpacity = let getInfo l "MaxOpacity" -> tmp in if tmp == nil then 0 else atoi tmp; set Texture = let getInfo l "Texture" -> tmp in if tmp == nil then "dms/3d/plugins/flare/flare.png" else tmp; _CRtext _channel ed.PluginEditorEditWin 5 10 120 20 ET_ALIGN_RIGHT "Max Distance :"; set MaxDist_e = _CReditLine _channel ed.PluginEditorEditWin 130 10 100 20 ET_DOWN itoa MaxDist; _CRtext _channel ed.PluginEditorEditWin 5 40 120 20 ET_ALIGN_RIGHT "Max Scale :"; set MaxScale_e = _CReditLine _channel ed.PluginEditorEditWin 130 40 100 20 ET_DOWN itoa MaxScale; _CRtext _channel ed.PluginEditorEditWin 5 70 120 20 ET_ALIGN_RIGHT "Max Opacity :"; set MaxOpacity_e = _CReditLine _channel ed.PluginEditorEditWin 130 70 100 20 ET_DOWN itoa MaxOpacity; _CRtext _channel ed.PluginEditorEditWin 5 100 120 20 ET_ALIGN_RIGHT "Min Opacity :"; set MinOpacity_e = _CReditLine _channel ed.PluginEditorEditWin 130 100 100 20 ET_DOWN itoa MinOpacity; _CRtext _channel ed.PluginEditorEditWin 5 130 50 20 ET_ALIGN_RIGHT "pos x :"; set posx_e = _CReditLine _channel ed.PluginEditorEditWin 60 130 30 20 ET_DOWN itoa posx; _CRtext _channel ed.PluginEditorEditWin 100 130 50 20 ET_ALIGN_RIGHT "pos y :"; set posy_e = _CReditLine _channel ed.PluginEditorEditWin 155 130 30 20 ET_DOWN itoa posy; _CRtext _channel ed.PluginEditorEditWin 195 130 50 20 ET_ALIGN_RIGHT "pos z :"; set posz_e = _CReditLine _channel ed.PluginEditorEditWin 250 130 30 20 ET_DOWN itoa posz; _CRtext _channel ed.PluginEditorEditWin 5 160 120 20 ET_ALIGN_RIGHT "PNG Picture :"; set Texture_b = _CBbutton (_CRbutton _channel ed.PluginEditorEditWin 130 160 30 20 PB_DEFAULT "Open") @cbPNGfile nil; }; 0;; fun closeedit() = strbuild ("posx"::(_GETtext posx_e)::nil):: ("posy"::(_GETtext posy_e)::nil):: ("posz"::(_GETtext posz_e)::nil):: ("MaxDist"::(_GETtext MaxDist_e)::nil):: ("MaxScale"::(_GETtext MaxScale_e)::nil):: ("MinOpacity"::(_GETtext MinOpacity_e)::nil):: ("MaxOpacity"::(_GETtext MaxOpacity_e)::nil):: ("Texture"::(Texture)::nil):: nil ;; fun savesuppdmi(l) = if l==nil then nil else let l->[a n] in (""::(strcat a.nameInst ".")::nil):: savesuppdmi n ;; fun save(l)= [ nil /* registerF */ nil /* register */ ("plugin"::plugin::nil)::nil /* supplemental Dat */ savesuppdmi l /* supplemental Dmi */ ];; fun IniPlug(file) = set plugin=file; set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @save nil @openedit @closeedit;;