protected void ViewportChanged(ClientViewport NewViewport) { ContentView.RemoveAllSubviews(); // Don't do anything if we didn't receive a new state Viewport = NewViewport; if (Viewport == null) { return; } ContentView.AddSubview(new SkillLabel(Viewport.Player.Level)); SkillLabel ExperienceLabel = new SkillLabel("Experience", delegate() { return(new SkillLabel.SkillValue() { Value = Viewport.Player.Experience, Percent = 0 }); }); ContentView.AddSubview(ExperienceLabel); SkillLabel HitpointLabel = new SkillLabel("Hitpoints", delegate() { return(new SkillLabel.SkillValue() { Value = Viewport.Player.Health, Percent = 0 }); }); ContentView.AddSubview(HitpointLabel); SkillLabel ManaLabel = new SkillLabel("Mana", delegate() { return(new SkillLabel.SkillValue() { Value = Viewport.Player.Mana, Percent = 0 }); }); ContentView.AddSubview(ManaLabel); SkillLabel CapacityLabel = new SkillLabel("Capacity", delegate() { return(new SkillLabel.SkillValue() { Value = Viewport.Player.Capacity, Percent = 0 }); }); ContentView.AddSubview(CapacityLabel); ContentView.AddSubview(new SkillLabel(Viewport.Player.MagicLevel)); foreach (ClientSkill Skill in Viewport.Player.Skill.Values) { ContentView.AddSubview(new SkillLabel(Skill)); } NeedsLayout = true; }
protected void ViewportChanged(ClientViewport NewViewport) { ContentView.RemoveAllSubviews(); // Don't do anything if we didn't receive a new state Viewport = NewViewport; if (Viewport == null) return; ContentView.AddSubview(new SkillLabel(Viewport.Player.Level)); SkillLabel ExperienceLabel = new SkillLabel("Experience", delegate() { return new SkillLabel.SkillValue() { Value = Viewport.Player.Experience, Percent = 0 }; }); ContentView.AddSubview(ExperienceLabel); SkillLabel HitpointLabel = new SkillLabel("Hitpoints", delegate() { return new SkillLabel.SkillValue() { Value = Viewport.Player.Health, Percent = 0 }; }); ContentView.AddSubview(HitpointLabel); SkillLabel ManaLabel = new SkillLabel("Mana", delegate() { return new SkillLabel.SkillValue() { Value = Viewport.Player.Mana, Percent = 0 }; }); ContentView.AddSubview(ManaLabel); SkillLabel CapacityLabel = new SkillLabel("Capacity", delegate() { return new SkillLabel.SkillValue() { Value = Viewport.Player.Capacity, Percent = 0 }; }); ContentView.AddSubview(CapacityLabel); ContentView.AddSubview(new SkillLabel(Viewport.Player.MagicLevel)); foreach (ClientSkill Skill in Viewport.Player.Skill.Values) ContentView.AddSubview(new SkillLabel(Skill)); NeedsLayout = true; }