Ejemplo n.º 1
0
 public static void Init(AdvData pA, VTList pVT, ItemList pItems, PersonList pPersons)
 {
     Items   = pItems;
     Persons = pPersons;
     A       = pA;
     VT      = pVT;
 }
Ejemplo n.º 2
0
 public CharacterInstance(AdvCharacter chr, AdvData data)
     : base(chr)
 {
     Character = chr;
     mAdvData  = data;
     setName(chr.Name);
 }
Ejemplo n.º 3
0
    public void view(AdvData data)
    {
        AdvText txt = (AdvText)data;

        Debug.Log (txt.Label + ":" + txt.AdvType + ":" + txt.Message);

        if(isNotNull(txt.Place)){
            labelMiniWindow.text = txt.Place;
        }

        if(isNotNull(txt.BackGround)){
            Sprite[] textures = Resources.LoadAll<Sprite>("bg");
            Sprite bgSprite = System.Array.Find<Sprite>(textures
                                                        ,(sprite) => sprite.name.Equals(txt.BackGround));
            if(bgSprite != null){
                bg.sprite = bgSprite;
            }
        }

        if(isNotNull(txt.CharaImg)){
            var charaSprite = Resources.Load<Sprite>("chara/" + txt.CharaImg);
            if(charaSprite != null){
                chara.sprite = charaSprite;
            }
        }
        labelWindowWriter.start(txt.Message);
    }
Ejemplo n.º 4
0
 public AdvFileWriter(AdvData data, TreeView gamepool, TreeView mediapool, string zipPassword)
 {
     ZipConstants.DefaultCodePage = 1252;
     mData      = data;
     mGamepool  = gamepool;
     mMediapool = mediapool;
     mZipPwd    = zipPassword;
 }
Ejemplo n.º 5
0
        public static void drawDepthHandle(Graphics g, AdvData data, Vec2i position, float depth, Color color)
        {
            int ycenter = (int)(depth * data.WalkGridSize / 2 - data.WalkGridSize / 4);
            Pen cp      = new Pen(color);

            g.DrawLine(cp, position.x, position.y, position.x, ycenter);
            g.FillRectangle(new SolidBrush(color), position.x - 2, ycenter - 2, 5, 5);
            g.DrawRectangle(cp, position.x - 5, ycenter - 5, 10, 10);
        }
Ejemplo n.º 6
0
        public Fonts(AdvData data)
        {
            InitializeComponent();
            mData = data;
            System.Drawing.Text.InstalledFontCollection fonts = new System.Drawing.Text.InstalledFontCollection();
            foreach (FontFamily fam in fonts.Families)
            {
                if (fam.IsStyleAvailable(FontStyle.Regular))
                {
                    font.Items.Add(fam.Name);
                }
            }
            mFonts = data.Settings.Fonts;
            fontlist.SelectedIndexChanged += new EventHandler(fontlist_SelectedIndexChanged);
            preview.Paint += new PaintEventHandler(preview_Paint);
            font.DrawItem += new DrawItemEventHandler(font_DrawItem);

            for (int i = 0; i < mFonts.Count; ++i)
            {
                fontlist.Items.Add("");
                setListName(i, mFonts[i] as FontInfo);
            }

            charset.Items.Add("Western");
            charset.Items.Add("East european");
            charset.Items.Add("Russian");
            charset.Items.Add("Greek");
            charset.Items.Add("Turkish");
            charset.Items.Add("Arabic");
            charset.Items.Add("Hebrew");
            charset.Items.Add("Vietnamese");
            charset.Items.Add("Thai");
            charset.Items.Add("Baltic");
            charset.Items.Add("Japanese ShiftJIS");
            charset.Items.Add("Dos OEM");
            charset.Items.Add("Symbol");

            for (int i = 6; i <= 40; ++i)
            {
                fontsize.Items.Add(Convert.ToString(i));
            }

            for (int i = -5; i <= 5; ++i)
            {
                letterspacing.Items.Add(Convert.ToString(i));
            }

            if (fontlist.Items.Count > 0)
            {
                fontlist.SelectedIndex = 0;
            }
            else
            {
                //TODO disable controls
            }
        }
