public void initialize() { battleLog = new BattleLog(); generalLog = new GeneralLog(); chatLog = new ChatLog(); frame = new Frame(Configurations.getInstance.logWindowDimensions, Configurations.getInstance.logWindowPosition, Configurations.getInstance.logWindowBorders); tabPanel = new TabPanel(); tabPanel.currentOpenTabIndex = Configurations.getInstance.logTabPanel.currentOpenTabIndex; tabPanel.defaultColor = Configurations.getInstance.logTabPanel.defaultColor; tabPanel.position = Configurations.getInstance.logTabPanel.position; tabPanel.tabs = Configurations.getInstance.logTabPanel.tabs; }
//for (int i = LogManager.getInstance.battleLog.entiries.Count - 1, j = Configurations.getInstance.BORDER_SIZE; // j < LogManager.getInstance.frame.dimensions.height && i >= 0; // i--, j++) // { // Console.SetCursorPosition(LogManager.getInstance.frame.position.x + Configurations.getInstance.BORDER_SIZE, LogManager.getInstance.frame.position.y + LogManager.getInstance.frame.dimensions.height - Configurations.getInstance.BORDER_SIZE - j); // textWidth = LogManager.getInstance.frame.dimensions.width - Configurations.getInstance.BORDER_SIZE * 2; // foreach (string word in LogManager.getInstance.battleLog.entiries[i].Split(' ')) // { // textWidth -= (word.Length + 1); // if (textWidth > 0 && i >= 0) // { // Console.Write(word + " "); // } // else // { // textWidth = LogManager.getInstance.frame.dimensions.width - Configurations.getInstance.BORDER_SIZE * 2 - word.Length; // j++; // if (j < LogManager.getInstance.frame.dimensions.height) // { // Console.SetCursorPosition(LogManager.getInstance.frame.position.x + Configurations.getInstance.BORDER_SIZE, LogManager.getInstance.frame.position.y + Configurations.getInstance.BORDER_SIZE + j); // Console.Write(word + " "); // } // else // { // i = -1; // } // } // } // } public void drawTabs(TabPanel tabPanel) { ConsoleColor originalBGC = Console.BackgroundColor; ConsoleColor originalFGC = Console.ForegroundColor; int lineX = tabPanel.position.x; for (int i = lineX; i < tabPanel.lastCharacterPosition; i++) { Console.SetCursorPosition(i, tabPanel.position.y); Console.Write(" "); } foreach (KeyValuePair<LogTypes, Utilities.Triplet<char, string, ConsoleColor>> tabs in tabPanel.tabs) { if (tabPanel.currentOpenTabIndex == tabs.Key) { Console.BackgroundColor = tabPanel.defaultColor; Console.ForegroundColor = tabs.Value.Third; Console.SetCursorPosition(lineX, tabPanel.position.y); Console.WriteLine(tabs.Value.Second); lineX += tabs.Value.Second.Length + 1; } else { Console.BackgroundColor = tabPanel.defaultColor; Console.ForegroundColor = tabs.Value.Third; Console.SetCursorPosition(lineX, tabPanel.position.y); Utilities.writeSymbol(lineX, tabPanel.position.y, tabs.Value.First); lineX += 2; } } tabPanel.lastCharacterPosition = lineX; Console.BackgroundColor = originalBGC; Console.ForegroundColor = originalFGC; }
public void initialize() { fileCollisionMapping = "collisionMappings.txt"; fileInput = "input.txt"; fileLevelingStats = "levelingDefault.txt"; mapList = "mapList.txt"; NPCDialogFileName = "NPCDialogStrings.txt"; isInitialized = true; shotType = "FireShot"; mainWindowDimensions = new Dimensions(48, 32); mainWindowPosition = new Position((Console.WindowWidth / 2) - (int)Math.Floor((double)(mainWindowDimensions.width / 2)), 1); mainWindowBorders = new BorderSymbols("-", "-", "|", "|", ConsoleColor.Green, ConsoleColor.Green, ConsoleColor.Green, ConsoleColor.Green); //mainWindowPosition = new Position(5, 5); subWindowDimensions = new Dimensions((int) Math.Floor((double)(mainWindowDimensions.width / 2.0)) - 1,(int) Math.Floor((double)(mainWindowDimensions.height / 2.0)) - 1); subWindowPosition = new Position(mainWindowPosition.x + (int)(mainWindowDimensions.width / 2.0) - (int)Math.Floor((double)(subWindowDimensions.width / 2.0)), mainWindowPosition.y + (int)(mainWindowDimensions.height / 2.0) - (int)Math.Floor((double)(subWindowDimensions.height / 2.0))); //subWindowPosition = new Position(10, 10); StatsPanel = new Position(mainWindowPosition.x + mainWindowDimensions.width + 2, 1); //StatsPanel = new Position(70, 5); GameTitle = "ASCII RPG: The Last Stance"; ConsoleBufferWidth = 100; ConsoleBufferHeight = 80; ConsoleWidth = 80; ConsoleHeight = 50; logWindowPosition = new Position(mainWindowPosition.x, mainWindowPosition.y + mainWindowDimensions.height + 2); logWindowDimensions = new Dimensions(mainWindowDimensions.width, 12); logTabPanel = new TabPanel(); logTabPanel.position = new Position(logWindowPosition.x, logWindowPosition.y - 1); logTabPanel.addTab(LogTypes.GeneralLog, 'G', "General", ConsoleColor.Magenta); logTabPanel.addTab(LogTypes.BattleLog, 'B', "Battle", ConsoleColor.DarkRed); logTabPanel.addTab(LogTypes.ChatLog, 'C', "Chat", ConsoleColor.Green); ConsoleColor initialLogBorderColor = logTabPanel.tabs.First().Value.Third; logWindowBorders = new BorderSymbols("-", "-", "|", "|", initialLogBorderColor, initialLogBorderColor, initialLogBorderColor, initialLogBorderColor); }