From f9bf4534836811d8917024c19d1567952be928f8 Mon Sep 17 00:00:00 2001 From: shlainn Date: Sat, 11 Sep 2010 00:54:25 +0200 Subject: [PATCH] * Fixed GUI bug which allowed entering character names that are too long (>12 chars) * Removed warning spam in ByteBuffer.h (Not sure if that helps for 32bit systems...) --- src/Client/GUI/SceneCharselection.cpp | 1 + src/shared/ByteBuffer.h | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Client/GUI/SceneCharselection.cpp b/src/Client/GUI/SceneCharselection.cpp index 97d82f1..1a06869 100644 --- a/src/Client/GUI/SceneCharselection.cpp +++ b/src/Client/GUI/SceneCharselection.cpp @@ -219,6 +219,7 @@ void SceneCharSelection::OnUpdate(s32 timepassed) //newcharwin->addChild(classselect); guienv->addStaticText(L"Char Name", CalcRelativeScreenPos(dim,0.1f,0.3f,0.8f,0.05f),false,true,newcharwin); charname = guienv->addEditBox(L"", CalcRelativeScreenPos(dim,0.1f,0.35f,0.8f,0.05f),true, newcharwin); + charname->setMax(12); msgbox = guienv->addStaticText(L"",CalcRelativeScreenPos(dim,0.2f,0.6f,0.6f,0.1f), true, true, newcharwin); } if(eventrecv->buttons & BUTTON_SELECT_REALM || scenedata[ISCENE_CHARSEL_REALMFIRST]) diff --git a/src/shared/ByteBuffer.h b/src/shared/ByteBuffer.h index d336415..8a1a3e3 100644 --- a/src/shared/ByteBuffer.h +++ b/src/shared/ByteBuffer.h @@ -297,7 +297,7 @@ class ByteBuffer } void print_storage() { - printf("STORAGE_SIZE: %u\n", size() ); + printf("STORAGE_SIZE: %lu\n", size() ); for(uint32 i = 0; i < size(); i++) printf("%u - ", read(i) ); printf("\n"); @@ -305,7 +305,7 @@ class ByteBuffer void textlike() { - printf("STORAGE_SIZE: %u\n", size() ); + printf("STORAGE_SIZE: %lu\n", size() ); for(uint32 i = 0; i < size(); i++) printf("%c", read(i) ); printf("\n"); @@ -314,7 +314,7 @@ class ByteBuffer void hexlike() { uint32 j = 1, k = 1; - printf("STORAGE_SIZE: %u\n", size() ); + printf("STORAGE_SIZE: %lu\n", size() ); for(uint32 i = 0; i < size(); i++) { if ((i == (j*8)) && ((i != (k*16)))) @@ -364,7 +364,7 @@ class ByteBuffer { uint32 line = 1; uint32 countpos = 0; - printf("STORAGE_SIZE: %u\n", size() ); + printf("STORAGE_SIZE: %lu\n", size() ); printf("|------------------------------------------------|----------------|\r\n"); printf("|00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F |0123456789ABCDEF|\r\n"); printf("|------------------------------------------------|----------------|\r\n");