Ejemplo n.º 7
0
    public void select(AdvData data)
    {
        advSelect = (AdvSelect)data;

        lblButton1.text = advSelect.Select1;
        lblButton2.text = advSelect.Select2;
        lblButton3.text = advSelect.Select3;
        lblButton4.text = advSelect.Select4;

        show ();
    }
Ejemplo n.º 8
0
        public LanguageDlg(AdvData data)
        {
            InitializeComponent();
            mData = data;
            Language  orig         = mData.Languages["origin"];
            ArrayList speech       = orig.getWords(Language.Section.Speech);
            ArrayList speechsounds = orig.getWords(Language.Section.Speech_Sounds);

            for (int i = 0; i < speech.Count; ++i)
            {
                string origtxt   = (string)speech[i];
                string origvoice = (string)speechsounds[i];
                speechGrid.Rows.Add(origvoice, origtxt);
            }
            ArrayList offspeech       = orig.getWords(Language.Section.Offspeech);
            ArrayList offspeechsounds = orig.getWords(Language.Section.Offspeech_Sounds);

            for (int i = 0; i < offspeech.Count; ++i)
            {
                string origtxt   = (string)offspeech[i];
                string origvoice = (string)offspeechsounds[i];
                offspeechGrid.Rows.Add(origvoice, origtxt);
            }
            ArrayList showinfo = orig.getWords(Language.Section.Showinfo);

            foreach (string str in showinfo)
            {
                showinfoGrid.Rows.Add("", str);
            }
            ArrayList textout = orig.getWords(Language.Section.Textout);

            foreach (string str in textout)
            {
                textoutGrid.Rows.Add("", str);
            }
            ArrayList setstring = orig.getWords(Language.Section.Setstring);

            foreach (string str in setstring)
            {
                setstringGrid.Rows.Add("", str);
            }
            ArrayList textscenes = orig.getWords(Language.Section.Textscenes);

            foreach (string str in textscenes)
            {
                textsceneGrid.Rows.Add("", str);
            }
            ArrayList commands = orig.getWords(Language.Section.Commands);

            foreach (string str in commands)
            {
                commandsGrid.Rows.Add("", str);
            }
        }
Ejemplo n.º 9
0
        public CharacterDlg(AdvCharacter chr, AdvData data)
        {
            InitializeComponent();
            this.stateFrameImage1.ClientSizeChanged += new EventHandler(stateFrameImage1_ClientSizeChanged);
            mCharacter = chr;
            updateCharacter();
            string[] labels = new string[36];
            labels[0]  = "Stand front";
            labels[1]  = "Stand back";
            labels[2]  = "Stand right";
            labels[3]  = "Walk front";
            labels[4]  = "Walk back";
            labels[5]  = "Walk right";
            labels[6]  = "Talk, Stand front";
            labels[7]  = "Talk, Stand back";
            labels[8]  = "Talk, Stand right";
            labels[9]  = "Talk, Walk front";
            labels[10] = "Talk, Walk back";
            labels[11] = "Talk, Walk right";
            labels[12] = "Bored 1";
            labels[13] = "Bored 2";
            labels[14] = "Pickup front";
            labels[15] = "Pickup right";
            for (int i = 16; i < 36; ++i)
            {
                labels[i] = chr.getStateName(i);
            }
            this.font.Items.Add("Default");
            for (int i = 0; i < data.Settings.Fonts.Count; ++i)
            {
                FontInfo fi = (FontInfo)data.Settings.Fonts[i];
                this.font.Items.Add(fi.name + " (" + fi.size + ")");
            }
            for (int i = 1; i < 10; ++i)
            {
                this.walkspeed.Items.Add(i);
            }
            this.stateFrameImage1.setStateLables(labels);
            this.stateFrameImage1.Data            = chr;
            this.stateFrameImage1.BackgroundColor = data.Persistence.CharBackColor;

            this.text_color.BackColor     = Color.FromArgb(Utilities.convertColor(chr.TextColor));
            this.font.SelectedIndex       = chr.Font;
            this.walksound.Text           = chr.Walksound;
            this.walkspeed.SelectedIndex  = chr.WalkSpeed - 1;
            this.nozoom.Checked           = chr.NoZoom;
            this.leftanim.Checked         = chr.RealLeftAnimations;
            this.memory_resistant.Checked = chr.MemoryReistent;
            this.ghostmode.Checked        = chr.Ghost;
            this.startzoom.Value          = chr.Zoom;

            mData = data;
        }
