#	the Free Software Foundation; either version 2 of the License, or
#	(at your option) any later version.
#
#	This program is distributed in the hope that it will be useful,
#	but WITHOUT ANY WARRANTY; without even the implied warranty of
#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#	GNU General Public License for more details.
#
#	You should have received a copy of the GNU General Public License along
#	with this program; if not, write to the Free Software Foundation, Inc.,
#	51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import barf, cfg, random, json, collections, random
from random import random as rand
from random import randint

types = cfg.set()
attributes = cfg.set()

types.load('./data/creature_types.json', suppress=True)
attributes.load('./data/attributes.json', suppress=True)

cdict = collections.OrderedDict({})

class Creature:
	def __init__(self):
		self.barf = barf.Barf
		# Can probably do this better, but it's still
		# better than it previously was.
		self.types = types.__dict__
		self.attributes = attributes.__dict__
		# Purely to make console easier to read.
예제 #2
0
    def okbutton(self):
        if self.useexternal_code.isChecked():
            cfg.set('stellar', 'codeeditor', str(self.inp_codeeditor.text()))
            cfg.codeeditor = str(self.inp_codeeditor.text())
        else:
            cfg.set('stellar', 'codeeditor', '')
            cfg.codeeditor = ''
            
        if self.useexternal_sound.isChecked():
            cfg.set('stellar', 'soundeditor', str(self.inp_soundeditor.text()))
            cfg.soundeditor = str(self.inp_soundeditor.text())
        else:
            cfg.set('stellar', 'soundeditor', '')
            cfg.codeeditor = ''
            
        if self.useexternal_img.isChecked():
            cfg.set('stellar', 'imageeditor', str(self.inp_imageeditor.text()))
            cfg.imageeditor = str(self.inp_imageeditor.text())
        else:
            cfg.set('stellar', 'imageeditor', '')
            cfg.codeeditor = ''

        cfg.save()

        self.close()