Пример #1
0
        private void doStrChooser(ComboBox scope, pjse.GS.GlobalStr instance, TextBox tbVal, TextBox strText)
        {
            Scope[] s = { Scope.Private, Scope.SemiGlobal, Scope.Global };
            pjse.FileTable.Entry[] items = (scope.SelectedIndex < 0) ? null :
                                           pjse.FileTable.GFT[(uint)SimPe.Data.MetaData.STRING_FILE, inst.Parent.GroupForScope(s[scope.SelectedIndex]), (uint)instance];

            if (items == null || items.Length == 0)
            {
                MessageBox.Show(pjse.Localization.GetString("bow_noStrings")
                                + " (" + pjse.Localization.GetString(s[scope.SelectedIndex].ToString()) + ")");
                return; // eek!
            }

            SimPe.PackedFiles.Wrapper.StrWrapper str = new StrWrapper();
            str.ProcessData(items[0].PFD, items[0].Package);

            int i = (new StrChooser(true)).Strnum(str);

            if (i >= 0)
            {
                bool savedState = internalchg;
                internalchg = true;
                tbVal.Text  = "0x" + SimPe.Helper.HexString((ushort)i);
                doStrValue(scope, instance, (ushort)i, strText);
                internalchg = savedState;
            }
        }
Пример #2
0
 private void doStrValue(ComboBox scope, pjse.GS.GlobalStr instance, ushort strno, TextBox strText)
 {
     Scope[] s = { Scope.Private, Scope.Global, Scope.SemiGlobal };
     strText.Text = (scope.SelectedIndex < 0) ? "" :
                    ((BhavWiz)inst).readStr(s[scope.SelectedIndex], instance, strno, -1, pjse.Detail.ErrorNames);
 }