<commit_before>
from rpg import event
from rpg.ui import components, options, views, widgets
import tkinter

import typing
if typing.TYPE_CHECKING:
    from rpg import app
    from rpg.data import actor
    from typing import Optional

Author = "<NAME>"
Version = "0.1"


@views.view_impl
class MainMenuView(views.View):

    """The Main Menu.

    This View is the default initial view. It displays the title of the game and buttons for the options.

    Options provided by this View are:
        1. "New Game" -> Attempts to push the view named "NewGame"
        2. "Load Game" -> Attempts to push the view named "LoadGame"
        3. "Options" -> Attempts to push the view named "Options"
        4. "Packages" -> Attempts to push the view named "PackageManager"
        5. "Quit" -> Clears the stack and quits the application

    """

    def __init__(self, game: 'app.Game') -> None:
        """Initialize the MainMenuView instance.

        :param game: The app.Game instance
        """
        views.View.__init__(self, game, "MainMenu")
        self._initial_view = True
        self.lblTitle = tkinter.Label(self, text="Text RPG", font=("Helvetica", 28, 'bold'))
        self.frmSpace1 = tkinter.Frame(self)
        self.frmButtons = tkinter.Frame(self)

        self.btnNewGame = widgets.Button(self.frmButtons, "New Game", self._action_new_game)
        self.btnLoadGame = widgets.Button(self.frmButtons, "Load Game", self._action_load_game)
        self.btnOptions = widgets.Button(self.frmButtons, "Options", self._action_options)
        self.btnQuit = widgets.Button(self.frmButtons, "Quit", self._action_quit)

        self.lblTitle.pack()
        self.frmSpace1.pack(pady=10)
        self.btnNewGame.pack(fill='x', expand=True)
        self.btnLoadGame.pack(fill='x', expand=True)
        self.btnOptions.pack(fill='x', expand=True)
        self.btnQuit.pack(fill='x', expand=True)
        self.frmButtons.pack()

    def _action_new_game(self):
        self._game_obj.build_resources()
        self._game_obj.stack.push("NewGame")

    def _action_load_game(self):
        self._game_obj.build_resources()
        self._game_obj.stack.push("LoadGame")

    def _action_quit(self):
        self._game_obj.quit(0)
<commit_msg>Made the Load Game button load a test profile with inventory items<commit_after>
from rpg import event
from rpg.ui import components, options, views, widgets
import tkinter

import typing
if typing.TYPE_CHECKING:
    from rpg import app
    from rpg.data import actor
    from typing import Optional

Author = "<NAME>"
Version = "0.1"


@views.view_impl
class MainMenuView(views.View):

    """The Main Menu.

    This View is the default initial view. It displays the title of the game and buttons for the options.

    Options provided by this View are:
        1. "New Game" -> Attempts to push the view named "NewGame"
        2. "Load Game" -> Attempts to push the view named "LoadGame"
        3. "Options" -> Attempts to push the view named "Options"
        4. "Packages" -> Attempts to push the view named "PackageManager"
        5. "Quit" -> Clears the stack and quits the application

    """

    def __init__(self, game: 'app.Game') -> None:
        """Initialize the MainMenuView instance.

        :param game: The app.Game instance
        """
        views.View.__init__(self, game, "MainMenu")
        self._initial_view = True
        self.lblTitle = tkinter.Label(self, text="Text RPG", font=("Helvetica", 28, 'bold'))
        self.frmSpace1 = tkinter.Frame(self)
        self.frmButtons = tkinter.Frame(self)

        self.btnNewGame = widgets.Button(self.frmButtons, "New Game", self._action_new_game)
        self.btnLoadGame = widgets.Button(self.frmButtons, "Load Game", self._action_load_game)
        self.btnOptions = widgets.Button(self.frmButtons, "Options", self._action_options)
        self.btnQuit = widgets.Button(self.frmButtons, "Quit", self._action_quit)

        self.lblTitle.pack()
        self.frmSpace1.pack(pady=10)
        self.btnNewGame.pack(fill='x', expand=True)
        self.btnLoadGame.pack(fill='x', expand=True)
        self.btnOptions.pack(fill='x', expand=True)
        self.btnQuit.pack(fill='x', expand=True)
        self.frmButtons.pack()

    def _action_new_game(self):
        self._game_obj.build_resources()
        self._game_obj.stack.push("NewGame")

    def _action_load_game(self):
        self._game_obj.build_resources()
        self._game_obj.stack.push("GameView")
        self._game_obj.state.player.name("Test Player")
        self._game_obj.state.player.inventory.add('misc.ore.coal', 100)
        self._game_obj.state.player.inventory.add('misc.ore.tin', 100)
        self._game_obj.state.player.inventory.add('misc.ore.copper', 100)
        self._game_obj.state.player.inventory.add('weapon.short_sword_bronze')
        self._game_obj.state.player.inventory.add('weapon.short_sword_bronze')
        self._game_obj.state.start()

    def _action_quit(self):
        self._game_obj.quit(0)

{'fraction_non_alphanumeric': 0.11554579924166833, 'fraction_numerical': 0.007383755737377769, 'mean_word_length': 3.012810248198559, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6687840', 'n_tokens_mistral': 1630, 'n_tokens_neox': 1584, 'n_words': 386}