Exemple #1
0
def main():
	storys = engine.getStoryList()
	story = True
	print 'start game: input \'help\' get help infomation'
	while story:
		story = choose_story(storys)
		if not story:
			break
		visit_story(story)
#coding:utf-8
import sublime, sublime_plugin
import engine, stools
# 一个插件150行……我是人民的罪人

helpinfo = u'''帮助信息:请联系Sprout'''
endFlag = 'end'
startFlag = 'start'
story_file_suffix = '.sfs'
functions = {}
all_options_num = 0
story_on = ''
chapter_on = startFlag

storys = engine.getStoryList()

prefix_dict = {
	'~': '',
	':': '-',
	'>': '>',
	}

def insert_2_gamefile(msg, mode=':'):
	global prefix_dict, story_file_suffix
	f = sublime.active_window().open_file('my_story'+story_file_suffix)
	content = ''
	print 'mode:' + mode+'|'
	print prefix_dict.get(mode)
	print prefix_dict.keys()
	for line in msg.split('\n'):
		content += str(prefix_dict.get(mode)) + line + '\n'