Skip to content

Commit a32f5e0

Browse files
committed
Fixed modules readding templates when refresh
1 parent 92f3661 commit a32f5e0

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

lib/editor.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,11 @@ class _EditorPageState extends State<EditorPage> {
382382
icon: const Icon(Icons.play_arrow),
383383
tooltip: "Run Project",
384384
),
385+
IconButton(
386+
onPressed: () => {},
387+
icon: const Icon(Icons.assessment_rounded),
388+
tooltip: "Toggle Console",
389+
),
385390
IconButton(
386391
onPressed: () => {Navigator.pop(context)},
387392
icon: const Icon(Icons.close),

lib/modules/module_core.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CoreModule extends Module { //TODO doesnt work
3939

4040
@override
4141
void onInitialized(ModulesManager modulesManager, BuildContext buildContext) async {
42-
42+
super.onInitialized(modulesManager, buildContext);
4343
var template = Template(
4444
"Empty", //title
4545
"Empty project", //desc

lib/modules/module_minecraft.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class MinecraftModule extends Module {
5858

5959
@override
6060
void onInitialized(ModulesManager modulesManager, BuildContext buildContext) async {
61+
super.onInitialized(modulesManager, buildContext);
6162
if (Platform.isWindows) {
6263
comMojang = Platform.environment['LOCALAPPDATA'] as String;
6364
comMojang +=

lib/util/modules_manager.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class ModulesManager {
3535
}
3636

3737
ModulesManager(BuildContext context) {
38+
internalModules.clear();
3839
internalModules.add(CoreModule());
3940
internalModules.add(MinecraftModule());
4041
}
@@ -95,7 +96,9 @@ abstract class Module {
9596
Module(this.name, this.desc, this.author, this.version, this.imageRaw,
9697
this.identifier);
9798

98-
void onInitialized(ModulesManager modulesManager, BuildContext buildContext);
99+
void onInitialized(ModulesManager modulesManager, BuildContext buildContext){
100+
templates.clear();
101+
}
99102
List<String> onAutoComplete(String language, String lastToken);
100103
void addTemplate(Template template) {
101104
templates.add(template);

0 commit comments

Comments
 (0)