Merge pull request #329 from Effer/Run-Button
Run button on code editor
This commit is contained in:
		@@ -835,6 +835,11 @@ static void redo(Code* code)
 | 
			
		||||
	update(code);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void run()
 | 
			
		||||
{
 | 
			
		||||
	setStudioMode(TIC_RUN_MODE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void doTab(Code* code, bool shift)
 | 
			
		||||
{
 | 
			
		||||
	char* pos = code->cursor.position;
 | 
			
		||||
@@ -1785,6 +1790,7 @@ static void onStudioEvent(Code* code, StudioEvent event)
 | 
			
		||||
	case TIC_TOOLBAR_PASTE: copyFromClipboard(code); break;
 | 
			
		||||
	case TIC_TOOLBAR_UNDO: undo(code); break;
 | 
			
		||||
	case TIC_TOOLBAR_REDO: redo(code); break;
 | 
			
		||||
	case TIC_TOOLBAR_RUN: run(); break;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										13
									
								
								src/studio.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								src/studio.c
									
									
									
									
									
								
							@@ -456,11 +456,20 @@ void drawExtrabar(tic_mem* tic)
 | 
			
		||||
		0b00110000,
 | 
			
		||||
		0b00000000,
 | 
			
		||||
		0b00000000,
 | 
			
		||||
 | 
			
		||||
		0b00000000,
 | 
			
		||||
		0b01000000,
 | 
			
		||||
		0b01100000,
 | 
			
		||||
		0b01110000,
 | 
			
		||||
		0b01100000,
 | 
			
		||||
		0b01000000,
 | 
			
		||||
		0b00000000,
 | 
			
		||||
		0b00000000,
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	static const s32 Colors[] = {8, 9, 6, 5, 5};
 | 
			
		||||
	static const StudioEvent Events[] = {TIC_TOOLBAR_CUT, TIC_TOOLBAR_COPY, TIC_TOOLBAR_PASTE,	TIC_TOOLBAR_UNDO, TIC_TOOLBAR_REDO};
 | 
			
		||||
	static const char* Tips[] = {"CUT [ctrl+x]", "COPY [ctrl+c]", "PASTE [ctrl+v]", "UNDO [ctrl+z]", "REDO [ctrl+y]"};
 | 
			
		||||
	static const StudioEvent Events[] = {TIC_TOOLBAR_CUT, TIC_TOOLBAR_COPY, TIC_TOOLBAR_PASTE,	TIC_TOOLBAR_UNDO, TIC_TOOLBAR_REDO, TIC_TOOLBAR_RUN};
 | 
			
		||||
	static const char* Tips[] = {"CUT [ctrl+x]", "COPY [ctrl+c]", "PASTE [ctrl+v]", "UNDO [ctrl+z]", "REDO [ctrl+y]","RUN [ctrl+r]"};
 | 
			
		||||
 | 
			
		||||
	for(s32 i = 0; i < sizeof Icons / BITS_IN_BYTE; i++)
 | 
			
		||||
	{
 | 
			
		||||
 
 | 
			
		||||
@@ -172,6 +172,7 @@ typedef enum
 | 
			
		||||
	TIC_TOOLBAR_PASTE,
 | 
			
		||||
	TIC_TOOLBAR_UNDO,
 | 
			
		||||
	TIC_TOOLBAR_REDO,
 | 
			
		||||
	TIC_TOOLBAR_RUN,
 | 
			
		||||
} StudioEvent;
 | 
			
		||||
 | 
			
		||||
void setStudioEvent(StudioEvent event);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user