public override void InitState() { base.InitState(); MenuSongSrc = new VSoundSource("Foom/Song/menu1.mp3"); //e2 MenuSongSound = MenuSongSrc.Play2D(true); SUI = new FusionEngine.Resonance.UI(); var TitleBG = new ImageForm().Set(0, 0, AppInfo.W, AppInfo.H).SetImage(new Texture2D("Foom/Img/titlebg1.jpg", LoadMethod.Single, false)); var foomLab = new ImageForm().Set(AppInfo.W / 2 - 350, 40, 700, 356).SetImage(new Texture2D("Foom/Img/foom1.png", LoadMethod.Single, true)); TitleBG.Add(foomLab); var StartGame = new ButtonForm().Set(AppInfo.W / 2 - 120, 380, 260, 40, "Begin..."); var ExitGame = new ButtonForm().Set(AppInfo.W / 2 - 120, 430, 260, 40, "Leave..."); TitleBG.Add(StartGame); TitleBG.Add(ExitGame); SUI.Root.Add(TitleBG); StartGame.Click = (b) => { MenuSongSound.Stop(); FusionApp.PushState(new IntroState(), true); }; }
public override void InitState() { SUI = new UI(); var bg = new ImageForm().Set(0, 0, AppInfo.W, AppInfo.H, "").SetImage(new Texture2D("FoomED/bg1.jpg", LoadMethod.Single, false)); SUI.Root.Add(bg); var back = new ButtonForm().Set(5, 5, 80, 30, "Back"); bg.Add(back); back.Click = (b) => { FusionApp.PopState(); }; var lab = new LabelForm().Set(25, 80, 200, 30, "Map Title:"); bg.Add(lab); TextBoxForm map_name = new TextBoxForm().Set(120, 75, 200, 30, "") as TextBoxForm; bg.Add(map_name); map_name.Enter = (txt) => { Directory.CreateDirectory("Game/Maps/" + txt + "/"); var edit_state = new EditMapState(txt); FusionApp.PushState(edit_state); }; }
private async void UpdateChat() { try { var chat = await FusionApp.GetChat(); if (chat.Error == false) { spMessages.Children.Clear(); foreach (var message in chat.Chat) { if (message.Author[0] == User.UserId) { spMessages.Children.Add(new ucSentBubble(message)); } else { spMessages.Children.Add(new ucReceivedBubble(message)); } } } else { MessageBox.Show(chat.Message, "FusionAPI.dev"); } } catch { } }
public static void InitFusion( ) { MainVM = new ManagedHost( ); ScriptSource init_ide_src = new ScriptSource("data/script/ide/ide_init.vs"); Compiler comp = new Compiler(); CompiledSource init_ide_compiled = comp.Compile(init_ide_src); MainVM.SetEntry(init_ide_compiled.EntryPoint); void InitIDE(int w, int h, int fs) { App = new FusionIDE(w, h, fs == 1); InitState = new States.CodeScreen(); App.Run(); } CFuncLink initIDE = new CFuncLink { Link = (t) => { InitIDE(t[0], t[1], t[2]); return(null); } }; MainVM.AddCFunc("InitIDE", initIDE); CodeScope scope = MainVM.RunEntry( ); }
private async void btnRefresh_Click(object sender, RoutedEventArgs e) { await FusionApp.RefreshApp(); lblUserCount.Content = Fusion.App.UserCount; lblApis.Content = Fusion.App.ApiCount; lblActiveApis.Content = Fusion.App.ActiveApis; lblAppName.Content = Fusion.App.AppName; lblAppDesc.Content = Fusion.App.AppDescription; }
private async void btnUpdatePass_Click(object sender, RoutedEventArgs e) { var resetResponse = await FusionApp.ResetPassword(tbOldPassword.Password, tbNewPassword.Password); if (resetResponse.Error == false) { MessageBox.Show(resetResponse.Message, "FusionAPI.dev"); } else { MessageBox.Show(resetResponse.Message, "FusionAPI.dev"); } }
private async void btnTrack_Click(object sender, RoutedEventArgs e) { var apiResponse = await FusionApp.ExecuteAPI("1528750760833494526", tbIP.Text); if (apiResponse.Error == false) { MessageBox.Show($"{apiResponse.Message}{Environment.NewLine}{Environment.NewLine}Raw Response{Environment.NewLine}{apiResponse.Response}"); FreeGEO geoResults = JsonConvert.DeserializeObject <FreeGEO>(apiResponse.Response); lblCity.Content = geoResults.city; lblCountryCode.Content = geoResults.country_code; lblCountryName.Content = geoResults.country_name; lblLatLon.Content = $"{geoResults.latitude} / {geoResults.longitude}"; lblRegionName.Content = geoResults.region_name; } else { MessageBox.Show(apiResponse.Message); } }
public override void InitState() { base.InitState(); var win = new WindowForm().Set(50, 50, 450, 300, "FoomED"); var bg = new ImageForm().Set(0, 0, AppInfo.W, AppInfo.H, "").SetImage(new Texture2D("FoomED/bg1.jpg", LoadMethod.Single, false)); SUI = new UI(); var new_map = new ButtonForm().Set(10, 40, 120, 30, "New Map"); win.Add(new_map); SUI.Root.Add(bg); SUI.Root.Add(win); new_map.Click = (b) => { FusionApp.PushState(new NewMapState()); }; }
private async void tbMessage_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { var sendMessage = await FusionApp.SendMessage(tbText.Text); if (sendMessage.Error == false) { spMessages.Children.Insert(0, new ucSentBubble(new ChatResponse { Author = new List <string>() { User.UserId, User.Username }, Content = tbMessage.Text, Edited = false, MessageId = "N/A", Timestamp = 0 })); } else { MessageBox.Show(sendMessage.Message, "FusionAPI.dev"); } tbMessage.Text = ""; tbText.Text = ""; } }