initial
This commit is contained in:
151
vgui2/vlocalize/CreateTokenDialog.cpp
Normal file
151
vgui2/vlocalize/CreateTokenDialog.cpp
Normal file
@@ -0,0 +1,151 @@
|
||||
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#include "CreateTokenDialog.h"
|
||||
#include "LocalizationDialog.h"
|
||||
|
||||
#include "vgui_controls/TextEntry.h"
|
||||
#include "vgui_controls/Button.h"
|
||||
#include "vgui_controls/MessageBox.h"
|
||||
#include "tier1/KeyValues.h"
|
||||
#include "vgui/ILocalize.h"
|
||||
|
||||
using namespace vgui;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Cosntructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CCreateTokenDialog::CCreateTokenDialog( CLocalizationDialog *pLocalizationDialog ) : Frame(NULL, "CreateTokenDialog"),
|
||||
m_pLocalizationDialog( m_pLocalizationDialog )
|
||||
{
|
||||
Assert( m_pLocalizationDialog );
|
||||
|
||||
MakePopup();
|
||||
|
||||
SetTitle("Create New Token - Localizer", true);
|
||||
|
||||
m_pSkipButton = new Button(this, "SkipButton", "&Skip Token");
|
||||
m_pTokenName = new TextEntry(this, "TokenName");
|
||||
|
||||
m_pTokenValue = new TextEntry(this, "TokenValue");
|
||||
m_pTokenValue->SetMultiline(true);
|
||||
m_pTokenValue->SetCatchEnterKey(true);
|
||||
|
||||
m_pSkipButton->SetCommand("SkipToken");
|
||||
m_pSkipButton->SetVisible(false);
|
||||
|
||||
LoadControlSettings("Resource/CreateTokenDialog.res");
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Destructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CCreateTokenDialog::~CCreateTokenDialog()
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: prompts user to create a single token
|
||||
//-----------------------------------------------------------------------------
|
||||
void CCreateTokenDialog::CreateSingleToken()
|
||||
{
|
||||
// bring us to the front
|
||||
SetVisible(true);
|
||||
RequestFocus();
|
||||
MoveToFront();
|
||||
m_pTokenName->RequestFocus();
|
||||
m_pSkipButton->SetVisible(false);
|
||||
|
||||
m_bMultiToken = false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: loads a file to create multiple tokens
|
||||
//-----------------------------------------------------------------------------
|
||||
void CCreateTokenDialog::CreateMultipleTokens()
|
||||
{
|
||||
SetVisible(true);
|
||||
RequestFocus();
|
||||
MoveToFront();
|
||||
m_pTokenValue->RequestFocus();
|
||||
m_pSkipButton->SetVisible(true);
|
||||
|
||||
m_bMultiToken = true;
|
||||
|
||||
//!! read tokens from file, prompt user to each in turn
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Handles an OK message, creating the current token
|
||||
//-----------------------------------------------------------------------------
|
||||
void CCreateTokenDialog::OnOK()
|
||||
{
|
||||
// get the data
|
||||
char tokenName[1024], tokenValue[1024];
|
||||
m_pTokenName->GetText( tokenName, sizeof( tokenName ) );
|
||||
m_pTokenValue->GetText( tokenValue, sizeof( tokenValue ) );
|
||||
|
||||
if ( Q_strlen( tokenName ) < 4 )
|
||||
{
|
||||
MessageBox *box = new MessageBox("Create Token Error", "Could not create token.\nToken names need to be at least 4 characters long.");
|
||||
box->DoModal();
|
||||
}
|
||||
else
|
||||
{
|
||||
// create the token
|
||||
wchar_t unicodeString[1024];
|
||||
g_pVGuiLocalize->ConvertANSIToUnicode(tokenValue, unicodeString, sizeof(unicodeString) / sizeof(wchar_t));
|
||||
g_pVGuiLocalize->AddString(tokenName, unicodeString, m_pLocalizationDialog->GetFileName() );
|
||||
|
||||
// notify the dialog creator
|
||||
PostActionSignal(new KeyValues("TokenCreated", "name", tokenName));
|
||||
|
||||
// close
|
||||
if (!m_bMultiToken)
|
||||
{
|
||||
PostMessage(this, new KeyValues("Close"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: skips the current token in the multitoken edit mode
|
||||
//-----------------------------------------------------------------------------
|
||||
void CCreateTokenDialog::OnSkip()
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: handles a button command
|
||||
// Input : *command -
|
||||
//-----------------------------------------------------------------------------
|
||||
void CCreateTokenDialog::OnCommand(const char *command)
|
||||
{
|
||||
if (!stricmp(command, "OK"))
|
||||
{
|
||||
OnOK();
|
||||
}
|
||||
else if (!stricmp(command, "SkipToken"))
|
||||
{
|
||||
OnSkip();
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseClass::OnCommand(command);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: handles the close message
|
||||
//-----------------------------------------------------------------------------
|
||||
void CCreateTokenDialog::OnClose()
|
||||
{
|
||||
BaseClass::OnClose();
|
||||
MarkForDeletion();
|
||||
}
|
||||
|
||||
|
||||
56
vgui2/vlocalize/CreateTokenDialog.h
Normal file
56
vgui2/vlocalize/CreateTokenDialog.h
Normal file
@@ -0,0 +1,56 @@
|
||||
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef CREATETOKENDIALOG_H
|
||||
#define CREATETOKENDIALOG_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <VGUI_controls/Frame.h>
|
||||
|
||||
namespace vgui
|
||||
{
|
||||
class Button;
|
||||
class TextEntry;
|
||||
};
|
||||
|
||||
class CLocalizationDialog;
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Creates a new token
|
||||
//-----------------------------------------------------------------------------
|
||||
class CCreateTokenDialog : public vgui::Frame
|
||||
{
|
||||
public:
|
||||
CCreateTokenDialog( CLocalizationDialog *pLocalizationDialog );
|
||||
~CCreateTokenDialog();
|
||||
|
||||
// prompts user to create a single token
|
||||
virtual void CreateSingleToken();
|
||||
|
||||
// loads a token file to prompt the user to create multiple tokens
|
||||
virtual void CreateMultipleTokens();
|
||||
|
||||
private:
|
||||
virtual void OnCommand(const char *command);
|
||||
virtual void OnClose();
|
||||
|
||||
virtual void OnOK();
|
||||
virtual void OnSkip();
|
||||
|
||||
vgui::Button *m_pSkipButton;
|
||||
vgui::TextEntry *m_pTokenName;
|
||||
vgui::TextEntry *m_pTokenValue;
|
||||
CLocalizationDialog *m_pLocalizationDialog;
|
||||
|
||||
bool m_bMultiToken;
|
||||
|
||||
typedef vgui::Frame BaseClass;
|
||||
};
|
||||
|
||||
|
||||
#endif // CREATETOKENDIALOG_H
|
||||
296
vgui2/vlocalize/LocalizationDialog.cpp
Normal file
296
vgui2/vlocalize/LocalizationDialog.cpp
Normal file
@@ -0,0 +1,296 @@
|
||||
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
|
||||
#include "LocalizationDialog.h"
|
||||
#include "CreateTokenDialog.h"
|
||||
|
||||
#include "vgui_controls/Button.h"
|
||||
#include "vgui_controls/ListPanel.h"
|
||||
#include"vgui_controls/TextEntry.h"
|
||||
#include "VGUI/IVGui.h"
|
||||
#include "VGUI/ILocalize.h"
|
||||
#include "VGUI/ISurface.h"
|
||||
#include "tier1/KeyValues.h"
|
||||
#include "vgui_controls/Menu.h"
|
||||
#include "vgui_controls/MenuButton.h"
|
||||
#include "vgui_controls/MessageBox.h"
|
||||
#include "vgui_controls/FileOpenDialog.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace vgui;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CLocalizationDialog::CLocalizationDialog(const char *fileName) : Frame(NULL, "LocalizationDialog")
|
||||
{
|
||||
m_iCurrentToken = -1;
|
||||
|
||||
m_pTokenList = new ListPanel(this, "TokenList");
|
||||
|
||||
m_pTokenList->AddColumnHeader(0, "Token", "Token Name", 128, 128, 1024, 0 );
|
||||
|
||||
m_pLanguageEdit = new TextEntry(this, "LanguageEdit");
|
||||
m_pLanguageEdit->SetMultiline(true);
|
||||
m_pLanguageEdit->SetVerticalScrollbar(true);
|
||||
m_pLanguageEdit->SetCatchEnterKey(true);
|
||||
m_pEnglishEdit = new TextEntry(this, "EnglishEdit");
|
||||
m_pEnglishEdit->SetMultiline(true);
|
||||
m_pEnglishEdit->SetVerticalScrollbar(true);
|
||||
m_pEnglishEdit->SetVerticalScrollbar(true);
|
||||
|
||||
m_pFileMenu = new Menu(this, "FileMenu");
|
||||
|
||||
m_pFileMenu->AddMenuItem(" &Open File ", new KeyValues("FileOpen"), this);
|
||||
m_pFileMenu->AddMenuItem(" &Save File ", new KeyValues("FileSave"), this);
|
||||
m_pFileMenu->AddMenuItem(" E&xit Localizer ", new KeyValues("Close"), this);
|
||||
m_pFileMenuButton = new MenuButton(this, "FileMenuButton", "File");
|
||||
m_pFileMenuButton->SetMenu(m_pFileMenu);
|
||||
m_pApplyButton = new Button(this, "ApplyButton", "Apply");
|
||||
m_pApplyButton->SetCommand(new KeyValues("ApplyChanges"));
|
||||
m_pTestLabel = new Label(this, "TestLabel", "");
|
||||
|
||||
LoadControlSettings("Resource/LocalizationDialog.res");
|
||||
|
||||
strcpy(m_szFileName, fileName);
|
||||
|
||||
char buf[512];
|
||||
Q_snprintf(buf, sizeof( buf ), "%s - Localization Editor", m_szFileName);
|
||||
SetTitle(buf, true);
|
||||
|
||||
// load in the string table
|
||||
if (!g_pVGuiLocalize->AddFile( m_szFileName ) )
|
||||
{
|
||||
MessageBox *msg = new MessageBox("Fatal error", "couldn't load specified file");
|
||||
msg->SetCommand("Close");
|
||||
msg->AddActionSignalTarget(this);
|
||||
msg->DoModal();
|
||||
return;
|
||||
}
|
||||
|
||||
// populate the dialog with the strings
|
||||
StringIndex_t idx = g_pVGuiLocalize->GetFirstStringIndex();
|
||||
while ( idx != vgui::INVALID_STRING_INDEX )
|
||||
{
|
||||
// adds the strings into the table, along with the indexes
|
||||
m_pTokenList->AddItem(new KeyValues("LString", "Token", g_pVGuiLocalize->GetNameByIndex(idx)), idx, false, false);
|
||||
|
||||
// move to the next string
|
||||
idx = g_pVGuiLocalize->GetNextStringIndex(idx);
|
||||
}
|
||||
|
||||
// sort the table
|
||||
m_pTokenList->SetSortColumn(0);
|
||||
m_pTokenList->SortList();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Destructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CLocalizationDialog::~CLocalizationDialog()
|
||||
{
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Handles closing of the dialog - shuts down the whole app
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLocalizationDialog::OnClose()
|
||||
{
|
||||
BaseClass::OnClose();
|
||||
|
||||
// Stop vgui running
|
||||
vgui::ivgui()->Stop();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: lays out the dialog
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLocalizationDialog::PerformLayout()
|
||||
{
|
||||
OnTextChanged();
|
||||
|
||||
BaseClass::PerformLayout();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sets the currently selected token
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLocalizationDialog::OnTokenSelected()
|
||||
{
|
||||
if (m_pTokenList->GetSelectedItemsCount() != 1)
|
||||
{
|
||||
// clear the list
|
||||
m_pLanguageEdit->SetText("");
|
||||
m_pEnglishEdit->SetText("");
|
||||
|
||||
//!! unicode test label
|
||||
m_pTestLabel->SetText("");
|
||||
|
||||
m_iCurrentToken = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// get the data
|
||||
int itemId = m_pTokenList->GetSelectedItem(0);
|
||||
vgui::ListPanelItem *data = m_pTokenList->GetItemData( itemId );
|
||||
Assert( data );
|
||||
m_iCurrentToken = data->userData;
|
||||
wchar_t *unicodeString = g_pVGuiLocalize->GetValueByIndex(m_iCurrentToken);
|
||||
|
||||
char value[2048];
|
||||
g_pVGuiLocalize->ConvertUnicodeToANSI(unicodeString, value, sizeof(value));
|
||||
|
||||
//!! unicode test label
|
||||
m_pTestLabel->SetText(unicodeString);
|
||||
|
||||
// set the text
|
||||
m_pLanguageEdit->SetText(value);
|
||||
m_pEnglishEdit->SetText(value);
|
||||
}
|
||||
|
||||
m_pApplyButton->SetEnabled(false);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Checks to see if any text has changed
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLocalizationDialog::OnTextChanged()
|
||||
{
|
||||
static char buf1[1024], buf2[1024];
|
||||
|
||||
m_pLanguageEdit->GetText( buf1, sizeof( buf1 ) );
|
||||
m_pEnglishEdit->GetText( buf2, sizeof( buf2 ) );
|
||||
|
||||
if (!strcmp(buf1, buf2))
|
||||
{
|
||||
m_pApplyButton->SetEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pApplyButton->SetEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Copies any changes made into the main database
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLocalizationDialog::OnApplyChanges()
|
||||
{
|
||||
if (m_iCurrentToken < 0)
|
||||
return;
|
||||
|
||||
static char buf1[1024];
|
||||
static wchar_t unicodeString[1024];
|
||||
m_pLanguageEdit->GetText( buf1, sizeof( buf1 ) );
|
||||
g_pVGuiLocalize->ConvertANSIToUnicode(buf1, unicodeString, sizeof(unicodeString) / sizeof(wchar_t));
|
||||
|
||||
//!! unicode test label
|
||||
m_pTestLabel->SetText(unicodeString);
|
||||
|
||||
// apply the text change to the database
|
||||
g_pVGuiLocalize->SetValueByIndex(m_iCurrentToken, unicodeString);
|
||||
|
||||
// disable the apply button
|
||||
m_pApplyButton->SetEnabled(false);
|
||||
|
||||
// reselect the token
|
||||
OnTokenSelected();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Message handler for saving current file
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLocalizationDialog::OnFileSave()
|
||||
{
|
||||
if (g_pVGuiLocalize->SaveToFile( m_szFileName ) )
|
||||
{
|
||||
// success
|
||||
MessageBox *box = new MessageBox("Save Successful - VLocalize", "File was successfully saved.", false);
|
||||
box->DoModal();
|
||||
}
|
||||
else
|
||||
{
|
||||
// failure
|
||||
MessageBox *box = new MessageBox("Error during save - VLocalize", "Error - File was not successfully saved.", false);
|
||||
box->DoModal();
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Message handler for loading a file
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLocalizationDialog::OnFileOpen()
|
||||
{
|
||||
FileOpenDialog *box = new FileOpenDialog( this, "Open", true );
|
||||
|
||||
box->SetStartDirectory("u:\\");
|
||||
box->AddFilter("*.*", "All Files (*.*)", true );
|
||||
box->DoModal(false);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Handles a token created message
|
||||
// Input : *tokenName - the name of the newly created token
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLocalizationDialog::OnTokenCreated(const char *tokenName)
|
||||
{
|
||||
// add the new string table token to the token list
|
||||
int idx = g_pVGuiLocalize->FindIndex(tokenName);
|
||||
int itemId = m_pTokenList->AddItem(new KeyValues("LString", "Token", g_pVGuiLocalize->GetNameByIndex(idx)), idx, true, true );
|
||||
|
||||
// make that currently selected
|
||||
m_pTokenList->SetSingleSelectedItem( itemId );
|
||||
OnTokenSelected();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Creates a new token
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLocalizationDialog::OnCreateToken()
|
||||
{
|
||||
CCreateTokenDialog *dlg = new CCreateTokenDialog( this );
|
||||
dlg->AddActionSignalTarget(this);
|
||||
dlg->CreateSingleToken();
|
||||
}
|
||||
|
||||
char const *CLocalizationDialog::GetFileName() const
|
||||
{
|
||||
return m_szFileName;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Input : *command -
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLocalizationDialog::OnCommand(const char *command)
|
||||
{
|
||||
if (!stricmp(command, "CreateToken"))
|
||||
{
|
||||
OnCreateToken();
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseClass::OnCommand(command);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: empty message map
|
||||
//-----------------------------------------------------------------------------
|
||||
MessageMapItem_t CLocalizationDialog::m_MessageMap[] =
|
||||
{
|
||||
MAP_MESSAGE( CLocalizationDialog, "RowSelected", OnTokenSelected ), // message from the m_pTokenList
|
||||
MAP_MESSAGE( CLocalizationDialog, "TextChanged", OnTextChanged ), // message from the text entry
|
||||
MAP_MESSAGE( CLocalizationDialog, "ApplyChanges", OnApplyChanges ), // message from the text entry
|
||||
MAP_MESSAGE( CLocalizationDialog, "FileSave", OnFileSave ),
|
||||
MAP_MESSAGE( CLocalizationDialog, "FileOpen", OnFileOpen ),
|
||||
MAP_MESSAGE_CONSTCHARPTR( CLocalizationDialog, "TokenCreated", OnTokenCreated, "name" ),
|
||||
};
|
||||
IMPLEMENT_PANELMAP(CLocalizationDialog, BaseClass);
|
||||
70
vgui2/vlocalize/LocalizationDialog.h
Normal file
70
vgui2/vlocalize/LocalizationDialog.h
Normal file
@@ -0,0 +1,70 @@
|
||||
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef LOCALIZATIONDIALOG_H
|
||||
#define LOCALIZATIONDIALOG_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <VGUI_controls/Frame.h>
|
||||
|
||||
namespace vgui
|
||||
{
|
||||
class Button;
|
||||
class ComboBox;
|
||||
class Label;
|
||||
class TextEntry;
|
||||
class ListPanel;
|
||||
class MenuButton;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Main localization dialog class
|
||||
//-----------------------------------------------------------------------------
|
||||
class CLocalizationDialog : public vgui::Frame
|
||||
{
|
||||
public:
|
||||
CLocalizationDialog(const char *fileName);
|
||||
~CLocalizationDialog();
|
||||
|
||||
char const *GetFileName() const;
|
||||
|
||||
private:
|
||||
// vgui overrides
|
||||
virtual void PerformLayout();
|
||||
virtual void OnClose();
|
||||
virtual void OnCommand(const char *command);
|
||||
|
||||
// message handlers
|
||||
virtual void OnTokenSelected();
|
||||
virtual void OnTextChanged();
|
||||
virtual void OnApplyChanges();
|
||||
virtual void OnFileOpen();
|
||||
virtual void OnFileSave();
|
||||
virtual void OnCreateToken();
|
||||
virtual void OnTokenCreated(const char *tokenName);
|
||||
|
||||
vgui::ListPanel *m_pTokenList;
|
||||
vgui::TextEntry *m_pLanguageEdit;
|
||||
vgui::TextEntry *m_pEnglishEdit;
|
||||
vgui::MenuButton *m_pFileMenuButton;
|
||||
vgui::Menu *m_pFileMenu;
|
||||
vgui::Button *m_pApplyButton;
|
||||
vgui::Label *m_pTestLabel;
|
||||
|
||||
int m_iCurrentToken;
|
||||
|
||||
char m_szFileName[512];
|
||||
|
||||
DECLARE_PANELMAP();
|
||||
|
||||
typedef vgui::Frame BaseClass;
|
||||
};
|
||||
|
||||
|
||||
#endif // LOCALIZATIONDIALOG_H
|
||||
34
vgui2/vlocalize/_vpc_/manifest_vlocalize/win32/manifest.txt
Normal file
34
vgui2/vlocalize/_vpc_/manifest_vlocalize/win32/manifest.txt
Normal file
@@ -0,0 +1,34 @@
|
||||
// ----------------------------------------- //
|
||||
// File generated by VPC //
|
||||
// ----------------------------------------- //
|
||||
|
||||
Source file: F:\csgo_64\cstrike15_src\vgui2\vlocalize\CreateTokenDialog.cpp
|
||||
Debug output file: F:\csgo_64\cstrike15_src\vgui2\vlocalize\CreateTokenDialog.cpp
|
||||
Release output file: F:\csgo_64\cstrike15_src\vgui2\vlocalize\CreateTokenDialog.cpp
|
||||
Containing unity file:
|
||||
PCH file:
|
||||
|
||||
Source file: F:\csgo_64\cstrike15_src\vgui2\vlocalize\LocalizationDialog.cpp
|
||||
Debug output file: F:\csgo_64\cstrike15_src\vgui2\vlocalize\LocalizationDialog.cpp
|
||||
Release output file: F:\csgo_64\cstrike15_src\vgui2\vlocalize\LocalizationDialog.cpp
|
||||
Containing unity file:
|
||||
PCH file:
|
||||
|
||||
Source file: F:\csgo_64\cstrike15_src\vgui2\vlocalize\main.cpp
|
||||
Debug output file: F:\csgo_64\cstrike15_src\vgui2\vlocalize\main.cpp
|
||||
Release output file: F:\csgo_64\cstrike15_src\vgui2\vlocalize\main.cpp
|
||||
Containing unity file:
|
||||
PCH file:
|
||||
|
||||
Source file: F:\csgo_64\cstrike15_src\public\tier0\memoverride.cpp
|
||||
Debug output file: F:\csgo_64\cstrike15_src\public\tier0\memoverride.cpp
|
||||
Release output file: F:\csgo_64\cstrike15_src\public\tier0\memoverride.cpp
|
||||
Containing unity file:
|
||||
PCH file:
|
||||
|
||||
Source file: F:\csgo_64\cstrike15_src\public\vgui_controls\vgui_controls.cpp
|
||||
Debug output file: F:\csgo_64\cstrike15_src\public\vgui_controls\vgui_controls.cpp
|
||||
Release output file: F:\csgo_64\cstrike15_src\public\vgui_controls\vgui_controls.cpp
|
||||
Containing unity file:
|
||||
PCH file:
|
||||
|
||||
114
vgui2/vlocalize/main.cpp
Normal file
114
vgui2/vlocalize/main.cpp
Normal file
@@ -0,0 +1,114 @@
|
||||
//===== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ======//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//===========================================================================//
|
||||
|
||||
#include "windows.h"
|
||||
#include "vgui_controls/Panel.h"
|
||||
#include "vgui/IScheme.h"
|
||||
#include "vgui/ISurface.h"
|
||||
#include "vgui/IVGui.h"
|
||||
#include "FileSystem.h"
|
||||
#include "tier0/icommandline.h"
|
||||
#include "inputsystem/iinputsystem.h"
|
||||
#include "appframework/tier3app.h"
|
||||
|
||||
#include "LocalizationDialog.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// The application object
|
||||
//-----------------------------------------------------------------------------
|
||||
class CVLocalizeApp : public CVguiSteamApp
|
||||
{
|
||||
typedef CVguiSteamApp BaseClass;
|
||||
|
||||
public:
|
||||
// Methods of IApplication
|
||||
virtual bool Create();
|
||||
virtual bool PreInit();
|
||||
virtual int Main();
|
||||
virtual void Destroy() {}
|
||||
};
|
||||
|
||||
DEFINE_WINDOWED_STEAM_APPLICATION_OBJECT( CVLocalizeApp );
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// The application object
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CVLocalizeApp::Create()
|
||||
{
|
||||
AppSystemInfo_t appSystems[] =
|
||||
{
|
||||
{ "inputsystem.dll", INPUTSYSTEM_INTERFACE_VERSION },
|
||||
{ "vgui2.dll", VGUI_IVGUI_INTERFACE_VERSION },
|
||||
{ "", "" } // Required to terminate the list
|
||||
};
|
||||
|
||||
return AddSystems( appSystems );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Entry point
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CVLocalizeApp::PreInit()
|
||||
{
|
||||
if ( !BaseClass::PreInit() )
|
||||
return false;
|
||||
|
||||
if ( !BaseClass::SetupSearchPaths( NULL, false, true ) )
|
||||
{
|
||||
::MessageBox( NULL, "Error", "Unable to initialize file system\n", MB_OK );
|
||||
return false;
|
||||
}
|
||||
|
||||
g_pFullFileSystem->AddSearchPath("../game/platform", "PLATFORM");
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Entry point
|
||||
//-----------------------------------------------------------------------------
|
||||
int CVLocalizeApp::Main()
|
||||
{
|
||||
// load the scheme
|
||||
if (!vgui::scheme()->LoadSchemeFromFile("Resource/TrackerScheme.res", "Tracker" ))
|
||||
return 1;
|
||||
|
||||
// Init the surface
|
||||
vgui::Panel *panel = new vgui::Panel(NULL, "TopPanel");
|
||||
vgui::surface()->SetEmbeddedPanel(panel->GetVPanel());
|
||||
|
||||
// Start vgui
|
||||
vgui::ivgui()->Start();
|
||||
|
||||
// add our main window
|
||||
if ( CommandLine()->ParmCount() < 2 )
|
||||
{
|
||||
Warning( "Must specify a localization file!\n" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *pFileName = CommandLine()->GetParm( 1 );
|
||||
CLocalizationDialog *dlg = new CLocalizationDialog( pFileName );
|
||||
dlg->SetParent( panel->GetVPanel() );
|
||||
dlg->MakePopup();
|
||||
// dlg->SetBounds( 0, 0, 800, 600 );
|
||||
dlg->SetVisible( true );
|
||||
|
||||
// Run app frame loop
|
||||
while (vgui::ivgui()->IsRunning())
|
||||
{
|
||||
vgui::ivgui()->RunFrame();
|
||||
vgui::surface()->PaintTraverseEx( panel->GetVPanel(), true );
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
90
vgui2/vlocalize/vlocalize.vpc
Normal file
90
vgui2/vlocalize/vlocalize.vpc
Normal file
@@ -0,0 +1,90 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// VLOCALIZE.VPC
|
||||
//
|
||||
// Project Script
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
$Macro SRCDIR "..\.."
|
||||
$Macro OUTBINDIR "$SRCDIR\..\game\bin"
|
||||
|
||||
$Include "$SRCDIR\vpc_scripts\source_exe_win_win32_base.vpc"
|
||||
|
||||
$Configuration
|
||||
{
|
||||
$Compiler
|
||||
{
|
||||
}
|
||||
|
||||
$Linker
|
||||
{
|
||||
$AdditionalDependencies "$BASE odbc32.lib odbccp32.lib WS2_32.LIB"
|
||||
}
|
||||
}
|
||||
|
||||
$Project "Vlocalize"
|
||||
{
|
||||
$Folder "Source Files"
|
||||
{
|
||||
$File "CreateTokenDialog.cpp"
|
||||
$File "LocalizationDialog.cpp"
|
||||
$File "main.cpp"
|
||||
$File "$SRCDIR\public\vgui_controls\vgui_controls.cpp"
|
||||
}
|
||||
|
||||
$Folder "Header Files"
|
||||
{
|
||||
$File "$SRCDIR\public\tier0\basetypes.h"
|
||||
$File "CreateTokenDialog.h"
|
||||
$File "$SRCDIR\public\tier0\dbg.h"
|
||||
$File "$SRCDIR\public\tier0\fasttimer.h"
|
||||
$File "$SRCDIR\public\filesystem.h"
|
||||
$File "$SRCDIR\public\appframework\iappsystem.h"
|
||||
$File "$SRCDIR\public\tier1\interface.h"
|
||||
$File "LocalizationDialog.h"
|
||||
$File "$SRCDIR\public\tier0\platform.h"
|
||||
$File "$SRCDIR\public\tier1\strtools.h"
|
||||
$File "$SRCDIR\public\tier1\utlmemory.h"
|
||||
$File "$SRCDIR\public\tier1\utlrbtree.h"
|
||||
$File "$SRCDIR\public\tier1\utlvector.h"
|
||||
$File "$SRCDIR\public\mathlib\vector2d.h"
|
||||
$File "$SRCDIR\public\vgui\vgui.h"
|
||||
$File "$SRCDIR\public\color.h"
|
||||
$File "$SRCDIR\public\vgui\Dar.h"
|
||||
$File "$SRCDIR\public\vgui\IClientPanel.h"
|
||||
$File "$SRCDIR\public\vgui\IHTML.h"
|
||||
$File "$SRCDIR\public\vgui\ILocalize.h"
|
||||
$File "$SRCDIR\public\vgui\IScheme.h"
|
||||
$File "$SRCDIR\public\vgui\ISurface.h"
|
||||
$File "$SRCDIR\public\vgui\IVGui.h"
|
||||
$File "$SRCDIR\public\vgui\KeyCode.h"
|
||||
$File "$SRCDIR\public\tier1\keyvalues.h"
|
||||
$File "$SRCDIR\public\vgui_controls\MessageMap.h"
|
||||
$File "$SRCDIR\public\vgui\MouseCode.h"
|
||||
$File "$SRCDIR\public\vgui_controls\Button.h"
|
||||
$File "$SRCDIR\public\vgui_controls\Controls.h"
|
||||
$File "$SRCDIR\public\vgui_controls\EditablePanel.h"
|
||||
$File "$SRCDIR\public\vgui_controls\FileOpenDialog.h"
|
||||
$File "$SRCDIR\public\vgui_controls\FocusNavGroup.h"
|
||||
$File "$SRCDIR\public\vgui_controls\Frame.h"
|
||||
$File "$SRCDIR\public\vgui_controls\Label.h"
|
||||
$File "$SRCDIR\public\vgui_controls\ListPanel.h"
|
||||
$File "$SRCDIR\public\vgui_controls\Menu.h"
|
||||
$File "$SRCDIR\public\vgui_controls\MenuButton.h"
|
||||
$File "$SRCDIR\public\vgui_controls\MessageBox.h"
|
||||
$File "$SRCDIR\public\vgui_controls\Panel.h"
|
||||
$File "$SRCDIR\public\vgui_controls\PHandle.h"
|
||||
$File "$SRCDIR\public\vgui_controls\TextEntry.h"
|
||||
$File "$SRCDIR\public\vstdlib\vstdlib.h"
|
||||
$File "$SRCDIR\public\winlite.h"
|
||||
}
|
||||
|
||||
$Folder "Link Libraries"
|
||||
{
|
||||
$File "$SRCDIR\lib\public\appframework.lib"
|
||||
$File "$SRCDIR\lib\public\dmxloader.lib"
|
||||
$File "$SRCDIR\lib\public\mathlib.lib"
|
||||
$File "$SRCDIR\lib\public\tier2.lib"
|
||||
$File "$SRCDIR\lib\public\tier3.lib"
|
||||
$File "$SRCDIR\lib\public\vgui_controls.lib"
|
||||
}
|
||||
}
|
||||
13
vgui2/vlocalize/vlocalize.vpc.vpc_cache
Normal file
13
vgui2/vlocalize/vlocalize.vpc.vpc_cache
Normal file
@@ -0,0 +1,13 @@
|
||||
"vpc_cache"
|
||||
{
|
||||
"CacheVersion" "1"
|
||||
"win32"
|
||||
{
|
||||
"CRCFile" "vlocalize.vcxproj.vpc_crc"
|
||||
"OutputFiles"
|
||||
{
|
||||
"0" "vlocalize.vcxproj"
|
||||
"1" "vlocalize.vcxproj.filters"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user