Ejemplo n.º 10
0
 public RoomCtrlDlg(Room room, AdvData data, MainForm mf)
 {
     InitializeComponent();
     mRoom   = room;
     mData   = data;
     mParent = mf;
     for (int i = 1; i <= 9; ++i)
     {
         zoomfactor.Items.Add(i);
     }
     for (int i = 0; i <= 10; ++i)
     {
         obj_state.Items.Add(i);
     }
     zoomfactor.SelectedItem  = mRoom.Zoom;
     doublewalkmap.Checked    = mRoom.DoubleWalkmap;
     roomwidth.Minimum        = data.WindowXRes;
     roomwidth.Maximum        = data.Settings.Resolution.x * 3;
     roomheight.Minimum       = data.Settings.Resolution.y;
     roomheight.Maximum       = data.Settings.Resolution.y * 2;
     roomwidth.Value          = mRoom.Size.x < roomwidth.Minimum ? roomwidth.Minimum : mRoom.Size.x;
     roomheight.Value         = mRoom.Size.y;
     light_color.BackColor    = mRoom.Lighting;
     mDragOffset.x            = -1;
     scroller.Paint          += new PaintEventHandler(scroller_Paint);
     scroller.MouseDown      += new MouseEventHandler(scroller_MouseDown);
     scroller.MouseMove      += new MouseEventHandler(scroller_MouseMove);
     scroller.MouseUp        += new MouseEventHandler(scroller_MouseUp);
     roomwidth.ValueChanged  += new EventHandler(roomwidth_ValueChanged);
     roomheight.ValueChanged += new EventHandler(roomheight_ValueChanged);
     mFxShapes          = new FxShapeTabCtrl(mRoom.FXShapes, this);
     mFxShapes.Visible  = false;
     mFxShapes.Location = objectgroup.Location;
     this.Controls.Add(mFxShapes);
     mInvSpacing          = new NumericUpDown();
     mInvSpacing.Visible  = false;
     mInvSpacing.Location = objectgroup.Location;
     mInvSpacing.Value    = room.InvSpacing;
     mInvSpacing.Minimum  = 2;
     mInvSpacing.Maximum  = 20;
     this.Controls.Add(mInvSpacing);
     mInvSpacing.ValueChanged += new EventHandler(mInvSpacing_ValueChanged);
 }
Ejemplo n.º 11
0
 public ScriptDlg(Script scr, AdvData data)
 {
     mData   = data;
     mScript = scr;
     InitializeComponent();
     int[] tabs = { 20, 40, 60, 80, 100, 120, 140 };
     scripttext.SelectionTabs      = tabs;
     linenumberbox.Paint          += new PaintEventHandler(linenumberbox_Paint);
     scripttext.VScroll           += new EventHandler(scripttext_VScroll);
     scripttext.TextChanged       += new EventHandler(scripttext_TextChanged);
     scripttext.MouseDown         += new MouseEventHandler(scripttext_MouseDown);
     scripttext.KeyUp             += new KeyEventHandler(scripttext_KeyUp);
     scripttext.KeyDown           += new KeyEventHandler(scripttext_KeyDown);
     matches.SelectedIndexChanged += new EventHandler(matches_SelectedIndexChanged);
     this.FormClosed += new FormClosedEventHandler(ScriptDlg_FormClosed);
     //scripttext
     updateScript();
     //parsing stuff
     mParser = new PcdkParser(data.Settings.ScriptingLanguage);
     mParser.initSyntax();
     mParser.Comment    += new PcdkParser.commentCB(colorComment);
     mParser.Function   += new PcdkParser.functionCB(colorFunction);
     mParser.ParseError += new PcdkParser.parseError(mParser_ParseError);
     mKeywordFont        = new Font(scripttext.Font, FontStyle.Bold);
     parseScript();
     if (!mHistory.Contains(scr))
     {
         if (mHistory.Count > 4)
         {
             mHistory.RemoveAt(4);
         }
         mHistory.Insert(0, scr);
     }
     else
     {
         mHistory.Remove(scr);
         mHistory.Insert(0, scr);
     }
 }
