public void Draw(int ID, int x, int y) { try { var Map = KMaps[ID]; var Scroll = KScroll[ID]; var Lay = Layers[ID]; #if DijkstraPathDebug var L = Map.Layers[Lay]; foreach (KthuraObject O in L.Objects) { if (O.kind == "Actor") { var A = (KthuraActor)O; if (A.Walking) { BubConsole.CSay($"Actor: {A.Tag}; Walking {A.Walking}; Moving: {A.Moving}; Path-Index: {A.PathIndex}; Length: {A.PathLength}"); BubConsole.CSay($"Current position: ({A.x},{A.y})"); BubConsole.CSay($"Moving to: ({A.MoveX},{A.MoveY})"); BubConsole.CSay($"Walkingto: ({A.WalkingToX},{A.WalkingToY})"); } } } #endif KthuraDraw.DrawMap(Map, Lay, Scroll.ScrollX, Scroll.ScrollY, x, y); } catch (Exception Moron) { Crash($"Draw(Res#{ID},{x},{y}):", Moron); } }
public int Load(string name) { try { var mappath = $"Maps/Kthura/{name.Trim()}/"; BubConsole.WriteLine($"Loading Kthura map {mappath}", 180, 0, 255); if (!(SBubble.JCR.Exists($"{mappath}Objects") && SBubble.JCR.Exists($"{mappath}Data"))) { SBubble.MyError("Kthura LoadMap Error", $"Error finding the two required files for map {name}", $"Found({mappath}Objects) => {SBubble.JCR.Exists($"{mappath}Objects")}\nFound({mappath}Data) => {SBubble.JCR.Exists($"{mappath}Data")}"); return(0); } var KMap = Kthura.Load(SBubble.JCR, mappath, SBubble.JCR); BubConsole.WriteLine($"Kthura map {mappath} loaded", 180, 0, 255); return(Assign(KMap)); } catch (Exception Ellende) { if (JCR6.JERROR != "") { Crash(JCR6.JERROR); } else { Crash(Ellende); } BubConsole.CSay(Ellende.StackTrace); return(0); } }
void VisByLabel(int ID, string label, bool value) { try { var L = KMaps[ID].Layers[Layers[ID]]; if (!L.LabelMap.ContainsKey(label)) { Console.Beep(); BubConsole.CSay($"WARNING! Label '{label}' not found!"); foreach (string k in L.LabelMap.Keys) { BubConsole.CSay("= Has label: '{label}'"); } } foreach (KthuraObject O in L.LabelMap[label]) { O.Visible = value; } } catch (Exception Poepzooitje) { #if DEBUG SBubble.MyError($"Kthura.VisByLabel({ID},\"{label}\",{value}):", Poepzooitje.Message, $"{LuaTrace}\n\nC# Trace{Poepzooitje.StackTrace}"); #else SBubble.MyError($"Kthura.VisByLabel({ID},\"{label}\",{value}):", Poepzooitje.Message, LuaTrace); #endif } }