Ejemplo n.º 12
0
        public MouseIcons(AdvData data)
        {
            InitializeComponent();
            mData = data;
            this.stateFrameImage1.StateChanged   += new StateFrameImage.StateEventHandler(stateFrameImage1_StateChanged);
            this.stateFrameImage1.PictureBoxSize  = new Size(96, 96);
            this.stateFrameImage1.PictureChanged += new EventHandler(stateFrameImage1_PictureChanged);
            this.command.SelectedIndexChanged    += new EventHandler(command_SelectedIndexChanged);
            this.FormClosed += new FormClosedEventHandler(MouseIcons_FormClosed);
            this.rc_change.CheckedChanged += new EventHandler(rc_change_CheckedChanged);
            this.command.Items.Add("walkto (standard)");
            this.command.Items.Add("loading icon");
            foreach (KeyValuePair <string, string> pair in mData.Settings.Commands)
            {
                this.command.Items.Add(pair.Key);
            }
            this.command.SelectedIndex = 0;
            string[] labels = new string[10] {
                "S", "1", "2", "3", "4", "5", "6", "7", "8", "L"
            };
            this.stateFrameImage1.setStateLables(labels);
            this.stateFrameImage1.Data = mData.Cursor;
            switch (data.Settings.RightClick)
            {
            case 0:
                this.rc_change.Checked = true;
                break;

            case 1:
                this.rc_icon_one.Checked = true;
                break;

            case 2:
                this.rc_nothing.Checked = true;
                break;
            }
            this.mouse_wheel.Checked = data.Settings.UseMouseWheel;
        }
Ejemplo n.º 13
0
 public static void endRefresh(AdvData data)
 {
     for (int i = 0; i < (int)Language.Section.NumSections; ++i)
     {
         ArrayList encountersToRemove = new ArrayList();
         for (int j = 0; j < mEncountered[i].Count; ++j)
         {
             if (!(bool)mEncountered[i][j])
             {
                 encountersToRemove.Add(j);
             }
         }
         for (int c = encountersToRemove.Count - 1; c >= 0; --c)
         {
             int removeMe = (int)encountersToRemove[c];
             mEncountered[i].RemoveRange(removeMe, 1);
             foreach (KeyValuePair <string, Language> langpair in data.Languages)
             {
                 Language lang = langpair.Value;
                 lang.mSections[i].RemoveRange(removeMe, 1);
             }
         }
     }
 }
Ejemplo n.º 14
0
        public Room(AdvData data)
        {
            mData              = data;
            Name               = "Room" + (data.NumRooms + 1);
            Size               = new Vec2i(data.WindowXRes, data.Settings.Resolution.y);
            Depthmap           = new Vec2i(5, 10);
            Zoom               = 3;
            Background         = "";
            ParallaxBackground = "";
            FXShapes           = new ArrayList();
            for (int i = 0; i < 3; ++i)
            {
                FxShape fs = new FxShape(i);
                FXShapes.Add(fs);
            }
            Vec2i wmsize = data.Settings.Resolution / data.WalkGridSize;

            wmsize.x  *= 3 * 2;
            wmsize.y  *= 2 * 2;
            Walkmap    = new WalkMapEntry[wmsize.x, wmsize.y];
            Lighting   = Color.White;
            InvScale   = new Vec2f(1.0f, 1.0f);
            InvSpacing = 10;
        }
Ejemplo n.º 15
0
 public ObjectInstance(AdvObject obj, AdvData data)
     : base(obj)
 {
     Object   = obj;
     mAdvData = data;
 }
Ejemplo n.º 16
0
 public Settings(AdvData data)
 {
     InitializeComponent();
     mData = data;
     setControls();
 }
Ejemplo n.º 17
0
 public CommandsAndBools(AdvData data)
 {
     InitializeComponent();
     mData = data;
     setControls();
 }